Tanenbaum, Structured Computer Organization, Fifth Edition, (c)

6 downloads 206 Views 4MB Size Report
Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0. The Operating System.
The Operating System Machine Level Chapter 6

Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Operating System Machine

Positioning of the operating system machine level. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Paging

A mapping in which virtual addresses 4096 to 8191 are mapped onto main memory addresses 0 to 4095. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Implementation of Paging (1) The first 64 KB of virtual address space divided into 16 pages, with each page being 4K.

Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Implementation of Paging (2)

A 32 KB main memory divided up into eight page frames of 4 KB each.

Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Implementation of Paging (3)

Formation of a main memory address from a virtual address.

Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Demand Paging and the Working Set Model

A possible mapping of the first 16 virtual pages onto a main memory with eight page frames.

Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Page Replacement Policy

Failure of the LRU algorithm. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Segmentation (1)

In a one-dimensional address space with growing tables, one table may bump into another. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Segmentation (2)

A segmented memory allows each table to grow or shrink independently of the other tables. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Segmentation (3)

Comparison of paging and segmentation. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Implementation of Segmentation (1)

(a)-(d) Development of external fragmentation. (e) Removal of the external fragmentation by compaction. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Implementation of Segmentation (2)

Conversion of a two-part MULTICS address into a main memory address. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Virtual Memory on the Pentium 4 (1)

A Pentium 4 selector.

A Pentium 4 code segment descriptor. Data segments differ slightly. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Virtual Memory on the Pentium 4 (2)

Conversion of a (selector, offset) pair to a linear address. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Virtual Memory on the Pentium 4 (3)

Mapping of a linear address onto a physical address. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Virtual Memory on the Pentium 4 (4)

Protection on the Pentium 4. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Virtual Memory on the UltraSPARC III (1)

Virtual to physical mappings on the UltraSPARC.

Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Virtual Memory on the UltraSPARC III (2)

Data structures used in translating virtual addresses on the UltraSPARC. (a) TLB. (b) TSB. (c) Translation table. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Implementation of Virtual I/O Instructions (1)

Reading a file consisting of logical records. (a) Before reading record 19. (b) After reading record 19. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Implementation of Virtual I/O Instructions (2)

Disk allocation strategies. (a) A file in consecutive sectors. (b) A file not in consecutive sectors. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Implementation of Virtual I/O Instructions (3)

Two ways of keeping track of available sectors. (a) A free list. (b) A bit map. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Directory Management Instructions

A user file directory and the contents of a typical entry in a file directory. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Virtual Instructions for Parallel Processing

(a) True parallel processing with multiple CPUs. (b) Parallel processing simulated by switching one CPU among three processes. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Race Conditions (1)

Use of a circular buffer.

Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Race Conditions (2)

Parallel processing with a fatal race condition. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Race Conditions (3)

Parallel processing with a fatal race condition. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Race Conditions (4)

Parallel processing with a fatal race condition. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Race Conditions (5)

Failure of the producer-consumer communication mechanism. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Process Synchronization Using Semaphores (1)

The effect of a semaphore operation.

Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Process Synchronization Using Semaphores (2)

Parallel processing using semaphores. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Process Synchronization Using Semaphores (3)

Parallel processing using semaphores. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Process Synchronization Using Semaphores (4)

Parallel processing using semaphores. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


UNIX (1)

A rough breakdown of the UNIX system calls. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


UNIX (2)

The structure of a typical UNIX system. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Windows XP

The structure of Windows XP. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


UNIX Virtual Memory

The address space of a single UNIX process. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Windows XP Virtual Memory

The principal Windows XP API calls for managing virtual memory. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


UNIX Virtual I/O (1)

The principal UNIX file system calls. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


UNIX Virtual I/O (2)

A program fragment for copying a file using the UNIX system calls. This fragment is in C because Java hides the low-level system calls and we are trying to expose them. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


UNIX Virtual I/O (3)

Part of a typical UNIX directory system.

Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


UNIX Virtual I/O (4)

The principal UNIX directory management calls. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Windows XP Virtual I/O (1)

The principal Win32 API functions for file I/O. The second column gives the nearest UNIX equivalent. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Windows XP Virtual I/O (2)

A program fragment for copying a file using the Windows XP API functions. This fragment is in C because Java hides the low-level system calls and we are trying to expose them. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Windows XP Virtual I/O (3)

The principal Win32 API functions for directory management. The second column gives the nearest UNIX equivalent, when one exists. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


Windows XP Virtual I/O (4)

The Windows XP master file table. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


UNIX Process Management (1)

A process tree in UNIX. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0 


UNIX Process Management (2)

The principal POSIX thread calls. Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved. 0-13-148521-0