Unit 2 - Systems software
Folien in diesem Satz (58)
-
- An Operating System is a program or set of programs that manages the operations of the computer for the user.
- It acts as a bridge between the user and the computer's hardware.
- The Operating System is held in permanent storage, for example on a hard disk. A small program called the loader is held in ROM. When a computer is switched on the loader in ROM sends instructions to load the OS by copying it from storage into RAM.
-
Functions of an Operating System
- The OS provides...
- a user interface
- memory management
- interrupt handling
- processor scheduling
-
- The OS hides the complexity of the hardware from the user by providing a user interface.
-
- Programs and their data need to be loaded into RAM
- The OS must manage the allocation of RAM to the different programs
- There may not be sufficient RAM for all desired processes to be completely loaded into RAM at once
-
- Available memory is divided into fixed sized chunks called pages
- Each page has an address
- A process loaded into RAM is allocated sufficient pages, but those pages may not be contiguous in physical terms
- A page table maps between the logical memory locations and the physical memory locations
-
Memory management - Segmentation
- Alternatively, memory is divided into segments which can be of different lengths
- Segmentation can relate to parts of a program, for example a particular function or subroutine may occupy a segment.
-
- A computer has a fixed amount of RAM, the demands of memory will often exceed this amount
- An area of the hard disk can be designated as virtual memory
- Some of the pages of a current process are stored in virtual memory until they are needed, at which point they are swapped into RAM
- If many processes are running and the computer has insufficient RAM, lots of time is spent swapping pages in and put of virtual memory
- Repeatedly swapping pages can noticeably slow down the computer this is known as disk thrashing
-
- It is vital that the CPU can be interrupted when necessary
- Interrupts can be sent to the CPU by software, hardware devices or the CPUs internal clock
- Examples of interrupts are:
- An input/output device sends an interrupt signal
- The printer runs out of paper
- An error occurs in a program
- A scheduled interrupt from the internal clock
- Power failure
- The CPU checks at the end of each clock cycle whether there are any interrupts to be processed
-
- When an interrupt is detected, the processor stops fetching instructions and instead pushes the current contents of its registers onto a stack
- The CPU uses an Interrupt service routine to process the interrupt
- When processing has finished the values can be popped from the stack and reloaded into the CPU
-
- Interrupts have different priorities, and will be processed in order of priority
- Interrupts can themselves be interrupted if the new interrupt is of a higher priority
- If a higher priority interrupt occurs whilst an interrupt is being processed the original interrupt's registers will be pushed onto the stack as well
- The stack is a Last In First Out (LIFO) data structure so the last data to be pushed on the stack will be the first to be retrieved
-
- A single CPU can only process instructions for one application at a time
- The OS must schedule when each application can use the CPU
- This gives the illusion of multi-tasking multiple applications appear to be running simultaneously
-
- To provide an acceptable response time to all the users
- To maximise the time the CPU is usefully engaged
- To ensure fairness on a multi-user system
-
Processor scheduling - Round Robin
- Each job is allocated (by FIFO) a time slice during which it can use the CPU's resources
- If the job has not been completed by the end of its time slice, the next job is allocated a time slice
- Bildunterschrift: Round Robin
-
- The first job to arrive is executed until it is completed
-
- The time to completion is estimated as each new job arrives
- The job with the shortest remaining time to completion is executed, meaning that a shorter new job can take over from the current process
-
- Also known as "shortest process next"
- As with shortest remaining time, the total execution time of each job is estimated by the user
- The waiting job with the shortest total execution time is executed when the current job is completed
-
- Multiple queues are created with different priority levels
- If a job uses too much CPU time it is moved to a lower priority queue
- Processes can also be moved to a higher priority queue if they have waited a long time
-
- A distributed OS can coordinate the processing of a single job across multiple computers
- A program can be run by the user that uses data or resources from any other computer e.g- processor time, memory, I/O devices
- The distribution of tasks is coordinated by the OS passing instructions between computers
- The user can access more computational power with the illusion of working with a single processor
- Advantage - No need for training or writing programs differently
- Disadvantage - The programmer has no control over the task distribution as this is entirely handled by the OS
-
Multi-tasking Operating Systems
- Enables a user to carry out task simultaneously
- Time slicing is used to switch quickly between programs and applications in memory
-
- Multiple users make use of one computer
- A scheduling algorithm is used to allocate processor time fairly between jobs and prevent processor starvation
-
Multi-user, Multi-tasking system
- Some systems use a very powerful computer called a mainframe
- Lots of users with their own terminals access the mainframe's CPU and each gets a time slice
- Each terminal is also running multiple processes
-
- A smartphone is a computer with a multi-tasking Operating system
- Mobile OSs are linked to specific hardware
- A low level proprietary OS is used for handling the hardware and special features
- Meanwhile the main OS handles the user interface and running applications
-
- Open source is used by all major device manufacturers
- It allows for major customisation
- A device manufacturer fine-tine the OS to suit their devices, and add additional features or user interfaces to enhance the users experience
- The interface and the available apps can be a major selling point
-
- Built to perform a small range of specific tasks
- Catered towards a specific device e.g- a household appliance
- Limited functionality and hard to update
- Consumes less power than other types of OSs
-
- Some operating systems must operate in real time
- Must respond extremely quickly to inputs
- May need to cope with many inputs simultaneously
- Real time OSs are usually seen in safety critical environments
- If a hardware component fails the OS must have a failsafe to detect this and respond accordingly
- There is hardware redundancy - crucial components are duplicated in case one fails
-
Basic Input Output System (BIOS)
- Basic Input Output System is the first program that runs when a computer system is switched on
- Runs a series of tests before the operating system is loaded into memory:
- POST(Power On Self Test) which ensures that all hardware is correctly connected and functional
- Checking the CPU clock, memory and processor
- Testing for external memory devices
-
- A driver is a program that provides an interface for the OS to interact with a device
- Drivers are hardware dependent and OS specific:
- Drivers are needed to allow the OS to control hardware devices from your speakers to your graphics card
- The OS does not need to know the specifics of the hardware to be able to interact with it
-
- A theoretical computer and a software implementation of a computer system
- Provides an environment with a translator for intermediate code to run
- Uses of virtual machines include:
- Testing programs
- Protection from malware
- Running software compatible with different versions/types of operating systems
-
- Code halfway between machine code and object code is called intermediate code
- Independent of processor architecture so can run across different machines and operating systems
- Takes longer to execute than low-level code
-
-
- Systems software is low-level software that is responsible for running the computer system smoothly, interacting with hardware and generally providing a platform for applications software to sun.
- The user does not directly interact with systems software but it ensures high performance for the user
- Examples - Library programs, utility programs, operating system, device drivers
-
- Utility programs optimise the performance of the computer and perform useful background tasks
- Examples - Disk defragmenter, Automatic backup, Automatic updating, Virus checker and compression software
-
Utility Programs - Disk defragmenter
- Large files stored on a magnetic hard drive may be split up across several physical disk locations
- Disk defragmenter reorganises the hard drive so that files are in sequential blocks where possible
- The result is that files can be read more quickly
-
Utility programs - Automatic backup
- Data in permanent storage needs to be regularly backed up
- The users may forget so...
- The process can be automated, specifying:
- Where - portable hard drive, cloud, local server...
- When - usually when the computer is not being used
- What - which data should be backed up
- How - should backups be compressed
-
Utility programs - Automatic updating
- Runs in the background detecting software update releases and automatically installing them
- Some updates add new software features
- Some important updates fix security issues which could otherwise be exploited by hackers
-
Utility programs - Virus checker
- Scans permanent storage for viruses by comparing files to known virus definitions
- May also san files "on access" as they are opened
- Must be kept up to date with new virus definitions to be effective
- Antivirus software uses heuristics - it now what types of behaviour are likely to be used by a malicious program
-
Utility program - Compression software
- Operating systems provide utilities that enable files to be compressed and decompressed
- This is used when compressing large files to be transmitted across the Internet and commonly used to compress scanned files
-
- Allows programs to use pre-written routines to be translated into executable code
-
- Application software is designed to be used by the end-user to perform one specific task
- Application software requires system software in order to run
- Examples - desktop publishing, word processing, spreadsheets, web browsers
-
Off the shelf or Bespoke software?
- Ready made software available to anyone to purchase is known as off the shelf software
- Software that is custom created for a specific user is known as bespoke software
- Bespoke software is mostly used by businesses rather than individuals
-
- Open source software allows anyone to access its source code
- The software is open source licensed out free to use
- Anyone may modify the software and sell it on the condition that the software produced is also open source
- Different from freeware - software that is free for anyone to use but the source code is not available
-
Closed source (proprietary) software
- Closed source software does not allow access to the source code
- Users must pay the person or company who owns the copyright for a license to use the software
- There may be restrictions on how the software is used
-
- Computers execute machine code
- It is difficult for humans to read, write and debug machine code
- Assembly code instructions are equivalent to machine code but easier for humans to work with e.g- LDA 5
-
- Assembly code is a low level language
- Translating assembly code instructions into machine code is done by an assembler
- Each processor has its own instructions set and so the object code produced will be hardware specific
-
- A compiler translates a whole program written in a high level language into executable machine code, going through several stages
- The resulting machine code is called object code
- The object code produced is also hardware specific
-
- An interpreter also translates code written in a high level language into machine code
- However, the interpreter does this line-by-line rather than translating the whole program before any of it can be executed
-
- Compiler
- Advantages:
- Program can be run many times without the need to recompile
- Faster to execute than interpreted code
- Compiled code cannot be easily read and copied by others
- Disadvantages:
- Must be recompiled to run on other platforms as it is hardware specific
- The source code must be re-compiled every time the programmer changes the program.
- Interpreter
- Advantages:
- Source code can be run on any machine without the interpreter
- If a small error is found, no need to recompile the entire program
- Disadvantages
- The program may be slower than a compiled program
-
- Most languages are not solely compiled or interpreted they use a combination of both
- For example - Java is compiled into bytecode which is an intermediate step between source code and machine code
- The bytecode is interpreted by a bytecode interpreter
-
- A compiler goes through several stages to convert source code to object code they are...
- Lexical analysis
- Symbol table
- Syntax analysis
- Semantic analysis
- Code generation
-
- All unnecessary spaces and all comments are removed
- Keywords (e.g-print), constants and identifiers are replaced with tokens representing their function in the program
-
- The lexer will build up a symbol table for every keyword and identifier in the program
- The symbol table helps to keep track of the run-time memory addresses for each identifier
-
- The stream of tokens from the lexing stage is split up into phrases
- Each phrase is parsed which means it is checked against the rules of the language
- If the phrase is not valid, an error will be recorded
-
- It is possible to create a sequence of tokens which is valid syntax but is not valid program
- Semantic analysis checks for this kind of error
- If an identifier has not previously been declared then semantically it is not a valid program
-
- Once the program has been checked the compiler generates the machine code
- It may do this in several "passes" over the code because code optimisation will also take place
-
- Sometimes source code is written insufficiently
- Code optimisation aims to...
- remove redundant instructions
- replace inefficient code with code that achieves the same result but in a more effective way
-
- Most languages have sets of pre-written ( and pre-compiled) functions called libraries eg-mathematical operations
- A programmer can also write their own libraries
- Library functions can be called within a program
-
- The linker needs to put appropriate memory addresses in place so that the program can call and return from a library function
-
- The job of the loader is to copy the program and any linked subroutines into main memory to run
- When the executable code was created it may assume the program will load in memory address 0
- However, memory addresses in the program will need to be relocated by the loader because some memory will already be in use
Informationen
- Beschreibung
- A level Computing Folienset am Unit 2 - Systems software, erstellt von Jodie Jacob am 26/11/2021.
- Erstellt von
- Jodie Jacob
- Aufrufe
- 73
- Bewertung