Looks like no one added any tags here yet for you.
Why is an operating system required
It is software that controls the computer, manages the computers hardware and from which other programs can be run.
a collection of programs that work together to provide an interface between the user and computer
enable the user to communicate with the computer and perform low level tasks involving the management of computer memory and resources.
what are the different tasks an operating system performs
memory management
resource management e.g. scheduling
file management
utility software
security
user interface
what is memory management
when a program is run it is retrieved from secondary storage and placed. Memory stores the programs and data in use by the system.
what is file management
the processes and techniques involved in craeting, organising, accessing, manipulating, and controlling files stored on storage devices
what is interrupt handling
how does an operating system provide a platform for software to run
how does an operating system provide a user interface and provide utilities
how do operating systems manage memory
Computer memory must be shared fairly between multiple programs and applications being used. Often, main memory is not large enough to store all of the programs being used. One of the roles of the operating system is to determine and allocate the length of processor time each task receives through the use of paging, segmentation and virtual memory.
what is the purpose of paging
when memory is split up into equal sized sections with programs being made up of a certain number of equally-sized pages. These can then be swapped between main memory and the hard disk as needed
what is segmentation
Segmentation is the splitting up of memory into logical sized divisions, known as segments, which vary in size. These are representative of the structure and logical flow of the program, with segments being allocated to blocks of code such as conditional statements or loops.
what is virtual storage
Virtual memory uses a section of the hard drive to act as RAM when the space in main memory is insufficient to store programs being used. Sections of programs that are not currently in use are temporarily moved into virtual memory through paging, freeing up memory for other programs in RAM.
why is virtual memory needed in a computer system
enables data that is in RAM and not currently being used to be transferred to the hard disk. This frees up room in RAM for other programs and data.
how is paging used in virtual memory
Paging divides memory into sections or paging files. When a computer uses up its available RAM, pages not in use are transferred to the hard drive using a swap file. A swap file is a space set aside on the hard drive to be used as the virtual memory extension for the computer's RAM.
benefits of virtaul memory
Preventing the requirement to buy extra RAM
Enabling the execution of programs on machines larger than their physical memory
Executing several programs concurrently or multitasking
Increasing the rate at which our computer utilizes its physical memory
Permitting the deployment of a multiprogramming environment without any restrictions
Programs that can estimate the physical addresses of other programs increase data security
Making it easier to debug simultaneous execution of many applications
drawbacks of having and using virtual memory
As physical memory is faster and easier to access, computers prefer to use it over virtual memory.
Virtually stored apps may take longer to load because computers must transition between virtual and physical memory.
Thrashing is a phenomenon where a computer with little RAM always alternates between virtual and physical memory. Performance lags may result from the computer becoming slower as a result.
A computer's available memory is usually decreased if it has little secondary storage.
Additional hardware support makes transferring data between a computer's virtual and real memory easier.
Large apps take up virtual storage space when opened and stored, which is normally used by computers to store long-term data.
It lowers the overall performance and stability of the system.
What is the purpose of having interrupts
Interrupts are signals generated by software or hardware to indicate to the processor that a process needs attention. Different types of interrupts have different priorities and how urgent.
e. Interrupts are stored in order of their priority within an abstract data structure called a priority queue in a special register known as an interrupt register.
It is the job of the operating system to ensure interrupts are serviced fairly by the processor through the Interrupt Service Routine
why might an interrupt be generated
a printer signalling the completion of a print job or a peripheral signalling power failure.
what happens within the cpu and memory in order to call an interrupt service routine
The processor checks the contents of the interrupt register at the end of each Fetch-Decode-Execute cycle.
If an interrupt exists that is of a higher priority to the process being executed, the current contents of the special purpose registers in the CPU are temporarily transferred into a stack.
The processor then responds to the interrupt by loading the appropriate interrupt service routine (ISR) into RAM. A flag is set to signal the ISR has begun.
Once the interrupt has been serviced, the flag is reset. The interrupt queue is checked again for further interrupts of a higher priority to the process that was originally being executed.
If there are more interrupts to be serviced, the process described above is repeated until all priority interrupts have been serviced.
If there are no more interrupts or interrupts are of a lower priority to the current process, the contents of the stack are transferred back into the registers in memory.
The Fetch-Decode-Execute cycle resumes as before.
what is the need for scheduling things by an operating system
Another core function of the operating system is to ensure all sections of programs being run (known as ‘jobs’) receive a fair amount of processing time.
This is done by implementing various scheduling algorithms, which work in different ways. Scheduling algorithms can either be:
1. Pre-emptive Jobs are actively made to start and stop by the operating system. For example: Multilevel Feedback Queues, Shortest Remaining Time, Round Robin
2. Non pre-emptive Once a job is started, it is left alone until it is completed. For example: First Come First Served, Shortest Job First
what are the benefits of scheduling
what are the different scheduling algorithms
round robin
first come first served
multilevel feedback queues
shortest job first
shortest remaining time
what is round robin algortihm
Each job is given a section of processor time - known as a time slice - within which it is allowed to execute. Once each job in the queue has used its first time slice, the operating system again grants each job an equal slice of processor time. This continues until a job has been completed, at which point it is removed from the queue.
benefits and drawbacks of round robin
Although Round Robin ensures each job is seen to, longer jobs will take a much longer time for completion due to their execution being inefficiently split up into multiple cycles. This algorithm also does not take into account job priority
what is first come first served algorithm
jobs are processed in chronological order by which they entered the queue.
what are the benefits and drawbacks of first come first served algorithm
Although this is straightforward to implement, FCFS again does not allocate processor time based on priority.
what is multi level feedback queue
This makes use of multiple queues, each which is ordered based on a different priority
what is the benefits and drawbacks of multilevel feedback queue algorithm
This can be difficult to implement due to deciding which job to prioritise based on a combination of priorities
what is shortest job first algorithm
The queue storing jobs to be processed is ordered according to the time required for completion, with the longest jobs being serviced at the end. This type of scheduling is most suited to batch systems, where shorter jobs are given preference to minimise waiting time.
what are the benefits and drawbacks of shortest job first algorithm
However it requires the processor to know or calculate how long each job will take and this is not always possible. There is also a risk of processor starvation if short jobs continue being added to the job queue
what is shortest time remaining algorithm
The queue storing jobs to be processed is ordered according to the time left for completion, with the jobs with the least time to completion being serviced first.
what are the benefits and drawbacks of shortest time remaining algorithm
Again, there is a risk of processor starvation for longer jobs if short jobs are added to the job queue.
classification of operating system: distributed
This is a type of operating system which is run across multiple devices, allowing the load to be spread across multiple computer processors when a task is run.
classification of operating system: embedded
Built to perform a small range of specific tasks, this operating system is catered towards a specific device. They are limited in their functionality and hard to update although they consume significantly less power than other types of OS.
classification of operating system: multi-tasking
Multi-tasking operating systems enable the user to carry out tasks seemingly simultaneously. This is done by using time slicing to switch quickly between programs and applications in memory.
classification of operating system: multi-user
Multiple users make use of one computer, typically a supercomputer, within a multi-user system. Therefore a scheduling algorithm must be used to ensure processor time is shared fairly between jobs. Without a suitable scheduling algorithm, there is a risk of processor starvation, which is when a process is not given adequate processor time to execute and complete.
classification of operating system: real time
Commonly used in time-critical computer systems, a real time OS is designed to perform a task within a guaranteed time frame. Examples of use include the management of control rods at a nuclear power station or within self-driving cars: any situation where a response within a certain time period is crucial to safety.
What is the role of BIOS in a computer system
The Basic Input Output System is the first program that runs when a computer system is switched on. The Program Counter register points to the location of the BIOS upon each start-up of the computer as the BIOS is responsible for running various key tests before the operating system is loaded into memory,
what steps does BIOS go through to start a computer
what is meant by device drivers
- POST (Power-on self test) which ensures that all hardware (keyboards, disk drives) are correctly connected and functional
- Checking the CPU clock, memory and processor is operational
- Testing for external memory devices connected to the computer
The BIOS is critical to the computer system as it is only after these checks are completed that the operating system can be loaded into RAM from the hard disk. Bootstrap/ bootloader is them name given to the program that loads the operating system from the hard disk into main memory.
why are device drivers needed for communication between hardware and the operating system
Device drivers are computer programs which are provided by the operating system and allow the operating system to interact with hardware.
When a piece of hardware is used, such as a keyboard, it is the device driver that communicates this request to the operating system which can then produce the relevant output - which in this case is displaying a letter on the screen
-Device drivers are specific to the computer’s architecture, so different drivers must be used for different device types such as smartphones, games consoles and desktop PCs.
As drivers interact with the operating system, they are also specific to the operating system installed on the device.
what is meant by a virtual machine
vA virtual machine is a theoretical computer in that it is a software implementation of a computer system. It provides an environment with a translator for intermediate code to run.
how can virtual machines be used to execute intermediate code
Code that is halfway between machine code and object code is called intermediate code. This is independent of the processor architecture so can be used across different machines and operating systems.
advantages and disadvantages of virtual machines
Virtual machines are commonly used to create a development environment for programmers to test programs on different operating systems. The advantage of this is that it saves both the time and money of having to purchase multiple devices solely for testing. However, 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.
how can virtual machines be used to run a software driven machine inside a physical machine
Theres a layer of abstraction between a VM and its physical host. This abstraction layer is called a hypervisor. A hypervisor is a specialized software program that runs on the physical host and interacts with both the host machine and the VM, abstracting the host computers resources to the VM
The benefits and drawbacks of using virtual machines to run a software driven machine inside a physical machine
Performance Issues: Although virtual machines can benefit businesses in terms of cost efficiency and flexibility, they can also cause performance issues if not configured properly. Since multiple virtual machines share the same hardware resources, it can lead to decreased performance and efficiency.
High Initial Costs: Implementing virtual machines can be expensive as you must purchase the VM software and storage space. This makes it costlier than installing physical servers for each application. The disadvantages of virtual machines in cloud computing include the cost of cloud hosting platforms.
Security Risks: Although VMs are more secure than traditional physical servers, they still come with security risks, such as malware and malicious attacks within the virtual environment. To ensure maximum security, it is important to configure the VMs properly and use advanced security tools.