Software and software development Flashcards
What is meant by the term ‘operating system’?
A collection of programs that work together to provide an interface between the computer and the user
Give examples of mobile phone operating systems
Android
iOS
Give examples of desktop operating systems
Windows
MacOS
Name the features that an operating system can provide for a computer system
- File management (moving, editing, deleting files and folders, sorting files into directories)
- Memory management (segmentation, virtual memory)
- Resource management (schedulling)
- User Interface
- Security (firewalls)
- Interrupt management
- Utility software (disk defragmentation, antivirus, backup…)
- Input/Output management (using device drivers)
What is meant by paging?
MEMORY MANAGEMENT OS
Memory is split into equally sized sections known as pages
-Programs are made up of a certain number of pages
-These pages can be swapped between main memory and the hard disk as they are needed
Explain memory management by the OS
Computer memory has to be shared fairly between the multiple programs and applications being used
-Often MM is not large enough
-So one of the roles of the OS is to make sure that main memory is shared efficiently through paging, segmentation and virtual memory
What is meant by segmentation?
MEMORY MANAGEMENT OS
Splitting up of memory into logical sized divisions known as segments (which vary in size)
-Segments are representative of structure and logical flow of program as each is allocated to blocks of code (eg. conditional statements or loops)
Segmentation is the process of splitting up memory into equally sized divisions called segments?
TRUE OR FALSE
FALSE
They dont necessarily have to be equal they are ‘logically sized’, which means that they are split depending on the logical structure of the program as each segment is allocated to a section of code
What is meant by virtual memory?
VM uses a section of the hard drive to act as RAM when there isnt enough space in MM.
So:
Sections of programs not being used currently are temporarily moved to VM through paging which frees up memory in RAM
Give a disadvantage of paging
Disk thrashing
When the disk freezes as a result of pages being swapped too frequently between main memory and the hard disk
-So more time is spent swapping rather than actually running the program
-This gets worst as virtual memory is filled up as:
In general the system has to swap pages in and out more frequently
VM must continually decide which pages to swap out to make space for others, this adds to overhead
Disk operations are slower than RAM operation
What is meant by RAM?
RANDOM ACCESS MEMORY
Type of computer memory that is used to temporarily store data that is being actively used or processed by the computer
-Its volatile memory = it loses its contents when power is turned off
MAIN MEMORY
Split into 2 parts:
RAM= Random Access Memory
ROM = Read only Memory
What is meant by volatile memory?
Requires power in order to retain its contents
What is meant by the term ‘Random Access’ in RAM?
Data in RAM can be accessed in any order without the need to go through other data sequentially.
MEANS THAT it doesn’t need to start from the beginning and go through all previous data to reach a particular point
-Allows for quick and efficient information retrieval
What is meant by the term interrupts?
Signals generated by software or hardware indicating to the processor that a process needs attention
What is taken into account before servicing interrupts?
Their priority / how urgent they are
Interrupts are ordered in a priority queue in a special register known as an interrupt register
Explain the role of the OS in Interrupts
The job of the OS is to ensure that interrupts are serviced fairly (taking into account their priority) by the processor through the Interrupt service routine (ISR)
Explain the Interrupt service routine
1.Processor checks contents of interrupt register at the end of each FDE cycle
- If interrupt exists of higher priority than the process being executed, current contents of the Special purpose registers in the CPU are temporarily transfered into a stack
3.Processor responds to interrupt by loading appropriate Interrupt Service Routine (ISR) into RAM
- A flag is set to signal the ISR has begun
- One ISR is serviced flag is reset, interrupt queue is checked again for interrupts of higher priority than one being executed.
- No more/ lower priority interrupts then contents of stack are placed back into Special PRs and the FDE cycle is resumed
What is disk thrashing?
The excessive swapping of pages between RAM (main memory) and virtual memory (hard disk)
Schedulling algorithms can be:
Preempt = interrupt
Pre-emptive: If a new job arrives with a shorter remaining time than the currently running job, the CPU will preempt (interrupt) the current process and switch to the new, shorter task.
Non pre-emptive: Once a job starts executing, it cannot be interrupted by other processes. The CPU remains committed to that process until it completes.
What is meant by schedulling?
One of the roles of the OS is to ensure that all sections of program being run (jobs) receive a fair amount of processing time
-This is done by implementing schedulling algorithms (which can be preemtive or non preemptive)
Give examples of pre-emptive schedulling algorithms
-Round Robin
-Shortest Remaining Time
-Multilevel Feedback Queues
Give examples of non pre-emptive schedulling algorithms
-First come first served
-Shortest Job first
Give disadvantages of Round Robin
-Doesnt take into account job priority
-Longer jobs will take much longer to complete as their execution is inefficiently split into multiple cycles
Give an advantage of Round Robin
-Each job is seen to/ carried out
Explain the Round Robin schedulling algorithm
ITS PRE-EMPTIVE
-Uses time slicing: Each job is given a section of processor time (TIME SLICE) which it is allowed to execute within
-Once each job has used up its time slice and hasnt finished, the OS will give another time slice to each of the jobs
-Once a job is completed it is removed from the queue
Explain the First Come first serve schedulling algorithm
NON PRE-EMPTIVE
-Jobs are carried out in chonological order by which they entered the queue
Give a disadvantage of the First Come first serve schedulling algorithm
Doesnt allocate processor time based on the priority of each job (as the jobs are carried out in chronological order)
Explain the multilevel feedback queues schedulling algorithm
PRE-EMPTIVE
Makes use of multiple queues, each is ordered based of different priorities
Give an advantage of multilevel feedback queues schedulling algorithms
Takes into account the priorities of the jobs to be completed
Give an disadvantage of multilevel feedback queues schedulling algorithms
Difficult to implement due to the deciding of which job to prioritise based on the combination of priorities
What is meant by processor starvation?
When a process is delayed or unable to access the CPU, preventing it from executing.
*This situation arises when higher-priority tasks continually take precedence over lower-priority ones, resulting in certain tasks being “starved” of processing time.
-Disadvantage which can occur in Shortest Job first schedulling algorithms
Explain the Shortest Job First Schedulling algorithm
NON PRE-EMPTIVE
-Queue storing the jobs which need to be processed is ordered according the time they will take to be completed
-(Longest jobs at the end and shorter jobs are given preference)
Give disadvantages of using the Shortest Job First Schedulling algorithm
-Processor starvation (lower priority jobs dont end up getting done as higher priority/ shorter jobs keep getting added to queue)
-Requires processor to know how long each job takes which is not always possible
Explain the Shortest Remaining time schedulling algorithm
ITS PRE-EMPTIVE
The queue storing jobs to be processed is ordered based on the time each of them have remaining to be completed
(Jobs with less time remaining are prioritised and therefore at the start of queue)
If a new process arrives with a shorter remaining time than the currently running process, the CPU will preempt (interrupt) the current process and switch to the new, shorter task.
Shortest job first is a type of schedulling algorithm most suited for…
batch systems
Explain the difference between Shortest Job first and Shortest remaining time algorithms
Shortest Job First
Non preepmtive: Once a process starts executing, it cannot be interrupted by other processes. The CPU remains committed to that process until it completes.
Shortest Remaining Time
Preemptive: If a new process arrives with a shorter remaining time than the currently running process, the CPU will preempt (interrupt) the current process and switch to the new, shorter task.
Give a disadvantage of Shortest remaining time schedulling algorithm
Risk of processor starvation for longer jobs if shorter jobs keep being added to the job queue
What are the different types of Operating Systems?
-Distributed
-Embedded
-Multi-Tasking
-Multi-User
-Real Time
There are various types of Operating Systems. Distributed is one of them.
What is meant by a distributed Operating System?
Its run accross multiple devices
Allows the load to spread accross multiple computer processors when running a task
There are various types of Operating Systems. Embedded is one of them.
What is meant by a embedded Operating System?
Designed to perform a small range of specific tasks
-Its catered towards a specific device
-Has limited functionality and they are hard to update
There are various types of Operating Systems. Multi-tasking is one of them.
What is meant by a Multi-tasking Operating System?
Allows user to carry out tasks seemingly simultaneously by using time slicing ( so it uses a pre-emptive schedulling method)
-To switch quickly between programs and applications in memory (so it creates the illusion that they are all ruining at once)
Each application or process is given a time slice/ gets a turn to use the CPU for a brief period before the OS switches to another task.
There are various types of Operating Systems. Multi-User is one of them.
What is meant by a Multi-User Operating System?
Multiple users make use of one computer, typically a supercomputer.
A schedulling algorithm needs to be used so that processor time is shared fairly between jobs
There are various types of Operating Systems. Real Time is one of them.
What is meant by a Real Time Operating System?
Used in time critical computer systems
-As its designed to perform a task within a guranteed time frame
Which type of operating system consumes the least amount of power out of all the types?
Embedded
When would a Real Time OS be suitable?
For systems which manage situations where a response within a certain time period is crucial to safety (eg self driving cars)
*As they perform a task within a guaranteed time frame
What the BIOS? Explain it
BASIC INPUT OUTPUT SYSTEM
-This is the first program which is run when a computer system is switched on
-Program counter register points to the location of the BIOS when the computer is started up as the BIOS is responsable for doing checks before the OS is loaded into memory (RAM) from the hard disk
*IT IS ONLY AFTER THESE CHECKS THAT THE OS CAN BE LOADED INTO RAM FROM THE HARD DISK)
CHECKS:
-Poweron self test (POST) = ensures all hardware (disk drives, keyboard) are connected correctly and functional
-Checks CPU clock, memory and processor
-Checking for any external memory devices connected to the computer
What is meant by the term ‘bootstrap’?
The name of the program which loads the operating system from the hard disk into main memory (RAM)
The name of the program which loads the operating system from the hard disk into main memory (RAM) is?
Bootstrap
What are device drivers?
Computer programs provided by the OS which allow the OS to interact with hardware
E.g When a piece of hardware such as a keyboard is used, the device driver communicates this request to the OS
-The OS then produces a relevant output such as displaying a character on the screen
Device drivers interact with the OS. What does this say about the relationship between device drivers and the OS it interacts with?
Device drivers are specific to the operating system installed on the hardware device
Device driver’s are specific to a computer’s architecture
TRUE OR FALSE?
TRUE
Diff device drivers must be used for different device types (e.g smartphones, game consoles, desktop PCs)
What is a virtual machine?
A theoretical computer as it is a software implementation of a computer system
It also provides an environment with a translator for intermediate code to run
Using the example of the user typing in a character into their keyboard. How would the use of device drivers be relevant in dispkaying this on the screen?
A device driver is a program provided by the OS which allows the OS to communicate with hardware
When a piece of hardware such as a keyboard is used, the device driver communicates this request to the OS
-The OS then produces a relevant output such as displaying a character on the screen
What is meant by intermediate code?
Code that is halfway between machine code and object code
Its independent of processor architecture so it can be used across all different machines and operating systems
Give me an advantage of intermediate code
Its independent of processor architecture so it can be used across all different machines and operating systems
Give uses of Virtual machines
-Protection from malware
(as malware will affect the Virtual machine rather than the device being used as VMs operate in isolated environments)
-Running incompatible software
(Programs specific to diff OSs or diff versions of an OS can be run within a VM)
-Development environment for programmers to test programs on diff OSs (as it saves money having to purchase different devices for testing)
Can you explain why Virtual machines can provide a device protection from malware?
Virtual machines operate in ISOLATED environments. Each VM runs its own operating system and applications independently from the host machine/device and other VMs.
This isolation helps contain malware, preventing them from spreading to the host system or affecting other VMs.
How does a virtual machine help when running incompatible software?
Programs specific to diff OSs or diff versions of an OS can be run within a VM which saves money in having to purchase the required hardware
(e.g games console being implemented on a PC via a virtual machine)
Software can be categorised as…
-Application software
-Systems software
What is meant by application software?
Software designed to be used by the end user to perform one specific task
It requires systems software to run
Give examples of application softwares
-Word processing
-Spreadsheets
-Web browsers
-Desktop publishing
What is systems software?
Software designed to manage and control the hardware components of a computer, as well as provide a platform for running application software.
(So it serves as a bridge between the hardware and user applications)
Give examples of Systems software
-Operating systems
-Library programs
-Utility programs
-Device drivers
What is meant by ‘utilities’?
A type of system software which is responsable for the consistent, high performance of the operating system
-Linked to the maintenance of the OS
Disk defragmentation is a type of utility software
Explain it
Disk defragmenter utility rearranges contents of hard disk so that files can be stored in contigous spaces so they can be accessed faster
-As hard disk becomes full R/W slow down
This is because files become fragmented as they are stored in diff parts of memory’
(fragmented = scattered)
Give examples of utilities
-Compression
-Disk defragmentation
-Antivirus
-Backup
-Automatic updating
Why does fragmentation occur?
When files are divided into multiple parts (fragments) and stored in different areas of the disk.
Occurs over time as files are created, deleted, and modified.
As files are deleted, small gaps are left on the disk. When new files are saved, they may be broken up and placed into these gaps if there isn’t enough contiguous space available, leading to fragmentation.
Antivirus is a type of utility software
Explain it
Responsible for detecting potential threats to the computer
Automatic updating is a type of utility software
Explain it
Ensures system is up to date ==> tackles security flaws, less vunreable to malware
Updates are automatically installed when the computer is restarted
Backup is a type of utility software
Explain it
Automatically creates routine copies (regularly scheduled backups) of specific files selected by user.
User also specifies how often these are backedup
Good for power failure, malicious attack so files can be recovered
What is meant by a ‘translator’?
A program which converts high level source code into low level object code which is then ready to be executed by a computer
3 types: assembler, compiler, interpreter
What is the main role of a compiler?
Translates high level code into machine code
How does a compiler work?
Translates HL code into MC all at once
-First checks for errors and reports back if found any
-Then translates whole code at once
-Produces machine code which can only be executed on certain devices
*Compiled code is specfic to a particular processor type and OS
-Code can be run without need for source code or translator to be present
*If you need to make changes, after that the whole code needs to be recompiled
Assembly code is platform specific
What does this mean?
Instructions used are dependent on the instruction set of the processor as each processor may have a diff instruction set
Give info on assemblers
-They translate assembly code into machine code
-Each line of assembly code is equivalent to almost one line of machine code (one to one relationship)
-Platform specific as they convert assembly code into machine code, assembly code is tailored to a specific processor as diff processors have diff instruction sets
Which translator has the longest initial compilation process and why?
Compilers as they carry out multiple checks to see if there are any errors
Interpreters
Translate HL code into MC line by line
-They stop and alerts there is an error if it detects one ==> Good for debugging as it stops when it gets to an error
-Slower than running compiled code as code must be translated each time its run/executed
-Both interpreter and source code must be present when code is run on different devices, however code can be executed on a range of diff platforms as long as right interpreter is available
Generally which runs faster a compiler or interpreter?
A compiler is generally faster
-A compiler translates the entire source code into machine code (or an intermediate language like bytecode) before the program is run.
This produces an executable file, which can then be executed directly by the hardware without needing the source code or the compiler.
-An interpreter translates the source code line by line while the program is running, and executes each line immediately after translating it.
This means that each line has to be translated every time the program is run, which slows down execution.
Interpreted code is generally more portable
TRUE OR FALSE?
When a compiler is used, high level code goes through…. before…
STAGES OF COMPILATION
When a compiler is used, high level code goes through 4 STAGES before IT IS TURNED INTO OBJECT CODE READY TO BE EXECUTED
Stages:
Lexical Analysis
Syntax Analysis
Code Generation
Optimisation
STAGES OF COMPILATION
Lexical Analysis
- Lexical Analysis:
-Whitespace and comments are removed
-Remaining code is analysised for keywords and names of constants and variables
-which are replaced with tokens. Info about each token associated with each keyword or identifier is stored in a symbol table
STAGES OF COMPILATION
Syntax Analysis
- Syntax Analysis
-Tokens are analysed against rules of programming language, if they break these they are flagged up as syntax errors (incomplete brackets, undeclared variable type)
-An abstract syntax tree is produced
-Further details about identifiers is added to symbols table
-Semantic analysis is carried out (logic mistakes are detected)
Representation of source code in the form of a tree
What is this called?
Abstract syntax tree
What is meant by an ‘abstract syntax tree’?
A representation of source code in the form of a tree
What is meant by semantic analysis?
Analysing the code for logic errors such as undeclared identifiers, multiple declaration
Give examples of syntax errors
-Undeclared variable type
-Incomplete set of brackets