16.05.2015 Views

Working with the Unix OS

Working with the Unix OS

Working with the Unix OS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

82<br />

Introduction to kernel<br />

Programs & Processes<br />

A program is a collection of instructions & data that are kept in an ordinary file on disk<br />

<strong>the</strong> file is marked executable, <strong>the</strong> contents have to obey rules<br />

text file --------> object file -----> bind <strong>with</strong> libraries<br />

compile linker<br />

To run program, <strong>the</strong> kernel has to create a new process (environment in which program executes)<br />

A process consists of<br />

- instruction segment<br />

- userdata segment<br />

- system data segment<br />

A process's system data includes attributes such as<br />

- current directory,<br />

- open file descriptors,<br />

- CPU time,<br />

A process uses system calls to access & modify attributes<br />

A process is created by <strong>the</strong> kernel on behalf of a currently executing process, which becomes <strong>the</strong> parent of <strong>the</strong> new<br />

child process.<br />

The child inherits most of <strong>the</strong> parents system data attributes.<br />

The UNIX<br />

Kernel<br />

User Level<br />

Kernel Level<br />

traps<br />

The system calls for controlling processes are:<br />

user programs<br />

libraries<br />

system call interface<br />

file subsystem<br />

process control subsystem<br />

interprocess communication<br />

buffer cache<br />

scheduler<br />

memory management<br />

character block<br />

device drivers<br />

hardware control<br />

Kernel Level<br />

Hardware Level<br />

hardware<br />

System calls interact <strong>with</strong> <strong>the</strong> file subsystem and process control system.<br />

The file subsystem manages files, allocating file space, administrating free space, controlling access to files,<br />

retrieving data for users.<br />

The file subsystem accesses file data using a buffering mechanism that regulates data flow between <strong>the</strong> kernel and<br />

secondary storage devices.<br />

Block I/O devices are random access storage devices, raw devices are called character devices.<br />

The process control subsystem is responsible for process synchronization, interprocess communication, memory<br />

management, and process scheduling.<br />

Processes interact <strong>with</strong> file subsystem via systems calls:<br />

open, close, read, write, stat, chown, chmod.<br />

fork, exec, exit, wait, brk, signal.<br />

Memory management - swapping and demand paging<br />

Scheduler<br />

- allocates <strong>the</strong> CPU to processes<br />

IPC - asynchronous signaling of events to synchronous transmission of messages between processes<br />

Hardware control is responsible for handling interrupts and communicating <strong>with</strong> <strong>the</strong> machine.

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

Saved successfully!

Ooh no, something went wrong!