Presentation is loading. Please wait.

Presentation is loading. Please wait.

Process management in Minix1 Processes Process is a program in execution. Program is a static entity while process is an active entity. Process Control.

Similar presentations


Presentation on theme: "Process management in Minix1 Processes Process is a program in execution. Program is a static entity while process is an active entity. Process Control."— Presentation transcript:

1 Process management in Minix1 Processes Process is a program in execution. Program is a static entity while process is an active entity. Process Control Block (PCB) is a data structure that holds essential process information. Process table is and array or link list of PCBs.

2 Process management in Minix2 The Internal Structure of Minix Minix is structured in four layers. User processes (Init) Server processes (MM, FS) I/O tasks and system task (Disk task) Process management

3 Process management in Minix3 Process Management Bottom layer of the structure. Catches hardware interrupts and software traps. Performs scheduling. Handles messages between processes (checks for protection, locates send and receive buffers, copies messages between senders and receiver’s buffers.)

4 Process management in Minix4 I/O Tasks (Drivers) Second layer from the bottom. There is one task per device type. Example of tasks are:disk tasks, printer tasks, terminal tasks, etc.. There is one special task: system task. System task provides for communication of MM and FS with the kernel and its data structures.

5 Process management in Minix5 The Kernel The layer 1 and 2 code (the process management code and the tasks) are linked together into a single binary program called the kernel.

6 Process management in Minix6 Server Processes Third layer from the bottom. Provide useful services to the user processes such as MM (Memory Management) and FS (File system). Less privileged than the process management and the tasks

7 Process management in Minix7 Memory Manager Memory manager carries out all the Minix system calls that involve memory management. E.g. FORK EXEC BRK

8 Process management in Minix8 File System File system carries out all the Minix file system calls. E.g. READ/WRITE MOUNT CHDIR

9 Process management in Minix9 Servers As User Processes Servers run at the same privilege level as user processes but at higher priority. Q: What is the difference between the privilege and priority?

10 Process management in Minix10 Server’s Characteristics They start when the system starts. They never terminate when the system is active. To accommodate a new server the kernel must be recompiled. The kernel startup code installs the servers in the higher priority slots of process table before any user processes are allowed to run.

11 Process management in Minix11 Processes Management in Minix All user processes in the system are descendants of a process called init. The Minix boot program loads into memory: the kernel the memory nanager the fisle syetm and init (the first user process)

12 Process management in Minix12 Init execution steps Init executes the following steps: –reads the file /etc/ttytab to find all potential login terminals –forks off a child process for each terminal –each child executes usr/bin/getty which prints a message and waits for a name to be typed –usr/bin/login is called with the name as its argument –after a successful login /bin/login executes user’s shell specifies in etc/passwd file.

13 Process management in Minix13 Interprocess Communication Processes communicate in Minix via message passing. Three primivites are provided for sending and receiving messages: –send (dest, &message) –receive(source, &message) –send_rec(src_dst, &message)

14 Process management in Minix14 Send send (dest, &message) Is used to send a message to process dest. The second parameter: &message is the address of the message data.

15 Process management in Minix15 Receive receive(source, &message) Is used to receive a message from process source. The second parameter: &message is the address of the message data to be received.

16 Process management in Minix16 Send and Receive send_rec(src_dst, &message) Is used to send a message and wait for a reply form the same process. The replay overwrites the original message.

17 Process management in Minix17 Synchronous and Asynchronous Message Passing When a process sends a message to a process that is not currently waiting to receive the message, the sender blocks until the destination does RECEIVE. Q. WHY? Q. What is the difference between synchronous and asynchronous message passing?

18 Process management in Minix18 Process Scheduling in Minix Minix uses multilevel queue scheduling algorithm. There are three levels corresponding to layers 2, 3 and 4 of the Minix structure Tasks and server processes run until they block (FCFS). User processes use Round Robin with quantum 100 msec.

19 Process management in Minix19 Minix Source Code Organization Source code is organized in two directories: /usr/include and usr/src /usr/include directory contain: –sys/ : contains additional POSIX headers –minix/: includes header files used by Minix –ibm/: includes header files with IBM PC specific definitions

20 Process management in Minix20 Src/ directory Scr/ directory contains: –kernel/ : layers 1 and 2 of Minix –mm/: the code for memory manager –fs/ : the code for the file system –lib/ : the source code for library procedures –tools/:the source code for the init program –boot/: the source code for booting and installing Minix.

21 Process management in Minix21 Minix Executable When Minix is compiled all source codes in src/kernel/, src/mm/ and src/fs/ are compiled to object files. All the object files in src/kernel/ are linked together to form a single executable program, kernel. The object files in src/mm/ and in src/fs/ are linked respectively to form mm and fs.

22 Process management in Minix22 Process header files src/kernel/kernel.h –defines macros _POSIX SOURCE, _MINIX. _SYSTEM –includes other header files – a lot of other files may share a large number of definitions by including kernel.h

23 Process management in Minix23 const.h –contains a number of machine dependent values such as interrupt vectors –contains machine independent values such as priorities of scheduling queues. type.h –defines several prototypes and structures used in any implementation of Minix and some machine dependent values

24 Process management in Minix24 proto.h –all functions that must be know outside of of the file in which they are defined are in this file glo.h –all kernel global variables are defined here

25 Process management in Minix25 Proc.h –defines a process table entry as proc. –Defines process table as proc[NR_TASKS+NR_PROCS] Question: –What are the values of NR_TASK and NR_PROCS? –Look at include/minix/const.h and include/minic/config.h

26 Process management in Minix26 protect.h –defines values very specific to the protected mode of the Intel Processor architectures.

27 Process management in Minix27 How to Backup the Kernel –Login as bin –In bin’s home directory /usr/src do !cpdir kernel kernelBackup

28 Process management in Minix28 How To Restore the Kernel !cpdir kernel_backup kernel !rm kernel/*.o !cd tools !make hdboot !shutdown

29 Process management in Minix29 How to Compile the Kernel Log in to as bin Change directory to tools Run make hdboot

30 Process management in Minix30 How to boot from an older (correct) version of Minix). Use the “image” variable of the boot monitor. For example: –hd1> image=minix/2.0.0 –hd1> boot After correcting the problem and recompiling the kernel you may instruct the monitor to pick the most recent version by typing. –Hd1> unset image –hd1> boot


Download ppt "Process management in Minix1 Processes Process is a program in execution. Program is a static entity while process is an active entity. Process Control."

Similar presentations


Ads by Google