Operating System The OS is JUST A PROGRAM

Slides:



Advertisements
Similar presentations
So far Binary numbers Logic gates Digital circuits process data using gates – Half and full adder Data storage – Electronic memory – Magnetic memory –
Advertisements

Section 6.2. Record data by magnetizing the binary code on the surface of a disk. Data area is reusable Allows for both sequential and direct access file.
11/15/2005Comp 120 Fall November Seven Classes to Go! Questions! VM and Making Programs Go.
11/18/2004Comp 120 Fall November 3 classes to go No class on Tuesday 23 November Last 2 classes will be survey and exam review Interconnect and.
11/29/2005Comp 120 Fall November 4 to go! Questions? Interrupts and I/O devices.
1 Computer System Overview OS-1 Course AA
L21 – OS and IO 1 Comp 411– Spring /24/08 Operating System The OS is JUST A PROGRAM but it runs in SUPERVISOR state access to PHYSICAL addresses.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
1/21/2010CSCI 315 Operating Systems Design1 Computer System Structures Notice: The slides for this lecture have been largely based on those accompanying.
Process Description and Control A process is sometimes called a task, it is a program in execution.
Chapter 2: Computer-System Structures
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
Disk Access. DISK STRUCTURE Sector: Smallest unit of data transfer from/to disk; 512B 2/4/8 adjacent sectors transferred together: Blocks Read/write heads.
Review of Memory Management, Virtual Memory CS448.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 2: Computer-System Structures Computer System Operation I/O Structure.
1 CSE Department MAITSandeep Tayal Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
2: Computer-System Structures
1 Week 9: Computing Components: PART II READING: Chapter 5.
1 Chapter 2: Computer-System Structures  Computer System Operation  I/O Structure  Storage Structure  Storage Hierarchy  Hardware Protection  General.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 9: Virtual Memory.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 2 Computer-System Structures Slide 1 Chapter 2 Computer-System Structures.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Virtual Memory Various memory management techniques have been discussed. All these strategies have the same goal: to keep many processes in memory simultaneously.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
L20 – OS and IO 1 Comp 411– Fall /09/09 Operating System The OS is JUST A PROGRAM but it runs in SUPERVISOR state access to PHYSICAL addresses access.
Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
10/15: Lecture Topics Input/Output –Types of I/O Devices –How devices communicate with the rest of the system communicating with the processor communicating.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Virtual Memory (Section 9.3). The Need For Virtual Memory Many computers don’t have enough memory in RAM to accommodate all the programs a user wants.
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Chapter 8 I/O.
Chapter 2: Computer-System Structures(Hardware)
Chapter 2: Computer-System Structures
Processes and threads.
Process Management Process Concept Why only the global variables?
Chapter 2: Computer-System Structures
Day 08 Processes.
Day 09 Processes.
William Stallings Computer Organization and Architecture
I/O Resource Management: Software
CS703 - Advanced Operating Systems
Chapter 8 I/O.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
CSI 400/500 Operating Systems Spring 2009
Computer Architecture
Chapter 8 I/O.
Operating System The OS is JUST A PROGRAM
Computer-System Architecture
Module 2: Computer-System Structures
Process & its States Lecture 5.
Operating Systems.
Chapter 8 I/O.
Process Description and Control
Computer Organization
Module 2: Computer-System Structures
Chapter 8 I/O.
CS149D Elements of Computer Science
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Chapter 1: Introduction CSS503 Systems Programming
Andy Wang Operating Systems COP 4610 / CGS 5765
Presentation transcript:

Operating System The OS is JUST A PROGRAM but it runs in SUPERVISOR state access to PHYSICAL addresses access to special registers (like page table register) all IO devices, etc. whereas ordinary programs run in USER state only access to VIRTUAL addresses through page tables normally no access to IO devices Programs ask the OS for services (syscall) give me more memory read/write data from/to disk put pixel on screen give me the next character from the keyboard

OS Execution The OS keeps a PROCESS TABLE of all running programs disk location of executable memory location of page tables priority current status (running, waiting ready, waiting on an event, etc.) PID (process ID) a number assigned to the process A PROCESS is an independent program running in its own memory space The OS allocates a new entry in the PROCESS TABLE And sets up the PAGE TABLE for the new process

Initial Page Table memory page table disk foo swap text segment 1 text segment 0x00001000 0x00002000 1 data segment 0x00003000 0x00004000 0x00005000 0xffffe000 0xfffff000 stack foo swap disk

Page Fault in the Text memory page table disk foo swap 1 text segment 0x00002000 data segment 0x00003000 0x00004000 0x00005000 0xffffe000 0xfffff000 stack foo swap disk

Allocate a block of memory page table 0x00000000 1 text segment 0x00001000 0x00002000 data segment 0x00003000 heap 0x00004000 0x00005000 0xffffe000 0xfffff000 stack foo swap disk

Fault in the other page of TEXT memory page table 0x00000000 1 text segment 0x00001000 0x00002000 data segment 0x00003000 heap 0x00004000 0x00005000 0xffffe000 0xfffff000 stack foo swap disk

Grow the stack memory page table disk foo swap 1 text segment data segment 0x00003000 heap 0x00004000 0x00005000 ... 0xffffd000 0xffffe000 0xfffff000 stack foo swap disk

Partially Paged Out memory page table disk foo swap 1 text segment data segment 0x00003000 heap 0x00004000 0x00005000 ... 0xffffd000 0xffffe000 0xfffff000 stack foo swap disk

Later we need that page memory page table disk foo swap 1 text segment data segment 0x00003000 heap 0x00004000 0x00005000 ... 0xffffd000 0xffffe000 0xfffff000 stack foo swap disk

Exit Finally our program exits It calls the “exit” system call to notify the OS that it is done The OS puts the memory back on the free list Cleans up the PAGE TABLE and PROCESS TABLE And goes on about its business...

Interrupts How does the CPU manage SLOW I/O devices? Programmed I/O Interrupt Driven I/O

Polling Advantages Simple No surprises Processor in full control Disadvantages Polling can waste lots of time

Interrupt Driven I/O Advantage CPU only bothered when actually needed Disadvantage Can occur at surprising or inconvenient times Have to save and restore state

Quick overview of I/O devices This is the “rest” of the computer Used to be called “peripherals” …but that term does not do justice to them!

Magnetic Disks: Outside

Inside

Platters and Heads

Magnetic Disk Organization Cylinder: All tracks under head with arm in a fixed position Read/Write time has 3 components Seek time to move the arm Rotational latency: wait for the desired sector to come by Transfer time: transfer bits

CD

LCD

Graphics Cards

Polygons to Surfaces Numerical coordinates specify vertex positions in 3D Matrix multiply transforms 3D coordinates to eye coordinates Divide projects 3D to 2D in perspective Pixel processors fill polygons with appropriate colors based on lighting model

Sound Sound is variations in air pressure A microphone converts these into an analog electrical signal An analog-to-digital converter samples this at frequent intervals The resulting numbers are stored in a file (.wav) On playback a digital-to-analog converter changes these numbers into an analog electrical signal And the moving cone of a speaker converts this into varying air pressure

That’s it folks! You now have a pretty good idea about: How computers are designed and how they work How data and instructions are represented How arithmetic and logic operations are performed How ALU and control circuits are implemented How registers and the memory hierarchy are implemented How performance is measured How performance is increased via pipelining, caching How VM works. (briefly) What the rest of the computer looks like (disks, sound, etc.) Final exam 3 May 4-7pm here Next Time: Review Everything for the final exam

Final Exam Final exam is Monday 3 May at 4pm here. Next week we’ll review the course, and work problems until we all know how to do them. Sample final exam.