0% found this document useful (0 votes)
8 views7 pages

Understanding Operating Systems and Their Functions

The document discusses the essential functions of operating systems (OS), including memory management, security management, process management, and file management. It also covers utility software, such as virus checkers and defragmentation tools, and the role of program libraries in software development. Additionally, it explains language translators, their types, and the pros and cons of compiling versus interpreting programs.

Uploaded by

The Amazing Jack
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views7 pages

Understanding Operating Systems and Their Functions

The document discusses the essential functions of operating systems (OS), including memory management, security management, process management, and file management. It also covers utility software, such as virus checkers and defragmentation tools, and the role of program libraries in software development. Additionally, it explains language translators, their types, and the pros and cons of compiling versus interpreting programs.

Uploaded by

The Amazing Jack
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

5.

1 Operating Systems
Monday, February 10, 2025 2:20 PM

5.1.1 The need for an OS

1. An OS is needed to provide an environment in which applications can run and


provides an interface between hardware and human operators

2. There are 2 ways of achieving a Human-Computer Interface (HCI)


a. Command Line Interface (CLI)
b. Graphical User Interface (GUI)

3. CLI:
a. Puts user in direct communication with computer
b. Does not restrict the user to a number of pre-determined options
c. A lot of commands have to be written to complete basic operations
d. A lot of syntax needs to be memorised and any mistype can cause errors

4. GUI uses 2 technologies:


a. WIMP: Windows Icons Menus and Pointing Device
b. Post-WIMP: WIMP + touchscreen elements like pinching and rotating

5.1.2 OS tasks

1. Memory Management:
a. It is the management of a computer's main memory
b. Can be broken into 3 parts
i. Memory Optimisation
ii. Memory Organisation
iii. Memory Protection

2. Memory Optimisation:
a. Determines how the memory is allocated and deallocated when multiple
applications are running at a time
b. Determines where the applications are stored in memory
c. Keeps track of all the allocated and free available data
d. To maintain it, data is swapped to and from the HDD/SSD

3. Memory Organisation:
a. Determines how much memory is dedicated to one application and how it
can be split up in the most efficient manner
b. This can be done with:
i. A single contagious (in series) allocation where all memory is
allocated to a single application
ii. Partitioned allocation where the memory is split into contagious
partitions of varying sizes
iii. Paged memory where the memory is split into contagious partitions

5. System Software Page 1


iii. Paged memory where the memory is split into contagious partitions
of fixed size
iv. Segmented Memory, where memory allocations are grouped logically
rather than contagiously
c. To split the OS and applications, Fences are used as boundaries and each
application is only allocated a set of memory addresses

4. Memory Protection:
a. Ensures that 2 competing applications do not use the same memory
locations at the same time
b. Not doing this can cause:
i. Data Loss
ii. Applications producing incorrect results
iii. Security issues
iv. Computer crashes
c. Essential part of any memory organisation

5. Security Management:
a. Ensures the integrity, confidentiality, and availability of data
b. This can be achieved by:
i. Carrying out OS updates as & when they are available
ii. Ensuring Antivirus software is always up-to-date
iii. Communicating with, e.g. a firewall to check all traffic to and from the
computer
iv. Making use of privileges to prevent users entering 'private areas' on a
computer so allows for multi-user activity
v. Maintaining access rights to all users
vi. Offering the ability for recovery of data when it has been lost or
corrupted
vii. Helping to prevent illegal intrusion of computer system

6. Process Management:
a. A process is a program that is being run by the computer
b. It involves the allocation of resources and permits the sharing and exchange
of data, thus allowing all processes to be fully synchronised

7. Hardware Management:
a. Communicates with all input and output devices using device drivers
b. Translates data from a file to a data that the I/O device can understand
using device drivers
c. Ensuring hardware resource has a priority so that it can be used and
released as required

8. File Management:
a. Defines the file naming conversions that can be used, e.g. [Link] can
have extensions like .txt, .rtf, etc.
b. Performs specific tasks such as create, open, close, delete, rename, copy,
paste, cut, etc.
c. Maintaining the directory structures , e.g. :C/documents .
d. Ensuring access control mechanisms are maintained such as access rights to
files, password protection, making files available for editing, locking files,
and so on
e. Specifying the logical file storage format (FAT, NTFS), depending on which
type of disk formatter is used
f. Ensuring memory allocation for a file by reading it from the HDD/SSD and
loading it into memory

5.1.3 Utility Software

5. System Software Page 2


5.1.3 Utility Software

1. Overview:
a. Utility Programs are parts of the OS that carry out certain functions
b. Utility Software can also be installed by users
c. Software can either be initiated by the user or run in the background (Virus
Checkers)

2. Hard Disk Formatter:


a. Organises storage spaces by assigning them to contagious data blocks (partitions)
b. Formats the partitions by writing files which will hold directory data and Tables of
Contents at the beginning of each partition
c. This allows the computer to recognise a file and know where to find it on the disk
surface
d. They also have checking tools, which are non-destructive tests that can be carried
out on each sector
e. Any bad sector errors discovered are flagged as 'bad' and file tracking records are
reorganised by replacing them with new unused sectors, effectively repairing
them
f. Bad sectors can be classified as hard or soft
g. Hard bad sectors are caused by:
i. Manufacturing errors
ii. Damage to disk surface caused by allowing the RW head to touch the disk
surface
iii. System crashes
h. Soft bad sectors are caused by:
i. Sudden power loss leading to data corruption in some sectors
ii. Effect of static electricity leading to data corruption on hard disk surfaces

3. Virus Checkers:
a. A computer is still prone to viruses even if we follow all preventions
b. Running antivirus software in the background will constantly check for virus
attacks
c. There are some common methods for carrying this out:
i. Checking software or file before they are run on the computer
ii. Compare possible viruses against a database of known viruses
iii. Carry out heuristic checking - checking of software for different behaviours
that could indicate a possible virus, which is useful for detecting a virus not
yet on the database
iv. Puts files or programs that may be infected into quarantine to either delete
the file automatically or allow the user to decide whether to delete it
d. A drawback of this software are false positives - programs or files that the user
knows they are not infected yet they're treated by the software as if they are.
e. Needs to be up-to-date as new virus are being constantly discovered
f. Full system checks need to be carried out on a regular basis to minimise risk

4. Defragmentation Software:
a. Files become more scattered across disk surfaces over time which increases data
access time
b. This is less of an issue if an SSD is used instead of an HDD
c. This software rearranges blocks of data to store files in contiguous sectors
wherever possible
d. Defragmentation may not be possible if the disk is almost full
e. Data blocks can also become damaged after several read/write operations, this
makes their sectors flagged as 'unusable' and any subsequent writing operation
will avoid writing data to data blocks which have become affected

5. Disk content analysis/Repair Software:

5. System Software Page 3


5. Disk content analysis/Repair Software:
a. Checks disk drives for empty space and disk usage by reviewing files and file
folders
b. This leads to optimal use of disk space by removal of unwanted files and
downloads like e.g. cookies

6. Disk and File compression:


a. Disk compression compresses data before writing it to hard disk and
decompresses it again when it is being read
b. It essentially overrides all other OS routines which is essential as:
i. All applications need to have access to the HDD
ii. If uninstalled, any previously saved data will be rendered to be unreadable
c. File compression is discussed in 1.3

7. Backup software:
a. Allows a schedule for backing up files to be made
b. Only carry out a back-up procedure if there have been any changes made to a file
c. For total security, a file would have 3 versions:
i. The current (working) version stored on the internal HDD
ii. A locally backed up copy (stored on for example, a portable SSD or a USB)
iii. A remote back-up version stored well away from the computer ( e.g. cloud
storage)
d. Once the backup storage (HDD/SSD) is almost full, the oldest backups are deleted
and replaced with the newest backup of data

5.1.4 Program Libraries

1. Program libraries are used if:


a. Software is under development and the programmer can utilise pre-written
subroutines in their own programs, thus saving considerable development time
(e.g. procedures and functions)
b. To help software developers who wish to use Dynamic Link Library (DLL)
subroutines in their own program, so these subroutines are available at run time
(e.g. import random)

2. Library program vs Library routine:


a. A library program is one that s stored in a program library
b. A library routine is a subroutine which could be used in another piece of software
under development

3. All OS have 2 program libraries:


a. Static:
i. Software being developed is linked to executable code in the library at the
time of compilation
ii. So library routines would be directly embedded into the new program code

b. Dynamic:
i. Software being developed is not linked to the library routines until the
actual run time
ii. Such files are known as Dynamic Link Library files (DLL)
iii. Library routines would be stand-alone only accessed as required by the new
program - the routines would therefore be able to several applications at
the same time

4. Program Libraries have a lot of benefits:


a. No need to rewrite routines multiple times which saves time and cost
b. Leads to modular programming which allows multiple programmers to work on

5. System Software Page 4


b. Leads to modular programming which allows multiple programmers to work on
the same piece of software at the same time which reduces the time taken to
write the program
c. Allows continuity with other games that may form a whole range (e.g. Batman
Arkham Trilogy)
d. Allows maintenance of corporate image in all the software developed by a
particular company (Apple)
e. Saves considerable development time having to test each routine, since the
routines are all fully tested in other software and should be error free

Pros of using DLL Files Cons of using DLL Files


Executable code of main program is much smaller as Executable code is not self-contained, therefore all DLL
DLL files are only loaded into the memory (RAM) at run files need to be available at run time otherwise error
time messages will be generated and software may crash
It's possible to make changes in the DLL files Any DLL linking software in the main program needs to
independently of the main program, therefore the be available at run time to allow links with DLL files to be
main program doesn't need recompilation upon made
change in DLL
DLL files can be made available to a number of If any of the DLL files have been changed, this could lead
applications at the same time to the main program giving expected results or crashing
All of the above save both memory and execution time Malicious changes to DLL files could be due to the result
of malware, thus presenting a risk to the main program
following the linking process

5. System Software Page 5


5.2 Language translators
Tuesday, February 11, 2025 1:17 AM

5.2.1 Translation and execution of programs

1. Translators are the systems software used to translate a source program written in any language other than machine code
2. There are 3 types of translators available:
a. Assemblers
b. Compilers
c. Interpreters

Assembler Compiler Interpreter


Source program written in Assembly Language HLL HLL
Machine dependent? Yes No No
Object program generated Yes, on disk or in main memory Yes, on disk or in main memory No, instructions executed under the control of the interpreter
Each line of source program generates One machine code instruction Many machine code instructions Same as compiler
One-one translation Instruction explosion

3. Object programs translated and stored on secondary storage media:


a. Require a loader program to load it to main memory
b. Program can be executed directly many times before being translated
c. For compilers, program will only need to be retranslated when changes are made to source code

4. HLL are machine independent, portable, and can be run on any computer/chip

5.2.2 Pros and cons of compiling or interpreting a program

Compiler Interpreter
End user only needs executable code and so the end user benefits as there is no need End user needs to purchase a compiler or an interpreter to translate the source code
to purchase a compiler to translate the program before it is used before it is used
Developer keeps hold of source code, so it cannot be altered or extended by the end The developer relinquishes control of source code, making it more difficult to charge for
user, therefore, the developer benefits as they can charge for updates or alterations upgrades and alterations. Since end users can view the source code, they could potentially
use the developer's intellectual property
Compiled programs take shorter time to execute as translation has already been An interpreted program can take longer to execute than the same program when a
completed and machine code may be generated may have been optimised by compiled, since each line of the source code needs to be translated before it is executed
compiler (16.3 A2) every time the program is run
Compiled programs have no syntax or semantic errors Interpreted programs may still contain syntax or semantic errors if any part of the program
has not been fully tested, these errors will need to be debugged
The source program can be translated on one type of computer then executed on Interpreted programs cannot be translated on one computer then executed on another
another type of computer type of computer
Compiler finds all the errors in the program. One error detected can mean that the It is easier to develop and debug a program using an interpreter as errors can be corrected
compiler can find other dependent errors later on in the program that will not be on each line and the program restarted from that place, enabling the programmer to easily
errors when the first error is corrected. Therefore, the number of errors found may learn from any errors
be more than the actual number of errors
Untested programs with errors may cause the computer to crash Untested programs should not be able to cause the computer to crash
Developer needs to write special routines in order to view partial results during Partial results can be viewed during development, enabling the developer to make
development, making it more difficult to assess the quality of particular sections of informed decisions about a section of code, for example
code
End users do not have access to source code and run-time libraries, meaning they are If an interpreted program is purchased, end users have all source code and run-time
unable to make modifications and are reliant on the developer for updates and libraries, enabling the program to be modified as required without further purchase
alterations

5.2.3 Partial compiling and interpreting

1. In order to achieve shorter execution times, many HLLs programs use a system that is partially compilation and partially interpretation:
a. Source code is checked and translated by compiler into object code
b. Compiled object code is checked and translated by a compiler into object code
c. To execute the code can be interpreted by an interpreter or compiled by a compiler

5.2.4 Integrated Development Environment (IDE):

1. An IDE is used by programmers to aid the writing and development of programs

2. IDEs usually have:


a. A source code editor
b. A compiler, an interpreter, or both
c. A run-time environment with a debugger
d. An auto-documenter

3. Source code editor:


a. Allows a program to be written and edited without the need to use a separate text editor
b. The use of it speeds up the development process
c. Most source code editors provide pretty printing - colour coding the words in a program and lay it out in a meaningful way
d. Some source code editors also offer sensitive prompts with text completion for variable names and reserved words
e. They also provide dynamic syntax checking - finds possible syntax errors as the program code is being typed in to the source code editor and alerts the programmer at
the time

5. System Software Page 6


the time
f. Logic errors can only be found when the program is run

4. Compilers and interpreters:


a. Most IDEs provide a compiler and/or an interpreter to run the program
b. Interpreter is often used for developing the program and the compiler to produce the final version of the object code

5. Run-time environment with debugger:


a. A debugger is a program that runs the program under development and aids the debugging process - the process of finding logic errors in a program
b. Allows the program to single step through the program one line at a time (single stepping) and to set a breakpoint to stop th e execution of a program at a certain
point
c. A report window then shows the contents of the variables and expressions evaluated at that point in the program. This allows the programmer to see if there are any
logic errors in the program and check that the program works as intended
6. Auto-documenters
a. Most IDEs provide it to explain the function and purpose of programming code

5. System Software Page 7

You might also like