Operating Systems Flashcards
Operating system
to allocate the shared system resources to the executing programs
a collection of program which makes it easier for us to use a computer
a simpler abstraction of the underlying hardware (hides the complexity of hardware)
Hardware
basic computing resources, cpu etc
Operating system
controls and coordinates use of hardware amongst application and uses
Application programs
ways in which the system resources are used to solve computing problems, compilers, text editors, email clients, webs browsers, games
Users
people, machines and other computers
Uniprogramming
Ability to only conduct one program at a time
Multi-programming
Executing multiple programs on the same CPU giving the user the impression that these programs are running at the same time but in reality they are running one after the other
There must be enough memory to hold the OS (resident monitor) and one user program
When one job needs to wait for the I/O the processor can switch to the other job which is likely not waiting for the IO
Time sharing system
Principle objective is to minimise response time
Bootstrap program
Small piece of software stored in the memory area which kicks in and loads the system when you press the power button to turn your laptop on
ROM
Read-only Memory
EEPROM
Erasable Programmable Read-Only Memory
Firmware
Create some processes
System processes
Actives tasks or instances of programs, often initiated or interacted with by users
System daemons
Processes in the background, running at all times regarding of whether the user is executing something or not
Registers
A type of memory, very small but very fast
Smallest one on the cpu
Main memory
Much larger, relatively slow, every system needs to have it
CPU can load instructions only from memory meaning any programs to run must be stored there
Secondary storage
Goes away when machine is switched off, magnetic disks, optical disks, tapes (external devices)
Cache memory
Data that has been used a lot is cashed into a faster storage system
If the CPU is looking for information, cache is first checked
Storage Structure
- Memory is an array of bytes, each byte has its own address
Memory interaction via load/store instructions
Load Instructions
Moves byte from main memory to an internal register within the CPU
Store memory
Writing of a byte from CPU register to main memory
Large portion of OS code dedicated to managing I/O devices
Without having any I/O devices you won’t be able to program or give anything from the outside world to the system and vice versa
Local Buffer Storage
Temporary memory area within a system or device that is used to store data temporarily while it is being transferred between components, processed or waiting to be used.
Device Driver
Typically downloaded
Whenever a user program wants to issue a command to a device, this will send the command to the OS.
The OS will give the command to the DD who will transfer this to the disk controller.
I/O Mechanisms - Programmed I/O
Processor controls the I/O device, constantly test the status and transfer the data
I/O Mechanisms - Interrupt Driven I/O
Tell the device to do an activity, and the device will announce the CPU once this is done. This allows the CPU to do some activity in the mean time.
Interrupt driven is fine for moving small amounts of data
Not really suitable for bulk data movement such as disk I/O
I/O Mechanisms - Direct Memory Access
DMA - the controller transfers data directly from the I/O device to memory
- No intervention by the CPU during the transfer
- Only one single interrupt is generated, much better than one interrupt per byte, the CPU is freed up to do other perhaps more interesting tasks
- Highly efficient for bulk or frequent transfers
Single-processor system
One CPU
Multiprocessor systems
more than one processors, share a number of resources i.e share bus clock memory and peripherals
benefit - if one processor or cpu does not work properly you can still make use of the remaining one, although the process might be slower it will still work (this is called graceful degradation)
What is part of an operating system?
System Programs - Program loader, command interpreter
Language processors - C compiler, assembler, linker
Utilities - Text editor, terminal emulator
Subroutine libraries - Standard C library, maths library
System Calls
A call you make to an operating system
Typically written in a high-level language (C or C++)
Application Programming Interface
Specifies a set of functions that are available to an application programmer
Includes the parameters passed to each function
Also includes the return values that the programmer can expect
Output - number of bytes read, if successful
If -1 is a failure