Chapter 1: Introduction CSS503 Systems Programming Prof. Munehiro

12 Slides1.15 MB

Chapter 1: Introduction CSS503 Systems Programming Prof. Munehiro Fukuda Computing & Software Systems University of Washington Bothell CSS503 Chapter 1: Introduction 1

Defining Operating Systems Goals Execute user programs and make solving user problems easier Making the computer system convenient to use Using computer hardware in an efficient manner Definitions Resource allocator – manages and allocates resources Control program – controls the execution of user programs and operations of I/O devices Kernel – the one program running at all times (all else being application programs) CSS503 Chapter 1: Introduction 2

Computer System Components CSS503 Chapter 1: Introduction 3

Operating-System Operations Protection I/O Management Launching, synchronizing, and terminating programs Memory Management Asynchronous I/Os Process Management Distinguishing user and kernel Giving each task a independent logical address space Storage Management Giving logical views of disk spaces, (i.e. directories and files) CSS503 Chapter 1: Introduction 4

Dual-Mode Operation User Mode: Non-privileged operations only Kernel Mode: All operations (including I/O instructions) Transition User to Kernel: Interrupts, system calls, and traps Kernel to User: A special instr. such as IRET CSS503 Chapter 1: Introduction 5

I/O Management requesting process waiting user device driver kernel Interrupt handler Hardware data transfer time CSS503 Faster CPU/Memory versus Slower I/Os Synchronous I/O or CPU I/O CPU takes care of All I/O operations. Polling wastes CPU time. Chapter 1: Introduction 6

I/O Management (Cont’d) user a requesting process replaced with another one interrupts device driver kernel DMA Interrupt handler Hardware data transfer time CSS503 Device interrupts and DMA Asynchronous I/O DMA takes care of I/O data transfers. Devices interrupt CPU when they are ready. Chapter 1: Introduction 7

Process Management Process Control Block and Logical Address Process ID UID GID EUID EGID Text Directory Entry (Code Global Data) TTY Heap Signal Dispatch Table 0 stdin 1 stdout 2 stderr 3 Memory Map priority Intr. mask registers CPU Status File Descriptors Stack A program in execution Process needs: CPU, memory, Files, I/Os etc. OS must supports: Creation: loading it in memory Synchronization/communication: having a process wait for another. Termination: clean it up from memory trek.txt CSS503 Chapter 1: Introduction 8

Memory Management Process A’s Logical Address Physical Address Space Text Heap Providing each process with a logical address space Mapping logical address to physical address (paging and segmentation) Facilitating virtual memory using disk Process B’s Logical Address Text Heap Process C Text Stack Heap Stack Virtual Memory in Disk Stack CSS503 Chapter 1: Introduction 9

Storage Management 0 stdin 1 stdout 2 stderr 3 File descriptors Process 1 Boot sector, partition table Superblock 1 File table entry inode Disk partitioning Linux File and directory management Process 2 0 stdin 1 stdout 2 stderr 3 Superblock 2 File descriptors Allowing multiple file systems Logical to physical mapping File operations open, read, write, seek, close NTFS CSS503 Chapter 1: Introduction 10

Memory Hierarchy Level Size Speed (ns) Managed by Registers 1KB 0.25 0.5 Compiler Cache 16MB 0.5 25 Important Rules on Storage Operations Inclusion property Memory coherence Core 1 Hardware CPU Core 2 Reg Reg L1 L1 L2 Cache Main memory 16GB Hard disks Several TB 80 250 OS Main Memory 5000 OS Hard disks CSS503 Chapter 1: Introduction Hard disks Hard disks 11

Discussion Solve Text Exercises: 1.6 (Privileged Instructions) 1.8 (CPU Mode) 1.20 (DMA) 1.22 (Cache Memory) CSS503 Chapter 1: Introduction 12

Back to top button