You are on page 1of 34

1

Preliminary Computer Science I

COMP0001

School of Science, Computing and Artificial Intelligence

Lecturer: Ilenius Ildephonce

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 1 / 31
2

Lecture 3

System Software

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 2 / 31
Contents
3

1 Operating System
Utility software

2 Purposes of an operating system (OS)


Process management
Process states

3 Language Translators
Partial compiling and interpreting
Integrated development environment (IDE)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 3 / 31
Content
4

1 Operating System
Utility software

2 Purposes of an operating system (OS)


Process management
Process states

3 Language Translators
Partial compiling and interpreting
Integrated development environment (IDE)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 4 / 31
The need for an OS
5

Early computers had no operating system at all. Control software had


to be loaded each time the computer was started
As the hard disk drive (HDD) was developed, operating systems were
stored on the hard disk, and start-up of the motherboard was handled
by the basic input/output system (BIOS).
An operating system provides both the environment in which
applications can be run, and a useable interface between humans and
computer.
The human-computer interface (HCI) is usually achieved through a
graphical user interface (GUI), although it is possible to use a
command line interface (CLI) if the user wishes to directly
communicate with the computer.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 5 / 31
Operating system tasks
6

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 6 / 31
Memory management
7

memory optimisation
memory organisation
memory protection

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 7 / 31
Security management
8

to ensure the integrity, confidentiality and availability of data. This can


be achieved by:
carrying out operating system updates
ensuring that antivirus software (and other security software) is
always up-to-date
making use of privileges to prevent users entering ’private areas’
on a computer which permits multi-user activity
offering the ability for the recovery of data (and system restore)
when it has been lost or corrupted

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 8 / 31
Process management
9

Process management
involves the allocation of resources and permits the sharing and
exchange of data, thus allowing all processes to be fully synchronised
(for example, by the scheduling of resources, resolution of software
conflicts, use of queues and so on)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 9 / 31
Hardware management
10

Hardware management involves all input and output peripheral


devices.
communicating with all input and output devices using device
drivers
ensuring each hardware resource has a priority so that it can be
used and released as required

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 10 / 31
File Management
11

File management
defining the file naming conventions
performing specific tasks, such as create, open, close, delete,
rename, copy, move
maintaining the directory structures
specifying the logical file storage format (such as FAT or NTFS if
Windows is being used)
ensuring memory allocation for a file by reading it from the
HDD/SSD and loading it into memory.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 11 / 31
Utility software
12

hard disk formatter


virus checker
defragmentation software
disk contents analysis/repair software » file compression
back-up software.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 12 / 31
Content
13

1 Operating System
Utility software

2 Purposes of an operating system (OS)


Process management
Process states

3 Language Translators
Partial compiling and interpreting
Integrated development environment (IDE)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 13 / 31
How an operating system can maximise the use
14
of computer resources

OS and resources
Bootstrap program loads part of the operating system into main
memory (RAM) from the hard disk/SSD and initiates the start-up
procedures.
Resource management can be split into three areas:
The CPU
Memory
The input/output (I/O) system

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 14 / 31
OS and resources cont...
15

Resource management of the CPU involves the concept of


scheduling to allow for better utilisation of CPU time and resources.
For input/output operations, the operating system will need to deal with
any I/O operation which has been initiated by the computer user
any I/O operation which occurs while software is being run and
resources, such as printers or disk drives, are requested.
The direct memory access (DMA) controller is needed to allow
hardware to access the main memory independently of the CPU.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 15 / 31
The Kernel
16

The Kernel

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 16 / 31
The Kernel
17

The Kernel
The kernel is part of the operating system.
It is the central component responsible for communication between
hardware, software and memory.

It is responsible for process management, device management,


memory management, interrupt handling and input/output file
communications

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 17 / 31
Multitasking
18

Multitasking allows computers to carry out more than one task (known
as a process) at a time.
To ensure multitasking operates correctly (for example, making sure
processes do not clash), scheduling is used to decide which processes
should be carried out.
There are two types of multitasking operating Systems
1 preemptive (processes are pre-empted after each time quantum)
2 non-preemptive (processes are pre-empted after a fixed time
interval).

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 18 / 31
Preemptive Vs Non- Preemptive
19

Figure: The differences between preemptive and non-preemptive systems

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 19 / 31
Process scheduler
20

Process priority depends on


1 its category (is it a batch, online or real time process?)
2 whether the process is CPU-bound (for example, finding 10000
factorial would need long CPU cycles and short I/O cycles) or I/O
bound (for example, printing a large number of documents would
require short CPU cycles but very long I/O cycles)
3 resource requirements (which resources does the process
require, and how many?)
4 the turnaround time, waiting time and response time for the
process
5 whether the process can be interrupted during running

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 20 / 31
Task/process priority
21

Task/process priority
Once a task has been given a priority, it can still be affected by
deadline for the completion of the process
how much CPU time is needed when running the process
the wait time and CPU time
the memory requirements of the process.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 21 / 31
22

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 22 / 31
Content
23

1 Operating System
Utility software

2 Purposes of an operating system (OS)


Process management
Process states

3 Language Translators
Partial compiling and interpreting
Integrated development environment (IDE)

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 23 / 31
Translation and execution of programs
24

Program translation & execution


Programming instructions written in any programming language other
than machine code must be translated before they can be used.
The systems software used to translate a source program written in
any language other than machine code are translators.
There are three types of translator available, each translator performs
a different role.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 24 / 31
Assemblers
25

Programs written in assembly language are translated into machine


code by an assembler program.
Assemblers either store the program directly in main memory, ready for
execution, as it is translated, or they store the translated program on a
storage medium to be used later.
If stored for later use, then a loader program is also needed to load the
stored translated program into main memory before it can be executed.
The stored translated program can be executed many times without
being re-translated.
Assembly language programs are machine dependent; they are not
portable from one type of computer/chip to another.
or example, MASM is an assembler that is used for the X86 family of
chips, while PIC and GENIE are used for microcontrollers.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 25 / 31
Assemblers
25

Programs written in assembly language are translated into machine


code by an assembler program.
Assemblers either store the program directly in main memory, ready for
execution, as it is translated, or they store the translated program on a
storage medium to be used later.
If stored for later use, then a loader program is also needed to load the
stored translated program into main memory before it can be executed.
The stored translated program can be executed many times without
being re-translated.
Assembly language programs are machine dependent; they are not
portable from one type of computer/chip to another.
or example, MASM is an assembler that is used for the X86 family of
chips, while PIC and GENIE are used for microcontrollers.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 25 / 31
Compilers and interpreters
26

Programs written in a high-level language can be either translated into


machine code by a compiler program, or directly executed line-by-line
using an interpreter program.
Compilers usually store the translated program (object program) on a
storage medium ready to be executed later.
With an interpreter, no translated program is generated in main
memory or stored for later use. Every line in a program is interpreted
then executed each time the program is run.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 26 / 31
Compilers and interpreters
26

Programs written in a high-level language can be either translated into


machine code by a compiler program, or directly executed line-by-line
using an interpreter program.
Compilers usually store the translated program (object program) on a
storage medium ready to be executed later.
With an interpreter, no translated program is generated in main
memory or stored for later use. Every line in a program is interpreted
then executed each time the program is run.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 26 / 31
Compilers and interpreters
26

Programs written in a high-level language can be either translated into


machine code by a compiler program, or directly executed line-by-line
using an interpreter program.
Compilers usually store the translated program (object program) on a
storage medium ready to be executed later.
With an interpreter, no translated program is generated in main
memory or stored for later use. Every line in a program is interpreted
then executed each time the program is run.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 26 / 31
Comparison between assemblers, compilers
27
and interpreters

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 27 / 31
Partial compiling and interpreting
28

Partial compiling & interpreting


In order to achieve shorter execution times, many high-level languages
programs use a system that is partially compilation and partially
interpretation.
The source code is checked and translated by a compiler into object
code.
The compiled object code is a low-level machine independent code,
called intermediate code, p-code or bytecode.
To execute the program, the object code can be interpreted by an
interpreter or compiled using a compiler.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 28 / 31
Example Java source code
29

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 29 / 31
intermediate code(Bytecode)
30

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 30 / 31
Integrated development environment (IDE)
31

IDEs
An integrated development environment (IDE) is used by programmers
to aid the writing and development of programs. There are many
different IDEs available; some just support one programming
language, others can be used for several different programming
languages. NetBeans®, PyCharm®, Visual Studio® and
SharpDevelop are all IDEs currently in use.
IDEs usually have:
a source code editor
a compiler, an interpreter, or both
a run-time environment with a debugger
an auto-documenter.

Ilenius Ildephonce (The UWI, Five Islands) COMP0001-Lecture Week 3A September 22, 2021 31 / 31

You might also like