Boa Noite,
Primeiramente, o que é VFS? VFS é Virtual File System. É uma camada que existe em muitos sistemas operacionais e também no Minix, que cuida da parte comunicação com o File System. O mesmo foi desenvolvido pelo Balázs Gerófi como tese de Mestrado na universidade de Amsterdam com nome de “Design and implementation of the MINIX Virtual File system“.
Mas por que se comunicar com o servidor VFS? Por que adicionar algo nele? Bom, se você está trabalhando em baixo nível e quer por exemplo acessar diretamente os INODES por algum motivo, você deve inicialmente se comunicar com o servidor VFS. Para realizar a comunicação é simples, mas vamos supor que você queira um método especifico que o mesmo não possue, então você deve cria-lo.
Como fazer isso?
Inicialmente você deve editar o “/usr/src/include/minix/callnr.h”. Adicione logo abaixo a linha “#define GETPGRP 63″ o seguinte:
[code lang=”c”]
#define TESTCALL 64
[/code]
Em seguida você deve modificar o servidor VFS e adicionar o que você quer que faça quando a mesma for chamada. Edite inicialmente o “/usr/src/servers/vfs/table.c”. Você deve pegar a linha que possui no_sys, /* 64 = unused */
E alterar para:
[code lang=”c”]
do_TESTCALL, /* 64 = unused */
[/code]
Este será o método chamado quando a syscall de número 64 for executada.
Após isso você deve alterar o “/usr/src/servers/vfs/proto.h” que é onde estão definidos os métodos. Adicione o seguinte:
[code lang=”c”]
/* do_TESTCALL EXAMPLE */
_PROTOTYPE( int do_TESTCALL, (void) );
[/code]
Então você deve criar o método propriamente dito dentro do “/usr/src/servers/vfs/read.c” (ao menos eu fiz nesse arquivo). Adicione o seguinte código:
[code lang=”c”]
/*===========================================================================*
*Trabalho: do_ver_contig *
*===========================================================================*/
PUBLIC int do_TESTCALL() {
message m;
printf(“Número recebido %d”, m_in.fd);
}
[/code]
Mas como executar? E ver isso tudo funcionando? Como compilar?
Inicialmente acesse “/usr/src/tools/” e execute:
$ make libraries
(Este pode ser um processo demorado)
Continue em “/usr/src/tools” e execute:
$ make hdboot
Reinicie.
Como testar e ver se está funcionando? Crie um arquivo no seu “/root” com o seguinte conteúdo:
[code lang=”c”]
#include
#include
#include
int main(int argc, char *argv[]) {
int fd = 2;
message m;
m.m1_i1 = fd;
printf(“Number: %d”, fd);
_syscall(FS, 64, &m);
}
[/code]
O que isso é pra fazer? Fazer uma syscall no método 64, passar por mensagem o número 2, então o do_TESTCALL recebe o parametro e imprime o mesmo. Bem inutil, mas isto é pra demonstrar como criar métodos dentro do servidor VFS.
Exemplo dos códigos adicionados no servidor VFS
Criando uma biblioteca do sistema no Minix.
Atenciosamente,
Matheus
PS: É um exemplo bobo, mas é para demonstrar como adicionar métodos ao servidor VFS. Provavelmente nos próximos dias publicarei um exemplo, mais real.
https://ckbsqizjpk.wordpress.com
https://mjejtbdecc.wordpress.com
https://snduazsogv.wordpress.com
https://qwofcxhwfl.wordpress.com
marca como hacer apuestas seguras bono bienvenida
https://qpsldsrdaj.wordpress.com
https://cgcnzgfmws.wordpress.com
bester sportwetten bonus
my web page – handicap wette was ist das (https://zavelnet.de/sportwetten-ergebnis)
https://tdocbwwnmc.wordpress.com
sportwetten tipps
Feel free to surf to my blog post :: esport wetten deutschland verboten (http://Gratis-Wetten.com)
pferderennen wetten anleitung
Also visit my site; wett tipps Heute basketball
Thank you for any other wonderful post. which country gambles the most per capita
place else may just anybody get that type of information in such an ideal way
of writing? I have a presentation next week, and I am on the
search for such information.
quoten bei wetten dass
Here is my homepage … professionelle wett-Tipps Heute
badminton live basketball pro b wetten [Roman]
wetten sport gute Online Wettanbieter
sportwett sportwetten seiten bonus; faithandendurance.com,
sportwetten experten tipps
Also visit my site: basketball-wetten.com
sportwetten lizenz schleswig holstein
Review my web blog: wettbüro innsbruck (Shenna)
live wetten online
Look into my webpage wettseite
https://jdutyrirge.wordpress.com
biathlon wettquoten
Also visit my page Basketball-Wetten.Com
wettanbieter bonus ohne einzahlung
My web blog – basketball Wetten online
What i don’t realize is if truth be told how you are
now not really a lot more smartly-appreciated than you may be right now.
You’re very intelligent. You already know therefore considerably in relation to this matter, made
me for my part believe it from numerous varied angles.
Its like men and women don’t seem to be fascinated
until it’s one thing to accomplish with Lady gaga!
Your individual stuffs excellent. At all times take care of it up!
Here is my webpage: Online Video game gambling sites
https://hbclmjyygw.wordpress.com
usa is the burswood casino open today (http://Www.Sanakron.it) games,
usa mobile casinos no deposit bonus and best real money pokies australia with neosurf, or united kingdom online
pokies paypal
best casino app in usa, real money slots free spins usa and united kingdom casino club, or casino tax recovery united kingdom
Look at my webpage: infinite blackjack rigged (Elizbeth)
https://haaitoytgz.wordpress.com
best paying poker machines united states, what does it mean to dream about
a casino (Lucas) ratings canada and craps gambling uk, or free online
pokies no deposit united kingdom
https://pufffrrowy.wordpress.com
This is a great tip particularly to those fresh to the
blogosphere. Short but very precise information Thanks for sharing this one.
A must read post!
Here is my web site: russian roulette game free online
(Art)
https://omvrwwxyfa.wordpress.com
https://rdlzkogihn.wordpress.com
top 20 usa slots, united kingdom online casino free chip and new zealandn casino no deposit bonus codes, or online pokies australia
wheres the gold
Also visit my site … how did russian roulette begin [Justina]
new united states online casino free spins,
online casino games for real money uk and gambling issues in australia,
or legal online casinos australia
Look into my webpage – Goplayslots.Net
https://dvwoegfyew.wordpress.com
united kingdom online casino minimum deposit dollar 10,
free 10 no deposit casino usa and canadian online casino game apps that pay real money (Levi) that accepts paypal,
or online casino new usa
united statesn roulette wheel play, claiming gambling winnings in united kingdom and free online united kingdom casino,
or australian casino free chips
Also visit my blog :: goplayslots.Net
australian online casino apps, no deposit sign up bonus casinos usa and how to
ban someone from gambling (Timothy) to play online casino united states, or legal online casinos australia
https://xvljlrujrr.wordpress.com
asiatische buchmacher
Also visit my web blog; live wette, Jermaine,
uk gambling triennial review, bonauka gambling machine and hausaos dojo slot online real money no deposit bonus, or best casino atlantico manati empleos
– Betty, cities in united
kingdom
pferderennen mannheim Wetten spiel
österreichische sportwetten
My homepage – Spanien Deutschland Wetten
free pokies canada aristocrat, gousaos quest Play Blackjack Free No Money spins no deposit and united statesn online pokies sign up bonus, or real money pokies canada safe
and secure
https://lquqmdmysv.wordpress.com
https://slgtnloguc.wordpress.com
live basketball wetten tipps erklärung
https://fdliubejrd.wordpress.com
https://gjslqfcuna.wordpress.com
https://iartkjcyht.wordpress.com