SLR 4 - OPERATING SYSTEMS Flashcards
What is a software?
a program that runs on a computer
What are the 2 main types of software?
- operating systems
- application software
What is an operating system?
a collection of programs that manages the hardware and software of a computer system including sharing the computer’s time, memory, hardware and other resources
What are the functions of an operating system?
- file management
- input/output management
- resource allocation
- process management
- networking management
- user management
- user interface
What is paging?
- partitioning memory into fixed sized physical divisions called pages
- processes in memory will be assigned an appropriate number of pages
What are the 3 features of pages?
- fixed sizes
- made to fit sections of memory
- physical divisions
What is segmentation?
- partitioning memory into variable sized logical divisions called segments
- a large program can be executed by consecutively running its segments
What are the 3 features of segments?
- different sizes
- complete sections of programs
- logical divisions
What are the similarities between paging and segmentation?
- both allow programs to run despite insufficient memory
- both pages and segments are stored on disk and transferred to memory when needed
What are the differences between paging and segmentation?
- pages are fixed sizes whereas segments are different sizes
- pages are physical divisions whereas segments are logical divisions
- pages are made to fit sections of memory whereas segments are complete sections of programs
What is virtual memory?
an allocated area of secondary storage where pages of inactive jobs are swapped into to free up enough RAM for the current job
What are the different types of OS?
- distributed
- multi-tasking
- multi-user
- embedded
- real-time
What is a distributed OS?
a distributed OS is spread over multiple computer servers on a network, acting as a single system to parallel process a job
What uses a distributed OS?
online shopping sites
What is a multi-tasking OS?
- an OS capable of running many tasks simultaneously
- each active program is scheduled to receive a tiny time slice in quick rotation, giving the impression that they are operating at the same time
What is a multi-user OS?
- OS consisting of one mainframe computer with multiple terminals that allow multiple users to access the computer’s resources
- each user is given a time slice of the mainframe processor
- computer will manage user’s various permissions and access rights when they log on
- server OS software will handle the requests of multiple people using diff computers on a network at the same time
What is an embedded OS?
- specialised OS with limited resources and functionality, built in to control a single machine
- tend to run on dedicated hardware so they run with max efficiency using low-powered processors and very little memory
What is a real-time OS?
- an OS that generates responses within a guaranteed time frame
- plenty of redundancy built in so they can handle sudden increases in input
Give 2 examples of uses of a real-time OS?
- self-driving cars
- hospital monitoring machines
What is a device driver?
- a program supplied with a peripheral device that allows the OS to control and communicate with the device
- translates OS instructions into a series of instructions that a specific piece of hardware can understand
What is a virtual machine?
a program that has the same functionality as a physical computer
What are the uses of virtual machines?
- running alternative operating systems
- supporting incompatible software
- creating a test system
- running multiple servers
What is the adv of using a virtual machine to create a development environment for programmers to test programs on different operating systems?
it saves both the time and money of having to purchase multiple devices solely for
testing
What is a disadv of virtual machines?
running intermediate code in a virtual machine can also be considerably slower compared to running low-level code on the device it was designed for
What is intermediate code?
- Intermediate code is a low-level representation of a program that is between the high-level source code and the machine code, often used in compilers.
- Code partly translated between high-level and machine language
produced by a compiler
Why is intermediate code used in compilers?
It allows for easier translation of code between different architectures and optimizations, providing a platform-independent representation before final machine code generation.
What is an example of a language that uses intermediate code?
Java uses bytecode as intermediate code, which is then interpreted or compiled into machine code by the Java Virtual Machine (JVM).
What is bytecode?
Bytecode is a form of intermediate code used by some programming languages like Java, which is executed by a virtual machine (e.g., JVM).
What is the role of a virtual machine in executing intermediate code?
A virtual machine interprets or compiles the intermediate code into machine code for the host system to execute, ensuring platform independence.
How does intermediate code improve portability?
Intermediate code can be executed on any platform with the appropriate virtual machine, making the program portable across different hardware systems.
How is intermediate code different from machine code?
Intermediate code is not specific to any one hardware platform, while machine code is tailored to a particular architecture and is ready for execution by the hardware.
What is the purpose of the Just-In-Time (JIT) compiler in relation to intermediate code?
The JIT compiler converts intermediate code (e.g., Java bytecode) into machine code at runtime, optimizing execution for the specific hardware.
What are the advantages of using intermediate code?
Advantages include portability, easier debugging, and the ability to optimize the code before generating machine code.
What is an example of an interpreter using intermediate code?
The Python interpreter converts Python source code into intermediate bytecode, which is then executed by the Python virtual machine.
What is an interrupt?
A signal from hardware, software or the clock to alert the CPU. If the interrupt is a
higher priority than the current task, the current routine pauses and resumes after the
interrupt is executed
What is the interrupt service routine (ISR)?
- a program with a set of instructions that need to be fetched, decoded and executed to carry out the operations of the interrupt
- if an interrupt is a higher priority than the current task, register contents are temporarily transferred onto the system stack at the end of the current FDE cycle and the interrupt is handled
What are some types of interrupts and examples?
- hardware (power supply failure, power reset button pressed, power down command)
- user (moving the mouse, clicking an icon, keyboard presses)
- software (illegal instruction encountered, arithmetic overflow, new log-on request)
- input/output devices (buffer nearly empty, signal completion of data transfer to/from a device, printer ink supply notification)
What is the Basic Input Output System (BIOS)
- a program that initialises and tests whether system hardware is functional and then loads the operating system from the hard disk into RAM
when the computer is turned on - responsible for loading the OS when the computer first turns on
- 1st checks that all hardware is connected and working using power on self test (POST)
- bootstrap used to load OS kernel into memory
- OS can then take over and boot up the rest of the system
Where are initial start up instructions stored?
ROM
Where are BIOS settings stored and why?
- stored on flash memory
- so they can be changed and are also retained when power is switched off
What is the role of the scheduler in an operating system?
The scheduler manages the execution of processes, deciding which process should run next, to optimize CPU utilization and ensure system performance.
What is non-preemptive scheduling?
Non-preemptive scheduling does not interrupt a running process. Once a process starts executing, it runs to completion or until it voluntarily relinquishes control of the CPU.
What is preemptive scheduling?
Preemptive scheduling allows the operating system to interrupt a running process and switch to another process, typically to ensure fairness or give higher-priority processes more CPU time.
What is the First-Come, First-Served (FCFS) scheduling algorithm?
FCFS is a non-preemptive scheduling algorithm where processes are executed in the order they arrive in the ready queue, without preemption.
What is a disadvantage of First-Come, First-Served (FCFS) scheduling?
FCFS can lead to the ‘convoy effect,’ where short processes are delayed behind longer ones, causing high average waiting times.
What is Shortest Job First (SJF) scheduling?
SJF is a non-preemptive algorithm that schedules processes based on the shortest estimated burst time. The process with the shortest burst time is executed first.
What is the disadvantage of Shortest Job First (SJF) scheduling?
SJF can cause starvation of longer processes, as shorter processes may continuously arrive and be executed first.
What is Round Robin (RR) scheduling?
RR is a preemptive scheduling algorithm that allocates a fixed time slice (quantum) to each process. When the time slice expires, the process is moved to the back of the ready queue.
What is the main advantage of Round Robin (RR) scheduling?
RR ensures fair CPU time distribution among processes, making it ideal for time-sharing systems.
What is Priority Scheduling?
Priority scheduling assigns a priority to each process, with the process having the highest priority executed first. It can be preemptive or non-preemptive.
What is Multilevel Queue Scheduling?
Multilevel Queue Scheduling divides processes into multiple queues based on priority or type (e.g., interactive, batch). Each queue may have its own scheduling algorithm.
What is Multilevel Feedback Queue Scheduling?
Multilevel Feedback Queue Scheduling allows processes to move between different priority queues based on their behavior and execution history, offering dynamic adjustments.
How does Multilevel Queue Scheduling differ from Multilevel Feedback Queue Scheduling?
In Multilevel Queue Scheduling, processes are statically assigned to queues based on their type, while Multilevel Feedback Queue Scheduling allows dynamic movement between queues depending on process behavior.
Describe the process of process blocking?
- process 1 enters the running state
- it required data from the hard disk while running
- hard disk is slow compared to the CPU so process 1 is blocked until input request has been serviced
- process 2 can enter the running state
- while process 2 is running, process 1 receives the data it needs
- it then generates an interrupt to let the scheduler know it can rejoin the ready queue