Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 OPERATING SYSTEMS DESIGN.

Similar presentations


Presentation on theme: "Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 OPERATING SYSTEMS DESIGN."— Presentation transcript:

1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 OPERATING SYSTEMS DESIGN AND IMPLEMENTATION Third Edition ANDREW S. TANENBAUM ALBERT S. WOODHULL Chapter 1 Introduction

2 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 The Modern Computer System Figure 1.1 A computer system consists of hardware, system programs, and application programs.

3 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 What Is an Operating System? Two basic functions of the OS: Extended machine or virtual machine –Easier to program than the underlying hardware Resource manager Shares resources in time and space User interface to OS is what we see, But really it is just another program….

4 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Operating System Generations (Tannenbaum – H/W) Generation 1 (1945 – 55) Vacuum tubes and plugboards Generation 2 (1955 – 65) Transistors and batch systems Generation 3 (1965 – 80) ICs and multiprogramming Generation 4 (1980 – Present) Personal computers (My gen 5 – multicore systems + pervasive computing)

5 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Program is in plugboard!!! Remmington Rand 409 (Univac)

6 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 card sorter (L) reader/punch (C), computer (R) IBM 650

7 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 front panel (L) drum (B), tubes (TL) IBM 650

8 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 IBM 650 announced1953, sold until1962 Vacuum Tube (IBM 650)

9 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Sperry-Univac AN-UYK/20 Program from toggle switches on front panel Note 64K of core memory (bottom half)

10 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Operating System Generations (Silberschatz and others – S/W) Generation 1 (50’s on) Resident Monitor – user = operator Single application program at a time Generation 2 (late 50’s – 60’s) Batch systems – user not operator, JCL 2a – uniprogrammed batch 2b – multiprogrammed batch Generation 3 (1960’s on) Timesharing systems Generation 4 (1980 – Present) Personal computers – user = operator Did they improved productivity?

11 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Operating System Generations (Silberschatz and others – S/W) Generation 5 (1980 – present) Network Operating Systems Remote commands, interoperability key Generation 6 (late 80’s – present) Distributed Operating Systems Transparency key – homogenous systems Generation 7 (1990’s on) Cooperative Autonomous Systems – independent systems – integration key Resource discovery, negotiation, etc. e.g., Service Oriented Architectures

12 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Resident Monitor Users reserved time on machine (hour scale) If not done when time up, too bad – try again later Useful to have a user interface and RM to allow you to –Read program and data in from card reader, tape drive, etc.; –Run program –Print results Also had utility programs –Compiler –Linker –Loader –Editor Also had libraries Sets of convenient procedures reused often –Math functions –Print formatting –I/O access

13 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Early Batch System (1) Figure 1-2. An early batch system. (a) Programmers bring cards to 1401. (b)1401 reads batch of jobs onto tape.

14 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Early Batch System (2) Figure 1-2. An early batch system. (c) Operator carries input tape to 7094. (d) 7094 does computing.

15 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Early Batch System (3) Figure 1-2. An early batch system. (e) Operator carries output tape to 1401. (f) 1401 prints output.

16 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Early Batch System (4) Figure 1-3. Structure of a typical FMS job.

17 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Uniprogrammed Batch System Uniprogramming – single process runs at a time Protect OS/RM using fence register & test vs. address User Program Operating System/RM Fence register

18 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Uniprogrammed Batch System While there is another job Read control card for next job Load job Run job Job 1 time Job 2Job N OS …

19 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Uniprogrammed Batch System I/O-bound jobs underutilize CPU Even CPU-bound jobs use little CPU when doing I/O Desirable to overlap CPU use of one job with I/O of other job(s) time activity CPU I/O CPU I/O CPU-bound job I/O-bound job CPU burstI/O burst

20 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Multiprogramming Figure 1-4. A multiprogramming system with three jobs in memory.

21 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Multiprogrammed Batch System time activity CPU-2 I/O-2 CPU-3 I/O-3 CPU-1 I/O-1 OS Has CPU Waiting for CPU or event Doing I/O (3 channels)

22 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Processes Figure 1-5. A process tree. Process A created two child processes, B and C. Process B created three child processes, D, E, and F. How to create a child process? Where does the first process come from?

23 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 File Systems (1) Figure 1-6. A file system for a university department.

24 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 File Systems (2) Figure 1-7. (a)Before mounting, the files on drive 0 are not accessible. (b)After mounting, they are part of the file hierarchy.

25 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 File Systems (3) Figure 1-8. Two processes connected by a pipe. What is a pipe, anyway? Not that kind of pipe! A pipe is a character stream – one process can write to it, the other one reads from it.

26 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 System Calls (1) Figure 1-9. The MINIX system calls. pid is process ID; statloc and status return exit status; name is filename; argv is argument list; envp is environment pointer. Process Management

27 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 System Calls (2) Signals Figure 1-9. The MINIX system calls. sig is signal number, act and oldact are procedures, how says what to do, old allows old signal mask to be remembered.

28 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 System Calls (3) File Management Figure 1-9. The MINIX system calls. fd is a file descriptor; mode determines access mode; nbytes is a byte count; buf holds status info.

29 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 System Calls (4) Directory & File System Mgmt. Figure 1-9. The MINIX system calls. s is return status; namex, dirname, and special are file/directory names; mode is protection mode.

30 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 System Calls (5) Protection Figure 1-9. The MINIX system calls. name is file/directory name; mode is protection mode, complmode is its inverse; uid and owner are user ID; gid and group are group ID.

31 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 System Calls (6) Time Management Figure 1-9. The MINIX system calls. tp and timep are pointers to time variable; file is filename.

32 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 The fork Call in the Shell Figure 1-10. A stripped-down shell. Throughout this book, TRUE is assumed to be defined as 1.

33 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Processes Figure 1-11. Processes have three segments: text, data, and stack. In this example, all three are in one address space, but separate instruction and data space is also supported. Instructions Persistent variables, constants Activation frames with non-persistent variables Stack and data grow and shrink

34 Return from first procedure Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Processes A process grows the stack as procedures/methods are called, shrinks it as they return. Instructions Persistent variables, constants Activation frames with non-persistent variables Stack and data grow and shrink A process uses up space in data segment as objects are allocated, must increase space if none left. Allocate a variable Allocate another var Free a variable Call a procedure Call another procedure Return from second procedure Free stack space Used stack space Free heap space Used heap space

35 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 System Calls for File Management (1) Figure 1-12. The structure used to return information for the stat and fstat system calls. In the actual code, symbolic names are used for some of the types.

36 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 I/O Redirection In the shell: $ cat - silly.txt The '<' character redirects input to come from a file The '|' characters indicate pipes The '>' character redirects the output to a file cat with the '-' option reads from stdin, and by default it writes to stdout. Both grep and sort read from stdin and write to stdout (cin and cout in C++) Pipes allow linking a sequence of operations together without having to make temporary files between each step

37 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 System Calls for File Management (2) Figure 1-13. First part of a skeleton for setting up a two-process pipeline. … NB: need two file descriptors – read (0) and write (1)

38 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 System Calls for File Management (3) Figure 1-13. Last part of a skeleton for setting up a two-process pipeline. … Now when process1 writes to STDOUT, it appends to pipe And when process2 reads from STDIN, it dequeues from pipe Frees slot 0 in PFT Copies read end of pipe to slot 0 in PFT

39 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 System Calls for Directory Management (1) Figure 1-14. (a) Two directories before linking /usr/jim/memo to ast’s directory. (b) The same directories after linking. link(“/usr/jim/memo”,”/usr/ast/note”); i-node number file name

40 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 System Calls for Directory Management (2) Figure 1-15. (a) File system before the mount. (b) File system after the mount. mount(“/dev/cdrom0”,”/mnt”,0);

41 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Operating System Structure Figure 1-16. The 11 steps in making the system call read(fd, buffer, nbytes).

42 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Basic Structure for Operating System 1.A main program that invokes the requested service procedure 2.A set of service procedures that carry out the system calls 3.A set of utility procedures that help the service procedures

43 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Layered Systems (1) Figure 1-17. A simple structuring model for a monolithic system.

44 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Layered Systems (2) Figure 1-18. Structure of the THE operating system.

45 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Virtual Machines Figure 1-19. The structure of VM/370 with CMS.

46 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Client-Server Model (1) Figure 1-20. The client-server model.

47 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Client-Server Model (2) Figure 1-21. The client-server model in a distributed system.

48 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Client-Server Model (3) Client-server synchronous communication Server Client time wait for reply request reply wait for request

49 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 Summary 1.OS definition(s) and functions 2.OS history, functionalities 3.OS components 4.System calls 5.OS Architectures


Download ppt "Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8 OPERATING SYSTEMS DESIGN."

Similar presentations


Ads by Google