Skip to content

Add method to VFS in Minix.

Good Night,

First of all, what is VFS? VFS means Virtual File System. It is a layer that exists in a lot of OS and in Minix too, this layer takes care of the communication with the File System. It is a Master’s thesis in Computer Science from Balázs Gerófi and the name is “Design and implementation of the MINIX Virtual File system“.

But why to communicate with VFS server? Or why to add something on it? If you want to some tasks you need to do a SYSCALL to it. But sometimes the VFS server don’t do what you want. So you must add and change it to do it.

How to do this?

Edit “/usr/src/include/minix/callnr.h”. After this line “#define GETPGRP 63″ add this:
[code lang=”c”]
#define TESTCALL 64
[/code]

Then you need to change the VFS server and add what you want to do when it is called. Edit “/usr/src/servers/vfs/table.c”. You should replace the line “no_sys, /* 64 = unused */” with:
[code lang=”c”]
do_TESTCALL, /* 64 = unused */
[/code]

What happens? The method do_TESTCALL will be called when a syscall with number 64 is done.

Change the “/usr/src/servers/vfs/proto.h”. Add this:
[code lang=”c”]
/* do_TESTCALL EXAMPLE */
_PROTOTYPE( int do_TESTCALL, (void) );
[/code]

Now you have to create the method in “/usr/src/servers/vfs/read.c” (I did in this file and it worked). Add this:

[code lang=”c”]
/*===========================================================================*
*Trabalho: do_ver_contig *
*===========================================================================*/
PUBLIC int do_TESTCALL() {
message m;
printf(“Number received %d”, m_in.fd);
}
[/code]

But how to execute? How this works? How to compile?
Acess “/usr/src/tools/” and execute:

$ make libraries

(This process can take a long time)

In “/usr/src/tools” execute:

$ make hdboot

Reboot.

How to test and see if it is working? Create in your “/root” a file with this:
[code lang=”c”]
#include
#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]

Compile it, execute it and done!

This file do a _syscall to FS saying to execute method 64 and send by message the number 2. So the do_TESTCALL receive the parameter and show it on screen. Yes it is simple, but it is just an example about how to work with VFS server.

Example of code changed/add to VFS server

Creating a system library in Minix.

Best Regards,
Matheus

PS: It is a silly example, but it just show how to add some method to VFS Server. Probably in the next days I will show a real example.

Published inCLinux

1,673 Comments

  1. free chip no deposit casino bonus united states, golden tiger casino uk and is
    casinos illegal in uk, or australian open gambling

    Also visit my web-site long shot craps bets (Eunice)

  2. free slots australia online, golden tiger grandwild casino bonus code 2021 – Andy – uk and poker stars uk offers, or united statesn free slots no download

  3. legit online casinos usa, state legalized gambling (Lida) ad canada
    and free spins bonus codes uk, or gambling united states statistics

  4. canadian original free slots, blackjack mulligan uk and best new uk bingo sites,
    or online diamondhead casino approved; Blake, with free signup
    bonus real money usa

  5. best online pokies united states casino, how many the top online pokies and casinos in australia
    and play yukon gold slot machine, or australian online hard rock casino collapse cause (Gwendolyn)
    no deposit signup bonus

  6. crazy_gmOt crazy_gmOt

    Sto giocando su queste piattaforme da inizio anno e diciamocelo la ruota mi ha portato piu risultati di quello che credevo. Non sono certo uno da puntate folli, di solito metto due o tre euro a spin e amen. Il lobby di Crazy Time e parecchio ricco: si parla di 2000 e passa macchinette contando Pragmatic Play, NetEnt e Play’n GO, quindi i soliti noti del calibro di Book of Dead e Gates of Olympus ci sono tutti.

    La parte live e gestita da Evolution e la qualita si nota. Croupier veri, con tavoli in italiano nelle ore di punta, e i game show sono proprio quelli dove butto quasi tutte le serate. Ogni tanto controllo le stats dei bonus prima di entrare, non che serva davvero, eh.

    L’offerta di benvenuto proposta da Crazy Time in questo periodo e del 100% fino a 300€ piu 100 giri gratis, spalmati su qualche giorno. Ti danno anche un piccolo no deposit dopo la verifica dei documenti. Il wagering sta a 35x, che non e regalato, meglio leggersi il regolamento: puoi trovare le condizioni complete su Crazy Time prima di metterci soldi.

    Per i soldi va abbastanza bene. Sono andato di Skrill e l’accredito arriva in 12-24 ore, con Mastercard serve un paio di giorni lavorativi. Prendono pure le crypto, che pero non ho testato. Si parte da 10 euro, l’iscrizione in tre minuti. La cosa che mi ha dato fastidio e stato il KYC: due giorni di attesa e un documento respinto per un motivo assurdo.

    La chat di assistenza di Crazy Time parla italiano e questo aiuta, pero di notte ci vuole pazienza. Da cellulare gira liscio dal browser, l’applicazione c’e per Android esiste ma e ancora acerba. Licenza Malta Gaming Authority, quindi non e concessione italiana, e va saputo prima. Io intanto vado avanti, senza troppe pretese.

Leave a Reply

Your email address will not be published. Required fields are marked *