Presentation is loading. Please wait.

Presentation is loading. Please wait.

Operating System Organization Chapter 3 Michelle Grieco.

Similar presentations


Presentation on theme: "Operating System Organization Chapter 3 Michelle Grieco."— Presentation transcript:

1 Operating System Organization Chapter 3 Michelle Grieco

2 Outline Basic Functions of an OS Basic Functions of an OS Defining Requirements Defining Requirements Implementation Considerations Implementation Considerations OS Kernels of Today OS Kernels of Today Research in OS Research in OS

3 Purpose of an OS Creates abstractions Creates abstractions Multiple processes compete for use of processor Multiple processes compete for use of processor Coordination Coordination

4 Responsibilities of an OS Create an abstract machine environment with multiple, autonomous, abstract components (that can be in use concurrently) Create an abstract machine environment with multiple, autonomous, abstract components (that can be in use concurrently) Multiprogramming is used to create an abstract machine for each process Multiprogramming is used to create an abstract machine for each process Coordinate the use of the components according to the policies of the machine’s administrator Coordinate the use of the components according to the policies of the machine’s administrator Scheduler decides when and which processes get to use the processor Scheduler decides when and which processes get to use the processor

5 Basic Requirements an OS Must Satisfy Device Management Device Management Process, Thread and Resource Management Process, Thread and Resource Management Memory Management Memory Management File Management File Management

6 Device Management OS manages the allocation, isolation and sharing of devices according to policies chosen by the designer or system administrator. OS manages the allocation, isolation and sharing of devices according to policies chosen by the designer or system administrator. Devices treated in a general manner Devices treated in a general manner Special approaches for memory and processor Special approaches for memory and processor

7 Device Management Device-Independent Part Device-Dependent Part Device

8 Process, Thread and Resource Management Basic units of computation Basic units of computation Elements of the computing environment needed by a process so that its threads can execute. Elements of the computing environment needed by a process so that its threads can execute.

9 Process Management Unix Style Unix Style Includes management facilities to create, destroy, block, and run a process. Includes management facilities to create, destroy, block, and run a process. Thread Based Approach Thread Based Approach More complicated since it has to manage processes and threads as separate entities More complicated since it has to manage processes and threads as separate entities

10 Resource Manager Allocates resources to processes Allocates resources to processes Handles requests for resources from threads Handles requests for resources from threads Changes in status/changes in resource needs Changes in status/changes in resource needs

11 Memory Management Cooperates with process manager to allocate primary memory (executable or main) to each process Cooperates with process manager to allocate primary memory (executable or main) to each process Enforces isolation, methods to allow sharing of blocks of memory Enforces isolation, methods to allow sharing of blocks of memory Virtual Memory – allows processes to reference information stored on a storage device as if it were stored in primary memory. Virtual Memory – allows processes to reference information stored on a storage device as if it were stored in primary memory.

12 Memory Management Isolation and Sharing Virtual Memory Block Allocation Process Manager Memory Manager Primary Memory Storage Devices

13 File Management Why do we need a file manager? Why do we need a file manager? Provides an abstraction layer Provides an abstraction layer Distribution of information across networks Distribution of information across networks

14 OS Implementation Considerations & Mechanisms Considerations Considerations Performance Performance Exclusive Use of Resources Exclusive Use of Resources Mechanisms Mechanisms Processor Modes Processor Modes Kernels Kernels Methods of Invoking Service Methods of Invoking Service

15 Performance OS provides simplified programming interfaces OS provides simplified programming interfaces Manage resource allocation & sharing Manage resource allocation & sharing OS designers need to keep in mind… OS designers need to keep in mind… What is the cost? Efficiency vs. Convenience How much do these abstractions slow down the execution of a program? How much do these abstractions slow down the execution of a program? What is the performance cost of using files rather than commands to directly manipulate storage devices? What is the performance cost of using files rather than commands to directly manipulate storage devices? How much contribution to functionality of the system is derived versus the impact to performance? How much contribution to functionality of the system is derived versus the impact to performance?

16 Exclusive Use of Resources Multiprogrammed systems support multiple processes and threads that need to share resources. Multiprogrammed systems support multiple processes and threads that need to share resources. Design Principles: Design Principles: Do not to interfere with other processes Do not to interfere with other processes Cannot use a resource unless it is specifically authorized to Cannot use a resource unless it is specifically authorized to Allow both exclusive control to a process / or shared among a set of processes Allow both exclusive control to a process / or shared among a set of processes

17 Exclusive Use of Resources Implementation of Design Principles includes: Implementation of Design Principles includes: Protection Mechanisms via security policies Protection Mechanisms via security policies Defines strategies for managing resources Defines strategies for managing resources File Protection Policy Example File Protection Policy Example If OS enforces a policy, how do we prevent application software from overriding this policy? If OS enforces a policy, how do we prevent application software from overriding this policy? Trusted vs. Untrusted software and access barriers Trusted vs. Untrusted software and access barriers The kernel of the OS is trusted software The kernel of the OS is trusted software All other software is untrusted All other software is untrusted

18 Processor Modes The key hardware element for implementation of trusted software The key hardware element for implementation of trusted software Mode Bit (supervisor or user) Mode Bit (supervisor or user) Supervisor (privileged, protected) Supervisor (privileged, protected) Processor can execute every instruction Processor can execute every instruction User User Processor can execute only a subset of all instructions Processor can execute only a subset of all instructions

19 Kernels What is a kernel? What is a kernel? Design Decisions for what goes into the kernel? Design Decisions for what goes into the kernel? Everything but the kitchen sink? Everything but the kitchen sink? If it is in the kernel, it will have access to other parts of the kernel. If it is in the kernel, it will have access to other parts of the kernel. If it is executed in user mode, it won’t have access to kernel data structures. If it is executed in user mode, it won’t have access to kernel data structures.

20 Requesting Services from the OS Techniques to request service Techniques to request service System Call System Call User invokes a trap instruction User invokes a trap instruction Message Passing Message Passing User constructs a message that requests service User constructs a message that requests service

21 System Call User invokes trap instruction when application calls stub program (uses reference to trap table) User invokes trap instruction when application calls stub program (uses reference to trap table) Processor is switched to supervisor mode Processor is switched to supervisor mode Branches through trap table Branches through trap table Executes function to be invoked Executes function to be invoked OS finishes work and returns to user mode and returns control to user process. OS finishes work and returns to user mode and returns control to user process. Call (…); return (…); trap

22 Message Passing Message constructed that requests service (message A) Message constructed that requests service (message A) OS send() system call passes the message to trusted OS process (kernel). OS send() system call passes the message to trusted OS process (kernel). Executes trap Executes trap Kernel executes function while user waits for result of service request. (message receive A) Kernel executes function while user waits for result of service request. (message receive A) Kernel completes request it sends message B back to user process (send and receive B). Kernel completes request it sends message B back to user process (send and receive B). send (…, A, …); receive (…, B, …); send/receive receive (…, A, …); send (…, B, …);

23 Logical Organization of OS Process, Thread and Resource Manager Memory Manager File Manager Device Manager Processor(s)Main MemoryDevice(s)

24 Kernels of Today UNIX UNIX Windows NT Windows NT

25 UNIX Goals Goals Implement process, memory, file and device management in the kernel but only with minimal functionality to support a broad range of policies (bare essentials to read and write byte streams) Implement process, memory, file and device management in the kernel but only with minimal functionality to support a broad range of policies (bare essentials to read and write byte streams) Wanted to keep kernel as small as possible to improve efficiency Wanted to keep kernel as small as possible to improve efficiency Tailored further by use of application domains and application software to solve problems Tailored further by use of application domains and application software to solve problems Result Result Very large software module including all managers (process, memory, file and device) Very large software module including all managers (process, memory, file and device) Separate device drivers from kernel Separate device drivers from kernel Evolved from swapping systems to paging Evolved from swapping systems to paging Processing now addresses multiprocessor and distributed hardware configurations Processing now addresses multiprocessor and distributed hardware configurations Implementations are difficult to modify Implementations are difficult to modify IEEE POSIX.1 open systems standard IEEE POSIX.1 open systems standard No cost implementation LINUX No cost implementation LINUX

26 WINDOWS Goals Goals Extensible Extensible Portable Portable Reliable Reliable Secure Secure

27 Summary Value of functionality built into the OS must justify the performance cost Value of functionality built into the OS must justify the performance cost Modern OS includes managers for processes and resources including managers for memory, files, and devices Modern OS includes managers for processes and resources including managers for memory, files, and devices Implementation techniques include: the mode bit (supervisor/user) to ensure exclusive use of resources and to operate as trusted, system call interfaces and message passing mechanisms Implementation techniques include: the mode bit (supervisor/user) to ensure exclusive use of resources and to operate as trusted, system call interfaces and message passing mechanisms

28 Research Here are some sites of interest on new and innovative advances in Operating Systems: Here are some sites of interest on new and innovative advances in Operating Systems: http://tunes.org/Review/OSes.html http://tunes.org/Review/OSes.html http://tunes.org/Review/OSes.html http://www.palmsource.com/palmos/ PalmOS Cobalt 6.1 is the next generation of Palm OS. It will enable the creation of new categories of devices for the communications, enterprise, education and entertainment markets. Palm OS Cobalt 6.1 provides integrated telephony features, support for WiFi and Bluetooth, and enhancements to the user interface. http://www.palmsource.com/palmos/ PalmOS Cobalt 6.1 is the next generation of Palm OS. It will enable the creation of new categories of devices for the communications, enterprise, education and entertainment markets. Palm OS Cobalt 6.1 provides integrated telephony features, support for WiFi and Bluetooth, and enhancements to the user interface. http://www.palmsource.com/palmos/ http://www.pdos.lcs.mit.edu/exo.html MIT’s AEGIS – no runtime kernel, extreme performance gain http://www.pdos.lcs.mit.edu/exo.html MIT’s AEGIS – no runtime kernel, extreme performance gainhttp://www.pdos.lcs.mit.edu/exo.html http://www.cs.utah.edu/flux/ Flux Project at University of Utah – build your own OS using OS bricks (an OS toolkit) http://www.cs.utah.edu/flux/ Flux Project at University of Utah – build your own OS using OS bricks (an OS toolkit) http://www.cs.utah.edu/flux/ http://srg.cs.uiuc.edu/2k/ 2K (formerly known as SPINE) is a distributed, reflective, component-based, adaptable operating system being built by researchers at the Systems Software Research Group from the University of Illinois at Urbana- Champaign and the Systems and Communications Group from the Universidad Carlos III - Madrid. http://srg.cs.uiuc.edu/2k/ 2K (formerly known as SPINE) is a distributed, reflective, component-based, adaptable operating system being built by researchers at the Systems Software Research Group from the University of Illinois at Urbana- Champaign and the Systems and Communications Group from the Universidad Carlos III - Madrid. http://srg.cs.uiuc.edu/2k/2K http://srg.cs.uiuc.edu/2k/2K http://www.acm.uiuc.edu/sigops/roll_your_own/ write your own OS http://www.acm.uiuc.edu/sigops/roll_your_own/ write your own OS http://www.acm.uiuc.edu/sigops/roll_your_own/

29 Questions You should be able to answer the following questions about this chapter: You should be able to answer the following questions about this chapter: 1. What is multiprogramming? 1. What is multiprogramming? 2. What are the four main managers in an OS and how do they interact? 2. What are the four main managers in an OS and how do they interact? 3. What are the benefits to having an independent and dependent part of the device manager? 3. What are the benefits to having an independent and dependent part of the device manager? 4. What is a process? What is a thread? 4. What is a process? What is a thread? 5. What are important considerations of a process manager? 5. What are important considerations of a process manager? 6. What is virtual memory? 6. What is virtual memory? 7. Why do we need a file manager? How is it useful? 7. Why do we need a file manager? How is it useful? 8. What are OS implementation considerations? What are the mechanisms we can use to implement these considerations? 8. What are OS implementation considerations? What are the mechanisms we can use to implement these considerations? 9. If OS enforces a policy, how do we prevent application software from overriding this policy? 9. If OS enforces a policy, how do we prevent application software from overriding this policy? 10. What are the two techniques to request service? How do they work? 10. What are the two techniques to request service? How do they work?

30 Sources Nutt, G. Operating Systems, 3 rd Edition. Addison Wesley. 2004 Nutt, G. Operating Systems, 3 rd Edition. Addison Wesley. 2004 http://tunes.org/Review/OSes.html http://tunes.org/Review/OSes.html http://tunes.org/Review/OSes.html http://www.palmsource.com/palmos http://www.palmsource.com/palmos http://www.palmsource.com/palmos http://www.pdos.lcs.mit.edu/exo.html http://www.pdos.lcs.mit.edu/exo.html http://www.pdos.lcs.mit.edu/exo.html http://www.cs.utah.edu/flux/ http://www.cs.utah.edu/flux/ http://www.cs.utah.edu/flux/ http://srg.cs.uiuc.edu/2k/ http://srg.cs.uiuc.edu/2k/ http://srg.cs.uiuc.edu/2k/ http://www.acm.uiuc.edu/sigops/roll_your_own/ http://www.acm.uiuc.edu/sigops/roll_your_own/ http://www.acm.uiuc.edu/sigops/roll_your_own/


Download ppt "Operating System Organization Chapter 3 Michelle Grieco."

Similar presentations


Ads by Google