Notes
1.2 - Software and Software Development
Content of the notes (4)
Page 1
1.2.1 - System Software
Operating Systems:
A program that manages the operations of a computer for a user.
Acts as a bridge between the hardware and the user.
Loaded into RAM from permanent storage from the loader in ROM.
Functions of Operating Systems:
Disguises the complexities of communicating with a computer's hardware, providing a simple interface.
There are multiple functions an operating system can perform:
Memory management.
Interrupt service routines.
Processor scheduling.
Backing store management.
Input/output management.
Memory Management:
The allocation of memory space, distributed by the operating system, to each application being used.
Paging:
Memory is divided into fixed sized 'pages' of around 4Kb each.
Any process can be held in several non-contiguous pages (they don't have to be together).
Uses both physical and logical memory addresses:
The physical address represents the actual address a page is stored in.
The logical address represents the address generated by the CPU
A page table holds the link between both physical and logical addresses.
Segmentation:
Logical division of address space into varying length segments.
May be used to implement virtual memory.
Can be combined with paging.
Virtual Memory:
Secondary storage is used as an extension of memory to make room for more jobs.
Performance may reduce if the OS is using more time to swap pages in and out than finishing jobs.
Interrupts:
A signal from a software program, hardware device or internal clock to the CPU.
Allows for multitasking to take place.
Interrupt Service Routines:
When the CPU receives an interrupt, it suspends all execution of the running proces and disables all interrupts of a lower priority.
After, it puts the values of each register in the CPU onto the system stack.
An interrupt service routine is called to deal with the interrupt, depending on the type and corresponding priority:
A power-fail interrupt has a very high priority.
A clock interrupt has a medium priority.
An I/O interrupt has a low priority.
A test to detect interrupts is carried out at the end of each FDE cycle.
Processor Scheduling:
Multitasking is the CPU carrying out small parts of multiple large tasks in turn, which gives the appearance of carrying out several tasks at once (in a single core processor).
The scheduler is responsible for making sure that the processor time is used as efficiently as possible.
The scheduler has many objectives:
Maximise throughput.
Be fair to all users on a system.
Provide acceptable response time for all users.
Ensure hardware resources are kept as busy as possible.
Scheduling Algorithms:
Round Robin:
Processes are despatched on a First In, First Out (FIFO) basis, like a queue.
Each process has a limited time slice (CPU time).
If the process is not completed before this time expires, or an interrupt of higher priority occurs, the CPU is allocatred to the next process.
First Come, First Served:
Jobs are processed in the order they arrive, with no priorities
Shortest Remaining Time:
The process with the smallest estimated completion time is run next.
Advantages:
Reduces the number of waiting jobs, and smaller jobs waiting behind bigger jobs.
Disadvantages:
Requires knowledge of how long a job will take, so the user must estimate.
This is possible in jobs that are run very regularly, such as payrolls.
Shortest Job First:
The process with the smallest estimated running time is run next.
Has similar advantages/disadvantages to shortest remaining time.
Multi-Level Feedback Queues:
Implements several job queues, allowing jobs to move between them depending on how much processor time they use.
The algorithm is designed to:
Give preference to short jobs.
Give preference to I/O processes (I/O is much slower than processor speed, so to be as efficient as possible I/O jobs should be kept as busy as possible).
Separate processes into categories based on their processor need.
Backing Store Management:
Enables a user to move files and folders, delete files and protect from unauthorised access.
Keeps a directory of where files are stored so that they can be quickly accessed.
Knows which areas of storage are free so that new files can be saved.
Input/Output Management:
Manages how applications connect with I/O devices, checking that it is the correct device to be used with the application and sending the correct data.
A buffer is used so that the CPU can continue with another task to compensate for the difference in speed between an output device and the CPU.
Types of Operating System:
Distributed Operating Systems:
A form of parallel processing, spreading the workload over multiple computer servers.
A single job is split into several tasks, each of which is run on a separate computer.
Appears to the user as a single system.
Multi-tasking Systems:
An OS with the ability to run multiple jobs simulatenously.
Multi-tasking, Multi-user Systems:
A single powerful mainframe is connected to many terminals, all using the mainfram CPU.
Each user gets a slice of processor time according to the scheduling algorithm in use.
Mobile Operating Systems:
Combines features of a PC operating system with mobile specific uses, such as cellular and wireless connectivity.
There is often two operating systems - the main system operating the user interface and applications, as well as the proprietary real-time operating system which will operate the hardware.
Embedded Operating Systems:
Found in many types of hardware such as washing machines or ovens.
Has several features:
Has a minimal interface.
Accepts input from sensors and send output to control devices.
There will not be any RAM, so will not need memory managment systems.
No permanent storage.
Real-Time Operating Systems:
Used in safety critical environments, such as in a plane.
Has several safety measures:
Must respond very quickly to input and sensors.
Must be able to deal with many inputs simultaneously.
Must have failsafe mechanisms, in the event that any hardware fails.
Must have redundancy, so must have backup hardware if one component fails.
Basic Input Output System (BIOS):
Stored in Erasable Programmable Read-Only Memory (EPROM).
Initialises and tests the system hardware components and to load the operating system from the hard disk to RAM.
Allows for the configuration of hardware such as the hard drive, CPU or memory.
Device Drivers:
A program that provides a software interface to a particular hardware device.
Enables operating systems to access hardware functions without knowing the details of the hardware.
Hardware dependent and operating system specific.
Typically communicates through the system bus connected to the hardware.
Virtual Machines:
An instance where software is used to take on the function of a machine, including the execution of code or running an operating system within another to emulate hardware.
Page 2
1.2.2 - Applications Generation
The Nature of Applications:
Systems Software:
Needed to run the computer's hardware and application programs.
Examples:
Translators.
Utility programs.
Library programs.
Operating systems.
Application Software:
Examples:
Off-the-shelf.
Custom written.
Proprietary.
Open source.
Utility Programs:
System software which is designed to optimise the performance of a computer.
Performs tasks such as restoring corrupted files, compressing/decompressing data, providing a firewall.
Examples:
Disk Defragmenter:
Reorganises a hard disk so that files which have been split up into blocks can be recombined and organised into sequential blocks.
Automatic Backup:
Creates a backup of any specific files a user wants to keep safe, in the event of losing them.
Automatic Updating:
Makes sure that any software installed is constantly up to date.
Virus Checkers:
Checks storage for viruses and malware, and then removes them to protect a computer.
Compression Software:
Reduces the size of files, such as images.
Types of Application Software:
General Purpose:
Software that can be used for several purposes.
Examples:
Word processors.
Spreadsheets.
Graphics packages.
Special-Purpose:
Performs a single specific task.
Examples:
Fingerprint scanning.
Browser software.
"Off-the-Shelf" Software:
Advantages:
Less expensive, as cost is shared with all others buying the package.
Ready to be installed immediately.
Well documented, tested and error free.
Disadvantages:
Will contain a lot of unwanted features, and may have missing desirable features.
Bespoke Software:
Advantages:
Features are applied subject to the requirements of the user.
Disadvantages:
Much more expensive.
May take longer to develop.
May contain errors which do not appear immediately.
Open Source:
Software is licensed for use, but there is no charge for the license.
Must be distributed with the source code so anyone can modify it.
Developers can sell the software they have created.
Any software created from open source software, must also be open source.
Advantages:
Changes over time.
Has an enthusiastic community dedicated to the source.
Closed Source:
There will be restrictions on how the software can be used.
The developers of the code will hold the copyright.
User will not be allowed access to the source code, and will not be allowed to modify the package.
Advantages:
Closer support from companies.
Regular updates available and technical support lines.
Large user base.
Assemblers:
Takes assembly code as input (source code) and outputs machine code (object code).
Each assembly code instruction is converted into binary machine code.
Each assembly code instruction is almost equivalent to one machine code instruction.
Compilers:
Translates high-level language, such as Python, into machine code.
Source code is scanned through several times, each time performing different checks needed to create the object code.
The resulting object code is hardware specific, so different platforms will need different compilers.
The object code can be saved and run without the prescence of the compiler.
Suitable when a program is to be run regularly, or if it is to be distributed to others outside of the producing company.
Advantages:
Object code can be saved and run without the need to recompile.
Object code executes faster than interpreted code.
Object code is more secure, as it cannot be read without reverse engineering.
Object code can be distributed or executed without the compiler.
Disadvantages:
If an error is discovered,the whole program must be recompiled.
Interpreters:
Looks through each line of a program rather than a whole program.
Checks for errors, then translates it into machine code and runs it
Advantages:
Platform independence - the source code can be run on any machine that has the appopriate interpreter available.
No need for recompilation whenever an error is discovered.
Disadvantages:
Program may run slower.
Stages of Compilation:
Lexical Analysis:
Removes spaces.
Removes all comments
Replaces all keywords, constants and identifiers with tokens.
Symbol Table:
Contains an entry for every keyword and identifier in a program.
Shows the identifier, kind of item, type of item and run-time address/value of the item.
Organised using a hash table, where each identifier is hased to produce an array subscript.
Syntax Analysis:
The process of determining whether the sequence of input characters, symbols or token form a valid sentence in the language being used.
Parsing:
Applying a set of rules to each statement to determine whether it is valid.
Semantic Analysis:
Checking the meaning of a statement rather than the grammar.
Example:
If a real value was assigned as an integer, an error would occur.
Code Generation:
Machine code is generated.
Code Optimisation:
Attempt to reduce the execution time of the object program.
Spots redundant instructions and produce object code that achieve the same effect, but by different means.
Disadvantages:
Increases compilation time.
It may sometimes produce unexpected results
Linkers:
Any separately compiled subroutine must be linked into the object code.
The linker puts the appropriate machine addresses in the call and return functions so that the modules are linked together.
Loaders:
Can load the object code from anywhere in memory, provided the programmer has used no absolute addresses and the object code is relocatable.
Use of Libraries:
Readily-compiled programs which can be run when needed.
Advantages:
Tested and error free.
Saves the programmer from writing the code themselves.
Page 3
1.2.3 - Software Development
Waterfall Lifecycle Model:
Analysis and Requirements:
Potential requirements are documented, serving as the basis for development.
Analysis of the system to suit the models and logic to be used in the application.
Design:
How the project will be developed, and how the analysis will be implemented.
Implementation:
The actual code is written, implementing all models and logic specified before.
Evaluation and Testing:
Testers will use the application, reporting issues that need to be resolved.
Maintenance:
Keeping the application functional and up to date.
Advantages:
Adapts well to teams that change a lot.
Forces structured organisation.
Allows for early design changes.
Suited for milestone focused development.
Suitable for small projects.
Disadvantages:
Any huge flaws discovered at later stages may cause dramatic backward leaps in development.
Client feedback has little input until the final stages, and even then it might not be to any effect.
Delayed testing periods.
Spiral Model
Generates a series of prototypes that are created by iterating through the below steps.
Analyse:
Requirements are defined for the next prototype.
Design:
Overviews the amount of risk.
Creates a program structure for the prototype.
Implementation:
Code and test the prototype.
Evaluation:
Allows the customer to evaluate the output of the prototype.
Generate a plan for the next iteration.
Advantages:
Improved user feedback allows a client to specify their requirements as they can see a working prototype.
Agile Modelling
Combines iterative and incremental processes.
Focuses on customer satisfaction and adaptability.
Each stage of development is built with a prototype, where feedback is given from the client.
Objectives:
Keeping the model simple.
Rapid feedback from the user.
Understanding that requirements may change.
Being prepared to make incremental changes.
Extreme Programming (XP):
Intends to improve software quality and responsiveness to changing requirements.
Frequent releases of the software are made in short development cycles.
Promotes productivity and introduces checkpoints at which new requirements can be adopted.
Developers are constantly chasing a target.
Rapid Application Development (RAD):
Generally used for large projects which may take a long period of time, in which user requirements and technology will change.
Attempts to provide faster completion of major projects.
Objectives:
Workshops and focus group to gather requirements rather than documentation.
Use of prototypes to continually refine the system in response to feedback.
Producing within a strict time limit, which is a "good-enough" quality.
Reusing software components.
Algorithms:
A set of rules to be followed to solve a problem.
A good algorithm has:
Clear and precise steps that produce the correct output.
Should allow for invalid input.
Must always terminate at some point.
Should execute efficiently.
Should be designed to be readable by others.
Pseudocode:
A way of expressing a solution to a problem such that it can easily be translated into a programming language.
Page 4
1.2.4 - Types of Programming Languages
Programming Paradigms:
A style of computer programming.
Procedural Programming:
A series of instructions that tell a computer what to do with an input in order to solve a problem.
Used in languages such as Python, Pascal.
Structured Programming:
Programming Constructs:
Sequence - A set of instructions that are executed in order.
Selection - Where multiple outcomes can occur, such as using an if statement.
Iteration - Going through a group of instructions over and over again (defined by limits).
Recursion - Calling a function within a function.
Object-Oriented:
Developed to make it possible to abstract details of implementation away from the user, make code reusable and programs easy to maintain.
Used in languages such as Java, Python.
Declarative:
Statements are written to describe the problem that needs to be solved, such as in SQL.
Functional:
Used as fundamental building blocks of a program.
Statements are writeen as a series of functions which accept input data and return an output.
Procedural Languages:
Has built in data types.
Programmers can define their own abstract data types, such as queues, stacks or trees.
Object-Oriented Languages:
A class is used as a description of what the data looks like and can do.
Data items are called objects, which is an instance of a class.
Each class has attributes, which define the characteristics of a given object.
Inheritance:
Where a subclass takes attributesfrom a provided superclass.
Each subclass can have its own attributes.
When drawing inheritance diagrams, the arrow is shown going towards the superclass.
Private Attributes:
Users can't access them.
They are changed through statements within the various methods.
Methods:
Functions - returns a value.
Procedures - does not have to return a value.
Polymorphism:
The ability to process objects differently depending on their class.
Redefines methods in a given superclass to process the object differently.
Encapsulation:
If attributes are private, they can only accessed through class methods.
Makes the concept of hiding data possible.
Constructors:
The method which defines a new instance of any given object.
Advantages:
Extensive planning makes for better design.
Encapsulation - the source code for an object can be written and tested independently from other objects.
Once an object has been created, knowledge of its methods are not necessary for them to be used.
New objects can be created easily with small differences to existing ones.
Objects are reusable.
Much easier to maintain due to the modular structure.
Assembly Language:
Uses mnemonics to represent the opcodes and addresses used in programs, instead of binary codes.
Little Man Computer (LMC) Mnemonics:
ADD - add the contents of the memory address to the accumulator.
SUB - subtract the contents of the memory address from the accumulator.
STA - store the value in the accumulator to the memory address.
LDA - load the accumlator with the value of the memory address.
BRA - branch always, jump to the address given.
BRZ - jump to the address given if the accumulator is 0.
BRP - jump to the address if the accumulator is positive or 0.
INP - input into the accumulator.
OUT - output the contents of the accumulator.
HLT - stops the execution of the program.
DAT - indicates a data location.
The flow of a program can be altered using an unconditional or conditional branch instruction.
Addressing Modes:
An opcode has a 2 digit code which represents the addressing mode, which are the last two digits of the opcode.
Immediate Addressing:
The operand is the actual value to be operated on.
Direct Addressing:
The operand holds the memory address of the actual value to be operated on.
Indirect Addressing:
The operand is location of the value to be operated on.
Enables a larger range of addressable locations.
Indexed Addressing:
The address of the operand is obtained by adding a constant value to an index register, where the number of the index register and the constant value are included in the instruction code.
Used to access an array whose elements are in successive memory locations.
Information
- Description
- A level OCR Computer Science H446 Note on 1.2 - Software and Software Development, created by Michael Mee on 27/05/2018.
- Created by
- Michael Mee
- Views
- 2
- Rating