15
LINUX System : Lecture 7 Bong-Soo Sohn ecture notes acknowledgement : The design of UNIX Operating System

LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

Embed Size (px)

Citation preview

Page 1: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

LINUX System : Lecture 7

Bong-Soo Sohn

Lecture notes acknowledgement : The design of UNIX Operating System

Page 2: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

2

Architecture of the UNIX

libraries

system call interface

file subsystem process control subsystem

inter-processcommunication

scheduler

memorymanagement

hardware control

hardware

buffer cache

device driverscharacter block

user Levelkernel Level

kernel Levelhardware Level

trap

user programs

Page 3: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

3

System calls & Libraries

libraries

system call interface

file subsystem process control subsystem

inter-processcommunication

scheduler

memorymanagement

hardware control

hardware

buffer cache

device driverscharacter block

user Levelkernel Level

kernel Levelhardware Level

trap

user programs

system call interface

Page 4: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

System calls & Libraries

• System call library– OS service in the form of C function call

• Standard library, User library– Linked with the programs at compile time and are part

of the user program

Page 5: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

5

File Subsystem (1)

libraries

system call interface

file subsystem process control subsystem

inter-processcommunication

scheduler

memorymanagement

hardware control

hardware

buffer cache

device driverscharacter block

user Levelkernel Level

kernel Levelhardware Level

trap

user programs

Page 6: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

6

File Subsystem (2)

• Managing files and structures of file system• Allocating file space• Administering free space• Controlling access to files• Retrieving data for users

• Interact with set of system calls– open, close, read, write, state, chown, chmod …

Page 7: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

7

Buffering Mechanism (1)

libraries

system call interface

file subsystem process control subsystem

inter-processcommunication

scheduler

memorymanagement

hardware control

hardware

buffer cache

device driverscharacter block

user Levelkernel Level

kernel Levelhardware Level

trap

user programs

Page 8: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

8

Buffering Mechanism (2)

• Interact with block I/O device drivers to initiate data transfer to and from kernel.

Page 9: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

9

Process Control Subsystem (1)

libraries

system call interface

file subsystem process control subsystem

inter-processcommunication

scheduler

memorymanagement

hardware control

hardware

buffer cache

device driverscharacter block

user Levelkernel Level

kernel Levelhardware Level

trap

user programs

Page 10: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

10

Process Control Subsystem (2)

• Managing process structures (proc table, u table,…)• Process scheduling• Interprocess communication (IPC)• Memory management• Responsible for process synchronization.

• Communicate with file subsystem– Loading a file into memory for execution

• Interact with set of system calls– fork, exec, exit, wait, brk, signal …

Page 11: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

11

Process Control Subsystem (3)

• Memory management module– Control the allocation of memory to a process

• Scheduler module– Allocate the CPU to processes

• Interprocess communication– There are several forms.

Page 12: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

12

Hardware Control (1)

libraries

system call interface

file subsystem process control subsystem

inter-processcommunication

scheduler

memorymanagement

hardware control

hardware

buffer cache

device driverscharacter block

user Levelkernel Level

kernel Levelhardware Level

trap

user programs

Page 13: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

13

Hardware Control (2)

• Responsible for handling interrupts and for communicating with the machine.

• Devices such as disks or terminals may interrupt the CPU while a process is executing

Page 14: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

Topics to be covered

• File subsystem• Process control subsystem• (Memory Management)• Signal• IPC (Inter-Process Communication),

Synchronization

• UNIX System Programming (System Calls)

Page 15: LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System

Reference Books

• The design of the UNIX Operating System, M. J. Bach

• UNIX Internals : The New Frontiers, U. Vahalia

• Advanced Programming in the Unix Environment, 2nd Edition, W. R. Stevens, S. A. Rago