CGS 3763 Operating Systems Concepts Spring 2013 Dan

  • Slides: 27
Download presentation
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office

CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: 30 - 12: 30 AM

Lecture 9 – Monday, January 28, 2013 n Last time: Interrupts ¨ Problem 2.

Lecture 9 – Monday, January 28, 2013 n Last time: Interrupts ¨ Problem 2. 8 from Chapter 2 ¨ n Today: Answers to student questions ¨ Interrupt processing ¨ Kernel data structures for process management ¨ n Next time Creation and termination of processes ¨ Inter-process communication ¨ n n n Shared memory Message passing Reading assignments Chapters 3 and 4 of the textbook ¨ Chapters 3 and 4 textbook slides ¨ n HW 1 due on Wednesday 9/14/2021 2

Student questions from week 2 Jan 14 th Monday: A lot of people seem

Student questions from week 2 Jan 14 th Monday: A lot of people seem to have trouble understanding how things work physically. There a lot of people asking, “Where are the registers, ” or “Where is the cache, ” etc. It would be really helpful if we could see more pictures with labels, or more diagrams in class of some of these things. What is the purpose of abstraction? Is a thread part of a process or independent? How do threads work? Further explanation of hardware and software events. Further explanation of addresses as well. Cover in more detail what an abstraction is and Instruction Set Architecture. I also didn’t understand the difference between 32 and 64 bit operating systems. 9/14/2021 3

9/14/2021 4

9/14/2021 4

9/14/2021 5

9/14/2021 5

9/14/2021 6

9/14/2021 6

Storage hierarchy 9/14/2021 7

Storage hierarchy 9/14/2021 7

Multi-level storage 9/14/2021 8

Multi-level storage 9/14/2021 8

Caching Important principle, performed at many levels in a computer (in hardware, operating system,

Caching Important principle, performed at many levels in a computer (in hardware, operating system, software) Information in use copied from slower to faster storage temporarily Faster storage (cache) checked first to determine if information is there If it is, information used directly from the cache (fast) If not, data copied to cache and used there Cache smaller than storage being cached Cache management important design problem Cache size and replacement policy 9/14/2021 9

9/14/2021 10

9/14/2021 10

Student questions from week 2 (cont’d) Jan 16 th Wednesday: What are MIPS and

Student questions from week 2 (cont’d) Jan 16 th Wednesday: What are MIPS and MFLOPS? Why are we interested in certain types of performance measurements over others for hardware (such as measuring CPU performance in MIPS or MFLOPS and no other measurements? What is a type of interrupt? What is context switching and what is its main purpose? I would like more explanation of cache and it’s forms (ex. L 1 cache) and how they are used in a system Jan 18 th Friday: I would like an example of a problem that a computer cannot solve. Explain more about Universal computers. 9/14/2021 11

Examples of non-computable functions n n The truth function, which correctly labels the statements

Examples of non-computable functions n n The truth function, which correctly labels the statements of arithmetic as true or false, is not computable. The halting problem function, which correctly labels program-input pairs as halting or non-halting, is easy to describe, but not computable. The Tiling function, which given any finite set of polygonal tiles, outputs the size k of the largest k×k sqaure that can be tiled by them, or 0 if they tile the entire plane. The Conjugate function, which given two words in a finite group presentation, correctly states whether they are conjugate or not. 9/14/2021 12

MIPS and MFLOPS n n The speed of a processor is measured in number

MIPS and MFLOPS n n The speed of a processor is measured in number of operations per second. There are two types of arithmetic operations and two distinct instruction execution units Integers MIPS (Million Instructions Per Second) ¨ Floating point MFLOPS (Million Floating Point Instructions Per Second) ¨ 9/14/2021 13

Interrupts provide the means to react to internal and external events 9/14/2021 14

Interrupts provide the means to react to internal and external events 9/14/2021 14

Context switching n n The storing and restoring the state (context) of a process

Context switching n n The storing and restoring the state (context) of a process so that execution can be resumed from the same point at a later time. Enables multiple processes/threads to share a single CPU. 9/14/2021 15

Process Control Block (PCB)

Process Control Block (PCB)

CPU Switch From Process to Process

CPU Switch From Process to Process

Control data structure maintained by the kernel n To carry out its functions the

Control data structure maintained by the kernel n To carry out its functions the kernel must maintain information about all objects in the system. For example: Processes Process Control Block (PCB) ¨ Open files File Control Block (FCB) ¨ 9/14/2021 18

Process Control Block (PCB) The entry for a process contains the following information ¨

Process Control Block (PCB) The entry for a process contains the following information ¨ ¨ ¨ ¨ Process state Program counter CPU registers CPU scheduling information Memory-management information Accounting information I/O status information

Process Control Block (PCB)

Process Control Block (PCB)

The state of a process 9/14/2021 21

The state of a process 9/14/2021 21

Interrupt handlers are a component of the kernel 9/14/2021 22

Interrupt handlers are a component of the kernel 9/14/2021 22

9/14/2021 23

9/14/2021 23

9/14/2021 24

9/14/2021 24

Kernel functions for program execution n Process management n Scheduling and resource allocation n

Kernel functions for program execution n Process management n Scheduling and resource allocation n Interrupt handling n Error handling 9/14/2021 25

System calls for process control n n n Load Execute Create, terminate a process

System calls for process control n n n Load Execute Create, terminate a process Block a process, abort Get process attributes/set process attributes Allocate/deallocate memory for a process 9/14/2021 26

Process Scheduling Queues n n Job queue – set of all processes in the

Process Scheduling Queues n n Job queue – set of all processes in the system Ready queue – set of all processes residing in main memory, ready and waiting to execute Device queues – set of processes waiting for an I/O device Processes migrate among the various queues