121-operating-systems Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Operating system

A
  • system software that manages and controls the computer system to make sure its efficient
  • provides an interface that manages drivers, files, and users
  • performs low-level tasks such as managing computer memory and resources
  • allows multitasking and loads various programs into memory so they can be executed.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Function of a OS

A
  • enable user to communicate w/ computer (provides user interface)
  • resource management (scheduling)
    -provides interface between all other software applications (API - application program interface), and hardware
    -provides platform for software to be installed and run on
    -management of interrupts, peripherals (sends output to device drivers n receives inputs from devices)
    -provides utility software for system maintenace
  • provides security and manage users (e.g user access levels, accounts password, administrator privilege policies and etc e.g can set only user student can read, not write).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

User interface

A

part of a computer program or system that allows a user to interact with it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Fixed and roaming profiles for a user:

A

fixed profile - ensures every user has the same desktop and settings
roaming profile - allows users to customize their settings which follows them when they log into different computers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Graphical user interface (GUI)-

A
  • Uses windows, toolbars, icons used to represent resources n actions visually. Optimised for mouse and touch gesture input.
  • type of GUI; WIMP (windows, icons, menus, pointers).
  • Ideal for beginners/accessible by most users- easy, simple, interactive to understand/learn/ use, eliminates need to learn commands and aesthetically nice visual
  • takes up more memory, less flexible, does not have same level of functionality as CLI, slower.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Command Line Interface (CLI)-

A
  • terminal, commands line, code to give instructions/ interact.
  • used by network engineers and experienced users
  • Very fast + powerful, greater flexibility of use, customisable with batch scripts,
  • complex to understand, less appeal as its text, difficult to learn
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Kernel

A
  • part of os that does low-level management n low-level hardware operations.
  • Applications make use of kernel when they want to operate computer’s hardware
  • many systems make use of the linux kernel e.g GPS, mp3 players, smartphones.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Resource Management/Multitasking:

A

-allows for more than one program to run at the same time
-programs held in queue. Scheduling. - Allocates small amounts of processor time to each process, cycling between them quickly
-only possibly if enough ram to hold more than one program in memory at once. Possible with VM.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

File Management:

A
  • Data is stored in files, with an extension determining which application to open the file with e.g file.py
  • Over time, hard disks become fragmented with files
  • Operating systems present a logical structure of files in folders (user’s benefit and doesn’t exist like that on the actual storage medium)
  • and allow users to rename, delete, copy, and move files
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

User Management:

A
  • Allows multiple users to log into the same computer
  • Each user has different access rights to files and programs
  • Operating systems retain settings for each user, such as icons and desktop backgrounds
  • Client-server networks may impose fixed or roaming profiles for users and manage login requests to the network.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Memory Management:

A
  • Freeing up memory is essential to ensure optimal performance of the computer system. When a program is closed, the allocated space is freed up for use by other programs, loaded into memory from secondary storage.
  • Memory must be shared fairly between multiple programs and applications, so more than one program/document can be open at the same time
  • OS determine and allocates the memory each program receives through paging, segmentation, and VM
  • Different processes have different areas of memory allocated to them to prevent data from being overwritten or lost.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Buffering

A
  • provides a temporary storage area for processes to dump outputs and store temporary data, avoiding collisions between different processes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Paging:

A
  • Physical divisions: does not take into account program contents, memory is divided into fixed-size pages and programs are split up to fit into the given number of pages. e.g separating instructions inside a looping condition into different pages would be inefficient
  • internal fragmentation (wasted unused memory allocation as fixed)
  • Pages can be swapped between main memory and hard disk as needed
    -page placed in special file called pagefile in HDD and swapped out for a page already in RAM, when needed
  • programs/data can be held in non contiguous memory locations using virtual addressing, making it easier to make best use of remaining storage/to avoid having i move context around to fit in new programs. it allows pages to be transferred from secondary storage (i.e. virtual memory)
    as random access there is no performance drop vs sequential storage
    space inside a page may be wasted as program is unlikely to take up exact number of oages, hower all pages can be used with no wasted space between them
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Segmentation:

A
  • Logical divisions: memory is divided into segments of varying (dynamic) sizes.
  • Segments are representative of the structure and logical flow of the program
  • Segments are allocated to complete sections of code/programs -e.g conditional statements are kept together in a segment for efficiency
  • external fragmentation (free memory not contiguous enough after too many, e.g think of defrag cases , is similar))
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Similarities and Differences of Paging and Segmentation

A

Similarities:
- Pages and segments are stored on the backing store (part of hard disk/is vm)
- Pages and segments are transferred into memory when needed.
- Both are ways of partitioning/splitting up memory.
- Both use virtual memory/backing store to swap parts of programs.
- Both allow programs larger than memory to run/insufficient memory and allow programs to be stored in memory non-contiguous.

Differences:
- Pages are fixed sized, while segments are different sizes.
- Pages are made to fit sections of memory, while segments are complete sections of programs.
- Pages are physical divisions, while segments are logical divisions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Virtual Memory:

A
  • Uses part of hard drive/secondary storage as temporary storage when the space in main memory is insufficient to store programs/full
  • Sections of programs not currently being used are temporarily moved into VM
  • frees up space in RAM so that it can be filled up with new data/programs in use
  • When data in virtual memory is needed, it is moved back to RAM
  • Lets you run applications larger than what RAM can support, allowing more memory to be used than there is in the system, and allows programs to be opened when RAM is full
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Virtual Memory Disk Thrashing:

A
  • when main memory is not big enough to fit all the currently active processes
  • CPU has to constantly swap files to/from the backing store(hard disk/vm)
    -Transferring data between virtual memory, RAM, and the CPU takes processor time
    -When pages/segments of data are swapped too frequently between the hard disk and main memory, more time is spent transferring pages between main memory and the hard disk than executing instructions.
  • which can cause the system to hang or crash due to overuse of vm, and slows down CPU performance (disk thrashing)
  • As virtual memory becomes more filled, the problem worsens.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Interrupt

A
  • signals sent to the CPU to obtain processor time, come from control bus and are stored in the interrupt register.
  • often triggered by devices indicating they need to be serviced/higher priority process/exception needs to be handled
  • each interrupt triggers the execution of an Interrupt Service Routine (ISR).
  • also used to handle events such as hardware errors, user input, and real-time operations.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Interrupt Register

A

special register where interrupts are stored in order of priority within an abstract data structure (priority queue).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Interrupt Service Routine (ISR)

A
  • program ran when an interrupt is made.
  • set of instructions that need to be fetched, decoded, and executed to carry out the operations of the interrupt.
  • handles the interrupt request by interrupting the current active process.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Interrupt Handling

A
  • processor checks interrupt register every time FDE cycle is finished
  • priority of current task/executing process compared to priority of task in interrupt register to avoid delays and data loss.
  • If interrupt w/ higher priority than current process then serviced, contents of registers are temporarily pushed into a stack.
  • program counter contents change to point to the address for the first instruction of the interrupt
  • processor responds to the interrupt by loading the appropriate ISR into RAM associated w/ the interrupt, and fetch, decode and executes it.
  • when the ISR is complete, the interrupt queue is checked again for further interrupts.
  • if none, processor retrieves the previous values for the original program/in the registers (popped off the stack) and carries on executing the original program/instruction where it left off.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Role of an interrupt

A
  • allow processor to handle events that require immediate attention without wasting processing cycles by continuously polling for them.
  • increase efficiency and responsiveness of the system by allowing the processor to perform other tasks until an event occurs that requires its attention.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

types of interrupts:

A
  • Hardware Interrupts by external hardware devices (e.g. keyboard, mouse, NIC) when they need the processor’s attention e.g power supply failure, power/reset button pressed, power-down command.
  • User Interrupts by user actions (e.g mouse movement, clicking icon, keyboard presses)
  • Software Interrupts by software programs (e.g system calls , error or exception) e.g illegal instruction encountered, arithmetic overflow, new log-on request.
  • Maskable Interrupts: Can be disabled or delayed if the processor is busy handling a higher priority interrupt.
  • Non-Maskable Interrupts (NMI): Cannot be disabled or delayed and always have the highest priority. critical events such as system crashes or power failures.
24
Q

Scheduling

A
  • process of managing which process to execute next and the length of time it can execute for.
    -maximising use of processor time between open processes
  • scheduler is required in multitasking operating systems to give the appearance of multiple tasks executing at the same time.
25
Q

What is the difference between pre-emptive and non pre-emptive scheduling?

A

Pre-emptive: actively starting and stopping jobs by the operating system. round robin, multilevel feedback queues, shortest remaining time.
Non pre-emptive: leaving a job alone once it has started until it is completed. first come first served, shortest job first

26
Q

Why are scheduling algorithms important?

A
  • efficient use of the processor time/resources
  • be fair to all users/applications
  • provide a reasonable response time
  • prevent processes from failing to run/process starvation/deadlock
  • process as many jobs as possible in the least possible time/quicker
  • ensure all jobs are processed (fairly)
  • maximise number of interactive users with fast response times/real time
27
Q

Round Robin (pre-emptive)

A
  • Each job allocated a fixed section of processor time (time slice), if not finished it’s suspended and next process starts. Cycles through them until job is completed and removed from queue.
  • simple, easy-to-implement, divides processor time equally among all running tasks, no single task can monopolize the processor and ensures each job is seen to, every task is allocated processor time without long wait
  • longer jobs may take longer, does not take into account job priority, does not scale well as more processes run (time slice gets smaller and urgent tasks may not complete quickly)
  • used for time-sharing and real-time systems
28
Q

Round Robin in real-time systems

A
  • important to ensure each task gets a chance to execute within a certain deadline so the system as a whole remains responsive.
  • deadline being: task must be completed within a specified time frame, otherwise system may fail/produce incorrect or inconsistent results.
  • though doesn’t take into account the priority/deadline of a task, not best scheduling algorithm to use where certain tasks have more urgent/critical deadlines that must be met.
29
Q

First come first served (FCFS)
Non-preemptive

A
  • ## processes jobs in the order they arrive in a queue.
  • fair (ensures jobs complete in order received)
  • simple to implement (no special hardware required so easy to use on a wide range of systems)
  • ## guarantees job will complete once it starts execution as never interrupted by another job.
  • “convoy effect”, long-running jobs holds up queue and delay processing of smaller jobs
  • inefficient doesn’t take into account the relative priority/resource needs. poor turnaround time (amount of time it takes to completely execute job from start to finish) for jobs arriving later in queue
  • may leave CPU idle if there are no jobs in the queue - poor processor utilization
  • doesn’t guarantee optimal performance (efficient use of system resources, how quickly it processes jobs, how many jobs it can handle at a given time)
30
Q

Multi-level feedback queues
preemptive

A
  • ## sorts processes into separate queues based on their priority, utilizing multiple ready queues ordered by different scheduling algorithms, and placing high-priority processes that rely on input/output devices in top queues and serving faster-to-complete processes first.
  • allows processes to move between queues as their priorities change, more efficient use of resources by dynamically prioritizing processes.
  • prevent starvation by moving processes between different queues based on processing time had
  • ensures all tasks are given processor time but deals with important jobs sooner
  • ## balance queues as tasks are processed to avoid domination by a single high-priority task.
  • complex to implement, involves deciding which job to prioritize based on a combination of priorities.
  • overhead for maintaining and managing the queues reduce overall performance and might not be the most efficient for a particular system
    -more complicated scheduling algorithms take up alot of processor time for scheduling itsle,f taking away processing time from the actual job that needs processing
31
Q

Shortest job first (scheduling algorithm)
non-preemptive

A
  • picks shortest process, runs it until completion, moves to next one. Jobs ordered in queue based on time required for completion, prioritises smaller jobs first to minimise waiting time.
  • Suited for batch systems where shorter jobs are given preference - large number of jobs submitted at once and the scheduler needs to find an efficient way to allocate resources to all of them.
  • Requires processor to know/calculate the time required for each job.
  • Risk of processor starvation if short jobs continue to be added to the queue.
32
Q

Shortest time remaining (scheduling algorithm)
pre-emptive

A
  • Orders queue by time left for completion. Processes with shortest remaining time serviced first and prioritised. If a new process with shorter time comes whilst processing a process, the new process is serviced.
    – quickest job is completed first but stops and re-evaluates when a new job arrives
  • reduces wait times and provides a more responsive system and more efficient use of system sources
  • suited for interactive systems where quick response times are important.
  • CPU utilized more effectively, continuously allocated to process w/ the shortest remaining time.
  • starvation for longer jobs if short jobs are keep added to queue.
  • convoy effect ( long jobs repeatedly interrupted by short jobs, and so experience delays
  • involves context switching (saving + restoring the state of suspended processes but requires processor to store large amount of info for each process to do so, can decrease system performance)
  • requires continuously updating estimated completion times.
33
Q

process blocking

A
  • a situation where a process is unable to execute further until a certain event occurs.
  • process blocking occurs when a running process is interrupted because it needs data that is not immediately available. can occur when a process needs to access slow components, such as a hard disk or network, which can cause significant delays.
  • process is blocked until the data it needs becomes available, and another process can take its place in the running state (context switching can also occur during process blocking, a way for the scheduler to maximize CPU utilization and ensure that no process is waiting unnecessarily)
  • The blocked process generates an interrupt to let the scheduler know that it is ready to rejoin the queue.
  • The scheduler needs to manage the blocked process and ensure that it is requeued appropriately once the required data is available.
34
Q

Distributed operating systems

A
  • OS manages a group of independent computers, makes them appear to users as a single, unified computing system.
  • multiple computers (connected to a network) work together as a single system to perform a set of coordinated tasks
  • provides a way for computers to communicate and share resources such as hardware, software, and data across a network.
  • used in large-scale computing environments e.g scientific research, online shopping sites, and Bitcoin farms.
35
Q

Distributed operating systems pros and cons

A
  • reliability and fault tolerance: multiple machines work together to ensure system services remain available even if one or more machines fail.
  • scalability: Additional machines can be added to system to increase capacity and performance.
  • flexibility: in terms of the types of hardware and software that can be used, and can be easier to upgrade/replace.
  • ## Reduced data duplication: data can be distributed across multiple machines, reducing need for data duplication and improving efficiency.
  • complexity: more complex to design, implement, and maintain than centralized systems.
  • Communication overhead (the additional time and resources required for communication between different components of a system or between different systems): Communication between machines can be slower than within a single machine.
  • Security: more points of potential vulnerability.
  • Synchronization and consistency issues: consistent and up-to-date across multiple machines can be difficult and requires careful coordination.
36
Q

Embedded operating systems

A
  • designed for specific devices (embedded systems - computer system built into another device) and have limited functionality.
    -simple or no user interface, designed for a specific dedicated purpose
  • in consumer applications e.g coffee machines, in-car systems, and digital clocks.
37
Q

embedded operating system pros and cons

A
  • Optimized performance for specific tasks, Low power consumption and cost, Increased reliability, Real-time response, use a limited amount of hardware resources.

Limited flexibility, Difficult to update or upgrade, Complex design and development, Higher development costs, Limited resources and processing power

38
Q

Multi-user operating systems

A
  • allow multiple users to access and use a single computer system simultaneously.
    -each user has their own account, so can access system and its resources using their own login credentials.
    -OS manages and allocates system resources, such as memory and processing power, among the various users and their applications.
    -commonly used in server environments, where many users need to access and use the same resources.
  • examples are Linux, Unix, and Windows Server.
39
Q

multi-user operating system pros and cons

A
  • Resource sharing: Multiple users can share same hardware and software resources, reducing costs and increasing efficiency.
  • Security: User accounts and permissions can be used to restrict access to sensitive data and resources, protecting them from unauthorized access.
  • Flexibility: Multiple users can run different applications and perform different tasks simultaneously, increasing the system’s overall flexibility and usefulness.
  • Complexity: Managing and maintaining a multi-user system can be more complex than managing a single-user system.
  • Performance: system’s performance can be affected by the number of users and their resource requirements.
  • Compatibility: Some applications and hardware may not be compatible with multi-user systems, requiring additional configuration or modification to function properly.
40
Q

Multitasking operating systems

A
  • allow users to carry out multiple tasks simultaneously.
  • allow multiple programs to run concurrently on a single computer.
  • OS manages the CPU’s time and resources, allowing multiple programs to execute concurrently.
  • Multitasking done using time slicing, which switches quickly between programs and applications in memory.
  • commonly used in personal computers, smartphones, and tablets.
41
Q

multitasking operating system pros and cons

A
  • Efficient use of resources: Multiple programs can share the CPU and other resources, allowing for better utilization of the computer’s hardware.
  • Increased productivity: Users can work on multiple tasks simultaneously, improving productivity.
  • Improved system responsiveness: system can respond to user input more quickly because it is not tied up with a single program.
  • Complexity: Managing multiple tasks and ensuring they do not interfere with one another can be complex and difficult.
  • Resource contention: Multiple programs sharing resources can lead to contention for those resources, reducing system performance.
  • Security risks: Malicious programs can attempt to exploit vulnerabilities in the system to gain access to resources or information they should not have.
42
Q

Real-time operating systems (RTOS)

A
  • designed to perform a task within a guaranteed time frame. (designed to handle and respond to events and processes in real-time)
    -Real-time scheduling: RTOS uses priority-based scheduling to ensure that higher-priority tasks are executed before lower-priority tasks.
    -Deterministic behavior: RTOS provides deterministic behavior, meaning that the timing and order of events are predictable and can be controlled.
  • used in time-critical computer systems. e.g situations such as managing control rods at nuclear power stations, self-driving cars, and any situation where a response within a certain time period is crucial to safety.
43
Q

real time operating system pros and cons

A
  • Precise timing and scheduling of tasks, making it ideal for time-sensitive applications
  • Predictable and reliable performance
  • Efficient use of system resources, especially memory
  • Low latency and high throughput (the rate at which a system or process can complete a task or produce a product within a given period of time)
  • Robust and fault-tolerant
  • Can be customized and optimized for specific hardware and applications
  • Can be expensive to develop and maintain
  • Limited flexibility compared to general-purpose operating systems
  • May require specialized skills and expertise to develop and operate
  • Higher complexity in development, testing, and debugging
  • May have limitations in terms of peripheral and device support.
44
Q

Booting up a computer

A

When a computer is turned on, the CPU runs a jump instruction that points to the first address of the BIOS stored in ROM.
The first initial instructions, passed from ROM to CPU, perform a power-on-self-test (POST) to check the connected components and make the CPU aware of their existence.
The BIOS performs a series of checks to make sure the hardware is operating properly, called the Power On Self Test (POST).
If the POST is successful, the BIOS looks for an Operating System in the MBR of the hard drive and loads the OS into main memory using a boot loader program.
The boot loader program loads the operating system kernel into memory and the operating system takes over to boot up the rest of the system.
The CMOS setup allows users to change settings for how devices are loaded at start-up, including enabling and disabling hardware devices.
If the BIOS is overwritten, the computer wouldn’t be able to load the OS, and the computer would become unusable.

45
Q

BIOS (basic input out system)

A
  • firmware (software stored on a chip on the motherboard)
  • initializes and tests the hardware components of a computer when it is powered on.
  • responsible for loading the operating system and providing a basic level of input/output services, such as reading data from a keyboard or displaying text on a screen.
46
Q

POST

A

program handled by the BIOS. It checks that the hardware is installed correctly before loading the operating system

47
Q

Bootloader/bootstrap loader and bootstrap

A
  • Bootstrap - the initial set of instructions stored in ROM that the CPU executes when the computer is turned on
  • Bootloader - the program that is responsible for loading the operating system into memory
48
Q

device drivers

A
  • software program, enables the operating system to communicate with a specific hardware device.
  • Provides an interface for communication between the OS and the device.
  • Translates the OS’s instructions into device specific instructions
  • Translates signals from device/OS
  • Enable devices from different manufacturers to work together
  • Enabke wide range of different devices to work with OS
49
Q

What are some key features of device drivers?

A
  • Specific to the hardware they control and the operating system they run on.
  • Usually written in a low-level language such as machine code or assembly, or a powerful high-level language like C.
  • Created by manufacturers to optimize their devices, but some common drivers may be pre-installed by the operating system.
  • Can be updated to the latest version to give better performance or remove bugs.
  • Device Manager in Windows can be used to see the current version of installed device drivers.
  • Allow any device to be used within the operating system as long as a driver is available for it.
  • Graphics card drivers, particularly those used by PC games, are commonly installed by the user.
50
Q

Virtual machines

A
  • a software implementation (emulation) of a computer system.
  • virtual machine is isolated from the underlying hardware and other software running on the machine
  • enables a computer to run software that it wouldn’t normally be able to run.
  • allows user to create a separate operating system environment on their computer.
  • can execute intermediate code or run an operating system within another.
51
Q

Virtual machine positive traits

A
  • save space and the time and cost of setting up multiple physical systems.
  • allow code to be tested and run on different platforms.
  • emulate different platforms. They can run on any device, making programs fully portable.
52
Q

virtual machine uses

A

-running software that requires a different operating system.
- testing new software or configurations, or creating a sandboxed environment for testing potentially dangerous software.
- create a development environment for programmers to test their programs on different operating systems without having to purchase the hardware.

53
Q

Intermediate code

A
  • code halfway in between machine code and object source code, can be run on a virtual machine e.g Java Virtual Machine (translated into specific machine code by a virtual machine)
  • independent of the processor architecture, can be used on different machines and operating systems, making the code highly portable between devices
  • Using intermediate code and virtual machines saves time and money because it eliminates the need to purchase multiple devices solely for testing.
  • However, running intermediate code in a virtual machine can be considerably slower compared to running low-level code on the device it was designed for.
54
Q

Pros of paging

A
  • programs/data can be held in non contiguous memory locations using virtual addressing, making it easier to make best use of remaining storage/to avoid having i move context around to fit in new programs. it allows pages to be transferred from secondary storage (i.e. virtual memory)
    as random access there is no performance drop vs sequential storage
    space inside a page may be wasted as program is unlikely to take up exact number of oages, hower all pages can be used with no wasted space between them
55
Q

Pros of segmentation

A
56
Q

cons of paging

A
57
Q

cons of segmentation

A