16.05.2015 Views

Working with the Unix OS

Working with the Unix OS

Working with the Unix OS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Introduction to kernel<br />

Every process is composed of:<br />

- code area executable portion of a process<br />

- data area used by process to contain static data<br />

- stack area used by process to store temporary data<br />

- user area holds housekeeping info about process<br />

- page tables used by memory management system<br />

Every process has its own user area created in <strong>the</strong> kernel's data region and only accessible by <strong>the</strong> kernel.<br />

- how process should react to each signal<br />

- process's open file descriptors<br />

- how much CPU time used<br />

Process Table created in <strong>the</strong> kernel's data region and only accessible by <strong>the</strong> kernel.<br />

- PID and parent PID<br />

- real and effective user id and group id<br />

- state (running, runnable, sleeping, suspended, idle, zombie)<br />

- location of its code, data, stack, user areas<br />

- list of pending signals<br />

The Scheduler<br />

- responsible for sharing CPU time<br />

- maintains a multi-level priority queue<br />

- a linked list of runnable processes<br />

- allocate CPU time in proportion to importance<br />

- CPU time allocated in "time quantums" 1/10 sec.<br />

! Scheduling Rules<br />

Every second, calculate <strong>the</strong> priorities of all runnable processes and organize <strong>the</strong>m into several priority queues.<br />

Every 1/10 sec, <strong>the</strong> scheduler selects <strong>the</strong> highest priority process. If <strong>the</strong> process is still running at end of time<br />

quantum, it is placed at <strong>the</strong> end of its priority queue.<br />

92

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!