Ch. 5 System software
5.1 Operating systems
Why does a computer system requires an OS
- OS: some software to control the hardware and interact with application software
Key management tasks carried out by the OS
- User-system interface
- command-line interface
- graphical user interface
- Program-hardware interface
- allowing the programmer to write a program without needing to know the details of the hardware
- Resource management
- process: when a program has started to run
- scheduling of processes
- resolution of conflicts when two processes require the same resource
- Memory management
- memory protection ensures that one program does not try to use the same memory locations as another program
- the memory organisation scheme is chosen to achieve the best usage of limited memory size, for example, virtual memory involving paging or segmentation
- memory usage optimisation involves decisions about which processes should be in the main memory at any one time and where they are stored in this memory
- Device management
- installation of the appropriate driver software
- control of usage by processes
- File management
- storage space is divided into file allocation units
- space is allocated to particular files
- maintains/creates directory structures
- specifies the logical method of file storage
- provides file naming conventions
- implements access rights
- specifies tasks that can be performed on a file
- Security management
- provision for recovery when data is lost
- prevention of intrusion
- ensuring data privacy
- Error detection and recovery
- capability to interrupt a running process and provide error diagnostics
Archive points (from trash textbook)
Memory managementMemory optimisationdetermines how computer memory is allocated
determines where they are stored in memory
Memory organisationdetermines how much memory is allocated to an application
how the memory can be split up in the most efficient manner
by use of paged memory, virtual memory systems
Memory protectionensures that two competing applications cannot use the same memory locations
Security managementensure the integrity, confidentiality and availability of data, e.g.carrying OS updates when they are available
ensuring that antivirus software is always up-to-date
communicating with firewall to check traffic to and from the computer
prevent users entering “private areas” on a computer that permits multi-user activity
maintaining access rights for all users
offering the ability for the recovery of data when it has been lost or corrupted
prevent illegal intrusion to the computer system
Process managementallocation of resources and permits the sharing and exchange of data, allowing all processes to be fully synchronised
Hardware managementinvolves all input and output devicescommunicating with all input and output devices using device drivers
translating data from a file into a format the input/output device can understand using device drivers
ensuring each hardware resource has a priority so that it can be used and released as required
File managementdefining the file naming conventions which can be used
performing specific tasks, such as copy, paste…
maintaining directory structures
ensuring access control mechanisms are maintained, such as access rights to files
specifying the logical file storage format, depending on which type of disk formatter is used
ensuring memory allocation for a file by reading it from the HDD/SDD and loading it into memory
Need for typical utility software provided by the OS, including disk formatter, virus checker, defragmentation software, disk content analysis/disk repair software, file compression, back-up software
- Hard disk formatter and checker
- removes existing data from a disk that has been used previously
- setting up the file system on the disk, based on a table of contents that allows a file recognised by the operating system to be associated with a specific physical part of the disk
- partitioning the disk into logical drives (when needed)
- Hard disk defragmenter
- a disk will gradually become less efficient because of the constant creation, editing and deletion of files, leaving them in a fragmented state
- reorganises the file storage to return it to a state where all files are stored in one block across a sequence of sectors
- less time is taken to open a file because each one is contiguous
- Disk clean up
- releases storage by removing unwanted/temporary files
- Backup software
- establish a schedule for backups
- only create a new backup file when there has been a change
- Virus checker
- makes more RAM available for programs to run
- File compression
Understanding for program libraries, including software under development is often constructed using existing code from program libraries, and the benefits to the developer of software constructed using library files, including Dynamic Link Library (DLL) files
- “programs” in program libraries are usually subroutines created to carry out particular tasks
- a programmer can use these within their own programs
- advantage: saves a lot of time and trouble for the programmer because subroutines from a program library are tried and tested
- disadvantage: every program using a routine has to have its own copy of the library routine, which increases the storage space requirement
- alternative: dynamic linked library (DLL)
- when a DLL routine is available, the executable code just requires a small piece of code to be included
- this allows it to link to the routine, which is stored separately in memory, when execution of the program needs it
- many processes can be linked to the same routine
- advantage: all programs need less storage space, memory requirement is minimised; when a new version of the routine becomes available it can be loaded into memory so any program using it is automatically upgraded
- disadvantage: program is relying on the routine being available AND performing the expected function, so if DLL becomes corrupted the program will fail
5.2 Language translators
Need for assembler software for the translation of an assembly language program, compiler for the translation of a high-level language program, an interpreter for translation and execution of a high-level language program
- Interpreter
- interpreter program, source code file and the data to be used by the source code program are all made available
- interpreter program begins execution
- first line of source code is read
- line is analysed
- if an error is found, this is reported and the interpreter program halts execution
- if no error is found, the line of source code is converted to an intermediate code
- the interpreter program uses this intermediate code to execute the required action
- next line of source code is read, steps 4-8 are repeated
- Compiler
- compiler program and source code file are made available but no data is needed
- compiler program begins execution
- first line of source code is read
- line is analysed
- if an error is found this is recorded
- if no error is found, the line of source code is converted to an intermediate code
- next line of source code is read and steps 4-7 are repeated
- when the whole of the source code been dealt with:
- if no error is found the whole source code is converted into object code
- if any errors are found, a list of these is output and no object code is produced
Benefits and drawbacks of using either a compiler or interpreter and justify the use of each
- The advantages and disadvantages to a programmer of creating interpreted or compiler programs
Interpreter Compiler errors can be identified as they occur and corrected immediately during a particular execution of the program, parts of the code which contain syntax errors may not be accessed so if errors are still present, they are not discovered until later when a program is error free and is distributed to users because the source code has to be sent to each user an executable file can be distributed to users, so the users have no access to the source code
- The advantages and disadvantages to the user of interpreted or compiled programs
Interpreter Compiler the interpreter and the source code have to be available only the object code has to be available faster execution less secure as it could contain a virus
The use of an interpreter is justified when:
- one error in a program can lead to several other errors occurring
- an interpreter can detect and correct an early error so limited subsequent ones
- the debugging facilities provided in association with the interpreter speed this process
The use of a compiler is justified when:
- an executable file can be created
- this can be distributed for general use
- execution of the program will be faster than if an interpreter were used
High-level language programs may be partially compiled and partially interpreted, such as Java (console mode)
Describe features found in a typical Integrated Development Environment (IDE)
- for coding, including context-sensitive prompts
- for initial error detection, including dynamic syntax checks
- for presentation, including prettyprint, expand and collapse code blocks
- for debugging, including single stepping, breakpoints, report window