Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (1 vote)
170 views

MINIX 3 - System Call Implementation Tutorial

This document discusses the history and features of the Minix 3 operating system. It describes Minix starting from version 1 in 1987 up to the current version 3 from 2005. Minix 3 is intended for education, mobile devices, low-power computers, and stability. It is POSIX compatible and supports networking, windows, over 650 Unix programs, and device drivers that run in userspace. Minix 3 has a small kernel of less than 4000 lines of code and uses a microkernel architecture with separate file, process, and reincarnation servers. The document then explains how to implement a new system call in Minix 3, including creating the handler, declaring the prototype, compiling servers, creating the user library function, and testing

Uploaded by

Marko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
170 views

MINIX 3 - System Call Implementation Tutorial

This document discusses the history and features of the Minix 3 operating system. It describes Minix starting from version 1 in 1987 up to the current version 3 from 2005. Minix 3 is intended for education, mobile devices, low-power computers, and stability. It is POSIX compatible and supports networking, windows, over 650 Unix programs, and device drivers that run in userspace. Minix 3 has a small kernel of less than 4000 lines of code and uses a microkernel architecture with separate file, process, and reincarnation servers. The document then explains how to implement a new system call in Minix 3, including creating the handler, declaring the prototype, compiling servers, creating the user library function, and testing

Uploaded by

Marko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 13

inix 3

Istorija
Minix 1 - 1987
(edukacija)

Minix 2 1997

(edukacija, podrska novog hardvera)

Minix 3 2005

(edukacija, umetnuti sis, prenosni uredjaji, visoka sigurnost)

Minix Linux

(Linux kernel je napisan po ugledu na minix kernel)

O Minix-u 3
Minimal + Unix = Minix
Namena:

Edukacija
Mobilni uredjaji: telefoni, kamere
Veoma slabi racunari
Stabilnost

Minix 3 Funkcije

POSIX kompatibilan
Umreavanje putem TCP/IP protokola
X sistem prozora
Preko 650 Unix programa
Drajveri uredjaja se izvrsavaju u
korisnickom prostoru

Arhitektura Minix a 3
Velicina
8/16 MB RAM-a i 50/600 MB HDD prostora

Kernel
Manje od 4000 linija koda
Mikrokernel

Serveri
File server
Process server
Reincarnation server

Prioriteti procesa

Implementacija sistemskog poziva


Kreiranje system call handler-a

Implementacija sistemskog poziva


Deklaracija prototipa za sistemski poziv:
/usr/src/servers/fs/proto.h
_PROTOTYPE( int do_printmessage, (void) );
System call handler:
int do_printmessage(){printf(\I am a system call \n);retu rn (OK);}

Kompajliranje Fajl servera

cd /usr/src/servers/
make image
make install

Implementacija sistemskog poziva


Kreiranje User library function a
Fajlovi:
/usr/src/include/minix/callnr.h
/usr/include/minix/callnr.h

Kod:
#define PRINTMESSAGE 69

Implementacija sistemskog poziva


Kreiranje fajla:
/usr/src/lib/posix/_printmessage.c

Kod:

#include <lib.h>
#include <unistd.h>
PUBLIC int printmessage(void)
{message m;return (_syscall(FS,PRINTMESSAGE,&m));}

Dodavanje imena fajla u fajl:


/usr/src/lib/posix/Makefile.in

Implementacija sistemskog poziva


Kompajliranje biblioteka
cd /usr/src/lib/posix/
make Makefile
cd /usr/src/
make libraries

Kreiranje nove butabilne slike


cd /usr/src/tools
make hd boot
make install

Koriscenje sistemskog poziva


#include <stdio.h>
int main()
{ printmessage(); }
cc - o sc_test.c hello
./hello

Pitanja?
Komentari

You might also like