1-Introduction To OS
1-Introduction To OS
Operating System
CPU
Hardware memory
I/O devices
OS:
Everything in system that isn’t an application or hardware
OS:
Software that converts hardware into a useful form for
applications
What is an Operating System?
• A program that acts as an intermediary
between a user of a computer and the
computer hardware.
• Operating system goals:
• Execute user programs and make solving
user problems easier.
• Make the computer system convenient to
use.
• Use the computer hardware in an
efficient manner.
OS – Good Definition!
• The operating system (sometimes referred to by its
abbreviation OS), is responsible for creating the link
between the material resources, the user and the
applications (word processor, video game, etc.). When a
programme wants to access a material resource, it does
not need to send specific information to the peripheral
device but it simply sends the information to the operating
system, which conveys it to the relevant peripheral via its
driver. If there are no drivers, each programme has to
recognize and take into account the communication with
each type of peripheral!
Operating System Definition
• OS is a resource allocator
• Manages all resources
• Decides between conflicting requests for
efficient and fair resource use
• OS is a control program
• Controls execution of programs to prevent
errors and improper use of the computer
Computer System Structure
• Computer system can be divided into four components
• Hardware – provides basic computing resources
– CPU, memory, I/O devices
• Operating system
– Controls and coordinates use of hardware among various
applications and users
• Application programs – define the ways in which the system
resources are used to solve the computing problems of the
users
– Word processors, compilers, web browsers, database
systems, video games
• Users
– People, machines, other computers
Four Components of a Computer System
What is the role of the OS?
Role #1: Provide standard Library (I.e., abstract resources)
What is a resource?
• Anything valuable (e.g., CPU, memory, disk)
Advantages of standard library
• Allow applications to reuse common facilities
• Make different devices look the same
• Provide higher-level abstractions
Challenges
• What are the correct abstractions?
• How much of hardware should be exposed?
What is the role of the OS?
Role #2: Resource coordinator (I.e., manager)
SMP. Used in systems where there are multiple CPU’s each running the same
copy of the operating system. Communication takes place across the system bus.
• File management
• create file, delete file
• open, close file
• read, write, reposition
• get and set file attributes
• Device management
• request device, release device
• read, write, reposition
• get device attributes, set device attributes
• logically attach or detach devices
Types of System Calls (Cont.)
• Information maintenance
• get time or date, set time or date
• get system data, set system data
• get and set process, file, or device attributes
• Communications
• create, delete communication connection
• send, receive messages if message passing
model to host name or process name
– From client to server
• Shared-memory model create and gain
access to memory regions
• transfer status information
• attach and detach remote devices
Types of System Calls (Cont.)
• Protection
• Control access to resources
• Get and set permissions
• Allow and deny user access
Examples of Windows and Unix System Calls
Standard C Library Example
• C program invoking printf() library call, which
calls write() system call