Chapter 1.2 Software and software development
1.2.1 Systems Software
Operating Systems
It is a set of programs which provides an interface between the user and the
hardware, allowing the user to interact with the system and run applications,
since the user can’t communicate with the hardware directly.
The OS is held in permanent storage (e.g. on a hard disk). A small program – the
loader, is held in ROM, and when the computer is switched on, the loader in ROM
sends instructions to load the operating system by copying it from storage into
RAM.
Application software Operating
User system Hardware
Functions of an OS
- Resource management
- File management
- Interrupt handling
- Security
- Providing a platform
- Provides a user interface and utilities
- Processor scheduling
- Memory management
Resource management: manages the resources, e.g., the CPU, memory, disk
drives and printer. It allocates resources to specific tasks and ensures they’re
used effectively.
E.g. when a user opens multiple applications simultaneously, the OS decides:
- how much memory to allocate to each application
- when and for how long each gets to use the CPU
- how to handle data being read / written to the hard drive
File management: handles the storage, retrieval, and manipulation of data
files. When working with files, the OS provides a GUI (graphical user interface)
which allows the user to handle the files.
Interrupt handling: interrupt events require the immediate attention of the
CPU. For the system to run smoothly, interrupts need to be handled and
processed in a timely manner. (E.g. if the user clicks cancel on a file conversion,
a signal is sent from the mouse which interrupts the processor, and the OS will
trigger the cancellation routine.)
1
,Chapter 1.2 Software and software development
Security: the OS provides various security features – firewalls, virus scanning,
and file encryption. System accounts can also be restricted from performing
certain actions (changing account settings for other users, editing network
settings etc.).
Providing a platform for software to run: mainly by allowing software access
to system resources (e.g. if a game has intensive graphics, the OS will grant it
access to the GPU).
Providing a user interface: through a GUI or a CLI. Most OS provide both
options.
Providing utilities: utility programs help with system maintenance and
security. Some utility programs include: file encryption, file compression, disk
defragmentation, system backup and disk cleanup.
2
,Chapter 1.2 Software and software development
Memory management
Deals with the allocation and deallocation of the computer’s primary memory.
Each program that is opened must be allocated a specific area of memory. The
allocation and management of space is controlled by the OS. During the memory
management task, each process must have enough memory to be allocated, and
it can’t access the memory space of another process.
When a user opens a file from the file system (e.g. a Word document), the CPU
loads this file data, as well as the application data, into the primary memory.
Primary memory is a limited resource, so it needs careful memory management.
Efficient allocation of memory enables a system to continue multitasking.
Memory management is made efficient through:
- Paging
- Segmentation
- Virtual memory
When a free space arises, instead of moving C to the front, we
could split the program (D). Part of D can be in the first section,
and the rest in the last section. This can be done by paging or
segmentation.
Paging
Method of chunking the primary memory into equal-sized blocks. Used for virtual
memory. The OS uses a page table to keep track of where pages are stored,
meaning all the pages of a process don’t have to be stored contiguously. (Pages
are physical divisions.) When an application is launched, data will be moved from
the hard disk into pages for faster access. As a user moves between applications,
3
, Chapter 1.2 Software and software development
memory is dynamically allocated. Pages will be taken away from applications not
in active use and given to applications that are in active use.
Paging can lead to internal fragmentation. If a 2,000 KB file is divided into 64 KB
pages, the last page would have 8 KB of unused space. Unused space in a page
is wasteful because other unrelated data can’t be stored in this page. Over time,
more pockets of wasted space will exist across the memory - leading to internal
fragmentation.
Segmentation
Used for RAM. Chunks memory into blocks that correspond to different types of
data needed by an application. (A video editing application: Segment for video
data, audio data and special effects.) Segments are not all the same size –
depends on the allocated data; it is space-efficient as it only allocates space
depending on the amount an application needs.
It can lead to external fragmentation. As segments fill up the memory, physical
gaps reduce the maximum size of new Segments that can be allocated. The
arrangement of data in the segment becomes more fragmented over time
because as blocks are taken away, it's not guaranteed that a new block will
occupy the same amount of space.
4