Chapter 2: Operating-SystemChapter 2: Operating-SystemStructuresStructures
2.2 Silberschatz, Galvin and GagneOperating System ConceptsChapter 2: Operating-SystemChapter 2: Operating-SystemStructure...
2.3 Silberschatz, Galvin and GagneOperating System ConceptsObjectivesObjectivesTo describe the services an operating syste...
2.4 Silberschatz, Galvin and GagneOperating System ConceptsOperating System ServicesOperating System ServicesOne set of op...
2.5 Silberschatz, Galvin and GagneOperating System ConceptsOperating System Services (Cont.)Operating System Services (Con...
2.6 Silberschatz, Galvin and GagneOperating System ConceptsOperating System Services (Cont.)Operating System Services (Con...
2.7 Silberschatz, Galvin and GagneOperating System ConceptsUser Operating System Interface -User Operating System Interfac...
2.8 Silberschatz, Galvin and GagneOperating System ConceptsUser Operating System Interface -User Operating System Interfac...
2.9 Silberschatz, Galvin and GagneOperating System ConceptsSystem CallsSystem CallsProgramming interface to the services p...
2.10 Silberschatz, Galvin and GagneOperating System ConceptsExample of System CallsExample of System CallsSystem call sequ...
2.11 Silberschatz, Galvin and GagneOperating System ConceptsExample of Standard APIExample of Standard APIConsider the Rea...
2.12 Silberschatz, Galvin and GagneOperating System ConceptsSystem Call ImplementationSystem Call ImplementationTypically,...
2.13 Silberschatz, Galvin and GagneOperating System ConceptsAPI – System Call – OS RelationshipAPI – System Call – OS Rela...
2.14 Silberschatz, Galvin and GagneOperating System ConceptsStandard C Library ExampleStandard C Library ExampleC program ...
2.15 Silberschatz, Galvin and GagneOperating System ConceptsSystem Call Parameter PassingSystem Call Parameter PassingOfte...
2.16 Silberschatz, Galvin and GagneOperating System ConceptsParameter Passing via TableParameter Passing via Table
2.17 Silberschatz, Galvin and GagneOperating System ConceptsTypes of System CallsTypes of System CallsProcess controlFile ...
2.18 Silberschatz, Galvin and GagneOperating System ConceptsMS-DOS executionMS-DOS execution(a) At system startup (b) runn...
2.19 Silberschatz, Galvin and GagneOperating System ConceptsFreeBSD Running Multiple ProgramsFreeBSD Running Multiple Prog...
2.20 Silberschatz, Galvin and GagneOperating System ConceptsSystem ProgramsSystem ProgramsSystem programs provide a conven...
2.21 Silberschatz, Galvin and GagneOperating System ConceptsSolaris 10 dtrace Following SystemSolaris 10 dtrace Following ...
2.22 Silberschatz, Galvin and GagneOperating System ConceptsSystem ProgramsSystem ProgramsProvide a convenient environment...
2.23 Silberschatz, Galvin and GagneOperating System ConceptsSystem Programs (cont’d)System Programs (cont’d)File modificat...
2.24 Silberschatz, Galvin and GagneOperating System ConceptsOperating System Design andOperating System Design andImplemen...
2.25 Silberschatz, Galvin and GagneOperating System ConceptsOperating System Design and ImplementationOperating System Des...
2.26 Silberschatz, Galvin and GagneOperating System ConceptsSimple StructureSimple StructureMS-DOS – written to provide th...
2.27 Silberschatz, Galvin and GagneOperating System ConceptsMS-DOS Layer StructureMS-DOS Layer Structure
2.28 Silberschatz, Galvin and GagneOperating System ConceptsLayered ApproachLayered ApproachThe operating system is divide...
2.29 Silberschatz, Galvin and GagneOperating System ConceptsLayered Operating SystemLayered Operating System
2.30 Silberschatz, Galvin and GagneOperating System ConceptsUNIXUNIXUNIX – limited by hardware functionality, the original...
2.31 Silberschatz, Galvin and GagneOperating System ConceptsUNIX System StructureUNIX System Structure
2.32 Silberschatz, Galvin and GagneOperating System ConceptsMicrokernel System StructureMicrokernel System StructureMoves ...
2.33 Silberschatz, Galvin and GagneOperating System ConceptsMac OS X StructureMac OS X Structure
2.34 Silberschatz, Galvin and GagneOperating System ConceptsModulesModulesMost modern operating systems implement kernel m...
2.35 Silberschatz, Galvin and GagneOperating System ConceptsSolaris Modular ApproachSolaris Modular Approach
2.36 Silberschatz, Galvin and GagneOperating System ConceptsVirtual MachinesVirtual MachinesA virtual machine takes the la...
2.37 Silberschatz, Galvin and GagneOperating System ConceptsVirtual Machines (Cont.)Virtual Machines (Cont.)The resources ...
2.38 Silberschatz, Galvin and GagneOperating System ConceptsVirtual Machines (Cont.)Virtual Machines (Cont.)(a) Nonvirtual...
2.39 Silberschatz, Galvin and GagneOperating System ConceptsVirtual MachinesVirtual Machines (Cont.)(Cont.)The virtual-mac...
2.40 Silberschatz, Galvin and GagneOperating System ConceptsVMware ArchitectureVMware Architecture
2.41 Silberschatz, Galvin and GagneOperating System ConceptsThe Java Virtual MachineThe Java Virtual Machine
2.42 Silberschatz, Galvin and GagneOperating System ConceptsOperating System GenerationOperating System GenerationOperatin...
2.43 Silberschatz, Galvin and GagneOperating System ConceptsSystem BootSystem BootOperating system must be made available ...
End of Chapter 2End of Chapter 2
Upcoming SlideShare
Loading in …5
×

2.Operating System Structures

1,002 views

Published on

Senthilkanth,MCA..
The following ppt's full topic covers Operating System for BSc CS, BCA, MSc CS, MCA students..
1.Introduction
2.OS Structures
3.Process
4.Threads
5.CPU Scheduling
6.Process Synchronization
7.Dead Locks
8.Memory Management
9.Virtual Memory
10.File system Interface
11.File system implementation
12.Mass Storage System
13.IO Systems
14.Protection
15.Security
16.Distributed System Structure
17.Distributed File System
18.Distributed Co Ordination
19.Real Time System
20.Multimedia Systems
21.Linux
22.Windows

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,002
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
37
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

2.Operating System Structures

  1. 1. Chapter 2: Operating-SystemChapter 2: Operating-SystemStructuresStructures
  2. 2. 2.2 Silberschatz, Galvin and GagneOperating System ConceptsChapter 2: Operating-SystemChapter 2: Operating-SystemStructuresStructuresOperating System ServicesUser Operating System InterfaceSystem CallsTypes of System CallsSystem ProgramsOperating System Design and ImplementationOperating System StructureVirtual MachinesOperating System GenerationSystem Boot
  3. 3. 2.3 Silberschatz, Galvin and GagneOperating System ConceptsObjectivesObjectivesTo describe the services an operating system provides to users,processes, and other systemsTo discuss the various ways of structuring an operating systemTo explain how operating systems are installed and customizedand how they boot
  4. 4. 2.4 Silberschatz, Galvin and GagneOperating System ConceptsOperating System ServicesOperating System ServicesOne set of operating-system services provides functions that arehelpful to the user:User interface - Almost all operating systems have a user interface (UI) Varies between Command-Line (CLI), Graphics User Interface (GUI),BatchProgram execution - The system must be able to load a program intomemory and to run that program, end execution, either normally orabnormally (indicating error)I/O operations - A running program may require I/O, which may involvea file or an I/O device.File-system manipulation - The file system is of particular interest.Obviously, programs need to read and write files and directories, createand delete them, search them, list file Information, permissionmanagement.
  5. 5. 2.5 Silberschatz, Galvin and GagneOperating System ConceptsOperating System Services (Cont.)Operating System Services (Cont.)One set of operating-system services provides functions that arehelpful to the user (Cont):Communications – Processes may exchange information, on the samecomputer or between computers over a network Communications may be via shared memory or through messagepassing (packets moved by the OS)Error detection – OS needs to be constantly aware of possible errors May occur in the CPU and memory hardware, in I/O devices, in userprogram For each type of error, OS should take the appropriate action toensure correct and consistent computing Debugging facilities can greatly enhance the user’s andprogrammer’s abilities to efficiently use the system
  6. 6. 2.6 Silberschatz, Galvin and GagneOperating System ConceptsOperating System Services (Cont.)Operating System Services (Cont.)Another set of OS functions exists for ensuring the efficient operation of thesystem itself via resource sharingResource allocation - When multiple users or multiple jobs runningconcurrently, resources must be allocated to each of them Many types of resources - Some (such as CPU cycles,mainmemory,and file storage) may have special allocation code, others (such as I/Odevices) may have general request and release code.Accounting - To keep track of which users use how much and what kindsof computer resourcesProtection and security - The owners of information stored in amultiuser or networked computer system may want to control use of thatinformation, concurrent processes should not interfere with each other Protection involves ensuring that all access to system resources iscontrolled Security of the system from outsiders requires user authentication,extends to defending external I/O devices from invalid access attempts If a system is to be protected and secure, precautions must beinstituted throughout it. A chain is only as strong as its weakest link.
  7. 7. 2.7 Silberschatz, Galvin and GagneOperating System ConceptsUser Operating System Interface -User Operating System Interface -CLICLICLI allows direct command entry Sometimes implemented in kernel, sometimes by systemsprogram Sometimes multiple flavors implemented – shells Primarily fetches a command from user and executes it– Sometimes commands built-in, sometimes just names ofprograms» If the latter, adding new features doesn’t require shellmodification
  8. 8. 2.8 Silberschatz, Galvin and GagneOperating System ConceptsUser Operating System Interface -User Operating System Interface -GUIGUIUser-friendly desktop metaphor interfaceUsually mouse, keyboard, and monitorIcons represent files, programs, actions, etcVarious mouse buttons over objects in the interface causevarious actions (provide information, options, execute function,open directory (known as a folder)Invented at Xerox PARCMany systems now include both CLI and GUI interfacesMicrosoft Windows is GUI with CLI “command” shellApple Mac OS X as “Aqua” GUI interface with UNIX kernelunderneath and shells availableSolaris is CLI with optional GUI interfaces (Java Desktop, KDE)
  9. 9. 2.9 Silberschatz, Galvin and GagneOperating System ConceptsSystem CallsSystem CallsProgramming interface to the services provided by the OSTypically written in a high-level language (C or C++)Mostly accessed by programs via a high-level ApplicationProgram Interface (API) rather than direct system call useThree most common APIs are Win32 API for Windows, POSIX APIfor POSIX-based systems (including virtually all versions of UNIX,Linux, and Mac OS X), and Java API for the Java virtual machine(JVM)Why use APIs rather than system calls?(Note that the system-call names used throughout this text aregeneric)
  10. 10. 2.10 Silberschatz, Galvin and GagneOperating System ConceptsExample of System CallsExample of System CallsSystem call sequence to copy the contents of one file to another file
  11. 11. 2.11 Silberschatz, Galvin and GagneOperating System ConceptsExample of Standard APIExample of Standard APIConsider the ReadFile() function in theWin32 API—a function for reading from a fileA description of the parameters passed to ReadFile()HANDLE file—the file to be readLPVOID buffer—a buffer where the data will be read into and writtenfromDWORD bytesToRead—the number of bytes to be read into the bufferLPDWORD bytesRead—the number of bytes read during the last readLPOVERLAPPED ovl—indicates if overlapped I/O is being used
  12. 12. 2.12 Silberschatz, Galvin and GagneOperating System ConceptsSystem Call ImplementationSystem Call ImplementationTypically, a number associated with each system callSystem-call interface maintains a table indexed according tothese numbersThe system call interface invokes intended system call in OS kerneland returns status of the system call and any return valuesThe caller need know nothing about how the system call isimplementedJust needs to obey API and understand what OS will do as aresult callMost details of OS interface hidden from programmer by API Managed by run-time support library (set of functions builtinto libraries included with compiler)
  13. 13. 2.13 Silberschatz, Galvin and GagneOperating System ConceptsAPI – System Call – OS RelationshipAPI – System Call – OS Relationship
  14. 14. 2.14 Silberschatz, Galvin and GagneOperating System ConceptsStandard C Library ExampleStandard C Library ExampleC program invoking printf() library call, which calls write() system call
  15. 15. 2.15 Silberschatz, Galvin and GagneOperating System ConceptsSystem Call Parameter PassingSystem Call Parameter PassingOften, more information is required than simply identity of desiredsystem callExact type and amount of information vary according to OS andcallThree general methods used to pass parameters to the OSSimplest: pass the parameters in registers In some cases, may be more parameters than registersParameters stored in a block, or table, in memory, and addressof block passed as a parameter in a register This approach taken by Linux and SolarisParameters placed, or pushed, onto the stack by the programand popped off the stack by the operating systemBlock and stack methods do not limit the number or length ofparameters being passed
  16. 16. 2.16 Silberschatz, Galvin and GagneOperating System ConceptsParameter Passing via TableParameter Passing via Table
  17. 17. 2.17 Silberschatz, Galvin and GagneOperating System ConceptsTypes of System CallsTypes of System CallsProcess controlFile managementDevice managementInformation maintenanceCommunications
  18. 18. 2.18 Silberschatz, Galvin and GagneOperating System ConceptsMS-DOS executionMS-DOS execution(a) At system startup (b) running a program
  19. 19. 2.19 Silberschatz, Galvin and GagneOperating System ConceptsFreeBSD Running Multiple ProgramsFreeBSD Running Multiple Programs
  20. 20. 2.20 Silberschatz, Galvin and GagneOperating System ConceptsSystem ProgramsSystem ProgramsSystem programs provide a convenient environment for programdevelopment and execution. The can be divided into:File manipulationStatus informationFile modificationProgramming language supportProgram loading and executionCommunicationsApplication programsMost users’ view of the operation system is defined by systemprograms, not the actual system calls
  21. 21. 2.21 Silberschatz, Galvin and GagneOperating System ConceptsSolaris 10 dtrace Following SystemSolaris 10 dtrace Following SystemCallCall
  22. 22. 2.22 Silberschatz, Galvin and GagneOperating System ConceptsSystem ProgramsSystem ProgramsProvide a convenient environment for program development and executionSome of them are simply user interfaces to system calls; others areconsiderably more complexFile management - Create, delete, copy, rename, print, dump, list, andgenerally manipulate files and directoriesStatus informationSome ask the system for info - date, time, amount of available memory,disk space, number of usersOthers provide detailed performance, logging, and debugginginformationTypically, these programs format and print the output to the terminal orother output devicesSome systems implement a registry - used to store and retrieveconfiguration information
  23. 23. 2.23 Silberschatz, Galvin and GagneOperating System ConceptsSystem Programs (cont’d)System Programs (cont’d)File modificationText editors to create and modify filesSpecial commands to search contents of files or performtransformations of the textProgramming-language support - Compilers, assemblers,debuggers and interpreters sometimes providedProgram loading and execution- Absolute loaders, relocatableloaders, linkage editors, and overlay-loaders, debugging systemsfor higher-level and machine languageCommunications - Provide the mechanism for creating virtualconnections among processes, users, and computer systemsAllow users to send messages to one another’s screens,browse web pages, send electronic-mail messages, log inremotely, transfer files from one machine to another
  24. 24. 2.24 Silberschatz, Galvin and GagneOperating System ConceptsOperating System Design andOperating System Design andImplementationImplementationDesign and Implementation of OS not “solvable”, but someapproaches have proven successfulInternal structure of different Operating Systems can vary widelyStart by defining goals and specificationsAffected by choice of hardware, type of systemUser goals and System goalsUser goals – operating system should be convenient to use,easy to learn, reliable, safe, and fastSystem goals – operating system should be easy to design,implement, and maintain, as well as flexible, reliable, error-free,and efficient
  25. 25. 2.25 Silberschatz, Galvin and GagneOperating System ConceptsOperating System Design and ImplementationOperating System Design and Implementation(Cont.)(Cont.)Important principle to separatePolicy: What will be done?Mechanism: How to do it?Mechanisms determine how to do something, policies decide whatwill be doneThe separation of policy from mechanism is a very importantprinciple, it allows maximum flexibility if policy decisions are tobe changed later
  26. 26. 2.26 Silberschatz, Galvin and GagneOperating System ConceptsSimple StructureSimple StructureMS-DOS – written to provide the most functionality in the leastspaceNot divided into modulesAlthough MS-DOS has some structure, its interfaces and levelsof functionality are not well separated
  27. 27. 2.27 Silberschatz, Galvin and GagneOperating System ConceptsMS-DOS Layer StructureMS-DOS Layer Structure
  28. 28. 2.28 Silberschatz, Galvin and GagneOperating System ConceptsLayered ApproachLayered ApproachThe operating system is divided into a number of layers (levels),each built on top of lower layers. The bottom layer (layer 0), is thehardware; the highest (layer N) is the user interface.With modularity, layers are selected such that each uses functions(operations) and services of only lower-level layers
  29. 29. 2.29 Silberschatz, Galvin and GagneOperating System ConceptsLayered Operating SystemLayered Operating System
  30. 30. 2.30 Silberschatz, Galvin and GagneOperating System ConceptsUNIXUNIXUNIX – limited by hardware functionality, the original UNIX operatingsystem had limited structuring. The UNIX OS consists of twoseparable partsSystems programsThe kernel Consists of everything below the system-call interface andabove the physical hardware Provides the file system, CPU scheduling, memorymanagement, and other operating-system functions; a largenumber of functions for one level
  31. 31. 2.31 Silberschatz, Galvin and GagneOperating System ConceptsUNIX System StructureUNIX System Structure
  32. 32. 2.32 Silberschatz, Galvin and GagneOperating System ConceptsMicrokernel System StructureMicrokernel System StructureMoves as much from the kernel into “user” spaceCommunication takes place between user modules using messagepassingBenefits:Easier to extend a microkernelEasier to port the operating system to new architecturesMore reliable (less code is running in kernel mode)More secureDetriments:Performance overhead of user space to kernel spacecommunication
  33. 33. 2.33 Silberschatz, Galvin and GagneOperating System ConceptsMac OS X StructureMac OS X Structure
  34. 34. 2.34 Silberschatz, Galvin and GagneOperating System ConceptsModulesModulesMost modern operating systems implement kernel modulesUses object-oriented approachEach core component is separateEach talks to the others over known interfacesEach is loadable as needed within the kernelOverall, similar to layers but with more flexible
  35. 35. 2.35 Silberschatz, Galvin and GagneOperating System ConceptsSolaris Modular ApproachSolaris Modular Approach
  36. 36. 2.36 Silberschatz, Galvin and GagneOperating System ConceptsVirtual MachinesVirtual MachinesA virtual machine takes the layered approach to its logicalconclusion. It treats hardware and the operating systemkernel as though they were all hardwareA virtual machine provides an interface identical to theunderlying bare hardwareThe operating system creates the illusion of multipleprocesses, each executing on its own processor with its own(virtual) memory
  37. 37. 2.37 Silberschatz, Galvin and GagneOperating System ConceptsVirtual Machines (Cont.)Virtual Machines (Cont.)The resources of the physical computer are shared to create thevirtual machinesCPU scheduling can create the appearance that users havetheir own processorSpooling and a file system can provide virtual card readers andvirtual line printersA normal user time-sharing terminal serves as the virtualmachine operator’s console
  38. 38. 2.38 Silberschatz, Galvin and GagneOperating System ConceptsVirtual Machines (Cont.)Virtual Machines (Cont.)(a) Nonvirtual machine (b) virtual machineNon-virtual Machine Virtual Machine
  39. 39. 2.39 Silberschatz, Galvin and GagneOperating System ConceptsVirtual MachinesVirtual Machines (Cont.)(Cont.)The virtual-machine concept provides complete protection of systemresources since each virtual machine is isolated from all other virtualmachines. This isolation, however, permits no direct sharing ofresources.A virtual-machine system is a perfect vehicle for operating-systemsresearch and development. System development is done on thevirtual machine, instead of on a physical machine and so does notdisrupt normal system operation.The virtual machine concept is difficult to implement due to the effortrequired to provide an exact duplicate to the underlying machine
  40. 40. 2.40 Silberschatz, Galvin and GagneOperating System ConceptsVMware ArchitectureVMware Architecture
  41. 41. 2.41 Silberschatz, Galvin and GagneOperating System ConceptsThe Java Virtual MachineThe Java Virtual Machine
  42. 42. 2.42 Silberschatz, Galvin and GagneOperating System ConceptsOperating System GenerationOperating System GenerationOperating systems are designed to run on any of a class ofmachines; the system must be configured for each specificcomputer siteSYSGEN program obtains information concerning the specificconfiguration of the hardware systemBooting – starting a computer by loading the kernelBootstrap program – code stored in ROM that is able to locate thekernel, load it into memory, and start its execution
  43. 43. 2.43 Silberschatz, Galvin and GagneOperating System ConceptsSystem BootSystem BootOperating system must be made available to hardware sohardware can start itSmall piece of code – bootstrap loader, locates the kernel,loads it into memory, and starts itSometimes two-step process where boot block at fixedlocation loads bootstrap loaderWhen power initialized on system, execution starts at a fixedmemory location Firmware used to hold initial boot code
  44. 44. End of Chapter 2End of Chapter 2

×