Lecture 1 Flashcards
Examples of Computer Hardware
CPU, RAM, Storage
Operating Systems enable…
…the user to interact with hardware
Examples of System/Application Programs
Compilers, Text Editors, Database Management Systems
Operating Systems act as…
…Resource allocators and control programs
What useful functions do operating systems provide on their own?
None (Waits for user or programs to do something)
Resource Allocator
- Manages all resources
- Decides between conflicting requests for efficient/fair
resource use
Control Program
Prevents errors and improper use of the computer
Operating System Goals
- Make system convenient to use (more important for
PCs) - Use hardware efficiently (more important for shared
systems) - Sacrifice performance to improve lifetime of resources
(Only done sometimes)
CPUs and device controllers connect through a bus to…
…Shared memory, which becomes a means of communication
Steps of an I/O operation
- CPU sends read request (CPU and I/O device
controllers execute concurrently) - Incoming data written to I/O device’s local buffer
- When I/O complete, send CPU an interrupt
- CPU services interrupt, read from I/O local buffer to
main memory
Interrupts are ____ events
Asynchronous
On an interrupt, OS preserves state of CPU by storing ____ and the ____
Registers and the Program Counter
Interrupt is processed by calling the corresponding…
…ISR (Interrupt Service Routine)
How would OS locate the correct ISR?
- An interrupt vector is stored at a known location in
memory - Each entry contains the address of an ISR
- Interrupt number is mapped to an entry in interrupt
vector
What does interrupt (or event) driven mean?
OS sits idle until something happens
Interrupts are generated by…
…Hardware devices
Traps/Exceptions are software-generated interrupts due to…
…Errors, or requests for OS services (system calls)
4 potential problems with user code
- Can be buggy/malicious
- Can corrupt hardware
- Can corrupt OS
- Can corrupt or access other users’ software/files
How to protect from user’s code?
Allow only OS to perform certain operations
OS operates in two modes: ____ and ____
User and Kernel
____ in hardware indicates OS’ current mode
Mode bit
What are privileged instructions?
Instructions that are predetermined to possibly cause harm
Hardware executes privileged instructions only in…
…Kernel mode
OS ensures ____ and ____ of privileged instruction before execution
Safety and correctness
How can users access privileged instructions?
System calls, which use software-generated interrupts
When an interrupt or trap is generated, control is transferred to…
…the OS