Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS149D Elements of Computer Science

Similar presentations


Presentation on theme: "CS149D Elements of Computer Science"— Presentation transcript:

1 CS149D Elements of Computer Science
Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture 9: 9/24/2002 Lecture 9: 9/24/2002 CS149D Fall 2002

2 Outline File Manager Memory Manager and Virtual Memory
Coordinating a machine activities (The Process concept) Should cover sections 3.2 and 3.3 Lecture 9: 9/24/2002 CS149D Fall 2002

3 Kernel Components revisited
File Manager Coordinate use of machine’s mass storage Device drivers Control operation of machine’s peripheral devices (printer, disk drive, monitor, …) Memory Manager Coordinate machine’s use of main memory Scheduler Which activity is executed next Dispatcher Controls allocation of time slices to activities Lecture 9: 9/24/2002 CS149D Fall 2002

4 File Manager Keep records of files stored in secondary storage
Location of each file Which users are allowed to access which files Available space in secondary storage Group files into a bundle called a directory or folder A directory may contain other directories called subdirectories A chain of directories within directories is called a directory path Provides means to access files (open and manipulate files) Lecture 9: 9/24/2002 CS149D Fall 2002

5 Memory Manager One task at a time
Load, execute, replace by program for performing next task Multi-user or Multi-tasking environments Many programs and blocks of data reside in main memory Allocate areas of memory for each program Fulfill memory requirements for programs Keep track of memory areas no longer occupied Lecture 9: 9/24/2002 CS149D Fall 2002

6 Virtual Memory When total main memory required exceeds actually available? Memory manager creates illusion of additional memory space by swapping programs and data back and forth between main memory and secondary storage Illusionary memory space called Virtual Memory Memory requirements are allocated in units called pages ( page size < 4 KB) Main memory is 64 MB, but only 32 MB is available? Memory manager stores contents of pages in secondary storage When a page in secondary storage is needed for access, load it in main memory If no space in main memory, swap some other page no longer required to secondary storage Lecture 9: 9/24/2002 CS149D Fall 2002

7 Concept of a Process Distinction between a program and the activity of executing a program Program  static set of directions Activity of executing a program  dynamic activity  known as a process Process state Current position in the program being executed (value of PC) Values in other registers and associated memory cells A single program can be associated with more than one process In a time-sharing computer, processes compete for time slices Operating System coordinates among processes Lecture 9: 9/24/2002 CS149D Fall 2002

8 Process Administration
Process coordination handled by scheduler and dispatcher within OS kernel Scheduler maintains a record of processes present in computer Maintains a block of information in main memory called process table When a new task is assigned to machine, creates a process for that task by placing a new entry in the process table Memory area assigned to process (from memory manager) Process priority Process status (ready, waiting for some event (I/O for example)) Dispatcher Ensures that scheduled processes are actually executed Divide time into time slices (or quantum) Process switching Lecture 9: 9/24/2002 CS149D Fall 2002

9 Process Administration
At interrupt CPU completes current machine cycle, saves current process state, and transfers control to an interrupt handler Interrupt handler is part of the dispatcher Dispatcher selects a ready process from the process table (highest priority) Restart timer circuit for the next interrupt Allow selected process to begin execution Copyright © 2003 Pearson Education, Inc. Sometimes, the process time slice is terminated before the timer expires For example when executing I/O Lecture 9: 9/24/2002 CS149D Fall 2002


Download ppt "CS149D Elements of Computer Science"

Similar presentations


Ads by Google