Presentation is loading. Please wait.

Presentation is loading. Please wait.

Operating system Concepts -mahabadiSilberschatz and Galvin1 3: Operating-System Structures  3.1 System Components  3.2 Operating-System Services  3.3.

Similar presentations


Presentation on theme: "Operating system Concepts -mahabadiSilberschatz and Galvin1 3: Operating-System Structures  3.1 System Components  3.2 Operating-System Services  3.3."— Presentation transcript:

1 operating system Concepts -mahabadiSilberschatz and Galvin1 3: Operating-System Structures  3.1 System Components  3.2 Operating-System Services  3.3 System Calls  3.4 System Programs  3.5 System Structure - Models  3.6 System Design &Implementation  3.7 System Generation

2 operating system Concepts -mahabadiSilberschatz and Galvin2 Computer-System Operation  I/O devices & the CPU can execute concurrently.  Each device controller is in charge of a particular device type.  Each device controller has a local buffer.  CPU moves data from/to main memory to/from the local buffers.  I/O is from the device to local buffer of controller.  Device controller informs CPU that it has finished its operation by causing an interrupt.

3 operating system Concepts -mahabadiSilberschatz and Galvin3 3.1 Common System Components  Process Management  Main-Memory Management  Secondary-Storage Management  I/O System Management  File Management  Protection System  Networking  Command-Interpreter System

4 operating system Concepts -mahabadiSilberschatz and Galvin4 Process Management  A process is a program in execution. A process needs certain resources, including CPU time, memory, files, & I/O devices, to accomplish its task. operating systemresponsible  The operating system is responsible for the following activities in connection with process management: – process creation & deletion. – process suspension & resumption. – provision of mechanisms for: process synchronization process communication

5 operating system Concepts -mahabadiSilberschatz and Galvin5 Main-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 & I/O devices.  Main memory is a volatile storage device. It loses its contents in the case of system failure. operating systemresponsible  The operating system is responsible for the following activities in connection with memory management:  – Keep track of which parts of memory are currently being used & by whom.  – Decide which processes to load when memory space becomes available.  – Allocate & deallocate memory space as needed.

6 operating system Concepts -mahabadiSilberschatz and Galvin6 Secondary-Storage Management  Since main memory (primary storage) is volatile & too small to accommodate all data & programs permanently, the computer system must provide secondary storage to back up main memory.  Most modern computer systems use disks as the principle on-line storage medium, for both programs & data. operating systemresponsible  The operating system is responsible for the following activities in connection with disk management:  – Free-space management  – Storage allocation  – Disk scheduling

7 operating system Concepts -mahabadiSilberschatz and Galvin7 I/O System Management  The I/O system consists of:  – A buffer-caching system  – A general device-driver interface  – Drivers for specific hardware devices

8 operating system Concepts -mahabadiSilberschatz and Galvin8 File Management  A file is a collection of related information defined by its creator.Commonly,files represent programs (both source & object forms) & data. operating systemresponsible  The operating system is responsible for the following activities in connection with file management:  – File creation & deletion.  – Directory creation & deletion.  – Support of primitives for manipulating files &directories.  – Mapping files onto secondary storage.  – File backup on stable (nonvolatile) storage media.

9 operating system Concepts -mahabadiSilberschatz and Galvin9 Protection System controlling access by system & user resources  Protection refers to a mechanism for controlling access by programs, processes, or users to both system & user resources.  The protection mechanism must:  – distinguish between authorized & unauthorized usage.  – specify the controls to be imposed.  – provide a means of enforcement.

10 operating system Concepts -mahabadiSilberschatz and Galvin10 Networking (Distributed Systems) distributed system  A distributed system is a collection of processors that don't share memory or a clock. Each processor has its own local memory.  The processors in the system are connected through a communication network. provides user access to various system resources  A distributed system provides user access to various system resources.  Access to a shared resource allows:  – Computation speed-up  – Increased data availability  – Enhanced reliability

11 operating system Concepts -mahabadiSilberschatz and Galvin11 Command-Interpreter System commandstooperating system  Many commands are given to the operating system by control statements which deal with:  – process creation & management  – I/O handling  – secondary-storage management  – main-memory management  – file-system access  – protection  – networking programreads & interprets control statements  The program that reads & interprets control statements is called variously:  – control-card interpreter  – command-line interpreter  – shell (in UNIX) Its function is to get & execute the next command statement.

12 operating system Concepts -mahabadiSilberschatz and Galvin12 3.2 Operating-System Services  Program execution  Program execution – system capability to load a program into memory & to run it.  I/O operations  I/O operations – since user programs cannot execute I/O operations directly, the operating system must provide some means to perform I/O.  File-system manipulation  File-system manipulation – program capability to read, write, create, & delete files.  Communications  Communications – exchange of information between processes executing either on the same computer or on different systems tied together by a network. Implemented via shared memory or message passing.  Error detection  Error detection – ensure correct computing by detecting errors in the CPU & memory hardware, in I/O devices, or in user programs.

13 operating system Concepts -mahabadiSilberschatz and Galvin13 Additional Operating System Functions ensuring efficient system operation Additional functions exist not for helping the user, but rather for ensuring efficient system operation.  Resource allocation  Resource allocation – allocating resources to multiple users or multiple jobs running at the same time.  Accounting  Accounting – keep track of &record which users use how much & what kinds of computer resources for account billing or for accumulating usage statistics.  Protection  Protection – ensuring that all access to system resources is controlled.

14 operating system Concepts -mahabadiSilberschatz and Galvin14 3.3 System Calls  System Call or Supervisor Call :SVC interface between a running program & the operating system (call OS service)  System calls provide the interface between a running program & the operating system (call OS service).  Mostly accessed by programs via a high- level Application Program Interface (API) rather than direct system call use.  – 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).

15 operating system Concepts -mahabadiSilberschatz and Galvin15 System Call API  Three most common APIs are  Win32 API for Windows,  POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, Mac OS X), &  Java API for the Java virtual machine (JVM).

16 operating system Concepts -mahabadiSilberschatz and Galvin16 System Call API –OS Relationship(1)

17 operating system Concepts -mahabadiSilberschatz and Galvin17 System Call API –OS Relationship(2)

18 operating system Concepts -mahabadiSilberschatz and Galvin18 SVC Example

19 operating system Concepts -mahabadiSilberschatz and Galvin19 System call for ?  Process Management:  Process Management: setpad, getpad, waitpad, exit, wait, fork  Signals:  Signals: pause, alarm, kill, signature, sigaction  File Management:  File Management: rename, write, read, close, open, creat  Directory Management:  Directory Management: link, chroot, chdir, mdir, mkdir  Protection:  Protection: setgrid, setuid, getgid, getuid  Time Management:  Time Management: time, stime, utime

20 operating system Concepts -mahabadiSilberschatz and Galvin20 System call parameter passing  Three  Three general methods are used to pass parameters between a running program & the operating system:  – Pass parameters in registers.  – Store the parameters in a table in memory,& the table address is passed as a parameter in a register.  – Push (store) the parameters onto the stack by the program, & pop off the stack by the operating system.

21 operating system Concepts -mahabadiSilberschatz and Galvin21 3.4 System Programs convenient environment  System programs provide a convenient environment for program development & execution. They can be divided into:  – File manipulation  – Status information  – File modification  – Programming-language support  – Program loading & execution  – Communications  – Application programs  Most users’ view of the operation system is defined by system programs, not the actual system calls.

22 operating system Concepts -mahabadiSilberschatz and Galvin22 3.5 System Structure – Models  3.5.1 Simple/Monolithic Approach  3.5.2 Layered Approach  3.5.3 Virtual Machines  3.5.4 Microkernels  3.5.5 Modules  Example : 3.5.6 Linux Model

23 operating system Concepts -mahabadiSilberschatz and Galvin23 3.5.1 System Structure – Simple Approach  MS-DOS  MS-DOS – written to provide the most functionality in the least space  not divided into modules  Although MS-DOS has some structure, its interfaces &levels of functionality are not well separated

24 operating system Concepts -mahabadiSilberschatz and Galvin24 Monolithic OS structure

25 operating system Concepts -mahabadiSilberschatz and Galvin25 3.5.2 System Structure – Layered Approach levels  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) & services of only lower-level layers.

26 operating system Concepts -mahabadiSilberschatz and Galvin26 UNIX OS : 2 layers  UNIX  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 & above the physical hardware  Provides the file system, CPU scheduling, memory management, & other operating-system functions; a large number of functions for one level.

27 operating system Concepts -mahabadiSilberschatz and Galvin27 UNIX : 2 layers

28 operating system Concepts -mahabadiSilberschatz and Galvin28 THE OS : 6 layers  A layered design was first used in the THE operating system. Its six layers are as follows:

29 operating system Concepts -mahabadiSilberschatz and Galvin29 3.5.3 Virtual Machines  A virtual machine takes the layered approach to its logical conclusion. It treats hardware & 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.

30 operating system Concepts -mahabadiSilberschatz and Galvin30 Virtual 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 & a file system can provide virtual card readers & virtual line printers.  – A normal user time-sharing terminal serves as the virtual machine operator’s console.

31 operating system Concepts -mahabadiSilberschatz and Galvin31 Virtual Machines (Cont.)

32 operating system Concepts -mahabadiSilberschatz and Galvin32 Virtual Machines (Cont.)

33 operating system Concepts -mahabadiSilberschatz and Galvin33 VMware Architecture (Cont.)

34 operating system Concepts -mahabadiSilberschatz and Galvin34 Java Virtual Machines (JVM) JVM : Example of VM on multiple platforms

35 operating system Concepts -mahabadiSilberschatz and Galvin35 Advantages/Disadvantages of Virtual Machines  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 & development. System development is done on the virtual machine, instead of on a physical machine & 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 of the underlying machine.

36 operating system Concepts -mahabadiSilberschatz and Galvin36 3.5.4 Microkernels (client-server)  Lean kernel  Lean kernel : Moves as much service functionality as possible from the kernel into “user” space  Communication  Communication takes place between user modules using message passing  Benefits  Benefits:  Easier to extend a microkernel,  Easier to port the operating system to new architectures,  More reliable (less code is running in kernel mode)  More secure  Performance overhead of user space to kernel space communication

37 operating system Concepts -mahabadiSilberschatz and Galvin37 Microkernels (client-server) (Cont.)  Adding additional abilities – I want more  Providing asynchronous messages over a synchronous message service  Improving/Replacing existing services – I want different /better  Faster sort/search routines  Faster device drivers (screen,disk, network etc.)  What does the OS provider want:  Allow for extensions, without compromising the operating system

38 operating system Concepts -mahabadiSilberschatz and Galvin38 Microkernels (client-server) (Cont.)  Modify the source code  Easy with open source, not so easy otherwise  Actually allows modifying the implementation of system calls  For devices, does the OS provider write all drivers?  Common devices  New devices?  The OS must provide a mechanism for writing/ installing device drivers  Review I/O introduction material for this  Libraries  Static vs. Dynamic linking

39 operating system Concepts -mahabadiSilberschatz and Galvin39 Microkernels (client-server) (Cont.)  Microkernel architecture  Messages passed between client and server processes  Easier to support true dynamic extension  As long as the message passing can support it, then changing the currently running server process is equivalent to dynamically changing the implementation of a system call  Can we refer to system calls as dynamically linked code?  Distributed client server:

40 operating system Concepts -mahabadiSilberschatz and Galvin40 3.5.5 Modules kernel modules  Most modern operating systems implement kernel modules  Component-based approach:  Each core component is separate  Each talks to the others over known interfaces  Each is loadable as needed within the kernel  Example: Solaris loadable kernel modules  Overall, similar to layers but more flexible

41 operating system Concepts -mahabadiSilberschatz and Galvin41 3.5.6 Linux Model  Developed from Unix  Originally multi-user networked servers  Designed to withstand with security threats from the beginning User Applications OS Services Linux Kernel Hardware Controllers

42 operating system Concepts -mahabadiSilberschatz and Galvin42 3.6 System Design Goals  User goals – operating system should be convenient to use, easy to learn, reliable, safe, & fast.  System goals – operating system should be easy to design, implement, & maintain, as well as flexible, reliable, error-free, & efficient.

43 operating system Concepts -mahabadiSilberschatz and Galvin43 Mechanisms & Policies  Mechanisms determine how to do something; policies decide what will be done.  The separation of policy from mechanism is a very important principle; it allows maximum flexibility if policy decisions are to be changed later.

44 operating system Concepts -mahabadiSilberschatz and Galvin44 System Implementation  Traditionally written in assembly language, operating systems can now be written in higher-level languages.  Code written in a high-level language:  – can be written faster.  – is more compact.  – is easier to understand & debug.  An operating system is far easier to port(move to some other hardware) if it is written in a high-level language.

45 operating system Concepts -mahabadiSilberschatz and Galvin45 3.7 Operating System Generation (SYSGEN)  Operating systems are designed to run on any of a class of machines; the system must be configured for each specific computer site.  SYSGEN program obtains information concerning the specific configuration of the hardware system.  Booting  Booting – starting up a computer by loading the kernel.  Bootstrap loader  Bootstrap loader – The initial program executed when system is powered up : code stored in ROM that is able to locate the kernel, load it into memory,& start its execution. init interrupt  Once the OS is loaded, the OS starts executing the first process (e.g., init) & then waits for some event to occur (interrupt).


Download ppt "Operating system Concepts -mahabadiSilberschatz and Galvin1 3: Operating-System Structures  3.1 System Components  3.2 Operating-System Services  3.3."

Similar presentations


Ads by Google