Introduction Flashcards
modern computer layout
hardware + software
-> software = kernel mode (OS) + user mode (UI + apps)
operating system
a program that manages the hardware
basis for apps
intermediary between user and hardware
os as a resource manager
top-down view
-> provides abstractions to apps
bottom-up view
-> manages pieces of complex systems
-> provides orderly, controlled allocation of resources
1st generation of OSs
(1945-55): Vacuum tubes
second generation of OSs
(1955-65): Transistors and batch systems
3rd generation of OSs
(1965-1980): ICs and multiprogramming
4th generation of OSs
(1980-present): Personal computers
5th generation of OSs
(1990-present): Mobile computers
UNIX, MINIX, LINUX
UNIX - a simpler os
- MINIX (1980s)
- LINUX (1990s)
Each component of a computer has a …
controller
three stage pipeline
Fetch -> Decode -> Execute
memory hierarchy
registers
cache
main memory
magnetic disk / SSD
up: size and access time decrease, cost increases
volatile memory
gone when the system doesn’t have power
registers <-> cache
quick access <-> slower access
nonvolatile storage
a type ofcomputer memory that can retain stored information even after power is removed
SSD
Solid State Drive
- No moving parts, data in electronic(flash) memory
- Much faster than magnetic disks
I/O devices strcuture
controller + device
device driver
- OS component that talks to controller
- One for each type of device controller
- communicates with controller via registers
- either accessed using special instructions (e.g., IN/OUT) or mapped in the OS’ address space (the addresses it can use)
I/O Port Space
The collection of device registers
to perform I/O:
- process executes system call
- kernel makes a call to driver
- driver starts I/O and either polls device to see if it is done (busy waiting) or asks device generate an interrupt when it is done (and returns) more advanced: make use of special hardware – DMA
interrupt
the occurrence of an event usually signalled by an Interrupt from Hardware or Software
CPU interrupted → stops what it is doing and transfers execution to a fixed location → the interrupt service routine executes → CPU resumes the interrupted action
hardware <-> software interrupts
hardware → interrupt
software → system call
bootstrap program
- the initial program that runs when a computer is powered up or rebooted
- it is stored in the ROM
- it must know how to load the OS and start executing that system
- it must locate the OS kernel and load it into memory
- in ROM form, because RAM is in an unknown state at startup
booting
the procedure of starting a computer by loading the kernel
booting steps
- firmware: ROM memory
- EPROM (erasable programmable ROM)
- flash memory on motherboard contains firmware (aka BIOS)
- after pressing power button, CPU executes BIOS which:
- initialises RAM and other resources
- scans PCI/PCIe buses to initialise devices
- sets up the runtime firmware for critical services (e.g. low-level I/O) to be used by the system after booting
- BIOS looks for location of partition table on second sector of boot device
- contains locations of other partitions
- BIOS can read simple file systems (e.g. FAT-32), and starts first bootloader program (from partition indicated by UEFI boot manager)
- the bootloader may load other bootloader programs
- eventually the OS is loaded
Computer System Architecture based on number of general purpose processors
- single processor systems
- one main CPU executing the general purpose instruction set + special purpose processors
- multiprocessor systems
- multiple CPUs
- clustered systems
- grouped systems
The OS Zoo
- Mainframe Operating Systems
- Server Operating Systems
- Personal Computer Operating Systems
- Smartphone and Handheld Computer Operating Systems
- The Internet of Things (IOT) and Embedded Operating Systems
- Real-Time Operating Systems
- Smart Card Operating Systems
What is an OS?
- extended machine
- Extending the hardware functionality
- Abstraction over hardware
- Hiding details from the programmer
- resource manager
- Protects simultaneous/unsafe usage of resources
- Fair sharing of resources
- Resource accounting/limiting
processes
user-level abstractions to execute a program on
behalf of a user
- Each process has its own address space
- Data involved in this processing is retrieved from/stored in files
- Files persist over processes
services
groups of system calls
multiprogramming
increases CPU utilisation by making sure it is always in use by some user