[go: up one dir, main page]

0% found this document useful (0 votes)
235 views11 pages

CSC 112 - Lecture 1 (Os)

The document discusses operating systems and their importance. An operating system communicates with hardware and allows other programs to run. It performs basic tasks like input/output handling and resource management. Common desktop operating systems include Windows, Mac OS, and Linux, while mobile systems include Android and iOS. Programming languages allow users to write instructions for computers in a structured format.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
235 views11 pages

CSC 112 - Lecture 1 (Os)

The document discusses operating systems and their importance. An operating system communicates with hardware and allows other programs to run. It performs basic tasks like input/output handling and resource management. Common desktop operating systems include Windows, Mac OS, and Linux, while mobile systems include Android and iOS. Programming languages allow users to write instructions for computers in a structured format.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 11

CSC 112 – LECTURE ONE

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.

While Windows and Linux can be installed on standard PC hardware, Mac OS X


can only run on Macintosh computers. Therefore, the hardware you choose affects
what operating system(s) you can run.
Mobile devices, such as tablets and Smart phones also include operating systems
that provide a GUI and can run applications. Common mobile OS include Android,
iOS, and Windows Phone. These OS are developed specifically for portable
devices and therefore are designed around touch screen input. While early mobile
operating systems lacked many features found in desktop OS, they now include
advanced capabilities, such as the ability to run third-party apps and run multiple
apps at once.

The operating system is the most important program that runs on a computer.

Every general-purpose computer must have an operating system to run other

programs. Operating systems perform basic tasks, such as recognizing input

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

drives and printers.

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.

Since the operating system serves as a computer's fundamental user interface, it


significantly affects how you interact with the device. Therefore, many users prefer
to use a specific operating system. For example, one user may prefer to use a
computer with Mac OS X instead of a Windows-based PC.
Another user may prefer an Android-based smartphone instead of an iPhone,
which runs the iOS.
When software developers create applications, they must be write and compile
them for a specific operating system. This is because each OS communicates with
the hardware differently and has a specific application program interface, or API,
that the programmer must use. While many popular programs are crossplatform,
meaning they have been developed for multiple OSes, some are only available for
a single operating system. Therefore, when choosing a computer, it is important to
make sure the operating system supports the programs you want to run.

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.

An operating system must be made up of different parts: (these can change


depending on the operating system)

i. kernel and drivers


ii. computer programs and software

Types of operating systems

1. Batch Processing System


In the batch processing system, the data or programs are collected, grouped
and processed at a later date. Examples of the batch processing systems are
payroll, stock control and billing systems.

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.

Introduction to computer programming

Programming languages are artificial languages designed to control computers and


many man hours have been spent to develop new and improved languages. There
are thousands of different programming languages, but most conform to a few
basic paradigms.
A computer programming language is a vocabulary and set of grammatical rules
for instructing a computer to perform specific tasks.
The term “programming language” usually refers to high-level languages, such as
BASIC, C, C++, COBOL, FORTRAN, Ada, and Pascal. Each language has a
unique set of keywords (words that it understands) and a special syntax for
organizing program instructions.
High-level programming languages, while simple compared to human languages,
are more complex than the languages the computer actually understands, called
machine languages. Each different type of CPU has its own unique machine
language.

A simple way to understand programming languages is to think of them as bricks


which can be used to create applications and operating system. Generally Java is
used for internet applications. C++ is a language of professional developers and
used extensively in developing operating systems. PHP is another language used
for internet applications. There is a new class of languages which are being utilized
for the mobiles. These are light weight, modular languages which are used to
design mobile applications.

Types of programming languages

There are three (3) basic types of computer programming languages. They are:

1. Machine language
2. Assembly language and
3. High-level language.

Each of these types of programming languages is described below.

Machine language

Machine language is the only language that a computer understands. Each


statement in a machine language program is a sequence of bits. Each bit may be set
to 0 or 1. Series of bits represent instructions that a computer can understand. For
example, the number 455 is represented by the bit sequence 111000111.
Machine language is a low-level programming language. It is easily understood by
computers but difficult to read by people. This is why people use higher level
programming languages. Programs written in high-level languages are compiled
and/or interpreted into machine language so computers can execute them.

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.

Generations of programming languages

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

As earlier discussed, a translator is a program which converts statements (program


or instructions) written in one language to statements in another language
especially to machine language.

There are three types of 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.

Functions of the assembler

(a) It translates mnemonic operation codes, and symbolic addresses into


machine addresses.
(b) Includes the necessary linkages for closed subroutines and insert appropriate
machine code for macros.
(c) Allocates area of storage.
(d) Detects and indicates invalid source language instructions.
(e) Produces the object program on disk as required.
(f) Produces a printed listing of the source and object program with comments.
Compiler

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.

Functions of the compiler

(a) Translates the source program statements into machine code.


(b) Includes linkage for closed subroutines.
(c) Allocates areas of main storage.
(d) Generates the object program on cards, tapes or disc as required.
(e) Produces a printed copy of the source and object program when required.
(f) Tabulates list of errors found during program compilation. For example, the
use of a word or statement not included in the language vocabulary, the rule
of syntax or lexis.

Interpreter

Interpreter is more easily understood by comparing them with compiler. Both


compilers and interpreters are commonly used for the translation of high-level
language program but they perform the translation in two completely different
ways. The difference between the compiler and the interpreter is in their translation
process. For the compiler, the whole of the high level language source program
is converted into machine code object program prior to the object program being
loaded into main memory for execution. This in contrast to the interpreter which
deals with the source program one instruction at a time, completely translating and
executing each instruction before it goes onto the next.

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.

Functions of the interpreter


1. Handling user commands in an interactive system.
2. They debug programs as they run, that is, for each line of coding before
implemented.
3. Handling software produced for or by different computer. In this case, the
interpreter may be essential if:
(a). Two dissimilar machines are to be connected together for operation, or

(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.

You might also like