SLR 2 Flashcards
What features do operating systems provide
- Memory management (paging, segmentation, virtual memory)
- Resource management (scheduling)
- File management (moving, editing, deleting files and folders)
- Input/ Output management (device drivers)
- Interrupt management
- Utility software (disk defragmenter, backup, formatting etc.)
- Security (firewall)
- User interface
What is segmentation
Segmentation is the splitting up of memory into logical sized divisions
Interrupts
Interrupts are signals generated by software or hardware to indicate to the processor that a process needs attention
Different types of operating systems (D)
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.
Different types of operating systems (E)
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.
What does a translator do?
A translator is a program that converts high-level source code into low-level object code, which is then ready to be executed by a computer
What is a compiler?
Compilers translate high-level code into machine code all at once, after carrying out a number of checks and reporting back any errors
What is a interpreter?
Interpreters translate and execute code line-by-line. They stop and produce an error if a line contains an error
Assembler
Assemblers translate assembly code into machine code. Each line of assembly code is equivalent to almost one line of machine code so code is translated on almost a one-to-one basis.
Assembly code
Assembly code is considered to be a low-level language as it is the ‘next level up’ from machine code. Assembly code is platform specific
Stages of compilation
Lexical Analysis
Syntax Analysis
Code generation
Optimisation
Lexical Analysis
whitespace and comments are removed from the code.
The remaining code is analysed for keywords and names of variables and constants. These are replaced with tokens and information about the token associated with each keyword or identifier is stored in a symbol table.
Syntax Analysis
tokens are analysed against the grammar
and rules of the programming language. Any tokens that break the rules of the programming language are flagged up as syntax errors and added to a list of errors.
e.g. incomplete brackets or variables not defined
Semantic Analysis (Within Syntax Analysis)
where logic mistakes within the program are detected. e.g. multiple declaration, undeclared identifiers
Code Generation
The abstract syntax tree produced in the syntax analysis stage is used to produce machine code.
Optimisation
This stage of compilation searches through the code for areas it could be made more
efficient. The aim of optimisation is to make the code faster to execute although this stage can significantly add to the overall time taken for compilation.