Download presentation
Presentation is loading. Please wait.
Published byShon Franklin Modified over 8 years ago
1
STRUCTURE OPERATING SYSTEMS
2
I. PROCESS MANAGEMENT Process a program in execution More than one process can be associated with a single program Each is a separate execution sequence All processes can potentially execute concurrently O/S Tasks Creation/deletion of processes Suspension and resumption of processes Process synchronization Interprocess communication Deadlock detection
3
II. MEMORY MANAGEMENT RAM Array of words or bytes, each with its own address Loosely speaking, the only storage device the CPU can address directly (forgetting about cache) Many programs are in memory at the same time O/S Tasks Keep track of which pieces of memory are being used and by whom Decide which processes are to be loaded into memory Allocate/deallocate memory to processes
4
III. FILE SYSTEM MANAGEMENT (1) Provides a uniform logical view of information storage O/S Tasks Creation/Deletion of files Creation/Deletion of directories Map files onto secondary storage Backup files onto stable media
5
III. FILE SYSTEM MANAGEMENT (2) A file system for a university department. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.
6
III. FILE SYSTEM MANAGEMENT (3) To be accessible, files must be mounted (a) before mount. (b) after mount Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.
7
IV. PROTECTION Ensure that these can only be manipulated by processes with proper authority Files Memory CPU
8
V. I/O DEVICE MANAGEMENT (1) A controller is hardware : The electronic component of a device. It has a standard interface (SATA, SCSI, USB, etc.). The controller translates input from software into something a device understands. Controllers can have memory and a processor. NICs and graphic cards are controllers. A Device drivers is software : provides an interface between the controller and the OS.
9
V. I/O DEVICE MANAGEMENT (2) SUBTLE PROBLEMS Problem 1: Getting device driver into kernel At boot time, OS detects controllers, finds the drivers it needs and loads them OS detects controllers and loads drivers on the fly—thumb drives Problem 2: OS issues i/o request Busy/Wait driver starts i/o and sits in tight loop polling device i/o completes and driver alerts OS Problem: wastes CPU cycles Interrupt driver starts the device. Is interrupted when i/o completes Problem: the interrupt handler is interrupted by another device Solution: When processing an interrupt, disable interrupts. The devices continue to assert interrupt signals, but the CPU does not respond until interrupts are enabled.
10
VI. COMMAND INTERPRETER Programmer interface to the o/s Shell Logging on creates a process on your behalf $ indicates waiting for input Issue a command (e.g., cp), shell starts a child process called a system call
11
VII. SYSTEM CALLS (1) Provides an interface between a running program and the o/s To be distinguished from the shell. System calls occur within a program Every subsystem of the o/s has its own set of system calls
12
VII. SYSTEM CALLS (2) FILE MANAGEMENT EXAMPLE #include int main(int argc, char* argv[]) { int inFile, outFile; int len; char ch; if (argc != 3) { printf("Usage: copy \n"); exit(1); } inFile = open(argv[1], O_RDONLY); outFile = open(argv[2], O_WRONLY | O_CREAT, S_IRWXU); while ((len = read(inFile, &ch, 1)) > 0) { write(outFile, &ch, 1); } close(inFile); close(outFile); return 0; }
13
VII. SYSTEM CALL (3) PROCESS MANAGEMENT Processes are created through other processes As early as 1963, researchers postulated 3 process creation functions fork() – create a process join() – merge two processes quit() – terminate a process
14
THERE IS MUCH,MUCH MORE
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.