Block Diagram of the System Kernel by mainskweeze

VIEWS: 0 PAGES: 18

									  Block Diagram of the System Kernel

                                User programs

                                                         libraries
                      trap
 User Level

 Kernel Level
                                 System call interface
                                                            Inter-
       File subsystem                                       process
                                                            communicat
                 Buffer cache                    process    ion
                                                  control scheduler
    character        block                      subsystem
                                                            Memory
         Device drivers                                     managemen
                                                            t

                             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


                      File
      User           Table         Inode table
 File Descriptor
      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
• Process’s 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 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
                                                         User
                                                        runnin
                                           1              g
                                                                 Interrupt, Interrupt
                                                                        return
                                  Sys          return
                                 call or
                                 interr
                                  upt
                                           2
                                 slee                                  Schedule
                                   p                                   process


        asleep
                             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