DOC PREVIEW
LSU CSC 4103 - Operating System Design and Implementation

This preview shows page 1-2 out of 7 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

11CSC 4103 - Operating SystemsSpring 2007Tevfik KoşarLouisiana State UniversityJanuary 23rd, 2007Lecture - III- OS Design & Implementation- Processes2Roadmap• OS Design and Implementation– Different Design Approaches– Virtual Machines• Processes– Basic Concepts– Context Switching– Process Queues– Process Scheduling– Process Termination3Operating System Design and Implementation• Start by defining goals and specifications • Affected by choice of hardware, type of system– Batch, time shared, single user, multi user, distributed• User goals and System goals– User goals – operating system should be convenient to use, easy to learn, reliable, safe, and fast– System goals – operating system should be easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient• No unique solution for defining the requirements of an OS Large variety of solutions Large variety of OS4Operating System Design and Implementation (Cont.)• Important principle: to separate policies and mechanismsPolicy: What will be done?Mechanism: How to do something?• Eg. to ensure CPU protection– Use Timer construct (mechanism)– How long to set the timer (policy)• The separation of policy from mechanism is allows maximum flexibility if policy decisions are to be changed later5OS Design Approaches • Simple Structure• Layered Approach• Microkernels• Modules6Simple Structure • No well defined structure• Start as small, simple, limited systems, and then grow• MS-DOS – written to provide the most functionality in the least space– Not divided into modules– Its interfaces and levels of functionality are not well separated– e.g. application programs can access low level drivers directly Vulnerable to errant (malicious) programs27MS-DOS Layer Structure8UNIX• UNIX – limited by hardware functionality, the original UNIX operating system had limited structuring. The UNIX OS consists of two separable parts– Systems programs– The kernel• Consists of everything below the system-call interface and above the physical hardware• Provides the file system, CPU scheduling, memory management, and other operating-system functions; a large number of functions for one level9UNIX System Structure10Layered Approach• The operating system is divided into a number of layers (levels), each built on top of lower layers. – The bottom layer (layer 0), is the hardware; – 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– GLUnix: Global Layered Unix 11Layered Operating System12Microkernel System Structure • Move all non-essential components from the kernel into “user”space• Main function of microkernel: Communication between client programs and various services which are run in user space– Uses message passing (never direct interaction)• Benefits:– Easier to extend the OS– Easier to port the OS to new architectures– More reliable (less code is running in kernel mode)– More secure• Detriments:– Performance overhead of user space to kernel space communication• Examples: QNX, Tru64 UNIX313Modules• Most modern operating systems implement kernel modules– Uses object-oriented approach– Each core component is separate– Each talks to the others over known interfaces– Each is loadable as needed within the kernel• Overall, similar to layers but more flexible– Any module can call any other module14Solaris Modular Approach15Mac OS X Structure - Hybrid• BSD: provides support for command line interface, networking, file system, POSIX API and threads• Mach: memory management, RPC, IPC, message passing16Virtual Machines• A virtual machine takes the layered approach to its logical conclusion. It treats hardware and the operating system kernel as though they were all hardware• A virtual machine provides an interface identical to the underlying bare hardware• The operating system creates the illusion of multiple processes, each executing on its own processor with its own (virtual) memory17Virtual Machines (Cont.)• The resources of the physical computer are shared to create the virtual machines– CPU scheduling can create the appearance that users have their own processor– Spooling and a file system can provide virtual card readers and virtual line printers– A normal user time-sharing terminal serves as the virtual machine operator’s console18Virtual Machines (Cont.)(a) Nonvirtual machine (b) Virtual machine Non-virtual MachineVirtual Machine419Virtual Machines (Cont.)• The virtual-machine concept provides complete protection of system resources since each virtual machine is isolated from all other virtual machines. This isolation, however, permits no direct sharing of resources.• A virtual-machine system is a perfect vehicle for operating-systems research and development. System development is done on the virtual machine, instead of on a physical machine and so does not disrupt normal system operation.• The virtual machine concept is difficult to implement due to the effort required to provide an exact duplicate to the underlying machine20VMware Architecture21The Java Virtual Machine22Processes23Process Concept• An operating system executes a variety of programs:– Batch system – jobs– Time-shared systems – user programs or tasks• Process – a program in execution; process execution must progress in sequential fashion• A process includes:– program counter – stack: temporary data– heap: dynamic memory– data section: global variablesProcess in Memory24Process State• As a process executes, it changes state– new: The process is being created– running: Instructions are being executed– waiting: The process is waiting for some event to occur– ready: The process is waiting to be assigned to a process– terminated: The process has finished execution525Process Control Block (PCB)Information associated with each process• Process state• Program counter• CPU registers• CPU scheduling information• Memory-management information• Accounting information• I/O status information26Context Switch• When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process• Context-switch time is overhead; the system does no useful work while


View Full Document

LSU CSC 4103 - Operating System Design and Implementation

Download Operating System Design and Implementation
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Operating System Design and Implementation and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Operating System Design and Implementation 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?