Flashcards
A2 System Software
Flashcards do conjunto (31)
- 1How do OSes maximise resource use?- CPU usage management - via scheduling
- Memory usage management/optimisation via system calls, VirtualMem, Partitioning...
- I/o management (aka device management), including storage devices management, interrupt handling
- File storage management: File size quotas, maintenance of file structures, file creation... - 2What is a system call?A message from a software to CPU requesting memory allocation for either new processes, hardware services or scheduling of any running processes. CPU contacts kernel which, after having looked at the call's priority level or GUI interaction nature to allocate memory slots (if any are available), perform hardware services or do the required scheduling.
After process has been completed, its slot in memory is removed - 3What is a process and what makes it different from software?Process: current running programme that takes up time. Also a program that is about to enter memory.
Process: dynamic code (currently being executed). Program: Static code (written). - 4How do OS hide complexity of hardware from userOS hide complexity of hardware from user so that specialised understanding of hardware is not required by the user.
- Provides interface between hardware and user/application
- Provides an interface for a user to manage files instead of dealing directly with the storage medium.
- Controls users' access rights to accessing different types of hardware on the interface - 5What does a high level scheduler (aka long term scheduler) do?Takes a process from backing store and puts it into memory/ready queue. Organises the processes in ready queue using some kind of scheduling algorithm
- 6What does the low level scheduler (aka short term scheduler) do?Looks at the processes in the ready queue and decides which process gets executed by the CPU by placing it on the runnning queue. It is also called upon after an interrupt has been handled.
- 7What does the interrupt handler do when an interrupt is detected and serviced?Interrupt Handler Software (IRS) do the following:
- identify source of interrupt
- Disables lower priority interrupts
- Save PC content in a safe space in memory
- Transfer register components into a stack
- ISR loaded with appropriate interrupt handling code
- Interrupt is handled
- registers and pc are restored to their places, lower priority interrupts enabled and resumes the process that was running before interrupt came - 8What is the point of memory management?- So that kernel's safe space is protected from programs that try to access it
- so that processor time scheduled for the most efficient uses
- so that memory as a resource is used most efficiently by processes that need it
- so that programs do not try to access one another's data
- memory fragmentation can occur; as a result the medium level scheduler may need to move data out of memory so that this problem is solved. - 9What is paging?Divides a process into pages, and divides a logical memory unit into corresponding page frames. Pages are of the same size. Pages and page frames do not have to be contiguous. The page frames are given a corresponding physical address in the physical memory. Translation of page frames' logical addresses are done using page tables. Pages can be loaded in and out of their frames in logical memory (page swapping), but not all of them are initially loaded.
- 10What is segmentation?Programmers divide up program into segments. Segments are not always initially loaded into memory, and are loaded when they are required. Segments can be of varying sizes. Segments are typically whole parts of a program, e.g. a segment can be a entire loop instruction or a segment can be an entire module.
- 11What is partitioning?The MMU divides main memory up into partitions. One or more programs is loaded into partitions. Partitions are used to specifically store similar programs, e.g. word processing programs may be stored in the same partition. Partitions' sizes can be either fixed or dynamic. When a prorgam's process makes a system call, it can be loaded into the ready queue (scheduled) by placing the process in its partition
- 12What is virtual memory?The use of space on secondary storage as primary storage memory.
- 13Advantages of virtual memory?Allows for a lot more storage space than primary storage memory
Maximises RAM use since the more idle pages are swapped for more active pages
programs can still be ran if some of its pages are on secondary storage
Allows for fragmented programs to run - 14Disadvantages of virtual memory?- Thrashing can occur - reduced performance due to constant page swapping
- Less secondary storage space available
- Page swapping and page translation between physical and virtual memory increases overhead time
- slower access time than main memory - 15What is a virtual machine?A software application that runs on the OS that attempts to emulate the workings of either an OS, an application or an application server by implementing an existing hardware set-up.
- 16What is a system VM?System VM-a platform for an OS and software running on it to be executed, emulates – e.g. VirtualBox
- 17What is a process VMProcess VM-runs on a current OS, supports a software's process
Is created when the process runs, terminatedwhen process terminates
Functions as an OS-Independent environment for software to be run on. Programs can run on it as if it is running on the OS it was made for - 18What is a server VMServer VM - caters resources to software's needs (as a server would) that support guests VMs (other VMs). Also known as server virtualisation. A really powerful server can have multiple VMs on it for various server programs (e.g. one VM for authentication server, another VM for file server, both VMs run on the same server computer)
- 19Benefits of VM?Firms with legacy status – reduces need to restructure old programs for new ones may continue using old software by running them on VM (as they may be virus-prone on newer host OS) with the benefit of newer hardware
Fully utilises a computer's hardware capabilites, especially in the case of system VMs
Allows sandboxing – when files and processes running and stored on the VM are fully contained within the confined limits of the VM
Allows programmers to write codes on the VM since existing I/O may restrict this
Multiple OS can simultaneously and separately run on the same computer - 20Limitations of VM?Both the programs running on the VM and those running on the host OS may be slower as more resources (RAM, hard disk...) is needed at the same time-performance issues
VMs are not always able to utilise all of the existing hardware
Full emulation of OS not always possible - 21How can interpreters execute programs without producing a translated version?They translate their source code into bytecodes line by line, hence do not produce stand-alone object code that is later turned into machine code (unlike compilers)
- 22What are the five stages of front-end program compilation?Lexical analysis
Syntax analysis
Semantic analysis
Intermediate Code generation - 23What happens in the lexical analysis stage?The analyser divides parts of source code and groups them into meaningful lexemes that make up each token. Identifiers are a special case: they are grouped into symbol tables instead of tokens. Generates an error list of invalid tokens. Tokens and symbol table are supplied to the syntax analyser.
- 24What happens in the syntax analysis stage?analyses program structures (subroutines, for e.g.). Results in a parsing tree. A parsing tree has a hierarchical structure, which ensures operations are done in correct order. A list of syntax errors is created.
- 25What happens in the semantic analysis stage?Parse trees have no grammatical meaning to them; they simply represent orders in which subroutines and statements are carried out
Semantic analysis creates an annotated abstract syntax tree which serves the purpose of understanding the FULL meaning of the code. Also, each identifier has attributes associated to it, such as its data type. These are also recorded in the symbol table. - 26What happens in intermediate code generation?reducing statements into various smaller statements that uses fewer addresses (i.e. variables).
- 27What is back-end analysis?The step that follows front end analysis. If errors found during the front end analysis, the only output from B.E. analysis would be a list of errors, otherwise the back end analysis takes intermediate codes and optimise them.
- 28If a token T1 can take any number of times the values in the token Digits, and the token Digits has either values 1,2 or 3, what is token T1's backus-naur form definition?::=|
- 29Converting from infix to RPN?Shunting Yard Algorithm
DO
If token is a variable/number THEN
Move it straight to the RPN line
ELSE
IF incoming token>stack's top token OR
incoming token==(same operator) top of stack THEN
incoming token placed top of stack
Else IF incoming token - 30Converting RPN to infix?Add operator or value, from left to right, to the stack. When it evaluates an operator, the operation is done on the top two stack values. The newly calculated value becomes the top stack value. Repeat until all values and operands have been added to stack (should give 1 final value)
- 31What type of traversal is used to derive RPN from a syntax tree that represents infix?Post Order - L,R,Root
Informações
- Descrição
- Advanced Level (A- Level) Computer Science (A2 System Software) FlashCards sobre A2 System Software, criado por TS P em 24-11-2016.
- Criado por
- TS P
- Visualizações
- 0
- Avaliação