Block Diagram of the System Kernel by mainskweeze


									  Block Diagram of the System Kernel

                                User programs

 User Level

 Kernel Level
                                 System call interface
       File subsystem                                       process
                 Buffer cache                    process    ion
                                                  control scheduler
    character        block                      subsystem
         Device drivers                                     managemen

                             Hardware control

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           Table         Inode table
 File Descriptor
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(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
• 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
                     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
• Process’s state
   - Its text
   - the values of its global user variables and data
   - the values of machine registers it use
   - the values stored in its process table slot and u
   - the contents of its user and kernel stacks
• The text of OS don’t 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              g
                                                                 Interrupt, Interrupt
                                  Sys          return
                                 call or
                                 slee                                  Schedule
                                   p                                   process

                             3                                              4           Ready to run

Context switch permissible                 wakeup
         Process States
• Critical sections are protected by
  - no context switches
  - processer execution level
  manipulation to prevent interrups

To top