ECSE 427 Lecture Notes - Lecture 2: Computer Multitasking, Assembly Language, Process Control Block

37 views21 pages
ECSE 427 Notes
Alex Hale
Basics of Operating Systems
- operating system (OS) = trusted software interposed between the hardware and application/utilities to improve
efficiency and usability
o most computing systems have some form of OS it’s
hard to use computer systems without one
OS Evolution - driven by the cost of computers (computer time) and the
cost of people (user time)
- major OS functions:
o provide abstractions: hide the peculiarities of the hardware
(e.g. device-dependent I/O)
o manage resources: implement policies, mediate resource
usage among different tasks
o control access and provide interfaces:
interfaces to the OS and devices attached to the system
interfaces for human-machine and machine-machine transactions
Function #1 - Abstraction
- central to the abstractions is processes and threads (lightweight processes)
- a process is an instance of a program in execution
o defined by an executable, data, and other components
- functions provided for processes by the OS:
o lifecycle management
o resource management
o inter-process communication
- simple process diagram: see right
Function #2 Control Access, Provide Interfaces
Access Problem
- user wants to access the OS because they want to access the devices connected to the system
o the OS must recognize the use’s itet to aess
- interrupt-driven I/O:
o the CPU issues an I/O operation then continues
working on other things
o the device notifies (interrupts) the CPU as data
arrives
o the CPU processes that data, then goes back to
doing other work again
- I/O devices are many orders of magnitude slower than
the CPU, so it’s ipotat fo the CPU to do useful ok
while waiting for the I/O device rather than just wasting the time
- when an interrupt occurs, the OS:
o branches from its current list of instructions
o locates the interrupt service routine (ISR) using the provided interrupt vector
o executes the ISR
o returns to the program that it was originally executing
Controlling OS Access
- the OS interposes itself between the hardware and applications, utilities, and users
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 21 pages and 3 million more documents.

Already have an account? Log in
o controlling access to the OS, by extension, controls access to the device
- a two-level architecture is used to control access to the OS
o trusted mode: the kernel (core part of the OS) runs in this mode
o untrusted mode: user applications and utilities run in this mode
System Call (via Trap)
- the OS provides system calls for accessing OS services from applications
- system calls are special procedural call that:
o control transfer
o switch protection domain
o validate the call
o allow authorized actions to take place
- system calls in UNIX:
o process control:
fork(), exec(), wait(), abort()
o file manipulation:
chmod(), link(), stat(), creat()
o device manipulation:
open(), close(), ioctl(), select()
o information maintenance:
time(), acct(), gettimeofday()
o communications
socket(), accept(), send(), recv()
Function #3 Manage Resources
Resource #1 Processor Time
- the most important resource managed by the OS
- management strategy depends on the OS
o batch vs. time-sharing
o uniprogramming vs multiprogramming
Uniprogramming only one program is running in the system
Multiprogramming multiple programs are simultaneously loaded into the system
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 21 pages and 3 million more documents.

Already have an account? Log in
Resource #2 Memory
- while multiprogramming, multiple programs co-exist in the memory
- it’s eessa to potet co-residing programs from each other
- the OS divides the memory into partitions, and allocates different process to corresponding partitions
o partitions can be of a fixed or variable size
- a process:
o a’t aess eo that is’t alloated to it
o can request more memory from the OS
o a elease eo that it’s uetl holdig ak to the O“
o may only use a small portion of its allocated memory, leaving the rest unused
Resource #3 Storage
- the OS needs to store data in persistent (non-voltatile) storage and ogaize it i a a suh that it’s oth eas
to access and well-protected
- challenges:
o secondary storage (e.g. magnetic hard disks) are very slow compared to the CPU speed
o heterogeneity
o device protection
Data View
Component View
UNIX
- systems programs
- kernel
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows pages 1-3 of the document.
Unlock all 21 pages and 3 million more documents.

Already have an account? Log in

Document Summary

Operating system (os) = trusted software interposed between the hardware and application/utilities to improve efficiency and usability: most computing systems have some form of os it"s hard to use computer systems without one. Os evolution - driven by the cost of computers (computer time) and the cost of people (user time) I/o devices are many orders of magnitude slower than the cpu, so it"s i(cid:373)po(cid:396)ta(cid:374)t fo(cid:396) the cpu to do useful (cid:449)o(cid:396)k while waiting for the i/o device rather than just wasting the time. When an interrupt occurs, the os: branches from its current list of instructions locates the interrupt service routine (isr) using the provided interrupt vector, executes the isr returns to the program that it was originally executing. Resource #1 processor time the most important resource managed by the os. Management strategy depends on the os: batch vs. time-sharing, uniprogramming vs multiprogramming. Uniprogramming only one program is running in the system.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents