Lec 6 Operating Systems

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 39

OPERATING SYSTEMS

LECTURE 6
Operating systems
■ The OS kernel sits between hardware and the end user. It's the foremost software
installed on a computer to make it functional. It is the first layer of software that is
loaded into memory when the computer is powered on. It allows hardware devices,
applications, and the user to accomplish different tasks.
■ Suppose a user wants to write and print a report to an attached printer. A word
processing application is required to accomplish this task. Data is inputted using the
keyboard and then displayed on the monitor before being sent to the printer.
■ In order for the word processor, keyboard, and printer to accomplish this task, they
must work with the OS, which controls input and output functions, memory
management, and printer spooling.
Definition
What is an operating system?
The definition of an operating system is not very precise, we therefore can define it in a number of
ways.
■ An operating system is the software that controls the hardware.
■ A set of programs that controls the computer
There are many different Operating Systems out there. On PCs the most popular operating
system is Windows. (In lab we use Windows 7 and 10).

On a Mac, the operating system is called MacOS, with the current version being OS 10.12.6
Sierra (Released on July 19, 2017)
These are probably the two most well known Operating Systems.

You’ve probably heard of Linux, another popular computer OS,


but basically, any computer or device that runs programs,
especially multiple programs, has an operating system.

Game consoles like the Wii, the PS3 and X-box all
have operating systems. Your mobile phone has an
operating system .

4
Introduction cont’d
An amazing aspect of operating systems is how varied they are in accomplishing various
tasks.
■ Mainframe operating systems are designed primarily to optimize utilization of
hardware. Mainframes are generally less user-centered and are mode used to process
data. For example, they are processing financial transactions of millions of people if the
mainframe is used by a bank
■ For a personal computer, the hardware is generally optimized to provide quick answers
to the user. These are build for a lot of user interaction and are generally graphical
interfaces or console interfaces on top of the kernel of an operating system. Personal
computer (PC) operating systems support complex games, business applications, and
everything in between. .
Thus, some operating systems are designed to be convenient and others to be efficient and
others some combination of the two.
Categories of OSs
■ Real Time OS: These are installed in special purpose embedded systems like robots,
cars, and modems.
■ Single-user and single-task OS: These are installed in single-user devices like
phones.
■ Single-user and multitask OS: These are installed in contemporary personal
computers.
■ Multi-user OS: These are installed in network environments where many users have
to share resources. Server OSs are examples of multi-user operating systems.
Modes of operation
Most computers have two modes of operation:
 kernel mode and
 user mode.
The operating system, the most fundamental piece of software, runs in kernel mode (also called
supervisor mode). In this mode it has complete access to all the hardware and can execute any
instruction the machine is capable of executing. The rest of the software runs in user mode, in which
only a subset of the machine instructions is available.
The user interface program, shell or GUI, is the lowest level of user-mode software, and allows the
user to start other programs, such as a Web browser, email reader, or music player
Modes of operation cont’d

■ An important distinction between the operating system and normal (user mode) software is that if a
user does not like a particular email reader, he is free to get a different one or write his own if he so
chooses; he is not free to write his own clock interrupt handler, which is part of the operating
system and is protected by hardware against attempts by users to modify it.
Basic Functions of Operating System
■ Manage Storage Space
The operating system stores data at some location on disk. It knows where to go to retrieve data when it
is needed.
■ Detects Problems and Equipment Failure
The operating system also is the maintenance mechanic of the system. It checks the system for failures
that will cause problems in processing. Messages will appear on the screen when there is a problem.
■ Traffic Controller
The operating system is also in charge of the data that is coming into the computer and going out of the
computer. It directs the flow of data to and from the external devices and also takes care of control
routing information along the bus to be processed by the processor.
Basic Functions of Operating System
cont’d
■ System Resource Manager
What is the system resource? Well any hardware or part of the computer used by the computer program is
considered a system resource. The memory, disk drive, external devices, etc. are all "mothered" by the
operating system. The O/S "allocates" or makes sure that enough space is there for the computer program
to operate, allocates, time for each program to work, and also keeps the processor going after each
instruction
■ Multitasking
Multitasking is the ability to run more than one program at a time
■ Security Cop
Security on the system is also managed by the operating system. The O/S can give you the option to set up
passwords or ID logons in order to use the computer
Operating system structures
The design of an operating system architecture traditionally follows the separation of concerns
principle. This principle suggests structuring the operating system into relatively independent parts that
provide simple individual features, thus keeping the complexity of the design manageable
The following sections outline typical approaches to structuring the operating system .
■ Monolithic (one unstructured program)
By far the most common organization, in the monolithic approach the entire operating system runs as
a single program in kernel mode. The operating system is written as a collection of procedures, linked
together into a single large executable binary program. When this technique is used, each procedure in the
system is free to call any other one, if the latter provides some useful computation that the former needs
Monolithic structure
operating system structures cont’d
■ Layered systems
A generalization of the approach is to organize the operating system as a hierarchy of layers,
each one constructed upon the one below it.
Each layer can interact with the one just above it and the one just below it. Lowermost layer
which directly deals with the bare hardware is mainly meant to perform the functionality of I/O
communication and the uppermost layer which is directly connected with the application program
acts as an interface between user and operating system
Layered system
Advantages of Layered architecture:
 
■ Dysfunction of one layer will not affect the entire operating system
■ Easier testing and debugging due to isolation among the layers.
■ Adding new functionalities or removing the obsolete ones is very easy.

Disadvantages of Layered architecture:


■ It is not always possible to divide the functionalities, many a times they are inter-related and
can’t be separated.
■ Sometimes, a large no. of functionalities is there and number of layers increase greatly. This
might lead to degradation in performance of the system.
■ No communication between non-adjacent layers.
operating system structures cont’d
■ Microkernel systems
as UNIX expanded, the kernel became large and
difficult to manage. This method structures the
operating system by removing all non essential
components from the kernel and implementing them
as system and user level programs.
Experience with the microkernel design suggests that
only very few individual parts of the operating
system need to have more privileges than common
applications.
Disadvantage of this is it uses message passing to
communicate between the modules hence system
overhead issues
Modular systems
A modular operating system is
built with its various functions
broken up into distinct processes,
each with its own interface.

The main elements of a modular


operating system are a kernel and a
set of dynamically loadable
applications with their own discrete
memory spaces

This ability to start and stop an


application gracefully, without
impacting the entire system,
enables a quick response to
emerging threats and security
vulnerabilities, and makes it easy
to manage applications with
frequent refresh cycles.
User operating system interface cont’d
■ Graphical User Interfaces
A second strategy for interfacing with the operating system is through a user friendly
graphical user interface, or CUI.
Here, rather than entering commands directly via a command-line interface, users
employ a mouse-based window and menu system characterized by a desktop metaphor.
The user moves the mouse to position its pointer on images, or icons on the screen (the
desktop) that represent programs, files, directories, and system functions.
Depending on the mouse pointer's location, clicking a button on the mouse can invoke
a program, select a file or directory-known as a folder-or pull down a menu that contains
commands.
UNDERSTANDING WINDOWS
■ Windows 95, 98, 2000, ME, NT, XP, Vista, 7, 8, 10
■ Desktop and icons
■ Task bar
■ Start button
■ Programs
Microsoft DOS I (Command Prompt)
The word DOS is an acronym meaning “Disk Operating System”, it is one of the first
Operating systems released as an IBM PC-Compatible based system, this OS is known as
the background to all PC Operating Systems including Windows 7. Being that it runs
in the background, makes it a single-user, single-task operating system with a basic
command line and no GUI (Graphical User Interface). DOS is strictly Command Line
functional, which simply means No “Icons”, “Mouse” or “Graphics”.

■ How to access DOS “Disk Operating System” screen.


There are two primary ways to launch the DOS screen.
I. Go to the Start Menu, Programs, Accessories and Click on Command Prompt.
II. Click on Start then select Run...
■ In the Run Dialog box Type “Command” in the Open: textbox and click
OK. Tip: you could type in “cmd” short for Command either way, the
outcome will be the same.
■ You should now see the black “DOS” screen also known as the Command Prompt. (The
command prompt means that the computer will do a performance based on a command
prompted by you the user.) Do not be worried if the text on your screen appears different
after the C: Prompt, some computers might have different names that were specified during
the O.S. setup.
Understand the Difference between DOS
Command Line and GUI.
Computers consist of two types of interfaces DOS and GUI.
DOS: We now know stands for “Disk Operating System”. It is a Black screen that is
running in the background of any pc based computer with an operating system
installed. We navigate our way through it by typing in commands or instructions.

GUI: Might not sound all that familiar to you, however it is something that we use every
day and might not even be aware of. GUI of course is an acronym which simply
stands for “Graphical User Interface”. Basically this interface consists of graphics
such as icons and mouse capability. We need not know any instructions to handle this
interface a simple click here and there will start us off in creating our task at hand.
Take a look below does this screen look familiar? it should! this is our GUI. Our latest Operating
Systems provide us with a much more appealing look to our screen. No more memorizing
commands or doing single tasks at a time.
Based on the two images above we are able to distinguish 2 main differences in each.
DOS – A: Command Line B: Single-task Capability
GUI – A: Interactive graphical icons B: Multi-tasking Capabilities.
With DOS we are only able to do tasks one at a time one command after another, once the first
task is complete we need to move on to the next task. With GUI however we are able to do
multiple tasks all together on the same screen.
Notice: At the bottom of our Desktop there are tabs lined up one after another. This is known as
multitasking, the ability to switch back and forth on multiple tasks using a single computer
screen.
How to view Directories / Folders and Files

As we‘ve seen in the previous objectives, there are several commands that we
could use to view the Directories and Files through the command prompt.
Command Prompt Basic Commands
Viewing a list of Directories and Folders
C:\>dir
Going into a folder Directory
Type “cd windows”
Type dir to display the directories in the windows folder, choose system, and type “cd system” and take a
look at the prompt.

We are now in a subdirectory with-in the windows folder, the process can go on and on until there are no
more subfolders available. By typing “CD..” we are able to decrement and remove you from the
current folder to the previous folder location, until you are back to the main command prompt.
How to access basic applications.
We can access both Windows and DOS applications through the command prompt.
Windows based applications: Calculator, Microsoft Paint, Notepad…
Typing calc, mspaint, notepad in the Command Prompt will Open the following
applications
Opening a document
■ Making a directory
Md foldername

■ Creating a file in a document


Copy con file.ppt

■ Opening a document
start file.ppy
Dos vs windows

 Dos is only single tasking while Windows is multitasking.


 Dos is based on plain interface while Windows is based on Graphical user interface (GUI).
 Dos is difficult to learn and understand while Windows is easy to learn and understand.
 Limited users can work on dos while in Windows there are many users.
 We cannot see mouse in Dos while in Windows we can see and use mouse to click on icons or
links.
 simple text commands are written in Dos while in Windows we operate computer with the help
of mouse.
Dos vs windows

 In Dos we cannot Play games, watch movies and listen songs while in Windows we can enjoy playing
games, watching movies and listening songs.
 In Dos new hardware cannot work properly while in Windows it can detect and installs software
automatically.
 Dos performs operations speedily as compared with Windows operating system.
BIOS:
■ The basic input-output system (BIOS) is the first thing you see when you turn on your
computer.
■ The BIOS is special software that interfaces the major hardware components of your
computer with the operating system. It is usually stored on a Flash memory chip on the
motherboard (which has its own battery), but sometimes the chip is another type of ROM.

33
Booting
■ Booting is a startup sequence that starts the operating system of a computer when it is
turned on.
■ A boot sequence is the initial set of operations that the computer performs when it is
switched on. Every computer has a boot sequence. The average computer doesn’t
understand the boot sequence but is important to know for customizing and
troubleshooting your computer
■ Before a PC can run the operating system, it needs some way to load it from disk into
RAM. The way to do this is with the bootstrap – a small amount of code that is
executed on startup or system boot. The bootstrap is aptly named because it lets the PC
do something entirely on its own, without any outside operating system
Boot Devices
The boot device is the device from which the operating system is loaded. A modern PC BIOS
(Basic Input/Output System) supports booting from various devices.
These include the local hard disk drive, optical drive, floppy drive, a network interface card, and a
USB device. Typically, the BIOS will allow the user to configure a boot order. If the boot order is
set to:
■ CD Drive
■ Hard Disk Drive
■ Network
then the BIOS will try to boot from the CD drive first, and if that fails then it will try to boot from
the hard disk drive, and if that fails then it will try to boot from the network, and if that fails then it
won’t boot at all.
Boot sequence
1. The computer loads the basic input/output system (BIOS) from ROM. The BIOS provides
the most basic information about storage devices, boot sequence, security, Plug and Play (auto
device recognition) capability and a few other items.
2. The BIOS triggers a test called a power-on self-test (POST) to make sure all the major
components are functioning properly. You may hear your drives spin and see some LEDs
flash, but the screen, at first, remains black.
3. The BIOS has the CPU send signals over the system bus to be sure all of the basic
components are functioning. The bus includes the electrical circuits printed on and into the
motherboard, connecting all the components with each other.
4. The POST tests the memory contained on the display adapter and the video signals that control
the display. This is the first point you’ll see something appear on your PC’s monitor.

36
Boot up process cont’d
5. During a cold boot the memory controller checks all of the memory addresses with a quick
read/write operation to ensure that there are no errors in the memory chips. Read/write means that
data is written to a bit and then read back from that bit. You should see some output to your screen -
on some PCs you may see a running account of the amount of memory being checked.
6. The computer loads the operating system (OS) from the hard drive into the system’s RAM. That
ends the POST and the BIOS transfers control to the operating system. Generally, the critical parts
of the operating system - the kernel - are maintained in RAM as long as the computer is on. This
allows the CPU to have immediate access to the operating system, which enhances the performance
and functionality of the overall system

37
Types of booting
Booting is divided into two types; Cold (Hard) Boot and Warm (soft) Boot.
■ Cold boot: Is described as a process of starting a computer after switching it off. A
good example is turning on a desktop computer after power cable is plugged in.
■ Warm Boot: it is a method where the ‘operating system’ (OS) is restarted without
switching it off after a computer locks, freezes or crashes. This type of booting is faster
and helps the (OS) recover from errors easily.

When To Perform A Warm boot;


■ After a new program is installed
■ When the OS freezes.
■ After installing external Hardware such as mouse, Keyboard.
THE END

You might also like