Sie sind auf Seite 1von 18

Block Diagram of the System Kernel

libraries
System call interface
File subsystem
character block
Device drivers


process
control
subsystem
Inter-process
communication
scheduler
Memory
management
Hardware control
Buffer cache
User programs
User Level
Kernel Level
trap
Hardware Level
File Subsystem
Managing files
Allocating file space
Administering free space
Controlling access to files
Retrieving data for users
Process Control Subsystem
Process synchronization
Interprocess communication
Memory management
Process scheduling
Hardware Control
Handling interrupts
Communicating with the machine
File Descriptors, File Table and Inode Table
User
File Descriptor
Table
File
Table
Inode table
An Overview of the File Subsystem
Inode(index node)
- a description of the disk layout of the file data
- the file owner
- access permissions
- access times
- 1 file : 1 inode
- 1 name : 1 link

An Overview of the File Subsystem
File Table
- 1 table per system
- byte offset
- access rights allowed to the opening process
User File Descriptor Table
- allocated per process
- list of all open files
File System Layout
Boot block
- bootstrap code
Super block
- the state of the file system
- how large it is
- how many files it can store
- where to find free space
Inode list
- list of inodes
Data block
- file data, administrative data


Process
Process(the execution of a program)
- text, data, stack
- the entity that is created by the fork system call
process 0
- created when the system boots
- become the swapper after forking process 1
process 1
- init process
- the ancestor of every other process
process
Executable file
- header : describe the attributes of the file
- text : program text
- data : data(has initial values) + bbs
- symbol table
The kernel loads an executable file into memory
during an exec system call
stack frame
- parameters, local variables, pc, stack pointer
Process Table
A state field
User Ids who owns the process
An event descriptor set when a
process is suspended (in the sleep
state)
U area
A pointer to the process table slot of the currently
executing process
Parameters of the current system call, return
values and error codes
File descriptors for all open files
Internal I/O parameters
Current directory and current root
Process and file size limits

Region Table
Describe the attributes of the region
- text/data
- shared/private
- location in memory

Process Context
Processs state
- Its text
- the values of its global user variables and data
structures
- the values of machine registers it use
- the values stored in its process table slot and u
area
- the contents of its user and kernel stacks
The text of OS dont constitute part of the context
of a process
Process Context
Executing a process
= be executing in the context of the process

Context switching = process switch

kernel/user mode switch is Not context switching
Process states
Executing in user mode
Executing in kernel mode
Not executing, but Ready to run
Sleeping on an event
State Transitions
1
2
3
4
User
runnin
g
wakeup
Ready to run
asleep
Context switch permissible
Schedule
process
slee
p
Interrupt, Interrupt
return
return
Sys
call or
interr
upt
Process States
Critical sections are protected by
- no context switches
- processer execution level
manipulation to prevent interrups

Das könnte Ihnen auch gefallen