0% found this document useful (0 votes)
17 views46 pages

COE628 W1 Lecture

Uploaded by

rheamalana409
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views46 pages

COE628 W1 Lecture

Uploaded by

rheamalana409
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Week 1: Agenda

• Introduction to Computer Systems


• Operating System
• Definition
• Types and Families
• Evolution
• Classification
• Views of an OS
• Components
• Structure
Computer System
• A computer System is a system composed of
two major
components: hardware and software.
• Computer hardware is the physical
equipment. Software is the collection of programs
that allows the hardware to do its job.
• Computer software is divided into two broad
categories: the operating system and
application programs Application programs
use the computer hardware to solve users’
problems. The operating system, on the other hand,
controls the access to hardware by users
Bootstrap process
• The operating system, based on the above definitions, provides supports for other
programs. For example, it is responsible for loading other programs into memory for
execution. However, the operating system itself is a program that needs to be loaded
into the memory and be run. How is this dilemma solved?
• The solution is a two-stage process. A very small section of memory is made of ROM and
holds a small program called the bootstrap program. When the computer is turned
on, the CPU counter is set to the first instruction of this bootstrap program and executes
the instructions in this program. When loading is done, the program counter is set to the
first instruction of the operating system in RAM.
Bootstrap process
Flow Chart of BIOS Functions
Turn on Computer

Pass through Error Free NO Output to Monitor


YES

Plug’n’Play Pass through Error Free

Test Boot Drive NO Pass through Error Free NO


YES

Bootable media found


Pass through POST Error Free

Load boot program

Start operating system


What is an Operating System?
• An operating system is complex, so it is difficult to give a simple universal
definition. Instead, here are some common definitions:
• An operating system is an interface between the hardware of a computer and the user
(programs or humans).
• An operating system is a program (or a set of programs) that facilitates the execution of other
programs.
• An operating system acts as a general manager supervising the activity of each component in
the computer system. As a general manager, the operating system checks that hardware and
software resources are used efficiently, and when there is a conflict in using a resource, the
operating system mediates to solve.
• For the purposes of this course, an Operating System is software that acts as
an abstraction layer between the physical resources of the computer system
and the application programs that run on the system.

Hardware (e.g., Operating User


mouse,
keyboard)
System Program
Comma
Text
GUI nd Line
Editor
Shell

Operating System

Hardware (e.g., mouse,


keyboard)

8
Many Different OSes
Windows

Linux

BSD (Berkeley
Software
Distribution)
11
Two Common OS Families

• Microsoft Windows.
• UNIX and UNIX-based including:
• LINUX
• SOLARIS
• MAC OS X
• Android (Google)
• Chromium (and Chrome—the OS, not the browser) (Google)
• BSD Unix
• Apple iOS (iPad, iPhone, iPod touch)
• POSIX (IEEE standard. All Unix OSes support it and Microsoft
Windows is almost completely compliant.)
Windows
• In the late 1980s Microsoft, under the leadership of Dave Cutler,
started development of a new single-user operating system to replace MS-
DOS (Microsoft Disk Operating System). Several versions of windows
are followed, such as Windows NT (NT standing for New Technology),
Windows 2000, Windows XP (XP stands for eXPerience in 2001), Windows
7 (supports the functions for touch-controlled screen and has released
this year of 2009), Windows 8/8.1, Windows 10, and so on.
• Design goals
• Extensibilities, portability, reliability, compatibility, and
performance.
Linux
• In 1991, Linus Torvalds, a Finish student at the University of
Helsinki at the time, developed a new operating system that is known
today as Linux. The initial kernel, which was similar to a small
subset of UNIX, has grown into a full- scale operating system
today. The Linux2.0 kernel, released in 1997, was accepted
as a commercial operating system: it has all features traditionally
attributed to UNIX.
• Linux has three components: kernel, system libraries, and system
utilities
Difference Between Linux and Windows
Operating System
LINUX
BASIS FOR COMPARISON WINDOWS

Cost Free of cost Expensive


Open source Yes No
Customizable Yes No

Security More secure Vulnerable to viruses and malware attacks.

Booting Either primary or logical partition. Only primary partition.


Separation of the directories using Forward slash Back slash
File names Case sensitive Case insensitive
File system EXT2, EXT3, EXT4, Reisers FS, XFS and JFS FAT, FAT32, NTFS and ReFS
Type of kernel used Monolithic kernel Microkernel

Efficiency Effective running efficiency Lower than Linux


More Differences
• Unix is a Command Line User Interface and Windows is Graphic User
Interface operating system.
• In Unix multiprocessing is possible whereas it is not possible in
Windows.
• Windows operating system support plug and play and this feature is
not available in Unix.
• Nice article
• https://www.ijera.com/papers/Vol5_issue2/Part%20-%203/N502038385.pdf
• Nice Link
• https://www.youtube.com/watch?v=EB5hPlqrGU8
Operating Systems Market Share
Evolution of Operating Systems

Hardware upgrades

New types of hardware

New services

Fixes
EVOLUTION of Operating Systems
• Early Systems (1950)
• Simple Batch Systems (1960)
• Multiprogrammed Systems (1970)
• Time-Sharing and Real-Time Systems (1970)
• Personal/Desktop Computers (1980)
• Multiprocessor Systems (1980)
• Networked/Distributed Systems (1980)
• Web-based Systems (1990)
EVOLUTION of Operating Systems
• Operating systems have gone through a long
history of evolution, which we summarize here.
• Batch systems
• Batch operating systems were designed in the 1950s to
control mainframe computers. At that time, computers
were large machines that used punched cards for
input, line printers for output and tape drives for
secondary storage media. Each program to be
executed was called a job. A programmer who wished
to execute a job sends a request
to the operating system.
EVOLUTION of Operating Systems
• Multiprogramming, Time-sharing systems
• To use computer system resources efficiently,
multiprogramming was introduced. The idea is to hold
several jobs in memory at a time, and only assign a resource to a
job that needs it on the condition that the resource is available.
Multiprogramming brought the idea of time sharing: resources
could be shared between different jobs, with each job being
allocated a portion of time to use a resource. Because a computer
is much faster than a human, time sharing is hidden from the
user—each user has the impression that the whole system is
serving them exclusively.
EVOLUTION of Operating Systems
• Personal systems
• When personal computers were introduced, there was a need for an operating
system for this new type of computer. During this era, single-user operating
systems such as DOS (Disk Operating System) were introduced.
• Parallel systems
• The need for more speed and efficiency led to the design of parallel systems:
multiple CPUs on the same machine. Each CPU can be used to serve one
program or a part of a program, which means that many tasks can be
accomplished in parallel instead of serially. The operating systems required for
this are more complex than those that support single CPUs.
EVOLUTION of Operating Systems
• Distributed systems
• Networking and internetworking, have created a new dimension in operating
systems. A job that was previously done on one computer can now be shared
between computers that may be thousands of miles apart. Distributed systems
combine features of the previous generation with new duties such as
controlling security.
• Real-time systems
• A real-time system is expected to do a task within a specific time constraint.
They are used with real-time applications, which monitor, respond to or control
external processes or environments.
Operating Systems Classification
¨Multiuser: when two or more users can work with programs and
share peripheral devices (printer, scanner, fax)
¨Multitasking: multiple applications operated at the same time
¨Multiprocessing: more than one CPUs that can be shared
¨Multithreading: smaller parts of a program are loaded when needed
by OS
¨Real-Time Operating System (RTOS): designed to allow computers to
process and respond to the consistent input of information without
delay
Why study operating systems?
• Operating systems are a maturing field
• Most people use a handful of mature OSes
• Hard to get people to switch operating systems
• Hard to have impact with a new OS
• High-performance servers are an OS issue
• Face many of the same issues as OSes
• Resource consumption is an OS issue
• Battery life, radio spectrum, etc.
• Security is an OS issue
• Hard to achieve security without a solid foundation
• New “smart” devices need new OSes
• Web browsers increasingly face OS issues
Views of an OS

• End user (non-technical)


• Application programmer
• System programmer/administrator
View of an OS : End user (non-technical)

Users (for example, someone who writes documents with


Microsoft Word) experience operating system differences at a
"cosmetic" level. • For example, if they change from
Windows to Mac OS X, they quickly adapt and learn that
the functionality of the square red "X" button on the top
right of a widow used in Windows to close a window is
accomplished with the red round button on the top left in
Mac OS X.
View of an OS : Application programmer
• Application programmers should strive to isolate the OS-dependent code into small
modules. To do this, the programmer needs to know the APIs for different systems.
Programmers writing sophisticated software will also need to learn how to use some
OS features directly. This is particularly important when designing apps that exploit
the concurrent use of multiple threads or processes and ensure reliable and safe
communication between these tasks.
View of an OS: System programmer/administrator

• These professionals need the greatest knowledge of operating


systems including:
• How operating systems work internally
• How to write device drivers.
• How to tune and/or modify the kernel.
COMPONENTS
• Today’s operating systems are
very complex. An operating
system needs to manage different
resources in a computer system. It
resembles an organization with
several managers at the top level.
Each manager is responsible for
managing their department, but also
needs to cooperate with others and
coordinate activities.
• A modern operating system has at
least four duties: memory
manager, process manager, device
manager and file manager.
OS Basic Functions
¨ File and folder management
¤ An operating system creates a file structure on the computer hard drive where the data can
be stored and retrieved
¨ Applications management
¤ Whenever a program is requested the operating system locates it and loads into the primary
memory or RAM.
¨ Support for built-in utility programs
¤ The operating system comes with tools for maintenance and repairs. They identify the
problem, they find lost files, repair the damaged ones and do backups for your data.
¨ Computer hardware control
¤ Operating systems facilitates the access of programs to the computer hardware through the
BIOS and through device drivers.
COMPONENTS
Memory Manager
• One of the responsibilities of a modern computer system is
memory management. Although the memory size of computers has
increased tremendously in recent years, so has the size of the
programs and data to be processed.

• Memory allocation must be managed to prevent applications from


running out of memory. Operating systems can be divided into two
broad categories of memory management: monoprogramming and
multiprogramming.
Process Manger
• The process manager uses two schedulers: the job scheduler and the process scheduler.
• In reality, there are many jobs and many processes competing with each other for computer
resources. To handle multiple processes and jobs, the process manager uses queues (waiting
lists).
• A job control block or process control block is associated with each job or process. This is a
block of memory that stores information about that job or process.
• The process manager stores the job or process control block in the queues instead of the job
or process itself. The whole idea behind process management is to synchronize different
processes with different resources.
• Whenever resources can be used by more than one user (or process, in this case), we can have
two problematic situations: deadlock and starvation. The process manager have capable to
solve them when they were occurred.
Device Manger
• The device manager, or input/output manager, is responsible for access to input/
output devices.
• There are limitations on the number and speed of input/output devices in a
computer system. Because these devices are slower in speed compared with the CPU
and memory, when a process accesses an input/output device, the device is not
available to other processes for a period of time.
• The device manager is responsible for the efficient use of input/output
devices.
• The responsibilities of a device manager are to monitor every input/output device
constantly to ensure that the device is functioning properly, to maintains a queue
for each input/output device or one or more queues for similar input/output devices,
and to control the different policies for accessing input/output devices.
File Manger
• Operating systems today use a file manager to control access to
files. A detailed discussion of the file manager also requires
advanced knowledge of operating system principles and file access
concepts that are beyond the scope of this book.
• The responsibilities of a file manager are to control access
to files and to supervise the creation, deletion,
modification, and naming of files, and to store files for
archiving and backups.
The structure of an operating system
There are three basic elements that make up the major design
components of any operating system:

• User Interface

• KernelFile

• management system
User Interface
• Each operating system has a user interface, a program that accepts
requests from users (processes) and interprets them for the rest of the
operating system. A user interface in some operating systems, such as
UNIX, is called a shell. In others, it is called a window to denote
that it is menu driven and has a GUI (graphical user interface)
component
Kernel
¨ This is the core of the operating
system.
¨ The kernel is responsible for loading
and operating programs or
processes, and managing input and
output.
¨ Kernel act as a bridge between
applications and the actual data
processing done at the hardware
level
Kernel
• The operating system software file (program) which is copied into
RAM, usually from the hard disk drive, during the boot-up.

• The kernel remains in RAM while the computer is on and is in charge


of the overall operation of the computer system.

• The kernel contains the “internal programs” for the most often used
operations like copying files.

• kmem (Linux)
• command.exe (Microsoft)
File Management System
¨The file management system is what the operating system uses to organize
and manage files.
¨A file is a collection of data.
¨Virtually all of the information that a computer stores is in the form of a
file.
¨There are many types of files, including program files, data files, and text
files.
¨The way an operating system organizes information into files is called the
file system.
¨Most operating systems use a hierarchical file system, which organizes files
into directories under a tree structure.
¨The beginning of the directory system is called the root directory.
KERNEL: System Calls
• OS kernel
• Creates/deletes processes
• Provides access to hardware
• Kernel supplies well-defined system call interface
• Applications set up syscall arguments and trap to
kernel
• Kernel performs operation and returns result
• Applications can invoke kernel through system
calls
• Special instruction transfers control to kernel
• which dispatches to one of few hundred syscall
handlers
• Higher-level functions built on syscall interface
as printf, scanf, fgets, etc. all user-level code
• Example: POSIX/UNIX interface, open, close,
read, write, etc.
System call Example
• Standard library implemented in terms
of syscalls
• - printf – in libc, has same privileges as
application
• - calls write – in kernel, which can send
bits out serial port
POSIX - Portable Operating System Interface
• POSIX is an IEEE standard for Unix-like operating systems
• MS-Windows is almost fully compliant
• POSIX is actually a collection of standards that cover system calls,
libraries, applications and more
• POSIX 1003.1 denes the C language interface to a Unix-like kernel
• While various programming languages provide specific means of
accessing keys, every POSIX compliant OS must implement the
following basic le I/O functions, creat(), open(), close(), read(), write(),
ioctl()
POSIX Example
Next Week: Process Management

You might also like