1
The Operating SystemThe Operating SystemMachine LevelMachine Level
Computer System Organization
Tb. Maulana Kusuma Week 4 | Session 2
Operating System Machine
Positioning of the operating system machine level.
2
Paging
A mapping in which virtual addresses 4096 to 8191 are mappedonto main memory addresses 0 to 4095.
Implementation of Paging (1)
The first 64 KB of virtual address space divided into 16 pages, with each page being 4K.
3
Implementation of Paging (2)
A 32 KB main memory divided up into eight page frames of 4 KB each.
Implementation of Paging (3)
Formation of a main memory address from a virtual
address.
4
Demand Paging and the Working Set Model
A possible mapping of the first 16 virtual pages
onto a main memory with eight page frames.
Page Replacement Policy
Failure of the LRU algorithm.
5
Segmentation (1)
In a one-dimensional address space with growing tables, one table may bump into another.
Segmentation (2)
A segmented memory allows each table to grow or shrink independently of the other tables.
6
Segmentation (3)
Comparison of paging and segmentation.
Implementation of Segmentation (1)
(a)-(d) Development of external fragmentation. (e) Removal of the external fragmentation by compaction.
7
Implementation of Segmentation (2)
Conversion of a two-part MULTICS address into a main memory address.
Virtual Memory on the Pentium 4 (1)
A Pentium 4 selector.
A Pentium 4 code segment descriptor. Data segments differ slightly.
8
Virtual Memory on the Pentium 4 (2)
Conversion of a (selector, offset) pair to a linear address.
Virtual Memory on the Pentium 4 (3)
Mapping of a linear address onto a physical address.
9
Virtual Memory on the Pentium 4 (4)
Protection on the Pentium 4.
Virtual Memory on the UltraSPARC III (1)
Virtual to physical mappings on the UltraSPARC.
10
Virtual Memory on the UltraSPARC III (2)
Data structures used in translating virtual addresses on theUltraSPARC. (a) TLB. (b) TSB. (c) Translation table.
Implementation of Virtual I/O Instructions (1)
Reading a file consisting of logical records. (a) Before reading record 19. (b) After reading record 19.
11
Implementation of Virtual I/O Instructions (2)
Disk allocation strategies. (a) A file in consecutive sectors.
(b) A file not in consecutive sectors.
Implementation of Virtual I/O Instructions (3)
Two ways of keeping track of available sectors. (a) A free list. (b) A bit map.
12
Directory Management Instructions
A user file directory and the contents of a typical entry in a file directory.
Virtual Instructions for Parallel Processing
(a) True parallel processing with multiple CPUs. (b) Parallel processing simulated by switching one CPU
among three processes.
13
Race Conditions (1)
Use of a circular buffer.
Race Conditions (2)
Parallel processing with a fatal race condition.
14
Race Conditions (3)
Parallel processing with a fatal race condition.
Race Conditions (4)
Parallel processing with a fatal race condition.
15
Race Conditions (5)
Failure of the producer-consumer communication mechanism.
Process Synchronization Using Semaphores (1)
The effect of a semaphore operation.
16
Process Synchronization Using Semaphores (2)
Parallel processing using semaphores.
Process Synchronization Using Semaphores (3)
Parallel processing using semaphores.
17
Process Synchronization Using Semaphores (4)
Parallel processing using semaphores.
UNIX (1)
A rough breakdown of the UNIX system calls.
18
UNIX (2)
The structure of a typical UNIX system.
Windows XP
The structure of Windows XP.
19
UNIX Virtual Memory
The address space of a single UNIX process.
Windows XP Virtual Memory
The principal Windows XP API calls for managing virtual memory.
20
UNIX Virtual I/O (1)
The principal UNIX file system calls.
UNIX Virtual I/O (2)
A program fragment for copying a file using the UNIX systemcalls. This fragment is in C because Java hides the
low-level system calls and we are trying to expose them.
21
UNIX Virtual I/O (3)
Part of a typical UNIX directory system.
UNIX Virtual I/O (4)
The principal UNIX directory management calls.
22
Windows XP Virtual I/O (1)
The principal Win32 API functions for file I/O. The second column gives the nearest UNIX equivalent.
Windows XP Virtual I/O (2)
A program fragment for copying a file using the Windows XP APIfunctions. This fragment is in C because Java hides the low-level
system calls and we are trying to expose them.
23
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.
Windows XP Virtual I/O (4)
The Windows XP master file table.
24
UNIX Process Management (1)
A process tree in UNIX.
UNIX Process Management (2)
The principal POSIX thread calls.