OS – Memphis – Day one notes 1/18/2005 – Bob Bradley
Dr. Stuart’s OS Class COMP 4270/6270 at the University of Memphis
What is an Operating System?
Not everything that comes on the machine. Not word processor browser.
Other end. Single program. Kernel. Core thing this class will be compiling and building after modifying.
A program that runs directly on the hardware.
The OS is the kernel plus the support apps that provide the OS services.
Apps
A
OS
n OS:
-
I/O Interface. Interface between applications and the hardware
-
M
Hardware
anager (eg. Memory) Resource Manager
-
Service Provider through API. (open files, kill/start a process)
-
Virtual Machine
OS Responsibilities
-
Memory
-
CPU / Processor Time
-
I/O devices
-
File Systems
-
Security (aspects of security in all of these)
-
Networking
-
User Interface?
History
Bare Hardware
1 machine / 1 program / 1 user
Sign-up / Timeshare
Batch OS – Lost immediacy – hard to debug program
-----
OS notes 1/20/2005
History
-
Bare Metal / No OSs
(Library of code you can reuse/code reuse)
-
Sign-up / “Timeshare”
-
Batch OS
Made use of the computer more efficient (CPU did more work)
Made programmers time inefficient – had to wait hours for an error report
-
Timesharing / Multiprogramming – late 1950’s / 1960’s
IBM and the 7 dwarves –
BUNCH: Burris, Univac/Unisys, NCR, Control Data Corp, Honeywell & GE
Digital – PDP8 (1975?) Cheap and small – sit on a desk – CPU – 4K - $18,000.00
Cheap computers – mini computer - back to 1 computer / 1 user / 1 program
Unix written 1969 for PDP 7.
1969 first unix, Apollo 11 on the moon, Woodstock, sesame street, first Arpanet / internet computers and some timesharing
1970’s Altair - $700.00 Popular Electronics – Box, CPU, Lights, Switches – a Personal Computer – 1 user/ 1 CPU / 1 program
PDA’s - at first - 1 user/1CPU/1 program
-
Distributed Operating System
Breaks the third leg of the triangle (1 user/1program/1cpu)
Need to plan the structure of the system, so that multiple machines are doing multiple jobs for multiple people
MULTICS – Designed for computer utility grid – 40 years ago
an interesting test bed for ideas – how to protect one user from another – how to store files – interact with users – gathering point for some of the best minds in CS.
Developed into an extremely wide specified system – late 1960’s bell labs pulled out of MULTICS. Look in 3.1 Inferno Origins in PDF.
MULTICS language (BCPL)
UNIX language (B) extend B add arrays and typing -> C
History of Programming Languages – Paper HOPL#2
History of C
Unix and Bell Labs
Bell Labs was AT&T Phone Company, and could not sell computer stuff, so they gave it away.
Berkley versions of Unix – Various BSDs, Free BSD, Open BSD, Dragon Fly BSD
Plan 9 – Bell Labs – Now Lucent
Inferno (Limbo)
Lucent sold to Vita Nuova
Inferno
Now Open Source
Can be hosted or native
Google is now becoming the largest and best CS research institute. Some of the plan 9 and inferno people are there now.
System Calls (1.5)
-
The interface between apps and the OS
-
Usually implemented with some form of software interrupt or trap
-
Transfers control to the OS
-
OS processes request and ends result back
New memory, new process
The C programming lang doesn’t know about interrupts or I/O or system calls
Compiler uses stub functions to do interrupt/system calls
OS Structure
-
Monolithic
-
Layered Design
Code in lower layers does not call or reference code/data in upper layers
XINU
-
Virtual Machine Design
The OS provides apps w/ the illusion that they’re alone on the HW
QEMU
-
Microkernel Design – Minux, Mach, etc.
Tue 1/25/2005
OS – Hardware
CPU
Input
Output
Memory
DMA
Direct Memory Access
CPU: ALU (Mostly addition and subtraction and setting flags to indicate something about the results)
CPU “Algorithm”
-
Put PC onto address bus and read an instruction from memory.
-
Decode the instruction
2a) Increment the program counter (PC) by the size of the instruction
-
Move data according to the decoded instruction
-
Goto 1
Next memory:
Triangle
At Top: faster – smaller – more expensive
At bottom: slower, bigger, cheaper
Regs < 1ns
Cache < 5-10 ns
Main Memory - Primary Storage < 50 ns
Swap Space - Secondary (Backing) Storage < 5 ms (factor of 100,000 x slower)
maybe million
Archival storage < 5 s m hrs
I/O
Punch cards
Paper Rolls
Tape Drives
Floppy Disks
How Disk Drives Work…
Head flying above disk on a cushion of air. And related sizes. Head, fingerprint, hair
-
head crashes
-
… thus ends computer hardware
-
Next time what we do in the OS in terms of process management
-
1/21/05 TH – OS
Process Management
-
An instance of a running program
-
Mannage by means of the process table
-
PID, Memory Usage, State, Code, Open files, registers, user/group
-
PTE – Process Table Entry
Services
-
scheduling who gets to run next
-
context switching – giving the cpu to another process
-
create process
-
terminate process
-
control and query permissions and other meta data
-
IPC – Inter-process communication
Scheduling
-
batch os
-
FCFS – queue
-
1, 2, 100, 1, 3
turn around time, time from submission to completion
1, 3, 103, 104, 107
-
SJF – shortest job first. Minimize the average turn around time
Timesharing OS
-
Round robin – circular queue
-
Priority scheduling, pick the one with the highest priority
-
Administrative – static
-
Dynamic eg prioritize interactive processes
-
Multiple queues
-
Eg. of different quantums
prioritize interactive processes
move long jobs down to longer quantums, but less priority
-
Two Level Scheduler (when mem was expensive)
-
First level – decide what processes are in memory at any given time – runs slowly (maybe every sec)
-
Second level – usual scheduling – among those in memory, which runs next – runs faster (maybe every 10th of a sec)
-
Real-time scheduling
-
Apollo 11 – 1201 and 1202 alarms – stuff not getting done
but we do the high priority stuff first, at the first of each cycle
The Process State
Proc preempted
Share with your friends: |