Minix Kernel: MessageBased Kernel - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

Minix Kernel: MessageBased Kernel

Description:

How to add a new SysCall? Solution 1: Add in a new system call from scratch. Very complicated: ... How to add a new SysCall? ( cont'd) Solution 2: - a simple way ... – PowerPoint PPT presentation

Number of Views:251
Avg rating:3.0/5.0
Slides: 7
Provided by: astpr
Category:

less

Transcript and Presenter's Notes

Title: Minix Kernel: MessageBased Kernel


1
Minix Kernel Message-Based Kernel
0. src/lib/posix/_fork.c 1. src/lib/other/syscall.
c
6. src/mm/main.c 7. src/mm/table.c
Memory Manager Server
(6,7)
(0,1)
User Process
do_fork
(5)
(2)
2. src/lib/i386/ Rts/_sendrec.s
Kernel
5. src/kernel/ proc.c
3. src/kernel/ mpx386.s
(3,4)
do_fork
4. src/kernel/ proc.c
2
Calling Diagram
Init
User Process
User Process
User Process
..
User Server I/O
Memory Manager
Network server
do_fork
disk
tty
clock
system
Ethernet
. do_fork Process Management
_send mini_send _receive mini_receive _sendre
c
K2p
p2K
3
vfork( )
  • See do_fork() at line 16832 src/mm/forkexit.c
  • v_fork does NOT do copying

parent
child
Address space

4
Lottery Scheduling
  • sum_t the number of total lottery tickets
    currently holding by all the child processes

Parent process
rand() sum_t
lottery
5

3
2
n
child process
1
2
Ticket
1,2,3
4,5
5
How to add a new SysCall?
  • Solution 1
  • Add in a new system call from scratch
  • Very complicated
  • System call number usr/include/minix/callnr.h
  • src/lib/posix/_newcall.c
  • ...
  • etc.

6
How to add a new SysCall? (contd)
  • Solution 2 - a simple way
  • Modify an existing system call it does something
    different with one of its parameters set to some
    special value
  • For instance,
  • int kill(pid_t pid, int sig)
  • gt int setLotteryTickets(pid_t pid, int
  • ticket)

negative pid
Write a Comment
User Comments (0)
About PowerShow.com