2.6 The Operating System Flashcards

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

Define operating system

A

Software that manages computer hardware and software resources

All computer programs (other than basic firmware programs) require an operating system to work

Examples:
Windows
Linux
Apple IOS, OSC
Android

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

What does an operating system provide

A

A layer of software services which are used to interact with the hardware (acts as a layer between software (and user) and the hardware

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

What is the kernel and what is it used for

A

OS can be extremely large so not all will be loaded into main memory

The kernel is the main part of the OS which is loaded into RAM when the computer boots up and this is responsible for managing processes, hardware and other important low level tasks

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

What are the functions of the OS

A

Managing resources

Memory Management

Human Computer Interface

Utilities

Security

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

What does manage resources include

A

Process Management - ensuring that different processes/programs can be run in a multitasking OS , appearing to run simultaneously using scheduling

Input/Output Management- communicating with devices such as keyboards, mice etc.

Backing Store Management- ensuring data can be read/written to disk drives, maintaining a hierarchical file system etc.

ALL OF THE ABOVE MAKE USE OF INTERRUPT HANDLING

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

What is the memory Management function of the OS

A

Ensuring programs and data can share memory and are stored correctly without interfering with each other

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

What is the human computer interface function of an OS

A

To display information to the user and accept inputs from the user

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

What is the utilities function of an OS

A

Software that comes with the OS to help with the running of the computer e.g

file Management- copy moven rename delete files and directories

Compressions software - to compress files [will be slower to open or execute each time as they will need to be decompressed]

Task managers - to view the processes/programs running, check how much processor time they are taking up and kill processes if necessary

Antivirus software - needs to be updated at least daily

Backup software - allows data to be backed up in an external drive or in the cloud

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

What is the security function of an OS

A

Typically OS has built in securities such as login/passwords, encryption, file access rights

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

How do operating systems have a generic way of talking to many different types of the same device (e.g. different monitors)

A

Hardware manufacturers produce software called hardware drivers which perform the translation between the generic OS instructions and the specific binary control signals that the hardware understands

If there isn’t a compatible driver for the OS, it won’t work

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

Managing backing Store

A

Storage devices are managed by OS which are able tor ead/write files and folders/directories and maintain a hierarchical structure, file access rights etc.

Many different formats:
NTFS (windows), FAT32(older windows), HFS Plus (Mac) all work differently

Information about files is stored in a file allocation table (FAT) which stores the location of all files on the drive together with meta data about the file( name, creation/mod date, size, access rights etc.)

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

Access rights

A

Can be set to specify which user or groups of users are able to read and/or update each file or folder

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

What are the different properties of a hierarchical structure in backing store

A

The root folder/directory can contain subfolders/directories

These subfiles can contain further files etc. Like a tree structure

They are ordered in a logical way for fast access to files and added security

Access rights can be set at a directory or file level to determine whether a particular user is able to access the folder, or if they just have read or write perm

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

What access rights may be given on a hierarchical structure in a school

A

. In a school system, a teacher may be given read access to each pupils folder

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

What are the different types of Human Computer interfaces

A

Command driven (e.g. MS-DOS)

WIMP (windows, icons, menus and pointers) e.g. Windows, apple OSX

Touch, voice etc.

Options for accessibility (to allow for easier use by people with particular disabilities)

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

What is a single tasking OS

A

The OS supervises the loading and running of one program (or process or task) at a time, and the input and output of data from and to peripheral devices

E.g. early PC running MS-DOS

Could only be used by one person at a time and could only use one program at a time

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

What is a batch system OS

A

OS that runs in batch mode will run a series of programs or jobs allocated to it in a batch file (typically left running overnight).

The transaction file once it has reached the end of its period will copy its data into the master file which will carry out its operations without human interaction

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

What is a multi programming OS

A

This OS allows more than one program to be held in main memory at the same Time.

Although the CPU can only be running the code for one program at a time, it does allow it to have one program performing Input/Output operations while it is processing another or if time slicing is used it can give each process a fair allocation of its processor time. Usually involves either or both

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

Multi user / multi access OS

A

Another form of multi programming

OS handles several different programs running at once but these programs can be owned by different users attached to the computer from terminals. The processor again allocates time slices to each program so rsch program appears to be running at the same time

Often referred to as a time sharing system

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

Multi tasking OS

A

An example of multi programming

E.g. Windows 10, where there can be different programs in memory and appearing to run at the same time. Users can switch between tasks/applications. Obviously a single processor is actually only able to run one process at a time and a time-slice based scheduling policy is used

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

What are the 3 different modes of operation that an OS has

A

Batch processing

Real time systems - control

Real time systems - transaction processing

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

Batch processing

A

When the OS executes a series of jobs without any manual intervention

E.g. thousands of pay slips or gas bills could be printed out with no human interaction

Traditionally done overnight when the computers aren’t being used for anything else (can be scheduled to run automatically)

Simpler to operate than a real time system as transactions can be stored in the order received with all processing carried out later.

Batch processing doesn’t stop for anything, any errors are written to an error log for someone to deal with the next day

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

What are the 4 characteristics of real time systems

A

They support applications which are continuous (don’t have an end)

They have to deal with events that can occur simultaneously and unpredictably

Some real time systems are safety critical. They must be fail safe, and must guarantee a response within a given interval of time

2 types of real time systems:
Real time process control

Real time transaction processing

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

Real time control

A

One of the types of real time systems

E.g. Automatic pilot on aircraft, monitoring of the production of electricity in a nuclear power station, missile guidance system, controlling traffic lights

E.g.
The coordinates of the target are set

The missiles released along its trajectory

Wind, drag etc readings are fed into input

If off target the process recalculates the trajectory, speed, direction etc. Otherwise nothing changes (example of a feedback loop)

Inputs processed quickly, processing needs to be fast enough to deliver output in time and adjusts outputs accordingly to avoid accidents

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

Real time control

A

One of the types of real time systems

Form of info processing, certainly involving accessing and updating tables in a database as part of a transaction that needs to be dealt with immediately

Transaction consists of a small number of operations that all have to be carried out one after the other - if any steps fail the entire transaction fails

More complexity than batch system as issues such as double booking and temporarily allocating records need to be considered (theatre booking system example)

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

What are interrupts

A

a signal or message from a device or software to the operating system, which may cause a break in the execution of the current routine because it is requesting attention.

they are vital in the smooth running of a computer system

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

What happens when an OS acknowledges the interrupt

A

-Suspends the current task/process carried out

  • notes where to come back to so it can resume the process

-loads and runs an appropriate interrupt service routine (or handler)

28
Q

what is an interrupt service routine

A

each type of interrupt can have one

a program or subroutine designed to deal with the situation appropriately

e.g. an interrupt from a printer reporting it is out of paper could result in an interrupt service routine displaying a message box asking the user to put more paper into the printer

29
Q

name examples of interrupts

A

the program/process that is running can generate an interrupt to perform an input or output e.g. write data to a hard disk, send data to a printer etc.

I/O interrupt - a device can interrupt e.g. hard drive might be ready for more data or may interrupt because it has now retrieved the data that was requested

Timer Interrupt - at the end of a time-slice so a different process gets the chance to run

Restart interrupt - when the operator presses the restart or off button

Program check interrupts - These are caused by various program errors such as division by 0

Machine check interrupts - caused by malfunctioning hardware

30
Q

what are interrupt priorities

A

some processes or interrupts are more important than others to have higher priority.

Interrupts with the highest priority have to be dealt with first so ‘jump the queue’

31
Q

what are examples of interrupts with higher priority

A

impending data loss

impending hardware/software failure

imminent power failure detected

32
Q

why are printers given high priority

A

they are more liable to get behind with what they do so should be allowed to start as soon as possible so they do not eventually hold up processing

33
Q

what time of memory is main memory

A

random access memory

therefore empty when the computer is first turned on

34
Q

how is main memory organised

A

main memory is empty when computer is turned on as it is random access

some of the OS is loaded in as the computer boots up

applications that are run are also loaded into memory

memory is also used to hold the data used by the applications as well as other things such as the run time stack which keeps track of procedure calls

35
Q

what is the solution if it cause big memory problems if an application that is running changes accidently or deliberately the memory locations holding the operating system or another application

A

all the different things (OS, programs, stack etc. ) stored in memory need to be partitioned from each other

36
Q

what are fixed sized memory partitions

A

used in early multiprogramming systems

main memory was divided into a number of fixed size partitions, with each partition holding a single job.

a process stayed in its partition until it was completed, and the CPU switched between the processes held in the partitions

37
Q

what are the issues with fixed sized memory partitions

A

they waste a lot of memory as it would be unlikely that jobs exactly fill the fixed partitions

38
Q

what are variable size memory partitions

A

where each program is allocated its own partition of the correct size

39
Q

what are the problems with variable size memory partitions

A

once tasks are completed and as new tasks begin and they don’t take up as much space or take up too much space etc. gaps appear

Algorithms can try and find the best place to fit but this doesn’t solve the problem

Thats why in modern systems another process called paging is used

40
Q

what is paging

A

in an os, a page table splits up the available memory into blocks of memory locations of typically 4k each

processes/programs will require a number of these pages both for the program itself and the data it needs to store

41
Q

what happens in paging if the running processes require more memory than is available

A

if the running process require more memory than is available then a swap file is used on disk and this is also split into pages

when memory addresses are accessed within pages that are stored in disk, the OS will load them into memory and swap out pages not accessed recently into the swap file

42
Q

what causes the thrashing of the hard disk

A

If pages are constantly being swapped in and out of memory and disk then this can slow things down and cause the thrashing noise

43
Q

how are pages stored

A

As far as the process is concerned, memory is presented as a contiguous set of blocks with no knowledge of there being other processes in the real memory

i.e. it has its own virtual address space

e.g. if process A is putting data into page 1 the OS translates this and writes this into page 6 in real memory

if process A tries to access memory address outside the virtual address space, the OS can allocate more pages to it

44
Q

what is a buffer

A

a buffer is an area of memory used to temporarily store data during the transfer of data to a peripheral 9e.g. printer, disk drive) or from a peripheral (e.g. a keyboard or disk drive)

45
Q

why is a buffer used between a processor and a device

A

to compensate for the difference in speed between them

46
Q

what would happen to the CPU if there weren’t any buffers

A

the CPU would have to constantly monitor the inputs and pass data very slowly to output devices and be completely tied up with the job it is carrying out.

e.g. if the OS had to constantly monitor a disk-drive, if it took a moment to do anything else then it may miss data being sent to it

the OS then needs to send the data a character at a time to the printer, wait until it has printed out that character and move onto the next

47
Q

why is a keyboard buffer useful

A

if a key was pressed while the CPU is busy it isn’t missed as it it written to the keyboard buffer

the OS can then deal with it when it is ready

48
Q

What is double-buffering

A

there can be a pause (lengthy if the OS is busy) after the disk drive has filled the buffer and it is waiting on the OS to empty it

There is also a pause after the printer has emptied the buffer while it waits for the OS to fill it with the next set of data

WHY DOUBLE BUFFERING IS USED:

situation is improved where pairs of buffers are used on each device

As soon as the disk has filled the first buffer it can start filling the second buffer without having to wait for the CPU to empty the first

therefore the e.g. disk drive should always have a buffer free

can be used continuously and doesn’t have to wait for data transfer

49
Q

define spooling

A

clicking print send the document to a spool file on disk

a spool file acts as a virtual printer (it hasn’t been sent to a real printer yet, just to a file)

50
Q

advantages of spooling

A

a file can be written to a disk much faster than it can be printed, making the word processor being able to be used again almost instantly

a queue of spool files can be maintained to allow the printer to deal with print queues

51
Q

what is a spooler

A

a program that runs in the background

could be multitasking or could be on a separate file on a network

sends data from the spool file to the printer

spooler is fast and the device is slow so uses a buffer to compensate, uses a buffer again for the fast speed of the spooler and the slow speed of the printer

52
Q

what is the connection between buffers and spooling

A

you still need buffers in a spooling system to compensate for the differences in speed between devices and processor

53
Q

what is scheduling

A

a method by which processor time is allocated in a multi-programming (multi-task or multi-user) operating system

in this type of system several processes/programs are competing for use of the processor

at any instant only one process will be running as the CPU can only do one thing at a time, other processes will be waiting for their turn at using the processor

54
Q

what is low level scheduling

A

when the OS has the task of deciding which process should be assigned to the CPU at any particular time.

55
Q

what is the aim of the scheduler

A

to minimise the jobs waiting to use the processor and therefore aim to get jobs completed or using input/output as they are not then waiting to use the processor

56
Q

what are the three different states that a process can be in in a multiprogramming system

A

ready - in a queue waiting for the processor

running - using the processor (only one process can be in this state at a time in a standard single processor system)

blocked - waiting to use (or is using) input or output (so doesn’t need the processor)

57
Q

what is the high level scheduler’s job

A

decides if a process is allowed into the system in the first place.

It may reject a process if it requires too many resources e.g. too much memory or system is already running too many other processes

58
Q

life cycle of a process

A

high level scheduler decides if it allowed in

process put in ready state if so

low level scheduler decides what process should be run next

running

three things may happen after this:

program ends

times-out and goes back to the ready queue

blocked (input/output) => back to ready queue once complete

59
Q

what is the low level scheduler’s job

A

decides which process should be chosen to run next

could favour:

I/O bound processes rather than processor bound processes

try to be fair and take into account the length of time a process has been in the queue

60
Q

what is time slicing

A

multiprogramming systems will typically allocate time-slices (finite amounts of time) to each process

when a process is running it is likely to become blocked quickly but if it doesn’t then there is a timer interrupt and the process will be put back into the ready state.

in a multi-user/multi-access system each user will get a time slice with the processor before it moves onto the next

61
Q

what is round robin scheduling

A

ready processes are all queued in FIFO manner

if a process uses the processor longer than it is allotted time-slice, it goes to the back of the queue.

some higher priority processes could be given 2 (or more) time slices

62
Q

what are multi-level feedback queues

A

a variation of round-robin scheduling, used in OS such as windows and MacOS

processes that use more time slice than it is allowed, it moves to the back of the queue below

time slice period in queue 1 is chosen to be large enough so that the great majority of jobs will issue an I/O request before their time slice expires.

if the time slice expires in the bottom queue, it circulates round robin until they complete

63
Q

define polling

A

involves a computer checking whether each connected device is ready to receive data or has data to send

each terminal gets a small amount of time from the processor called a time slice

the OS switches between the different processes giving the illusion that it is running all of the tasks simultaneously

64
Q

why is polling inefficient and why are interrupt driven systems better

A

waste time checking each device

interrupt systems are far better as in that situation each device that requires attention sends a signal to the processor and the processor can deal with each in turn if more than one interrupts.

65
Q

define threading

A

scheduling involves the operating system managing multiple processes

modern application programming languages often make use of threading to allow a process/program to split itself into sub-processes

e.g. the opening screen of a game might play some music in one thread while at the same time displaying graphics in another

the scheduler will deal with each of these threads separately

may take advantage of multiple processors or processor cores available.

66
Q

why can programming using threading be complex

A

it is never certain which thread will finish last. The wo threads might both need to write to the same item of data, and care is needed that this doesn’t cause an error