Software Systems and Operating Systems (Week 7) Flashcards
What are two major types of software?
- Operating Systems (OS), e.g., Windows, MacOS, Linux, Android
- Application Programs, e.g., Web browsers, text processors, spreadsheet software, image viewer, etc.
Why do we need an operating system?
Early computers could only run one program at a time.
Today, they can handle multiple users and multiple tasks at a time.
* OS manages resources and coordinates applications;
* OS provides services for applications, e.g., storage of data in files;
=> applications do not have to worry about every system detail
* Programs use the same resources and naturally get in each others way.
What are the 4 main responsibilities of the operating system?
The operating system…
- Controls and allocates the resources of a computer, above all else how much CPU time each application gets;
- Manages and allocates RAM to applications;
- Manages information on storage devices e.g., files on hard drives, optical drives, thumb drives;
- Manages and coordinates the activities of peripheral devices connected to a computer.
e.g., if you plug in a printer, a microphone or a speaker, the OS makes them available to be used by applications.
What are the 4 main responsibilities of the operating system? (Simpler version)
- Control the CPU / Processing Unit
- Manage RAM
- Manage Storage
- Manages and coordinates the activities of peripheral devices connected to a computer
Describe OS Responsibility 1 - Control the CPU
- At any given moment, only one process can use (= is being executed by) a CPU core
- Active applications and background processes (e.g. virus scanner) share the CPU and are executed consecutively
- It is the OS ́s responsibility to decide, which process gets to run (on which core), when and how long (scheduling)
- OS can prioritize (increase CPU time) or also suspend (pause) a process, e.g. if it is waiting for data from a network to arrive
What is a Process?
- A program currently being executed is called a process
- Typically, dozens of processes run at the same time
- The Task Manager (Windows) or Activity Monitor (macOS) allows us to view information about processes
Describe OS Responsibility 2 - Manage RAM
OS loads a program into RAM before the process is started
* To be executed, program code must be available in RAM
OS decides how much RAM will be allocated to each process
* A process needs to ask OS for permission to use more memory
RAM is a limited resource, especially if you run a lot of processes that work with lots of data, e.g. large images, videos, etc.
OS can move memory content of a process out to disk temporarily if RAM is needed for the next process to run
* This is called memory swapping and slows down execution significantly (because any disk is much slower than RAM)
What is Virtual Memory?
OS shows each process only those RAM segments that are assigned to this process (Virtual Memory)
The purpose is to keep processes from interfering with each other
* Makes sure a process doesn’t overwrite or read (spy on) RAM being used by another process
* This is called Memory Protection
Describe OS Responsibility 3 - Manage Storage
To manage information stored on disks, OS ́s use a “file [management] system” which is responsible for:
- How files are physically stored on disks,
e.g. which platter/sector/track of a hard disk is used - How files are organized logically,
e.g. names, folders and sub-folders - How permissions to access files are organized,
e.g. read, write and execute permissions - Providing services for applications to create and modify files
Describe the Physical Organization of Storage
Any data on drives is stored in blocks of equal size, e.g. 4096 bytes
A file that is larger than a block is spread out over several blocks (a block may be only partially used, but never for more than one file)
The OS keeps records of all blocks used by a file
If files are deleted, only the folder entry is removed, but data in blocks remains on disk until blocks are reused to store other files
What is Peripheral Device Coordination?
device management
handling input and output, and controlling peripheral devices such as disk drives and printers.
handles the translation of requests between a device and the computer. Defines where a process must put outgoing data before it can be sent, and where incoming messages will be stored when they are received.
What are 6 major Operating Systems?
Unix: 1969, Bell Labs – research center
DOS (Disk Operating System): 1981, Microsoft
* Developed for IBM ́s first Personal Computer
* Used via command line interface (CLI)
Mac OS: 1984, Apple
* One of the first OS with graphical user interface (GUI)
* Mac OS X (2001) and iOS (2007) is to a certain extent based on Unix
Windows: 1985, Microsoft
* Was first only an extension to DOS; “grown up” OS since 1995
Linux: 1991, Open Source
* UNIX-like, but developed independently (started by Linus Torvalds)
Android: 2007, controlled by Google
* Based on Linux
What is Folder Hierarchy and how does it work?
Logical organisation of files is based on a tree structure
=> a hierarchy of folders/directories
It is largely independent from the physical organization
* (blocks) of data on the hard disk, optical disc, etc.
Location of a file in this tree is called path
Windows paths begin with a drive letter,
e.g. D:\My Documents\TEACHING\105\Grades.xls
Linux and MacOS paths start with the root directory / and drives are “mounted” to a directory
e.g. /mnt/d/My Documents/bestfilms.txt
What is Remote Storage?
Network file systems: used to access files that are stored on remote computers (file servers) via network,
e.g. your Camosun M: drive is hosted on a file server
What is Redundant Storage?
Redundant Array of Independent Disks (RAID)
* Multiple disks are used in combination to provide redundant storage and/or higher speed
* Redundancy: multiple copies of each data item are stored on different disks
e.g. each block of a file, in this case A1, A2, A3
and A4 is stored on both disks 0 and 1
* If one disk crashes, data remains unharmed