Operating Systems in Practice
Operating Systems in Practice
Operating
Systems in
Practice
Karl O’Connell
Operating Systems ….
Operating systems have two main
roles:
• An Interface
• A Manager
Interface
• An OS is a suite of programs which provides an interface
between the user and the hardware.
Operating system
Instruction Set
Architecture
Execution hardware
Memory
System interconnect
translation Hardware
( bus )
I/O devices
Main
and
memory
networking
Services (cont.)
• Program Execution – The OS will help to compile, link,
load, run and debug programs. OS will allow normal and
abnormal termination of programs. It generally handles
the scheduling of these tasks.
Services (cont.)
• System Access – For shared or public systems,
the OS controls access to the system as a
whole. This provides protection from
unauthorized users
Services (cont.)
• Accounting - The OS keeps track of resource
use for either payment, protection or statistical
purposes. Protection accounting allows system
to record damage done. Statistics are used in
trying to improve service.
11
12
13
Multiprogramming
• Multiprogramming refers to the task of running several programs at the
same time. For example, a payroll program, a printing task, a statistics
program, all doing their separate work. It is up to the OS to divide its time
between the jobs.
• The OS is capable of dealing with more than one program running at the
same time. For example, while one job is waiting for input, another could be
running some computation, while yet another could be waiting for an output
device, and so on. All of these programs are said to be running
concurrently. The job scheduling task of the OS was to juggle the CPU time
so that each job got access to it in some fair and efficient manner. This task
is referred to as CPU Scheduling. CPU scheduling depends on being able
to interrupt one program and resume another.
15
Multiprogramming (cont.)
• When several jobs are ready to run on the CPU they must all be
stored in main memory. In a multiprogramming system there must
be some way of managing the main memory so that each program
gets the space it needs and doesn’t interfere with the others. This
management task is known as Memory Management.
16
Time Sharing
In addition to multiprogramming, the OS facilitates time
sharing.
In reality the CPU is switching from one job to the next very
quickly. All of this is possible because the CPU can multi-
program.
17
Manager
• The OS also manages the allocation of
machine resources to running programs.
18
Managing Processes
Multiple processes run concurrently.
19
Managing Memory
Each process requires memory.
20
Managing Storage
Data and programs can be stored in
different non-volatile devices.
22
This call is translated by the compiler/assembler into code which will call the
OS giving it information about the data to be output, and the output device.
That is something like:
A system call to the OS will ask the kernel to take a certain number of bytes
from RAM starting at data_address and have them displayed on a particular
device. The kernel will arrange to call the correct device driver software to
communicate with the screen.
23
Command Interpreter
• All operating systems must have some way of understanding and carrying
out instructions from users. This is achieved through a command
interpretation program which runs continuously. The user types a command,
the interpreter translates it into something meaningful and then calls up the
necessary system programs, utilities, or applications that will carry out the
work. The interpreter is less obvious in a GUI environment (e.g. Windows)
and more so in a command based environment (e.g. UNIX shell).
24
25
The Shell
26
UNIX Features
• Portability – it was relatively easy to move UNIX from one type of computer to
another.
UNIX
The UNIX system is functionally organized at three levels:
The Kernel
The heart of the operating system, the kernel
controls the hardware and turns part of the system
on and off at the programmer’s command.
29
The Shell
• There are several types of shell, most notably the
command driven Bourne, BASH and the C Shells.
Whatever shell is used, its purpose remains the same -
to act as an interpreter between the user and the
computer
30
31
Editors – used to create scripts, data files, etc. The vi editor (‘though
not user friendly) comes with every version of UNIX and Linux.
Most Linux systems come with a graphical user interface and often a
suite of office programs.
32
UNIX Advantages
• Already exists for over 40 years
• Multi tasking
• Multi user
• Scalable
33
Disadvantages of UNIX
• UNIX commands can be difficult to remember –
wasn’t user friendly
34
Linux
• In 1991 Linus Torwalds at the University of Helsinki build a UNIX-
like operating system for IBM compatible PCs. He used freely
available source code to develop what would become known as
"Linux" ("Linus' Unix"). By 1994 he released the first stable Linux
Kernel (version 1.0). This was further developed by others.
• One of the reasons for Linux’s popularity is that the source code is
freely available to everyone, and everyone can contribute to its
development. This effectively added thousands of programmers to
the Linux development team. The large number of Linux developers
yielded an operating system of unprecedented efficiency and
robustness, with countless freely available software packages for
both business and pleasure.
35
Linux Advantages
• Low cost: You don’t need to spend time and money to obtain licenses.
• Flexibility: Linux can be used for high performance server applications, desktop
applications and embedded systems. You can save disk space by only installing the
components needed for a particular use.
36
• Choice: The large number of Linux distributions gives you a choice. Each distribution is
developed and supported by a different organization. You can pick the one you like best; the core
functionalities are the same; most software runs on most distributions.
• Easy installation: Most Linux distributions come with user-friendly installation and setup
programs.
• Multitasking: Linux is designed to do many things at the same time; e.g., a large printing job in
the background won’t slow down your other work.
• Security: Linux is one of the most secure operating systems. “Walls” and flexible file access
permission systems prevent access by unwanted visitors or viruses.
• Open source: If you develop software that requires knowledge or modification of the operating
system code, Linux’s source code is at your fingertips.
37
38
39
Linux Distributions
Linux Distributions
Linux distribution is a coherent collection of free software with the kernel as its
center. To run this you normally need a Linux distribution CD.
• Red Hat Linux has been around for a while and has acquired a reputation
for consistency and reliability.
• SuSE Linux is a serious alternative for Windows users, with solid, user-
friendly installation and configuration tools
40
Acquiring Linux
There are a number of sites from where you
download and install Linux.
41
Installing Linux
Linux can be installed on your hard disk on a single
partition (also creates a swap partition)
Install on a CD / DVD
Linux Software
Once Linux is installed, software can be downloaded and
installed. There are various methods of installation –
software may be available in the following formats:
43
Example -
Example :the java jdk environment may offer the following options:
now download this software.
Product / File Description File Size Download
44
45
46
48
apt-get example
• To install a new service (e.g. at)
apt-get install at
49
Zypper
This is used for package management in
openSuse and Suse.
50