Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 1 Introduction to Operating System Part 5

Similar presentations


Presentation on theme: "Chapter 1 Introduction to Operating System Part 5"— Presentation transcript:

1 Chapter 1 Introduction to Operating System Part 5

2 Chapter Summary At the end of this chapter, student will be able to:
Describe the following operating system structure: i. Monolithic system ii. Layered system iii. Virtual machines iv. Client-server model Identify three major subsystem of operating system: i. Process Management ii. File Management iii. Memory Management System calls

3 OPERATING SYSTEM STRUCTURE

4 Monolithic System This approach well known as “The Big Mess” - there is no structure. All kernel routines are together, any can call any A system call interface (main program, sys calls, utility functions) Examples: Linux, BSD Unix, Windows Pros Shared kernel space Good performance Cons No information hiding Inflexible Chaotic Difficult to understand

5 Layered System 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. Hiding information at each layer E.g. level 1 is processor allocation, level 1 memory management, level 2 communication, level 3 I/O, etc. Examples: THE System (6 layers), MS-DOS (4 layers) Pros Layered abstraction Separation of concerns, elegance Cons Protection, boundary crossings

6 Virtual Machines (VM) 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) memory. 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 console.

7 Advantages/ disadvantages:
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 machine.

8 Client-server model or microkernel
The advent of new concepts in OS design, microkernel is aimed at migrating services of an operating system out of monolithic kernel into user level process. Divide the OS into several processes, each which implements a single set of services - Example: I/O servers, memory server, process server Each server runs in user mode, provide services to the requested client. Client: Another operating system component or application program, request service by sending message to server An OS kernel (microkernel) running in kernel mode deliver message to the server. The server perform operation, and microkernel delivers the result to client in another message.

9 Client-server model or microkernel
Components above microkernel communicate directly with one another, although using message that pass through the microkernel itself. Microkernel validate messages, passes them between the components and grants access to hardware. Example: C-DAC microkernel, Mach, Windows NT, Chorus

10 Client-server model or microkernel

11 Example: Winowds NT Various applications (Win32, OS/2, and POSIX) run in user space. Server for each application runs in user space. Message passing between client application programs and application servers runs in kernel space.

12 MAJOR SUBSYTEM OF OPERATING SYSTEM

13 1) Process Management A process is a program in execution.
A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task. The operating system is responsible for the following activities in connection with process management. Process creation and deletion. process suspension and resumption. Provision of mechanisms for: - process synchronization - process communication

14 2) File Management Computers can store information in different physical media (e.g., disks, tapes). OS provides a logical (an abstract) view of information storage, i.e., define a logical storage unit called the file. OS maps files into physical media, and accesses these files via the storage devices such as disk drive. A file is a collection of related information (program or data) defined by its creator. OS is responsible for all file management activities: file creation and deletion. directory creation and deletion. support of primitives for manipulating files and directories. mapping files onto secondary storage. file backup on stable (nonvolatile) storage media.

15 3) Memory Management Memory is a large array of words or bytes, each with its own address. It is a repository of quickly accessible data shared by the CPU and I/O devices. Main memory is a volatile storage device. It loses its contents in the case of system failure. The operating system is responsible for the following activities in connections with memory management: Keep track of which parts of memory are currently being used and by whom. Decide which processes to load when memory space becomes available. Allocate and reallocate memory space as needed.

16 SYSTEM CALLS

17 Definition System calls provide the interface between a running program and the operating system. – Generally available as assembly-language instructions. – Languages defined to replace assembly language for systems programming allow system calls to be made directly (e.g., C. Bliss, PL/360). Are like procedure calls – take parameters – calling routine waits for response Permit application programs to access protected resources

18 Definition Three general methods are used to pass parameters between a running program and the operating system. Simplest: pass the parameters in registers but number of parameter registers is limited. Parameters stored in a block in memory, and address of block passed as a parameter in a register. This approach taken by Linux and Solaris. Parameters pushed onto the stack by the program and popped off the stack by the operating system

19

20 The kernel uses system calls such as 'read' and 'write' to provide an abstraction of your hardware.

21 Types 1) Process management
load, execute, end, abort, create, terminate, wait ... memory allocation and reallocation File management Common systems calls dealing with files and directories: create file, delete file open, close read, write, reposition get file attributes, set file attributes

22 Types 3) Device Management
Similarity between files and I/O devices results in similar device system calls (some OS even merges two into a combined file device structure): request device, release device read, write, reposition get device attributes, set device attributes logically attach or detach devices 4) Information Maintenance System calls for transferring information between the user program and OS: get time or date, set time or date get system data, set system data get process, file, or device attributes set process, file or device attributes

23 Types 5) Communication System calls for transferring information between the user program and OS: create, delete communication connection send, receive message transfer status information attach or detach remote devices 6) Signaling Use signals to keep track of events which must follow the same path of execution as depicted in figure below regardless of their type being synchronous or asynchronous.


Download ppt "Chapter 1 Introduction to Operating System Part 5"

Similar presentations


Ads by Google