Chapter IV
Software
By Eng. Ibrahim Jomaa
A Numeric Machine can only execute orders. When
turned on, the CPU starts the boot sequence as
indicated in its boot program located in ROM. It
performs hardware initialization during the booting
process, it initializes and tests the system hardware
components, and tries to load a boot loader from a mass
memory device which then initializes an Operating
System. The Operating System takes control of the
machine and manages all its physical (hardware) and
logical (software) aspects.
If the Operating System couldn’t be initialized, the
Numeric Machine generates and error message and
halts.
The more complex the Operating System is, the more
easier becomes the use of the machine, which at its turn
doesn’t require a smarter user.
An Operating System, or simply OS, is a system software
that is being executed all the time by the CPU in order to
control all the physical components (hardware) of the
machine to fulfill the user’s (human using the machine)
requests and to provide common services for computer
programs (programs being used by a human or
background services such as device drivers).
End User
Operating System
Microsoft Windows, mac OS,
Linux
Hardware
CPU, Memory, Hard Disks
The Operating System handles all User
the input and output operations
between the user and the computer
hardware. Application
The user interacts directly with the
OS (file copy) or through an Operating System
application (game, word processor,
…) , and the OS then interacts
System
directly with the physical Programs
component (memory allocation) or
through a special system program or
Hardware
a driver (printer).
Operating systems are found on many devices that contain a computer
from cellular phones and video game consoles to web servers and
supercomputers.
The common personal computer (desktop or laptop) operating systems
are:
1. Microsoft Windows
2. macOS by Apple Inc.
3. the varieties of Linux
In the mobile sector (including smartphones and tablets):
1. Android
2. Apple's iOS
3. other operating systems
In the server and supercomputing sectors, the Linux distributions and
UNIX are dominant.
Memory
Management
Process
Job Accounting
Management
Communicatio File
n Management Management
OS
Device
Networking
Management
Secondary
Command
Storage
Interpretation
Management
Security
Memory management:
Memory management module performs the task of allocation
and de-allocation of memory space to programs in need of this
resource.
Process management:
Process management helps OS to create and delete processes. It
also provides mechanisms for synchronization and
communication among processes.
File management:
It manages all the file-related activities such as organization
storage, retrieval, naming, sharing, and protection of files.
Device Management:
Manages all the I/O devices including mouse, keyboards, touch
pad, disk drives, display adapters, USB devices, Bit-mapped
screen, LED, Analog-to-digital converter, On/off switch,
network connections, audio I/O, printers etc.
Secondary Storage Management:
Systems have several levels of storage which include primary storage,
secondary storage, and cache storage. Instructions and data must be
stored in primary storage or cache so that a running program can
reference it.
Security:
Security module protects the data and information of a computer
system against malware threat and unauthorized access.
Command interpretation:
This module is interpreting commands given by the user and acting
system resources to process that commands.
Networking:
A distributed system is a group of processors which do not share
memory, hardware devices, or a clock. The processors communicate
with one another through the network.
Communication management:
Coordination and assignment of compilers, interpreters, and another
software resource of the various users of the computer systems.
Job accounting:
Keeps track of time & resources used by various jobs and users.
An application is a set of one or more files including
programs and libraries designed to be used by an end
user to fulfill a certain task which could be a simple text
editor, a complex word processor, a game, a media
recorder, player and/or editor, a web browser, etc.
A program is a sequence instructions that, when
executed, fulfill a certain task. An executable program is
a program in which the statements are written in binary
and are directly executed by the CPU.
A program is written a Programming Language, which
is, in turn, an application dedicated to create and modify
programs.
Programming Languages are subdivided into two main
categories: Low Level and High Level.
In a Low Level Programming Language, programs are
written directly in code that is closest to the machine,
due the name: Low Level. This category includes Binary
Language and Assembly Language.
In Binary Language, or Machine Code, programs are
written directly as a sequence of binary numbers.
Writing in this language requires a person that is
extremely familiar with the hardware. Programs written
in Binary Language are the fastest in execution but the
hardest to write.
Debugging, tracing an error, or Modifying a program
written in such language is a true painful operation since
it involves dealing with a large amount of binary
numbers.
The rules of writing in Binary language are set by the
manufacturer of the CPU.
Assembly Language is a set of pseudo-code that can be
easily translated into machine code by an Assembler,
which is a program that translates the pseudo-code into
binary.
Writing in this language also requires a person that is
extremely familiar with the hardware. A program written
in Assembly Language is as fast as a program written
directly in Binary Language and as hard in writing, but
debugging or modifying such program is easier.
Programs written in a Low Level Programming
Language can only be executed by the CPU or CPU
family that supports the code, i.e., they can’t be executed
by a totally different CPU. To do so, the program MUST
be RE-WRITTEN entirely in the new code.
A High Level Programming Language uses commands
taken from the simple English vocabulary such as: read,
write, if, for, while, … and following a predefined set of
rules called Syntax.
A program is written as a plain text, called source code,
and saved in a file called source file or source program.
In order to be executed by the machine, the source code
needs to be translated into binary code or machine
language by a special program called Compiler.
FORTRAN
Formula Translator, used in numeric and scientific
computation,
LISP
List Processor, still used in Artificial Intelligence,
COBOL
Common Business Oriented Language, obviously used in
Business
ALGOL
Algorithmic Language, used to describe Algorithms
PROLOG
Programmation en Logique, Logic Programming, one of
the first logic programming languages and remains the
most popular such language today
PASCAL
Named after the French mathematician Blaise Pascal, intended
to encourage good programming practices using structured
programming and data structuring.
BASIC
Beginners' All-purpose Symbolic Instruction Code, intended to
enable students in fields other than science and mathematics to
use computers. At the time, nearly all use of computers required
writing custom software, which was something only scientists
and mathematicians tended to learn.
C
As the letter C, is a structured programming language that was
designed to construct utilities running on Unix.
Perl, Python, Java, Php, Julia, etc.
The compiler is a program that is very specific the
programming language, i.e., each programming
language has its own compiler.
The tasks of a compiler are:
1. Read the source code
2. Perform a lexical analysis, check the components of a
statement
3. Perform a syntactic/semantic analysis, check if the
statement follows the rules of the PL.
4. Generate a list of all the errors found
5. When no errors are found, generate an executable
code into a file called executable program.
These tasks are generally accomplished by scanning the
source program several times called Passes.
Julia Language
c=0
for i in 1:10
if Pos[i, 2] == 0
c=c+1
end
end
Same Code In C Language
c = 0;
for (i = 1; i < 10; i++)
if ( Pos[i][2] == 0 )
c += 1;
In BASIC Language
10 c = 0
20 For i = 1 To 10 Step 1
30 if Pos(i, 2) = 0 Then c = c + 1
40 Next i
END