1.2.1 systems software Flashcards
What are the functions of an operating system?
- Managing the hardware
- Managing software (secondary storage loading programs in and out of RAM to be executed)
- Provide a user interface (so user can interact with hardware)
- manages system security
- provides a platform for utilities/applications
- manages external devices (efficient comms with devices and manage functionality issues)
- managing the processor/scheduling
- provides a platform for networking and multitasking
- memory management (paging, segmentation and VM)
- handle interrupts
What does an OS provide?(4)
- User interface
- Memory/resource Management
- Interrupt handling
- Processor scheduling
Name 4 common operating systems.
Windows, Android, Linux, iOS
What is the kernel?
- the core of the operating system that provides basic services for all other parts of the OS.
What are the tasks of the kernel?
- Loading and unloading programs from RAM
- CPU scheduling
- Memory management
- Storing files to and from storage
- File management
- Data security
Why do different operating systems have different kernels?
Because different devices have different priorities.
e.g. A kernel for a mobile phone will need to be as power efficient as possible whereas one for a desktop will be optimised for performance
What are device drivers? (think of mr caselton vs bus driver who act as software)
- software installed which enables communication between OS and device so OS can interact with and control it.
- Mr Caselton can drive but can’t use all bus functionality. Bus driver (software) has more capability.
What does a device driver do?
- Translates commands from the OS into series of hardware specific commands that only that device understands. The device can also pass data back to the OS using the device driver.
Device drivers are…
hardware dependent and OS specific
Who makes the driver for a specific device?
The company who created the device.
What is a user interface? What does it contain.
- Software that allows the user to interact with computer’s hardware.
- WIMP (Windows, Icons, Menus, Pointers)
Name two user interfaces.
GUI and CLI
what is a GUI. Give advantages and disadvantages
- graphical user interface
- uses WIMP (Windows, Icons, Menus, Pointers) to provide clear graphical interface for user to control computer.
- visual, interactive and optimised for mouse and touch gesture input
- allows for multitasking
- can take longer to perform tasks
- more resource intensive
- requires more power (more data involved)
What is a CLI. Give advantages and disadvantages
- command line interface
- allows user to type commands directly into the computer.
- more reliable + more control due to direct communication from commands
- requires less power
- hard to use without knowledge of commands. But if experienced, its fast to use
Give 3 examples of utilities.
(utilities help to maintain the computer)
- Print queue
- File management
- Encryption software
- Compression Software
- Antivirus
- Disk defragmenter
What is the job of the memory manager?
- Allocating memory to each program that runs
- Mapping logical addresses to actual physical addresses
- Prevents programs from overwriting each other
- Moving files to virtual memory when running short on RAM
Give two ways that an operating system manages memory.
Paging (Pagination) and Segmentation
Give some similarities about paging and segmentation
- both allow programs to run despite insufficient memory
- pages and segments are stored on disk
- pages and segments are transferred into memory when needed
- Allows programs to be stored in memory non-contiguously
- both are ways of partitioning memory
Give 3 differences about paging and segmentation
- pages = fixed size, segments = different sizes
- pages made to fit section of memory, segments are complete sections of program
- pages are physical divisions but segments are logical divisions
How does segmentation work?
- An application running is split into processes (segments)
- Each segment is a complete section of program that is allocated a space in RAM and executed separately.
- The large program is run by running the smaller segments as required.
What does segmentation do?
- Allows a program to be run on a system without using up too much memory.
what are segments?
- logical divisions of varied sizes
What is the code segment?
A segment which holds the executable instructions for the process.
What is the data segment?
A segment which holds all of the variables for the process.
What is the stack segment?
A segment which holds the memory addresses for the process which is running.
What is the free memory segment?
A segment which allows the stack segment to grow and shrink as necessary.
How does segmentation prevent files from overwriting each other?
All the processes have a set section of memory which is controlled by the OS.
What is virtual memory?
- allocated section of the hard disk which can be used as memory when the memory is full.
- Pages that aren’t needed are moved to VM and moved back to physical memory when required
Why is virtual memory not ideal to use? (why do instruction currently being run have to be on RAM and not on hard disk)
Because the hard disk is much slower than the RAM.
what are pages
- physical divisions of fixed size to fit into sections of memory
- programs split up to fit into a given number of pages
How does paging work?
- RAM split up into numbered pages, each 4MB in size. Then can be assigned to non-contiguous memory locations in RAM
- this method doesn’t take into account how the program is split (it could split looping instruction –> inefficient)
- Pages that have not recently been used can be copied from the RAM into virtual memory to free up space in RAM.
What is disk thrashing and explain the implications?
When more time is spent swapping data (pages/segments) in and out of RAM than on actually processing the data.
- increases amount of time OS spends on management tasks + is witnessed through slowing of operations on computer.
What is a memory leak?
When a program does not flush its used data and so it takes up more and more space the longer it runs.
What will happen if a memory leak is bad enough?
The RAM will be completely full and the system will require restarting to clear the contents of the RAM.
Why is a memory leak less likely to happen to a well written program?
Because a well written program will regularly flush out the used data that it no longer requires, freeing up space in RAM.
What is a stack overflow?
The more memory addresses are used in a process, the more the stack segment expands into the free memory. If the stack segment gets too big, then it overflows, causing the program to crash.
What are the main two ways that the CPU reacts to events?
Polling and interrupts.
How does polling work?
The CPU regularly checks to see if any peripherals or applications require attention.
Why is polling good?
It is very simple and predictable.
Why is polling inefficient?
It uses up CPU processing time waiting for potentially nothing to happen.
What is an interrupt?
A signal produced by either hardware or software which tells CPU it requires the processors attention and that the current task should be stopped and carry out the interrupt task instead.
what is the code called that is run when an interrupt is flagged
- interrupt service routine
what is the interrupt service routine
- a software routine that hardware or software invokes in response to an interrupt
How does the CPU know whether the interrupt task is more important than the task currently being executed?
Because an interrupt comes with a priority label. If this is higher than the task currently being executed then it replaces this task.
How does a CPU process an interrupt? (ISR)
- pushes values of registers onto stack in a stack frame
- contents of PC changed to point to address of 1st instruction for interrupt. Then, process the interrupt
- Once interrupt complete, pop frame off top of stack to reload values into registers + carry on executing where original program left off
how is using the stack data structure beneficial (relate to if higher priority interrupt (ISR B) is sent through but ISR A is trying to be executed)
- the previous program/ ISR A can be suspended, pushing contents onto top of stack to start executing ISR B of higher priority. Once completed, pop frame off top of stack to retrieve values of ISR A, load them into registers and carry on executing ISR A
What is scheduling?
The way that the processor time is managed when multiple programs want to use it.
a scheduler manages what 2 things
- which process to execute next
- length of time the next process can execute for
Aims of scheduling
- provide acceptable response time to all users
- maximise time the CPU is usefully engaged (make most efficient use of processor)
- ensure fairness on a multi-user system
- Prevent processes from failing to run / Process starvation / Deadlock
Explain why scheduling is necessary (4 marks)
- Process as many jobs as possible in least possible time, not preventing processes
- Ensure all jobs are processed fairly
- Maximise number of interactive user with fast response times (real time)
- Efficient use of resources / processor time
What are the duties of the scheduler?
- Processing as many tasks as possible in given amount of time
- Prioritising jobs
- Altering priorities when needed
- Ensuring no job is left waiting too long, even at low priority
- Minimising delay between user request and action
what happens if a process enters the running state but requires data from hard disk
- Hard disk = very slow compared to CPU –> process blocked until input request has been serviced
- Next process can enter running state. While process is running, the process that got blocked receives data it needs
- Therefore, an interrupt is generated to tell scheduler it can re-join queue
Describe the Round Robin (RR) scheduling algorithm.
- queue holds all processes ready to be run.
- First process is loaded + given set amount of time to run (time slice).
- If it’s completed in time, next process loaded
- If it isn’t then it’s sent to back of queue + next process is loaded.
Give a pro and con of round robin.
- Useful if all processes are the same length and priority
- Not useful if processes vary in length and priority as it does not take these into account
Describe the first come first serve (FCFS) scheduling algorithm.
- Loads all processes into queue. Then gives them as long as they need to run before loading next process.
- think like a supermarket queue
Give a pro and con of first come first serve.
- It is simple to implement and ensures that all jobs will complete in minimum time once they have started.
- Doesn’t consider length and priority (long processes will block more important ones from taking place + once job starts it prevents others from being processed)
Describe the shortest job first (SJF) algorithm.
- scheduler organises processes into a queue based on number of cycles (time) they take. They are executed in this order.
- When a new task comes along, it’s slotted into correct place in queue.
- If it’s shorter than whole queue then current task is interrupted.
Give a pro and a con of the shortest job first scheduling algorithm.
- Ensures that the maximum number of jobs are completed
- Does not take priority into account - long jobs may be waiting for a long time
Describe the shortest remaining time (SRT) scheduling algorithm.
SIMILAR TO SHORTEST JOB FIRST BUT
- scheduler organises processes into queue based on how many cycles they have left instead of their total number of cycles.
- SRT is a pre-emptive algorithm so processes can be suspended if higher priority process joins queue
Why is shortest remaining time better than shortest job first?
Because if a long job is executing or is interrupted, it may have a low amount of cycles left out of a high total number of cycles. SJF would keep this at the end of the queue due to its high total cycles meaning that it wouldn’t be run however SRT will move it to the front because it will take less time to execute than lots of smaller processes.
Describe the multilevel feedback queue scheduling algorithm.
- Scheduler organises processes into one of 3 ready queues, each with a different scheduling algorithm, based on their priorities to promote or demote processes (high priority queue always executed first)
- Scheduler can reallocate processes from one queue to another if it became more important / has been waiting too long.
(I/O bound processes sleep in wait queue to give other processes CPU time)
Give a pro and con of multilevel feedback queues.
- They take priority into account (only one)
- They are complicated to implement and are no more useful if the processes are all the same priority
Non pre-emptive algorithms
- First come first serve
- shortest job first
Pre-emptive algorithms
- Round Robin
- Shortest Remaining Time
- Multi-level feedback queue
Pre-emptive
- ‘Pre-emptive’ algorithms are able to interrupt a job during its running state and move it into a ready state.
non pre-emptive
- ‘Non pre-emptive’ algorithms aren’t able to interrupt a job during its running state and must wait for it to finish before loading another.
what is multitasking
- more than 1 program open and running simultaneously
How does an operating system provide a platform for multi-tasking
- O.S manages available space in RAM and allocates memory for tasks held in a queue to allow processor to multitask
What is a multitasking OS?
- allows multiple processes to be carried out at the same time, or at least gives the illusion of this by using time slicing.
- Scheduler in charge of switching between multiple processes to keep all applications up to date. - Because it’s so fast, it appears to user it’s all happening at once.
Give some examples of a multitasking OS.
Windows, Android, Linux, macOS
What is a multiuser OS?
- Multiple workstations connected to single server through a network.
- The workstations don’t run their own OS but rely on OS of central computer to allocate them resources.
- when users logs on, their customisation and access rights/permissions are managed by computer
Where are multiuser operating systems usually found?
- Offices
- Schools
Why are multiuser operating systems useful for businesses?
- allow easy sharing of files
- Any update applied to main computer is instantly available to all workstations
- Antiviruses apply to all workstations (security managed centrally)
State what is meant by a distributed system. [1]
- A system which shares processing (between the processors on a network) / shares the data between different systems (on a network in order to reduce bottlenecks).
What is a distributed OS?
- you can combine processing power of multiple computers across a network for a single task
- In distributed computing, OS controls host/cluster of different computers (on LAN or series of LANS) at a time in order to complete task which requires a lot of computing power, returning results to a central server.
- Presents computers to user as if they were a single powerful system
What is Distributed computing?
- the method of making multiple computers work together to solve common problem.
- It makes a computer network appear as a powerful single computer that provides large-scale resources to deal with complex challenges.
What is a distributed OS an example of?
Parallel processing
Where might distributed operating systems be used?
- Testing new drugs
- Online shopping (basket handled by 1 server while the querying of items handled by another. as system gets busy with more user requests, additional server will automatically join system)
What is a real time OS?
- intended to handle input data as soon as it arrives within guaranteed time (latency), typically without buffering delays
- very reliable + has very precise and consistent timings.
- vital for safety-critical environments like medical monitoring systems, aircraft autopilot, missile and car management systems.
- Real time OS usually have plenty of redundancy meaning CPU and memory can never be at maximum capacity.
How does a real time OS handle two inputs which arrive at the same time?
It orders them by priority and then handles them in this order.
Where are real time operating systems commonly found?
Aeroplane systems
Car engine systems
Robot control systems
What is an embedded OS?
- highly specialised OS which may control a device like ATM’s, cars, dishwashers or microwaves.
- It’s designed with dedicated hardware to carry out one task so it will be coded to do this with max. efficiency using low-powered processors and very little memory.
- Not designed to multitask but may react in real time.
list some features of embedded systems
- designed for single purpose
- includes single or no interface
- often resource limited
what is an embedded system
any computer systems (hardware and software) with a dedicated function within a larger mechanical or electrical system.
Is BIOS part of the operating system?
NO
What is BIOS?
- small piece of software responsible for checking the hardware is present and functioning (uses bootstrap which performs POST) before loading the OS kernel into RAM.
Where is BIOS stored?
In a small chip of non volatile memory on the motherboard.
what would be the effects if BIOS is overwritten
- computer wouldn’t be able to boot / load OS
- cant do initial configuration / hardware checks. These 2 things make the computer unusable
How does the BIOS communicate with the user and vice versa?
Through very basic user interface (CLI) and also through beeps to communicate error codes.
What is a virtual machine?
- piece of software which has the same functionality as a physical computer
(simulates fully functioning computer by using resources from a host computer)
Give an example of how a virtual machine is used
- to emulate arcade games from 1980’s onto todays hardware
- develop game on PC but use emulator for another device (games console / phone) to test program before release
How many virtual machines can you have running on a single host?
Multiple
can emulation be used to support a large number of virtual servers spread over a small number of physical servers?
YES
(example: 4 physical servers can run 6 virtual servers)
how can a large number of virtual servers be utilised
- as demand on network increases, additional servers can be spun up and the load balanced across different physical devices
- if 1 server stops working, others can pick up load and continue working as if nothing happened
what are virtual servers
- process of using software to create multiple instances of a server
what is a virtual network
- non-physical private network that runs on public / existing network
- can combine 1 or more physical networks into 1 logical network (partitions physical network)
- users in virtual network can only access data in virtual network but can join network from an location
What are the benefits of running an operating system on a virtual machine?
- Old incompatible applications can be run
- Multiple operating systems can be run
- Real computer can be protected from malware by opening files in the VM
How are virtual machines used to run intermediate code?
- Instead of recompiling code to run on multiple different operating systems, you can write the code to run on a VM and then just run that VM on the computer which you want to run the program on.
Many programs do this automatically.
Describe a commonly used virtual machine for running intermediate code.
Java Virtual Machine compiles its code into intermediate code (bytecode)
- this code is then translated by JVM which is running on a target device which then translates it into specific machine code
- this process makes java code highly portable between different devices
what is a JVM
- interpreter that translates intermediate code
Define the term “systems software”
program designed to run a computers hardware and applications, and manage its resources (memory, processor and devices). It also provides a platform for running application software. System software is typically bundled with computers OS