Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
97 Cards in this Set
- Front
- Back
What is operating system? |
An operating system is a program that acts as an interface with the user and the computer hardware and control the execution of the software |
|
What is resource management? |
It is related to concerns of the CPU on the scheduling to ensure the processor is efficiently used It relates to the concerns of the memory to ensure optimum usage of main memory The concept of scheduling to allow for better use of CPU time and resources |
|
What are the 3 fundamental resources in a computer system? |
CPU Memory The Input or Output system |
|
How does the operating system deal with the input and output operations? |
The Input and output operations that has been limited by the computer user The Input and output operation occurs while the software is run and resources such as printers or disk drives are requested |
|
What is bootstrap? |
A small program to load other program to start up the computer The bootstrap program loads part of the OS into the main memory (RAM) from the hard disk and initiates the start up procedures |
|
What is scheduling? |
The process manager which handles the removal of the running programs from the CPU and the selection of new processes |
|
What are in the 2 parts of flash memory? |
1st part(Os resides) Os can only be updated by manufacturer but the user can't interfere with the software from the memory 2nd part(apps and data are stored) The user don't have direct access to this part of the memory |
|
What is direct memory access controller? |
A device that allows certain hardware to access RAM independently of the CPU When the CPU is carrying out a programmed input and output operation. It is fully utilised during the entire read and write operations. The direct memory access frees up the CPU to allow it to carry out other tasks while the slower input and output operations takes place |
|
How does the direct memory access controller works? |
Direct memory access starts the data transfers The CPU carries out other tasks while data transfer operation is taking place Once the data transfer is complete, an interrupt signal is sent to the CPU from the direct memory access |
|
What is kernel? |
The core of an operating system with control over process management,memory management, interrupt handling,device management and input and output operations It is the central component that is responsible for communication between hardware , software and memory |
|
What are the ways in which the user interface hides the complexities of the hardware from the user? |
Using GUI interfaces rather than CLI Using device drivers Simplifying the saving and retrieving of data from memory and storage devices Carrying out background utilities |
|
How an operating system can maximise the use of resources? |
By implementing process scheduling to ensure efficient CPU use Manages the main memory usage Optimizes the input and output which dictates whether Input and Output passes through CPU or not |
|
What is multitasking? |
Allows the computers to carry out more than one task at a time Each of these process will share common hardware resources To ensure multitasking operates correctly ; scheduling is used to decide which process should be carried out Ensures the best use of computer resources by monitoring the state of each Process - it should give the appearance that many process are being carried out at the same times it should give the appearance that many process are being carried out at the same times |
|
What are the 2 types of multitasking operating systems |
1) Preemptive=> a type of scheduling which the process change from running state to steady state or waiting state to steady state 2) Non preemptive=> a type of scheduling which process terminates or changes from running state to a waiting state |
|
What are the difference between preemptive and non preemptive |
Preemptive ->Resource are allocated to a process for a limited time -> More flexible form of scheduling ->Process can be interrupted while running ->High priority processes arriving in the ready queue on a frequent basis can mean there is a risk that low priority processes may be starved of resources Non preemptive -> Once the resource are allocated to a process,the process keeps them until it has completed its burst time or the process has switched to a waiting state -> More rigid form of scheduling ->Process can't be interrupted while running.It must first finish it switch a waiting state -> If a process with a long burst time it's running in the CPU, there is a risk of another process with a shorter burst time may be starved of resources |
|
What is burst time? |
The time when a process has control of the CPU |
|
What is starve? |
The constant deprive a process of the necessary resources to carry out a task |
|
What is process priority depends on? |
->Category ->Whether the process is CPU - bound would need long CPU cycles and short input and output cycles or input and output bound ->Resource requirement -> Turn around time,waiting time, and response time for the process -> The process can be interrupted or not |
|
What can be affected even though the process has been a given a priority? |
->A deadline for the completing the process -> How much CPU time is needed when running the process -> The wait time and CPU time -> Memory requirements of the process |
|
What is low level scheduling? |
A system that assigns a processor to a task or process based on the priority level |
|
What the objective of low level scheduling? |
It's objectives are to maximise the system throughput to ensure response time is acceptable and ensure that the system remains stable at all times |
|
What is process control block? |
A data structure which contains all of the data needed for a process to run |
|
What does the Process Control Block store? |
Current process state Process privileges Register values Process priority and any scheduling information The amount of CPU time the process will need to complete A process ID which allows it to be uniquely identified |
|
What are process state? |
Running -The program is executed during its time slice - The program can use the processor to execute its instructions Ready - The new process has arrived at the memory and the PCB is created - The process is not being executed - The process is in the queue waiting for the processor's time slice Blocked - Can't progress until some event has occurred |
|
What are the type of process states? |
Running -> Ready Condition -> A program is executed during its time slice; when the time slice is completed an interrupt occurs and the program is moved to the Ready Queue Ready -> Running A process's turn to use the processor; the OS scheduler allocates CPU time to the process so that it can be executed Running-> Blocked The process needs to carry out an Input and Output operation, the OS scheduler places the process into the Blocked queue Blocked -> Ready The process is waiting for an input and output resource; an input and output operation is ready to be completed by the process |
|
What is round robin? |
->Is a scheduling algorithm that use time slices assigned to each process in a job queue ->When the process is executed during its time slice it is removed and place in the blocked queue,another process from the ready queue is executed in its own time slice -> Context switching is used to save the state of the pre empted process -> The ready queue is worked out by giving each process its time slice in the correct order then the next process is brought into the ready queue for its time slice.
|
|
How does round robin works? |
->Each process has an equal time slice -> When the time slice ends,the low level scheduler puts the process back into the Ready queue allowing another process to use CPU time -> When the time slice ends, the status of each process must be saved so that it can continue from where it left off when it is allocated it's next time slice -> The contents of CPU registers are saved to the process control block(PCB) each process has it own control block -> The next process takes control of the CPU , it previous state is reinstated or restored
|
|
What is first come first served scheduling? |
The data added to the queue first is the data that leaves the queue first Similar concept of a queue structure which uses First In First Out(FIFO) principle |
|
What is shortest job first scheduling and shortest remaining time first scheduling? |
The leat CPU time is executed first |
|
What are the advantage of using round robin? |
It is a much more efficient algorithm |
|
What are the advantages of using shortest job first? |
Best approach to minimise waiting time Easy to implement in batch system where required CPU time is known in advance |
|
What are the advantages of using first come first serve? |
It is easy to understand and implement |
|
What types of interrupt signs that will cause the system to enter the kernel mode? |
Device interrupt Exceptions Traps and software interrupt |
|
How the kernel of the operating system acts as an interrupt handler and how interrupt handling is used to manage low level scheduling? |
1) Once the interrupt is received, the other interrupts are disable so that it allows the process to deal with the interrupt that can't be intercepted 2) Process is shared on the kernel stack 3) The source of the interrupt is identified 4) The system now jumps to the ISR(Interrupt Service Routine) 5) Once completed, the process is restored using the values saved on the kernel stack 6) After the interrupt is handled, the interrupt must be restored so that any further interrupts can be dealth with |
|
What is context switching? |
A procedure when the next process takes control of the CPU it's previous state is restored |
|
What is interrupt dispatch table? |
Data structure which is use to implement an interrupt vector table |
|
What is optimisation? |
The function of memory management deciding which processes should be in main memory and where they should be stored |
|
What is single allocation? |
All memory is made available to a single application |
|
What is paging? |
A form of memory management which divides up physical memory and logical memory into fixed size memory blocks |
|
How does paging works? |
The process split into pages,memory is split into frames All pages are loaded into memory at once When a process is executed, the process pages from logical.memory are loaded into frames in physical memory A page table is used which has a page number as the index.Each process has its own separate page table that maps logical addresses to physical addresses The page table shows page number,flag status,page frame address and time of entry |
|
What is physical memory? |
Primary RAM memory |
|
What is logical memory? |
An address space that an operating system recognise to be storage |
|
What is frames? |
They are fixed size memory blocks |
|
What is pages? |
Fixed size logical memory blocks |
|
What is page table? |
A table that maps logical addresses to physical addresses, it contains page number, flag status, frame address and time of the entry |
|
What is segment? |
Variables size memory blocks which logical memory is split up Logical address space is broken up into variable size memory blocks |
|
How does segmentation takes place? |
The logical address space is broken up into variable size memory blocks called segments Each segment has a name and a size For execution to take place segment from logical memory are loaded into physical memory The address is specified by the user which has segment name and offset value Address of segment= segment number + offset value Segment in logical memory don't need to be contiguous but once loaded into physical memory each segment than becomes a contiguous block of memory |
|
What is the difference between paging and segmentation? |
Paging ->A page is a fixed size block of memory ->All the block may not be fully used due to the block size is fix which leads to internal fragmentation -> A page table maps logical addresses to physical addresses -> The process of paging is invisible to the programmer SEGMENTATION -> a segment is a variable-size block of memory segment map table containing segment number + offset (segment size); it maps logical addresses to physical addresses ->because memory blocks are a variable size, this reduces risk of internal fragmentation but increases the risk of external fragmentation segmentation is essentially a visible process to a user |
|
What is virtual memory? |
A type of paging that gives illustatiiom that gives unlimited memory to be available Secondary storage is used to extend the RAM so the CPU appears to be able to access more memory space than the available RAM Virtual memory is created temporarily |
|
What is the problem of memory management? |
Processes run out of RAM main memory due to amount of available RAMm is exceeded because of multiple processed running.This will cause it to be possible to corrupt the data used in some of programs being run |
|
How to solve the problem of memory management? |
By separately mapping each program's memory space to RAM and using the hard disk drive if we need more memory |
|
What are the advantages and disadvantages of virtual memory? |
Programs can be larger than physical memory and can be still executed
It leads to be more efficient multi programming with less input and output loading and swapping programs into and out of the memory
No need to waste memory with the data that is not being used
It eliminates external fragmentation and reduce internal fragmentation
It removes the need to buy and install more expensive RAM memory Disadvantages -> As main memory fills more and more pages need to be swapped out of virtual memory which leads to a high rate of write head movements |
|
What is disk thrasing? |
A problem that is cause by using virtual memory.Excessive swapping in and out of virtual memory leads to a high rate of hard disk read and write head movements which reduces processing speed |
|
What is thrash point ? |
A point with the execution of the process comes to stop since the system is busier paging in and out of memory rather than actually executing system |
|
How to reduce thrasing? |
By installing more RAM By reducing the number of program running at a time By reducing the size of swap file |
|
How do processes access data when using virtual memory? |
1)The program executes the load process with a virtual address 2) The computer translates the address to a physical address in the memory 3)If physical address is not in memory, the operating system loads it from HDD 4) The computer reads RAM using physical address and returns the data to the program |
|
What is first in first out page replacement? |
Page replacement that keeps track of all pages in memory using a queue structure. The oldest page is at the front of the queue and is the first to be removed when a new page is added Do not consider page usage when replacing pages: a page may be replacedsimply because it arrived earlier than another page |
|
What is belady's anomaly? |
A phenomenon that is possible to have more page faults when increasing the number of page frames |
|
What is optimal page replacement? |
Page replacement algorithm that looks forward in time to see which frame to replace in the event of a page fault The algorithm is impossible to implement at the time of a page fault as the operating system has no knowing when each of the pages will be replaced next. |
|
What are the advantages of optimal page replacement? |
It is free of belady's anomaly Fewest page faults |
|
What is least recently used page replacement? |
Page replacement algorithm which the page which has not been used for the longest time is replaced |
|
How to implement least recently used page replacement? |
is necessary to maintain a linked list of all pages in memory with the most recently used page at the front and the least recently used page at the rear |
|
What is a clock page replacement? |
->use a circular queue structure with a single pointer serving as both head and tail ->When a page fault occurs, the page pointed to is inspected ->The action taken next depends on the R-Flag status ->If R=0, the next page is looked at and this is repeated until a page Where R=0 is found ->When a page fault occurs, the OS has to decide which page to remove from memory to make room for a new page ->Page replacement is done by swapping pages from back-up store to main memory ->If the page to be removed has been modified while in memory, it must be written back to disk ->If it has not been changed, then no re-write needs to be done |
|
What are the difference between the processor management and memory management? |
Process management -> Decides which processes will be executed and in which order to maximize resources Make use of scheduling -> which uses scheduling to ensure processes can run smoothly -> use interrupts to service hardware and software requests -> use ready,running and blocked states ->Assigns priorities to decide which process to run on CPU ->Multitasking ->More than 1 task running at a time Memory Management -> Decides where in memory data will be stored and how they will be stored ->Partitioning of memory ->To know where to store data and run processes and so on Memory Paging -> use of paging strategies which processes are in physical memory -> use of virtual memory to maximise RAM and CPU usage
|
|
How an interpreter differs from complier? |
Interpreter -Executes the program its interpreting -The program source code is similarly input - There may also be other inputs that the program requires or to correct errors in the source program -No object code is output, but error messages from the interpreter are output, as well as any outputs produced by the program being interpreted -Since there’s no object code produced, the interpreter will need to be used everytime the program is executed -Will construct a symbol table-Will allocate space in memory to store any constants, variables, and other data items used by the program -Checks each statement individually and reports any errors, which can be corrected before the statement is executed -After each statement is executed, control is returned to the interpreter so the next statement can be checked before execution Compiler - Does not execute the program it is compiling -The program source code is input and either the object code program or error messages are output -The object code produced can then be executed without needing recompilation -Will construct a symbol table |
|
What is lexical analysis? |
The first stage in the process of compilation which removes unnecessary characters and tokenises the program
Uneccessary characters like white spaces and comments are removed Before translation, the source programs need to be converted to tokens Compliers will use a keyword table that contains all of the tokens for the reserved words and symbols used in programming language |
|
What lexical analysis do? |
It does simple error checking If the language imposes a limit on th length of the identifiers or string constants, the lexical analyser will determine if the identifier is too long |
|
What is lexical analyzer? |
It is use to detect an attempt to assign an illegal value to a constant, such as value of the wrong type or that causes overflow or underflow |
|
How does tokenisation works? |
1) The source program needs to be converted to tokens 2)Complier use a keyword table that contains all the tokens for the reserved words and symbols used in the programming language 3)The variables and constants and other identifier used are added to the symbol table |
|
What happens during the lexical analysis stage of compilation? |
1) Space are removed 2) Comments are removed 3) Error checking are performed 4) All keywords,constants and identifiers are replaces by tokens 5) Symbol table is created |
|
What is syntax analysis? |
The second stage in the process of compilation ->The whole program goes through this process even if errors are found ->If any errors are found ,each statement and the associated error are output but the next stage of complication code generation is not attempted -> Complication process will finish after this stage If the tokenized code is error free it will be passed to the next stage of compilation which generates the object code |
|
What is parsing? |
Complete tokenises list is checked for errors using grammatical rules for the programming |
|
What is code generation? |
The 3rd stage of the process of compilation which this stage produces an object program to perform the task defined in the source code |
|
What are the features of an object program? |
The object program is in machine readable form Not in a form that is designed to be read by humans Program must be syntactically correct for an object program to produced The object program that must be in machine code or intermediate form that is converted to machine code when the program is loaded |
|
What can intermediate code support? |
The use of relocatable code so the program can be stored anywhere in the main memory The addition of library routines to the code in order to minimise the size of the object program The linking of several program to run together |
|
What is optimisation? |
The 4th stage in the process of compilation which creates an efficient object program Optimized programs performs task by using minimum amount of resources Some optimized can take place after syntax analysis or part of the code generation Not every complier is able to optimize the object code produced for every source program |
|
What is syntax diagram? |
A graphical method of defining and showing grammatical rules of a programming language |
|
What is Backus naur form(BNF)? |
A formal method of defining. The grammatical rules of a programming language |
|
What are the symbols of BNF? |
::= means ' defined by' ; means end of rule | means 'or' <> Used to enclose an item |
|
What does this symbol mean ::=? |
Separate an item from its definition |
|
What is recursive definition? |
The definition is called itself ::=| ::=| |
|
What is reverse polish notation? |
A method of representing an arithmetical expression without using brackets or special punctuation RPN uses postfix notation where an operator is placed after the variables it acts on It uses BODMAS to arrange in order |
|
How does disk thrashing occur? |
more time is spent on moving pages in and out of memory than actually doing any processing then the processing speed of the computer will be reduced A point can be reached when the execution of a process comes to a halt since thesystem is so busy paging in and out of memory (thrash point) Due to large numbers of had movements, this can also lead to premature failure of ahard disk drive
|
|
What is segment number? |
Index number of a segment |
|
What is segment map table? |
Is a table that contains the segment number ,the segment size and corresponding memory location in physical memory it maps logical memory segments to physical memory |
|
What is interrupt priority level |
Values given to interrupts based on values 0-31 |
|
Explain how an interpreter executes a program without producing a complete translated version of it |
An interpreter examines source code one statement at a time • Check each statement for errors •If no error is found the statement is executed •If an error is found this is reported and the interpreter halts • Interpretation is repeated for every iteration in repeated sections ofcode/in loops • Interpretation has to be repeated every time the program is run |
|
Whata data structure that could be used to evaluate an expression in RPN |
a stack can be used as operands are popped from the stack in the reverse order to how theywere pushed |
|
What are the tasks that occur in syntax analysis ? |
Parsing/construction of a parse tree Checking that the rules of grammar/syntax have been obeyed Production of an error report |
|
What are the reasons for code optimization? |
Minimise execution time Produces code that minimise the amount of memory used |
|
What are the main steps in the evaluation of RPN expression using a stack |
Working from left to right in the expression If element is a number PUSH that number onto the stack If the element is an operator then POP the first two numbers from stack PUSH result back onto stack End once the last item in the expression has been dealt with |
|
Describe how an operating system can maximise the use of resources using primary memory |
Making use of virtual memory with paging or segmentation in order to swap memory to and from a disk. Segmentation in order to swap memory to and from a disk. |
|
Describe how an operating system can maximize the use of resources using disk |
By defragmentation, the files are rearranged to occupy a disk space which reduces the time taken to access files. By disk caching which disk cache holds data that is frequently transferred from disk |
|
Explain how paging is used to manage virtual memory? |
Divide memory / RAM into frames • Divide virtual memory into blocks of same size called pages • Frames / pages are a fixed size • Set up a page table to translate logical to physical addresses • Keep track of all free frames Swap pages in memory with new pages from disk when needed |
|
What are the types of data in the keyword tables? |
Tokens Reserved words operators |
|
What are types of data in the symbol table? |
variable constants data type identifier name |
|
How the contents of the keyword and symbol tables are used to translate the source code program? |
The keywords are looked up in the keyword table The identifiers are looked up in the symbol table Identifiers are converted into address. |