OSA Unit - II

Views:
 
Category: Education
     
 

Presentation Description

Operating System and Administration: Introduction to the Kernel

Comments

Presentation Transcript

Introduction to the Kernel:

Introduction to the Kernel Reference: UNIX AND LINUX SYSTEM ADMINISTRATION HANDBOOK Authors : Evi Nemeth Garth Snyder Trent R. Hein Ben Whaley

Index:

Index Architecture of Unix operating system, Introduction to the system concepts, Kernel data structure, System Administration. 2

Architecture of the UNIX:

Architecture of the UNIX libraries system call interface file subsystem process control subsystem inter-process communication scheduler memory management hardware control hardware buffer cache device drivers character block user Level kernel Level kernel Level hardware Level trap user programs 3

Libraries (1):

Libraries (1) libraries system call interface file subsystem process control subsystem inter-process communication scheduler memory management hardware control hardware buffer cache device drivers character block user Level kernel Level kernel Level hardware Level trap user programs 4

Libraries (2):

Libraries (2) Make system calls look like ordinary function call. Map these function call to the primitives needed to enter the OS. 5

File Subsystem (1):

File Subsystem (1) libraries system call interface file subsystem process control subsystem inter-process communication scheduler memory management hardware control hardware buffer cache device drivers character block user Level kernel Level kernel Level hardware Level trap user programs 6

File Subsystem (2):

File Subsystem (2) Managing files 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 … 7

Buffering Mechanism (1):

Buffering Mechanism (1) libraries system call interface file subsystem process control subsystem inter-process communication scheduler memory management hardware control hardware buffer cache device drivers character block user Level kernel Level kernel Level hardware Level trap user programs 8

Buffering Mechanism (2):

Buffering Mechanism (2) Interact with block I/O device drivers to initiate data transfer to and from kernel. 9

Process Control Subsystem (1):

Process Control Subsystem (1) libraries system call interface file subsystem process control subsystem inter-process communication scheduler memory management hardware control hardware buffer cache device drivers character block user Level kernel Level kernel Level hardware Level trap user programs 10

Process Control Subsystem (2):

Process Control Subsystem (2) Responsible for process synchronization . Interprocess communication (IPC) Memory management Process scheduling Interact with set of system calls fork, exec, exit, wait, brk, signal … 11

Process Control Subsystem (3):

Process Control Subsystem (3) Memory management module Control the allocation of memory Scheduler module Allocate the CPU to processes Interprocess communication There are several forms. 12

Hardware Control (1):

Hardware Control (1) libraries system call interface file subsystem process control subsystem inter-process communication scheduler memory management hardware control hardware buffer cache device drivers character block user Level kernel Level kernel Level hardware Level trap user programs 13

Hardware Control (2):

Hardware Control (2) Responsible for handling interrupts and for communicating with the machine . 14

An Overview of the File Subsystem:

An Overview of the File Subsystem inode (index node) a description of the disk layout of the file data and other information 15

File Access:

File Access User File Descriptor Table File Table Inode Table 16

File System Layout:

File System Layout boot block Be needed to boot the system super block Describes the state of a file system inode list a list of inodes data block contain file data and administrative data boot block super block inode list data blocks 17

User and Kernel Stack for Copy Program:

User and Kernel Stack for Copy Program Addr of Frame 2 Ret addr after write call Local Vars not shown params to write new buffer count Addr of Frame 1 Ret addr after copy call Local Vars count params to copy old new Addr of Frame 0 Ret addr after main call Local Vars fdold fdnew params to main argc argv user stack Addr of Frame 1 Ret addr after func2 call Local Vars parms to kernel func2 Addr of Frame 0 Ret addr after func1 call Local Vars params to kernel func1 kernel stack frame 3 call write() frame 2 call copy() frame 1 call main() frame 3 frame 2 call func2() frame 1 call func1() frame 0 start frame 0 system call interface Direction of stack growth 18

Data Structures for Processes:

Data Structures for Processes u area main memory region table per process region table process table 19

Process Table:

Process Table State, ownership, event descriptor set u pointer (address) 20

u Area:

u Area Pointer to the process table slot System call parameters File descriptor Internal I/O information Current directory and current root Process and file size limits 21

Region Table:

Region Table Text / Data Shared / Private 22

Process states:

Process states User mode currently executing Kernel mode currently executing Ready to run soon as the scheduler chooses it. Sleeping no longer continue executing eg) waiting for I/O to complete. 23

Process Transition:

Process Transition 1 2 4 3 kernel running user running context switch permissible ready to run return sys call or interrupt interrupt, interrupt return schedule process sleep wakeup 24

Multiple Proceses Sleeping on a Lock:

Multiple Proceses Sleeping on a Lock Time Proc A Proc B Proc C Buffer locked Sleeps Buffer locked Sleeps Buffer locked Sleeps Ready to run Ready to run Ready to run Runs Buffer unlocked Lock buffer Sleep for arbitrary reason Runs Buffer loced Sleeps Wakes up Unlocks Buffer Wake up all sleeping procs Context switch, eventually Runs Ready to run Ready to run Runs Buffer loced Sleeps Buffer is unlocked Wake up all sleeping procs 25

authorStream Live Help