0% found this document useful (0 votes)
15 views

1.5 Operating System Concepts

Uploaded by

loveeling04
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

1.5 Operating System Concepts

Uploaded by

loveeling04
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 29

1.

Introduction

1.5. The Operating System Concepts


Processes (1)

• Key concept in all operating systems


• Definition: a program in execution
• Process is associated with an address space
• Also associated with set of resources
• Process can be thought of as a container
– Holds all information needed to run program

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
Processes (2)

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.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
Files (1)

Figure 1-14. A file system for a university department.


Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
Files (2)

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.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
Pipe

Figure 1-16. Two processes connected by a pipe.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
Ontogeny Recapitulates Phylogeny

• Each new “species” of computer


– Goes through same development as “ancestors”
• Consequence of impermanence
– Text often looks at “obsolete” concepts
– Changes in technology may bring them back
• Happens with large memory, protection
hardware, disks, virtual memory

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
System Calls (1)

Figure 1-17. The 11 steps in making the system call


A call from a C program might look like this: read(fd, buffer, nbytes).
(Read nbytes from the file specified by fd into buffer. Return: How many bytes)
Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
System Calls (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 are as follows: 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.
POSIX (Portable Operating System Interface) is
a set of standard operating system interfaces
based on the Unix.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
System Calls (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 are as follows: 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.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
System Calls (4)

Figure 1-18. Some of the major POSIX system calls. The return code
s is −1 if an error has occurred. The return codes are as follows: 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.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
System Calls (5)

Figure 1-18. Some of the major POSIX system calls. The return code
s is −1 if an error has occurred. The return codes are as follows: 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.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
System Calls for Process
Management

Figure 1-19. A stripped-down shell. Throughout this book,


TRUE is assumed to be defined as 1.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
System Calls for File
Management

Figure 1-20. Processes have three segments:


text, data, and stack

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
System Calls for Directory
Management (1)

link("/usr/jim/memo", "/usr/ast/note");
Thereafter, /usr/jim/memo and /usr/ast/note refer to
the same file.

Figure 1-21. (a) Two directories before linking usr/jim/memo


to ast’s directory. (b) The same directories after linking.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
System Calls for Directory
Management (2)

Figure 1-22. (a) File system before the mount.


(b) File system after the mount.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
The Windows Win32 API (1)

Figure 1-23. The Win32 API calls that roughly correspond to


the UNIX calls of Fig. 1-18.
Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
The Windows Win32 API (2)

Figure 1-23. The Win32 API calls that roughly correspond to


the UNIX calls of Fig. 1-18.
Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
Monolithic and Microkernel
• Traditional monolithic kernels: Implements all operating
system services in kernel space.
• A microkernel is a type of operating system kernel that is
designed to provide only the most basic services required
for an operating system to function, such as memory
management and process scheduling. Other services, such
as device drivers and file systems, are implemented as user-
level processes that communicate with the microkernel via
message passing. This design allows the operating system
to be more modular and flexible than traditional monolithic
kernels, which implement all operating system services in
kernel space.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
Monolithic Systems (1)

Basic structure of OS
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.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
Monolithic Systems (2)

Figure 1-24. A simple structuring model


for a monolithic system.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
Layered Systems

Figure 1-25. Structure of the THE operating system.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All
Microkernels

Figure 1-26. Simplified structure of the


MINIX 3 system.
Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
Client-Server Model

Figure 1-27. The client-server model over a network.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
Virtual Machines

Figure 1-28. The structure of VM/370 with CMS.


VM/370, released in 1972, is an IBM's System/370 reimplementation of
earlier CP/CMS operating system.
The Conversational Monitor System (CMS) is a simple interactive single-user
operating system. CMS runs as a "guest" operating system in a private virtual
machine created by the VM control program. The control program plus CMS
together create a multi-user time-sharing operating system.
Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
Virtual Machines Rediscovered

Figure 1-29. (a) A type 1 hypervisor. (b) A pure type 2


hypervisor. (c) A practical type 2 hypervisor.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
Large Programming Projects

Figure 1-30. The process of compiling C and header


files to make an executable.
Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
Metric Units

Figure 1-31. The principal metric prefixes.

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.
End
Chapter 1

Tanenbaum & Bos, Modern Operating Systems: 4th ed., Global Edition (c) 2015 Pearson Education Limited. All rights reserved.

You might also like