chapter 1 introduction - laboratoire de recherche en ...falcou/teaching/l3/ch1.pdf · 1 tanenbaum...
TRANSCRIPT
![Page 1: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/1.jpg)
1
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
OPERATING SYSTEMSDESIGN AND IMPLEMENTATION
Third EditionANDREW S. TANENBAUMALBERT S. WOODHULL
Chapter 1Introduction
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.
![Page 2: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/2.jpg)
2
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
What Is an Operating System?
The operating system has two basicfunctions of the operating system
• It is an extended machine or virtualmachine
– Easier to program than the underlyinghardware
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
What Is an Operating System?
The operating system has two basicfunctions of the operating system
• It is an extended machine or virtualmachine
– Easier to program than the underlyinghardware
• It is a resource manager– Shares resources in time and space
![Page 3: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/3.jpg)
3
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Operating System Generations
• 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
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 bringcards to 1401. (b)1401 reads batch of jobs onto tape.
![Page 4: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/4.jpg)
4
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 inputtape to 7094. (d) 7094 does computing.
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 outputtape to 1401. (f) 1401 prints output.
![Page 5: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/5.jpg)
5
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.
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 systemwith three jobs in memory.
![Page 6: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/6.jpg)
6
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
UNIX History
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Beyond 2010?A note on Architecture
![Page 7: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/7.jpg)
7
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Beyond 2010?A note on Architecture
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Operating Systems Concepts
• Interface between OS and Machine:– Interrupt / Registers
• Interface between OS and Userland:– System Calls / Signals
• Key Concept: Process– A Process is a program in execution
![Page 8: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/8.jpg)
8
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 childprocesses, B and C. Process B created three child
processes, D, E, and F.
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.
![Page 9: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/9.jpg)
9
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 notaccessible. (b) After mounting, they are part of the file
hierarchy.
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.
![Page 10: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/10.jpg)
10
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. fd is a file descriptor;and n is a byte count.
Process Management
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. fd is a file descriptor;and n is a byte count.
![Page 11: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/11.jpg)
11
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;and n is a byte count.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
System Calls (4)
Dir. & File System Mgmt.
Figure 1-9. The MINIX system calls. fd is a file descriptor;and n is a byte count.
![Page 12: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/12.jpg)
12
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. fd is a file descriptor;and n is a byte count.
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. fd is a file descriptor;and n is a byte count.
![Page 13: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/13.jpg)
13
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, TRUEis assumed to be defined as 1.
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, andstack. In this example, all three are in one address space,but separate instruction and data space is also supported.
![Page 14: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/14.jpg)
14
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
System Calls for Signaling
Software Generated TerminationSIGTERM15
AlarmSIGALRM14
Write on pipe with no readerSIGPIPE13
Bad Argument to System CallSIGSYS(12)*
Segmentation violationSIGSEGV(11)*
Bus errorSIGBUS(10)*
Kill SignalSIGKILL9
Floating point overflow/underflowSIGFPE(8)*
EMT instructionSIGEMT(7)*
IOT instructionSIGIOT(6)*
Trace trapSIGTRAP(5)*
Illegal InstructionSIGILL(4)*
^\ key hit on standard input (quit)SIGQUIT3*
^C (DEL) key hit on standard inputSIGINT2
Broken link (like network)SIGHUP(1)
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 statand fstat system calls. In the actual code, symbolic names
are used for some of the types.
![Page 15: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/15.jpg)
15
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. A skeleton for setting up a two-process pipeline.
…
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. A skeleton for setting up a two-process pipeline.
…
![Page 16: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/16.jpg)
16
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 toast’s directory. (b) The same directories after linking.
link(“/usr/jim/memo”,”/usr/ast/note”);
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);
![Page 17: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/17.jpg)
17
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 callread(fd, buffer, nbytes).
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Basic Structure for OperatingSystem
1. A main program that invokes therequested service procedure
2. A set of service procedures thatcarry out the system calls
3. A set of utility procedures that helpthe service procedures
![Page 18: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/18.jpg)
18
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.
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.
![Page 19: Chapter 1 Introduction - Laboratoire de Recherche en ...falcou/teaching/l3/Ch1.pdf · 1 Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall,](https://reader031.vdocuments.site/reader031/viewer/2022022508/5acd098f7f8b9a27628d2f80/html5/thumbnails/19.jpg)
19
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.
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.