CSC 112 - Lecture 1 (Os)
CSC 112 - Lecture 1 (Os)
Operating systems
An operating system, or "OS" for short, is software that communicates with the
hardware and allows other programs to run. The operating system is considered the
most important program that is on a computer. The operating system basically
runs the computer and allows other programs to run as well.
It comprises the fundamental files your computer needs to boot up and function.
Every desktop computer, tablet, and Smartphone includes an operating system that
provides basic functionality for the device.
Common desktop operating systems include Windows, Mac OS X, and Linux.
The operating system is the most important program that runs on a computer.
from the keyboard, sending output to the display screen, keeping track of files
and directories on the disk and controlling peripheral devices such as disk
For large systems, the operating system has even greater responsibilities
and powers. It makes sure that different programs and users running at the same
time do not interfere with each other. The operating system is also responsible for
security, ensuring that unauthorized users do not access the system.
Not all computers have operating systems. For instance, the microwave oven (it is
a computer) in the kitchen does not need an operating system.
It has a set of tasks to perform, very straightforward input to expect (a numbered
input pad and a few pre-set buttons) and simple, unchanging hardware to control.
For a computer like this, an operating system would be unnecessary load, causing
the development and manufacturing costs to increase unnecessarily and adding
complexity where none is required. Instead of having an OS, the computer in a
microwave oven simply runs a single hard-wired program all the time. However,
all desktop computers have operating systems.
Common families of OSes are:
a. GNU/Linux
i. Debian (derivatives include Ubuntu, Mint, Trisquel)
ii. Red Hat (derivatives include Fedora, Blag)
iii. Arch (derivatives include Parabola)
iv. Gentoo (derivatives include Ututo XS)
v. Slackware
b. BSD
i. FreeBSD
ii. Mac OS X
iii. OpenBSD
iv. NetBSD
c. Microsoft Windows
i. Windows XP
ii. Windows Vista
iii. Windows 7
iv. Windows 8
d. iOS
i. iOS 4
ii. iOS 5
iii. iOS 6
e. Android
i. CyanogenMod
ii. Replicant
Importance of an operating system
The following are the importance of an OS:
1. The OS helps devices to serve a variety of purposes, performing several
different tasks.
2. It helps devices to interact with users in more complicated ways.
3. It ensures the device keeps up with needs that change over time. In any
device that has an operating system, there's usually a way to make changes
to how the device works without totally discarding the device. Updates can
be made to the software running on the device and the operating system can
be changed.
4. It enables startup application programs to run.
5. It ensures the allocation of resources needed to execute programs and this is
done by identifying: the programs that are running, the need for memory,
peripheral devices and data protection requirements.
6. It provides facilities for data compression, sorting, mixing, cataloging and
maintenance of libraries, through utility programs available.
2. Real-time Systems
In the real-time systems, inputs immediately affect the outputs. Timing is
critical and an important factor in processing. That is, they are capable of
influencing the source of the data with the use of a feedback mechanism. For
example, the system of control where data from sensors is processed
immediately and affect the outputs, thereby controlling the device. For
example, control of nuclear power plants, oil refining, chemical processing
and air traffic control systems that have regulators in them.
3. Single User Operating System
A single user OS as the name suggests is designed for one user to effectively
use a computer at a time.
4. Multi-Tasking Operating System
In this type of OS, several applications maybe simultaneously loaded and
used in the memory. While the processor handles only one application at a
particular time it is capable of switching between the applications effectively
to apparently simultaneously execute each application. This type of
operating system is seen everywhere today and is the most common type of
OS, the Windows operating system is an example.
5. Multi-User Operating System
This type of OS allows multiple users to simultaneously use the system,
while here as well, the processor splits its resources and handles one user at
a time, the speed and efficiency at which it does this makes it apparent that
users are simultaneously using the system, some network systems utilize this
kind of operating system.
6. Distributed Operating System
In a distributed system, software and data maybe distributed around the
system, programs and files may be stored on different storage devices which
are located in different geographical locations and may be accessed from
different computer terminals.
The multi-tasking and multi-user operating systems are the most common,
some of the other operating systems are usually used in companies and firms
to power special systems.
There are three (3) basic types of computer programming languages. They are:
1. Machine language
2. Assembly language and
3. High-level language.
Machine language
Assembly language
Assembly language is a representation of machine language. In other words, each
assembly language instruction translates to a machine language instruction. The
advantage of assembly language is that its instructions are readable. For example,
assembly language statements like MOV and ADD are more recognizable than
sequences of 0s and 1s. Though assembly language statements are readable, the
statements are still low-level.
A disadvantage of assembly language is that it is not portable. In other words,
assembly language programs are specific to a particular hardware. Assembly
language programs for a Mac will not work on a PC. But this can be an advantage
for programmers who are targeting a specific platform and need full control over
the hardware.
High-level language
High-level languages are what most programmers use. Languages such as C, C++
and Java are all high-level languages. One advantage of high-level languages is
that they are very readable. The statements in these languages are English-like. For
example, you can gain a basic understanding of what a Java program is doing by
simply reading the program source code. High-level languages use English words
as statements. Loops in Java programs are indicated by the words for, while and
do.
A disadvantage of high-level languages is that they are usually less powerful and
less efficient. Since statements are high-level, you cannot code at the bit level the
way you can with assembly language. High-level languages also need to be
compiled and/or interpreted into machine language before execution.
Examples are Java, C#, Perl, Ruby, Python, PHP and JavaScript.
As there are trends in technology, so also are there trends in the evolution of
programming languages. There are currently five (5) generations of computer
programming languages. In each generation, the languages syntax has become
easier to understand and more human-readable. They are:
1. First generation languages (abbreviated as 1GL)
It represents the very early, primitive computer languages that consisted
entirely of 1's and 0's - the actual language that the computer understands
(machine language).
2. Second generation languages (2GL)
Represents a step up from the first generation languages. Allows for the use
of symbolic names instead of numbers only. Second generation languages
are known as assembly languages. Code written in an assembly language is
converted into machine language (1GL).
Generally, the 1GL and 2GL are low-level languages.
3. Third generation languages (3GL)
With the languages introduced by the third generation of computer
programming, words and commands (instead of just symbols and numbers)
were being used. These languages therefore, had syntax that was much
easier to understand. Third generation languages are known as "high level
languages" and include C, C++, Java, and Javascript, among others.
4. Fourth generation languages (4GL)
The syntax used in 4GL is very close to human language, an improvement
from the previous generation of languages. 4GL languages are typically used
to access databases and include SQL and ColdFusion, among others.
5. Fifth generation languages (5GL)
Fifth generation languages are currently being used for neural networks. A
neural network is a form of artificial intelligence that attempts to imitate
how the human mind works.
Translators
1. Assemblers
2. Compilers.
3. Interpreters.
Assembler
This is a program, which translate assembly language into machine code. One
machine instruction is generated for each source instruction. The resulting program
can only be executed when the assembly process is completed. The assembler
reserves space for the instructions and data, replaces mnemonic operating codes by
machine codes and symbolic addresses by numeric addresses while it determines
the machine representation of constants.
A compiler translates a high level language into machine language. The compiler
translate the whole source program into machine code or object program prior to
the object being loaded into main memory and execution. The resulting program
can only be executed when compilation is completed.
Interpreter
Interpreters hardly produce object codes but call upon in-built routines instead.
However, some intermediate codes are usually produced temporarily. The
interpreter does not produce object program, it read source program, translates it
and goes ahead to execute it.
The object program provided by a compiler fastens execution than any interpreter
can do in the running of a program, the use of object program may however pose a
problem where there is an error as it is very time consuming to discover the source
of error, a compiler is capable of producing a machine code generated by it at any
time, whereas an interpreter can only execute the source program. If a computer is
used, the same program needs only to be translated once. Thereafter, the object
program can be loaded directly into main storage and executed. However, when an
interpreter is used, the source program will be translated every time the program is
executed. Execution carried out in this way may be ten times slower than the
execution of the equivalent object programs.
(b). If software produced on an old model and not yet converted had to be run on a
new one. This procedure is referred to as SIMULATION since the interpreter
allows the new computer to simulate the behavior of the old.
4. The interpreter can also be used to simulate a new machine not yet provided but
for which software is already written.