Operating Systems Principles Design and Implementation Policies And

Operating Systems Principles Design and Implementation Policies And

Betriebssysteme ws2000/2001 Operating Systems Principles Design and Implementation Policies and Mechanisms S 2004 CS325 1 Textbook: L.Bic and A.C Shaw: "Operating Systems Principles" Other references: • A.S. Tanenbaum, „Modern Operating Systems“, Prentice-Hall • Other references – see web site: cs.nmt.edu/~cs325 S 2004 CS325 2 Prof. H. D. Clausen 1 Betriebssysteme ws2000/2001 Simple hardware configuration control CPU data addres s controller controller main memory device_1 device_2 user IO subsystem S 2004 CS325 3 Typical hardware configuration main CPU memory IOC IOC/PPU controller controller controller controller device device device S 2004 CS325 4 Prof. H. D. Clausen 2 Betriebssysteme ws2000/2001 Processor performance This chart plots relative performance as measured by the SPECint benchmarks with base of one being a VAX 11/780. S 2004 CS325 5 Memory cost Prices of DRAMs (from 16K bits to 64M bits) over time in 1977 dollars. S 2004 CS325 6 Prof. H. D. Clausen 3 Betriebssysteme ws2000/2001 API application program application support API SVC SysCall systems programs kernel programs SW CISC driver programs RISC HW S 2004 CS325 7 Principle of abstraction • Higher-level function: – Read( file, logical_block, main_memory ) • Lower-level functions – Calculate position of logical_block on the disk; – Move Read/Write head to corresponding track; – Check for „seek“ errors; – Read physical block; – Check for „read“ errors; – Copy block to main_memory; S 2004 CS325 8 Prof. H. D. Clausen 4 Betriebssysteme ws2000/2001 Principle of abstraction extended machine read Calc_pos Mov_RWhd Functions = “virtual” ReadPhysBlk CopyBlkToMe instructions m ChckReadErr ChckSeekErr driver basic machine HW machine instructions S 2004 CS325 9 “Logical Design” • Logical -> “virtual” machine • Real -> “physical” machine • Design principles – – “policy”, strategy – plan of action --- design – “mechanism”, tactics, approach --- implementation • Example: waiting queue – Logical organization: FIFO, priority, some scheduling scheme – Physical organization: linked list, doubly linked list, circular list, array, heap, … S 2004 CS325 10 Prof. H. D. Clausen 5 Betriebssysteme ws2000/2001 „Timesharing“ – time slicing 1 1 2 4 3 S 2004 CS325 11 Real and virtual memory logical real (virtual) (physial) mapping S 2004 CS325 12 Prof. H. D. Clausen 6 Betriebssysteme ws2000/2001 Real and virtual memory logical (virtual) real (physial) The ideal situation: each The real situation: each process (executing memory system is composed program) has its own of a hierarchy of storage address space ranging from components (cache, fast and 0 to a max_size. big memory…). The total No access from/to other storage is divided into address spaces is allowed. segments, pages and access/ transfer pieces – proper Special hardware support (paging, access and protection is a base and limimt registers, address serious problem. mapping hardware (MMU) alleviate the task of the operating system. S 2004 CS325 13 Virtual, logical und physical devices control data virtual device log. device 1 log. device 2 Driver_1 Driver_2 phys. phys. device 1 device 2 S 2004 CS325 14 Prof. H. D. Clausen 7 Betriebssysteme ws2000/2001 interfaces and Virtual machines Operating System kernel virtual machine = logical machine + manager logical machine = physical maschine + driver S 2004 CS325 15 Virtual Machines Processes Processes Processes Kernel_1 Kernel_2 Kernel_3 Virtual Machine Hardware S 2004 CS325 16 Prof. H. D. Clausen 8 Betriebssysteme ws2000/2001 Example Virtual Machine Processes Processes Processes OS_1 OS _2 OS _3 Virtual Machine (VM/370) Hardware S 2004 CS325 17 System Configuration secondary storage tape/C terminal printer D controller controller controller controller controller netw.interf. CPU memory S 2004 CS325 18 Prof. H. D. Clausen 9 Betriebssysteme ws2000/2001 structural organization application programs user_1 user_2 user_n user- mode System-Libraries file- (protected) (functions) system OS-kernel system- mode (priviledged) Hardware Plattform S 2004 CS325 19 structural organization • Monolithic systems: one big collection of routines, all run in privileged mode; • Structured systems: higher-level functions run in user mode, lower-level functions are combined into a privileged kernel; • Micro-kernel systems: only the hardware-drivers and a few critical components (thread management, inter- process communication, synchronization) run in kernel mode – everything else runs in user mode. S 2004 CS325 20 Prof. H. D. Clausen 10 Betriebssysteme ws2000/2001 Software structure User 1 User 2 . User n (Graphical)(Graphical) User User Interface Interface Applic.-Applic.- utility-utility- SW-SW- Applic.-Applic.- progr.progr. 1 1 programprogram tooltool progr.progr. n n System Calls MaschinenPOSIX OperatingOperating System System FunctionsFunctions code VM OperatingOperating System System KernelKernel HardwareHardware S 2004 CS325 21 „von Neumann Architecture“ Memory contains: Adress • data and Data (results) of next instruction • programs instructions data (commands) Control unit control- ALU signals This principle was invented by J. P. Eckert and J. W. Mauchly but published first as an abstract concept by John von Neumann. Similar ideas were developed by Konrad Zuse and Schreyer. S 2004 CS325 22 Prof. H. D. Clausen 11 Betriebssysteme ws2000/2001 Fetch-Execute Cycle REPEAT IR := Mp[PC]; PC := PC+1 IF (FC == JpClass) THEN PC := Operand jumps ELSE other Execute (IR) operations END_IF; UNTIL cpu_HALT; S 2004 CS325 23 von Neumann Architecture (SISD) memory Mp contains: ALU Adress of • data and dat next instruction • programs instruction Program Counter PC instruction register IR FCMod Operand modifier Adress, direct function code Operand S 2004 CS325 24 Prof. H. D. Clausen 12 Betriebssysteme ws2000/2001 Interrupt Mechanism IF (IRQ_i == 1) THEN save PC; PC := IRLoc_i ELSE IR := Mp[PC]; PC := PC+1 IF (FC == JpClass) THEN PC := Operand ELSE Execute (IR); END_IF END_IF // Interrupt S 2004 CS325 25 „basic instruction cycle with interrupts“ nxnynz This transition is triggered by the interrupt nnn_i nxnyni This location is saved by the interrupt hardware or the handler This transition is executed by the interrupt software. handler (driver) command “RTI” S 2004 CS325 26 Prof. H. D. Clausen 13 Betriebssysteme ws2000/2001 Software Structure User 1 User 2 . User n (Graphical)(Graphical) User User Interface Interface–– „shell“ „shell“ applicationapplication 1 1 UtilityUtility i i ToolTool k k applicationapplication n n System Calls (SVC) Operating System Functions and Services Operating System kernel Hardware S 2004 CS325 27 OS Functions • Process management • Memory management • File management5 • Input/Output • Networking • Utility services S 2004 CS325 28 Prof. H. D. Clausen 14 Betriebssysteme ws2000/2001 Simple batch system – memory allocation FF….FF free space -data User program - code Operating system 0 S 2004 CS325 29 Bootstrap Loader task: load a small initial program into memory and start it. This process is also called „deadstart“, „coldstart“, „bootstrap“; it must be supported by a hardware “initial load” function. Press_Load: FOR i := 0 TO 79 DO Read(M[i]); END_FOR; GOTO (M[0]); S 2004 CS325 30 Prof. H. D. Clausen 15 Betriebssysteme ws2000/2001 Bootstrap 0 1 79 LA1 n1 Absolute Code (Program/Data) LA2 n2 Absolute Code (Program/Data) LA3 n3 Absolute Code (Program/Data) .. .. ...... E_A 0 Entry_Address = start of execution ( PC := E_A; go! ) S 2004 CS325 31 Bootstrap In a second/third phase the minimal program can read and sub- sequently start a bigger program - e.g. a more powerful loader or the kernel of an executive system (Exec, Monitor program,0 OS)1 79 LA n Absolute Code (Program/Data) Load address LOOP: FOR i := 0 TO 79 DO Read(M[r+i]) END_FOR; LA := M[r]; n := M[r+1]; IF n==0 THEN GOTO LA; FOR i := 0 TO n-1 DO M[LA+i] := M[r+2+i] END_FOR; END_LOOP; S 2004 CS325 32 Prof. H. D. Clausen 16 Betriebssysteme ws2000/2001 Bootstrap Loader 3 loading stages Operating system Main memory S 2004 CS325 33 Bootstrap Loader II 1 2 Initially a HW program (ROM) reads the first sector of the boot disk with the “Partition Table”; then it reads the bootblock of the active partition. 3 All other steps are identical to the simple boot process. S 2004 CS325 34 Prof. H. D. Clausen 17 Betriebssysteme ws2000/2001 Early Programming • Use of the „bare machine“ • Certain instruction sequences which appear frequently are arranged into subroutines • Subroutines which are commonly used are organized into a library for application programming a symbolic notation is introduced - > Assembler FC „64“ = „jmp“ • Address managment is alleviated by introducing symbolic names and automatic relocation at translation and loading time S 2004 CS325 35 Early Programming • Binding (linkage edit) und Loading are delegated to special programs. (linkage editor, loader) • Execution is supervised and controlled by a „Monitor“ program (Exec). • Additional service programs (utilities) are provided: editor, compiler, SortMerge programs • Control cards and a „Job Control Language“ (JCL) permit user control of „job“ execution • all systems and utility programs comprise the operating software; the machine-oriented programs lower layers form the operating system proper. S 2004 CS325 36 Prof. H. D. Clausen 18 Betriebssysteme ws2000/2001 protected user mode kernel unprotected = privileged mode bare hardware S 2004 CS325 37 Multiprogramming systeme - memory allocation user job_n User job_2 user job_1 operating system Jan 26 S 2004 CS325 38 Prof. H. D. Clausen 19 Betriebssysteme

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    33 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us