Download presentation
Presentation is loading. Please wait.
Published byDominic Simmons Modified over 8 years ago
1
Operating Systems: History, Hardware & Concepts Ch 1.4 & 1.5 Thursday, January 18, 2007
2
Today’s Schedule Sec 1.4 - Hardware Review Sec 1.5 - O/S Concepts Quiz #1
3
Computer Hardware Review Components of a simple personal computer Monitor Bus
4
Computer Hardware Review (a) A three-stage pipeline (b) A superscalar CPU
5
Processors Brain of the computer Fetch, decode, execute cycle Registers Program Counter (PC) Stack Pointer (SP) Pipelining improves performance, but complexities of “rolling back” appear Kernel vs. User Mode (enables establishing limitations of instruction set available)
6
Computer Memory The CPU is often referred to as the brain of the computer. This is where all the actual computing is done. The chipset supports the CPU. It usually contains several "controllers" which govern how information travels between the processor and other components in the system. Some systems have more than one chipset.
7
Computer Memory The memory controller is part of the chipset, and this controller establishes the information flow between memory and the CPU. A bus is a data path in a computer, consisting of various parallel wires to which the CPU, memory, and all input/output devices are connected. The memory bus runs from the memory controller to the computer's memory sockets
8
Computer Memory Memory speed is sometimes measured in Megahertz (MHz), or in terms of access time - the actual time required to deliver data - measured in nanoseconds (ns). A computer's system clock resides on the motherboard. It sends out a signal to all other computer components in rhythm, like a metronome. Cache memory is a relatively small amount (normally less than 1MB) of high speed memory that resides very close to the CPU. Cache memory is designed to supply the CPU with the most frequently requested data and instructions.
9
Memory Tradeoff - Speed vs. Capacity Typical memory hierarchy numbers shown are rough approximations For RAM, how many bytes in 1KB? In 1 MB? 1000 and 1,000,000? NO!
10
Multiple Processes in Memory One base-limit pair and two base-limit pairs Protection and Relocation problems solved!
11
Memory Allocation We need a protective and fair way of allocating and resizing memory blocks for processes/jobs Two sections of memory Code (typically static) Data (volatile) OS Program Code User 1 Data User 2 Data Limit Base Limit Base Limit Base
12
Memory Management Unit (MMU) Device that checks and maps memory addresses Virtual Address – address generated by the program Physical Address – address actually used in memory
13
I/O Devices Typically consist of two parts: Controller Device Controller manages & presents the API of the device to the OS The software that “talks” to the controller is called a device driver
14
Input and Output Busy Waiting User issues system call, driver waits in loop Ties up CPU polling device Interrupt Driver starts device, requests interrupt when finished CPU looks for other work, until interrupt received Direct Memory Access (DMA) Chip controls flow of bits memory and controller CPU not constantly involved
15
I/O Devices (a) Steps in starting an I/O device and getting interrupt (b) How the CPU is interrupted (a) (b) Where does the Interrupt Handler store its data?
16
Bus Communication “highway” for all data to travel upon Multiple buses exist in modern machines Cache (fastest) Local (on mainboard –other busses connect to it) Memory PCI (successor of ISA - high-speed I/O) SCSI (high-speed scanners & disks) USB (slow peripherals) IDE (disks, etc.) ISA (slowest – legacy)
17
Buses in PC Structure of a large Pentium system
18
OS Concepts Processes Deadlock Memory Management I/O Files Security
19
Processes Defined as a “program in execution” AKA a “job” Contain Instructions (code segment) SP, PC, registers, file handles Data segment Processes can spawn subprocesses & threads The OS must ensure fairness & protection, timeslicing & managing multiple processes at a time
20
Deadlock Two or more processes “stalemated” because they can’t make progress Process A Has resource 1 Waiting on resource 2 Process B Has resource 2 Waiting on resource 1
21
Memory Management Providing protection of one process’ memory section from another process (security) Providing a fair allocation of memory to multiple processes Swapping memory to disk as needed
22
Input/Output All OS must manage I/O devices Two categories: Device independent Device dependent (device drivers)
23
Files System calls Create, remove, read, write, etc. Directories & subdirectories Create, remove, rename, move, etc.
24
Security Allocate permissions Directories Files Example UNIX policies to consider: Read, Write, Execute User, Group, World
25
System Calls Services that the OS provides to the user Set of API that user-level programs may invoke Flavors of System Calls UNIX Win32
26
UNIX System Calls pid = fork()creates child process exit()terminates process fd = open(file, …)opens file s = mkdir(name, mode)creates directory s = chmod(name, mode)sets file/dir permissions s = kill(pid, signal)sends signal to process
27
Win32 System Calls CreateProcess(…)creates new process ExitProcess(…)terminates process CreateFile(…)opens file CreateDirectory(…)creates directory
28
Approaches to OS Monolithic Virtual Machines Client-Server (microkernel)
29
Monolithic OS Architecture OS written as a set of procedures Each procedure has well-defined interface (parameters) Very little structure or information hiding
30
Virtual Machine OS Architecture Replicate the hardware within software Trap OS calls and translate/handle them Breaks down if you make direct I/O calls Slow (Windows running DOS applications) Other approach: JVM (define an alternate instruction set and translate to various OS)
31
Client-Server OS Architecture Implement as much as possible in user- level modules The OS is as small as possible It only serves to translate and message pass OS-level calls to service processes
32
Tuesday, January 23 Read Chapter 2 - Processes and Threads Sections 2.1 – 2.2.2 (ends top pg 90) Do not worry about “code fragments”, reading for understanding concept of process Process states Threads and why they are useful
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.