MODERN OPERATING SYSTEMS - usmanlive.comusmanlive.com/wp-content/uploads/2015/02/Chapter1.pdf ·...
Transcript of MODERN OPERATING SYSTEMS - usmanlive.comusmanlive.com/wp-content/uploads/2015/02/Chapter1.pdf ·...
MODERN OPERATING SYSTEMS
Third Edition
ANDREW S. TANENBAUM
Chapter 1Introduction
Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639
What Is An Operating System (1)
A modern computer consists of• One or more processors• Main memory• Disks• Printers• Various input/output devices
• Managing all these components requires a layer of software – the operating system
The Operating System as an Extended Machine
– Hides the messy details which must be performed– Presents user with a beautiful interface, easier to use
The Operating System as a Resource Manager
• Allow multiple programs to run at the same time
• Manage and protect memory, I/O devices, and other resources
• Includes multiplexing (sharing) resources in two different ways:
• In time• In space
History of Operating Systems
Generations
1. (1945–55) Vacuum Tubes2. (1955–65) Transistors and Batch Systems
3. (1965–1980) ICs and Multiprogramming4. (1980–Present) Personal Computers
Transistors and Batch Systems (1)
Figure 1-3. An early batch system. (a) Programmers bring cards to 1401. (b)1401 reads batch of jobs onto tape.
Transistors and Batch Systems (2)
Figure 1-3. (c) Operator carries input tape to 7094. (d)7094 does computing.
(e) Operator carries output tape to 1401.
Processors
• Instruction Set
• ALU Arithmetic/Logic Unit• Program Counter• Stack Pointer
• General Registers• PSW Program Status Word
• Pipeline
Figure 1-8. (a) A quad-core chip with a shared L2 cache. (b) A quad-core chip with separate L2 caches.
Multithreaded and Multicore Chips
Questions when dealing with cache
1. When to put a new item into the cache.2. Which cache line to put the new item in.3. Which item to remove from the cache when a slot
is needed.4. Where to put a newly evicted item in the larger
memory.
Memory (2)
Figure 1-11. (a) The steps in starting an I/O device and getting an interrupt.
I/O Devices (1)
Figure 1-11.(b) Interrupt processing involves taking the interrupt, running the interrupt handler, returning to the user program.
I/O Devices (2)
Figure 1-12. The structure of a large Pentium system
Buses
The Operating System Zoo
1. Mainframe operating systems2. Server operating systems3. Multiprocessor operating systems4. Personal computer operating systems5. Handheld operating systems6. Embedded operating systems7. Sensor node operating systems8. Real-time operating systems9. Smart card operating systems
1. Processes2. Address spaces3. Files4. Input/Output5. Protection6. The shell7. Ontogeny recapitulates phylogeny
• Large memories• Protection hardware• Disks• Virtual memory
Operating System Concepts
Processes
Figure 1-13. A process tree. Process A created two child processes, B and C. Process B created three child
processes, D, E, and F.
Figure 1-15. (a) Before mounting, the files on the CD-ROM are not accessible. (b) After mounting, they are part of the file hierarchy.
Files (2)
Figure 1-17. The 11 steps in making the system call read(fd, buffer, nbytes).
System Calls
Figure 1-18. Some of the major POSIX system calls. The return code s is −1 if an error has occurred.
The return codes: pid is a process id, fd is a file descriptor, n is a byte count, position is an offset within the file, and seconds is the elapsed time.
System Calls for Process Management (1)
Figure 1-18. Some of the major POSIX system calls. The return code s is −1 if an error has occurred.
The return codes: pid is a process id, fd is a file descriptor, n is a byte count, position is an offset within the file, and seconds is the elapsed time.
System Calls for Process Management (2)
Figure 1-18. Some of the major POSIX system calls. The return code s is −1 if an error has occurred.
The return codes: pid is a process id, fd is a file descriptor, n is a byte count, position is an offset within the file, and seconds is the elapsed time.
System Calls for Process Management (3)
Figure 1-18. Some of the major POSIX system calls. The return code s is −1 if an error has occurred.
The return codes: pid is a process id, fd is a file descriptor, n is a byte count, position is an offset within the file, and seconds is the elapsed time.
System Calls for Process Management (4)
Figure 1-19. A stripped-down shell. Throughout this book, TRUE is assumed to be defined as 1.
System Calls for Process Management (5)
Figure 1-20. Processes have three segments: text, data, and stack.
System Calls for Process Management (6)
Figure 1-21. (a) Two directories before linking /usr/jim/memo to ast’s directory. (b) The same directories after linking.
System Calls for Directory Management (1)
Figure 1-22. (a) File system before the mount. (b) File system after the mount.
System Calls for Directory Management (2)
Figure 1-23. The Win32 API calls that roughly correspond to the UNIX calls of Fig. 1-18.
Windows Win32 API (1)
Windows Win32 API (2)
Figure 1-23. The Win32 API calls that roughly correspond to the UNIX calls of Fig. 1-18.
Monolithic systems – basic structure1. 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.
Operating Systems Structure
1. The C language2. Header files3. Large programming projects4. The model of run time
The World According to C