1/41
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Why an operating system is needed
The hardware is unusable without an OS // hides complexity of hardware from user
Acts as an interface / controls communications between user and hardware / hardware and software
Provides software platform / environment on which other programs can be run
Operating system management tasks
• Main memory management
• File / secondary storage management
• Peripheral / hardware / device management
• Provision of a user interface
• Process / task / resource management - Interrupt handling
• Security management
• Input / output management
• Error detection / recovery
• Provision of a platform for software
Memory management tasks
Allocates / deallocates RAM to programs/processes
Memory protection. Prevents a process from accessing memory that is not allocated to it
Keeps track of allocated and free memory locations
Swaps data to and from the hard drive
Handles virtual memory
Paging // segmentation
Secondary Storage/File management
• OS maintains a file directory structure and FAT
• Provides file naming conventions
• Storage space divided into file allocation units
• Space allocated to particular files
Controls access // implements access rights // implements password protection // Makes file sharing possible
Specifies tasks that can be performed on a file (e.g. open, close, delete, copy, create, move)
Peripheral Management
• Manages installation of appropriate driver software
Manages communication between devices / hardware and software:
• Controls access to data being sent to/from hardware/peripherals
• Controls access to hardware/peripherals
Printer management example
Installs printer driver
Sends data to the printer / buffer // sends documents to the print queue
Sends commands to printer
Receives and handles (error) messages/interrupts from the printer
Provision of a User interface
• Allows user interaction with the computer system // Facilitates human-computer communication
• Hides the complexity of the hardware from the user
e.g. GUI, command line interface, Menu-driven
Process Management
Manages the scheduling of processes
Allows multi-tasking
Ensures fair access of CPU
Handles interrupts
Manages / allocates which resources the processes require
Facilitates the sharing and exchange of data between processes
Prevents interference between processes
Interrupt
A signal from a device/program that it requires attention from the processor
Interrupt Handling
Check for interrupt at a point during the fetch-execute cycle.
If an interrupt flag/bit is set in the interrupt register:
Halt the execution of the current process
Store the values of the current process on a stack/register
Loads and executes the appropriate ISR code
Use of priorities for handling simultaneous interrupts
Saves data on power outage
Security Management
• Makes provision for recovery when data is lost
• Automatic backup. Enables system restore / roll back (to previous stable state)
• Provides and checks usernames and passwords (Authentication) / encryption / user accounts
• Implements access rights to prevent unauthorized access.
Utility program
Provide additional functionality that make it easier to maintain and manage the system
They can be packaged as part of the operating system or bought as stand-alone software programs
Utility program examples
• System clean up
• Automatic update
• Disk contents analysis / Disk checking / Disk repair
• File compression
• Disk formatter
• Firewall
• Disk Defragmenter
Disk repair software
Checks for and resolves any errors, inconsistencies, or bad sectors on the disk:
Retrieves files / data from a damaged disk // re-constructs directory // recovers disc when data corrupt
Marks bad sectors on the disk as unusable
Disc contents analysis
Visually demonstrates the disc usage by showing sizes of files/folders
Disk formatter
Configures the disc for use / initialise tracks and sectors
Initialises a file system (e.g. FAT, NTFS) / create a file directory
Install a boot sector (if creating a bootable disk)
Checks all sectors and mark bad sectors
Makes existing data inaccessible
Partitions the disk into logical drives
Disk Defragmenter
Re-organises the disk contents
Moves split files so they are contiguous
Creates a larger area of (contiguous) free space
File compression software
Compresses/decompresses the contents of the disc, thus increasing number of files that can be stored.
Anti-virus software
Scans files for viruses // detects/identifies a virus
Can constantly run in background
Can run scheduled scans
Can automatically update virus definitions
Can quarantine or delete viruses
Completes heuristic checking
Notifies user of possible viruses
Backup software
Makes copy of files on another medium in case of corruption / loss of data
Firewall
Prevents unauthorised access to computer systems from external sources
Sits between the computer or LAN and the Internet/WAN and permits or blocks traffic to/from the network
Can be software and/or hardware
Can make precise decisions about what to allow or block as it can detect attempts by specific software to connect to Internet
Can help to block hacking and prevent viruses from reaching a computer
Authentication
• The process of determining whether somebody/something is who/what they claim to be
• frequently done through log-on passwords/biometrics, although digital certification is also used as passwords can be cracked/stolen
• helps to prevent unauthorised access to data
Assembly language
Low level programming language.
Uses mnemonic codes.
Specific to the computer hardware.
Often used to create drivers for hardware.
Machine code
A computer programming language consisting of binary or hexadecimal instructions which a computer can respond to directly.
Sometimes used interchangeably with object code
Object code
Code generated by a compiler or other translator, consisting of machine code, byte code, or possibly both
Combined with additional metadata that will enable a linker or loader...
...to assemble it with other object code modules into executable machine code
Translator
Converts a (higher-level) programming language to a different form
e.g. compilers, interpreters and assemblers
Compiler
Translates a high-level language program into machine code for the processor to execute.
Reads the source code and reports all errors at the end.
An executable file is produced.
Different hardware platforms need different compilers to translate the source code into the machine code.
Interpreter
Translates a high-level language program into machine code for the processor to execute.
Reads each statement and checks it before running it.
Halts when it encounters a syntax error.
Assembler
Translates low-level statements into machine code for the processor to execute.
Compiler benefits
Once translated, the compiler software is not needed to run the program.
Compiled code should execute faster.
The executable file produced by a compiler can be distributed without users having sight of the source code, which is kept secure. Users are unable to make changes to the program.
Cross-compilation is possible.
Interpreter benefits
Easier de-bugging:
The interpreter stops when error encountered, so errors can be corrected in real time
The interpreter translates a statement then executes it immediately
Parts of the program can be tested, without all the program code being available
Interpreter and Compiler used together
Interpreter:
Easier debugging because errors are reported as they are found and can be corrected immediately.
No need to wait until the end of the process for the error report.
Used during development.
Compiler:
Produces an executable file (.exe)
After compilation the compiler does not need to be present for the program to run
The program can be given to others without giving access to source code
Final program does not need to be re-compiled each time it is run
Cross-compilation, the program can be compiled to run on different platforms
Used when development complete // ready for distribution
Integrated Development Environment (IDE)
An application that includes an editor, debugger and compiler/interpreter among other useful tools in order to program.
Features:
Colour coding // pretty printing
Auto-complete
Auto-correct
Context-sensitive prompts
Expand and collapse code blocks
Dynamic syntax checking
Debugging tools including single stepping, breakpoints, variables/expressions report window
Java
An object-oriented programming language designed specifically for programs (particularly multimedia) to be used over the Internet.
Java allows programmers to create small programs or applications to enhance websites.
Machine independent
The program code can be translated to run on any processor / platform
Source code is translated into machine independent intermediate code, not machine dependent code
How a Java source code program is translated
Java code is partially interpreted - partially compiled. Java uses a two-step translation process:
Code is translated first into intermediate code/bytecode using the Java compiler
bytecode file is portable, because each computer that can run Java has a Java Virtual Machine
The bytecode is then interpreted by the Java Virtual Machine
Library routine
Pre-existing / pre-compiled / pre-written modules / code
Can be linked/imported into the program
They are called to perform common / complex tasks
Typically statically-linked
Library routine/program benefits
Saves time: less code needs to be written
Simplifies the program, since only the name of the function is included in the source code
Reliability: pre-tested/used by many people. Reduces time spent testing. Can be fairly sure that it will function as it should.
Convenience: can be complex algorithms (e.g. mathematical/graphics functions). Programmer won’t need to figure out how to implement it from scratch.
Can be written in a different programming language, making use of special features of that language
Domain specialists can contribute their knowledge to the library
Library routine/program drawbacks
Compatibility issues: may not work with the other code/may require changing program for it to work
Not guaranteed thorough testing: there may be unknown or unexpected bugs / virus
May not meet exact needs or need editing, and then it may give unexpected results/errors after modification.
DLL file
Dynamic Link Library
A shared library file format
Code is saved separately from the main .exe files
Code is only loaded into main memory when required at run-time
Can be made available to several applications (at the same time)
DLL file benefits
The executable file is smaller as it does not need to contain all the library routines.
DLL files are only loaded into memory when required.
Changes to the DLL file code are done independently of the programs that use it, so there is no need to recompile the other programs. Improvements to the DLL file will benefit all programs that use it.
A single DLL file can be made available to several application programs, saving memory space.
Routines are pre-written, saving the developers time and money
Routines are pre-tested so should be reliable
DLL file drawbacks
The executable code is not self-contained. The DLL files need to be included at run time.
Appropriate linking software must be available at run-time to link / import the DLL files.
The DLL file must be present, otherwise you get (unable to find X.dll) errors
Unexpected changes to the DLL file / corrupted DLL file could mean the program stops working as expected
Malicious changes to the DLL file could install a virus on the user's computer / related files could be corrupted
“DLL hell” - DLL file version conflicts. Different applications need different versions of the same DLL file.