Download system call.

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Plan 9 from Bell Labs wikipedia , lookup

Acorn MOS wikipedia , lookup

Mobile operating system wikipedia , lookup

Security-focused operating system wikipedia , lookup

Unix security wikipedia , lookup

RSTS/E wikipedia , lookup

OS 2200 wikipedia , lookup

Burroughs MCP wikipedia , lookup

Spring (operating system) wikipedia , lookup

Copland (operating system) wikipedia , lookup

Process management (computing) wikipedia , lookup

Distributed operating system wikipedia , lookup

Paging wikipedia , lookup

VS/9 wikipedia , lookup

CP/M wikipedia , lookup

Transcript
Contact Information






Office: 225 Neville Hall
Office Hours: Monday and Wednesday 12:00-1:00
E-Main: [email protected]
Phone: 581-3967
Textbook: Tanenbaum, Modern Operating Systems (2nd
edition)
URL: http://umcs.maine.edu/~dickens/COS431/COS431.html
Chapter 1
Introduction
1.1 What is an operating system
1.2 History of operating systems
1.3 The operating system zoo
1.4 Computer hardware review
1.5 Operating system concepts
1.6 System calls
1.7 Operating system structure
Introduction

A computer system consists of
 hardware
 system programs
 application programs
System Components

Hardware:

Physical Devices:



Memory, CPU, I/O devices….
Microarchitecture: Executes machine-level
instructions. Hardware or firmware.
Machine language: Hardware and instructions
visible to an assembly language program.
Introduction

Operating System:

Hides complexity of hardware and
provides simplified set of instructions.
Introduction

System programs:


Generally execute in user mode.
Command interpreter (shell), compilers,
editors, …..
So What is an Operating System?

It is an extended machine
 Hides the messy details which must be performed
 Presents user with a virtual machine, easier to use


Don’t want to program I/O devices, handle interrupts, etc.
It is a resource manager (and scheduler)

Each program gets time with the resource


E.g., CPU, I/O devices, memory
Each program gets space on the resource

E.g., Disk space.
History of Operating Systems

First generation 1945 - 1955



vacuum tubes, plug boards
Scheduling algorithm was a signup sheet.
Second generation 1955 – 1965


Operator loading in programs from card deck one at a time.
Led to batch systems
Early batch system




bring cards to 1401
read cards to tape
put tape on 7094 which does computing
put tape on 1401 which prints output
History of Operating Systems
(3)

Structure of a typical FMS job – 2nd generation
Early Operating Systems


Automatic job sequencing – automatically transfers
control from one job to another. First rudimentary
operating system.
Resident monitor



initial control in monitor
control transfers to job
when job completes control transfers pack to monitor
Memory Layout for a Simple Batch System

Third generation 1965 – 1980

Machines were very expensive and CPU frequently idle. Led
to multiprogramming.

Multiprogramming system

three jobs in memory – 3rd generation
Multiprogramming Batch Systems
Solution: Multiplex CPU between multiple jobs.
OS Features Needed for Multiprogramming





Use of disk space to hold jobs not in system.
Job scheduling: Choose jobs to bring into
memory.
Memory management – the system must
allocate the memory to several jobs.
CPU scheduling – the system must choose
among several jobs ready to run.
Allocation of devices.
Time-Sharing Systems–Interactive Computing





The CPU is multiplexed among several jobs that are kept
in memory and on disk (the CPU is allocated to a job only
if the job is in memory).
A job swapped in and out of memory to the disk.
On-line communication between the user and the system
is provided; when the operating system finishes the
execution of one command, it seeks the next “control
statement” from the user’s keyboard.
 i.e., the shell
Goal is to give the illusion that each user has own
machines.
Response time is a priority.
Computer Hardware Review
Monitor
Bus

Components of a simple personal computer

Special registers:



Program counter.
Stack pointer.
Process Status Word (PSW).
Computer Hardware Review
(a) A three-stage pipeline
(b) A superscalar CPU


CPU has two modes: user and kernel.
Application obtains OS services through a system
call.

Traps to operating system and switches to kernel
mode.

Typical memory hierarchy

numbers shown are rough approximations
Structure of a disk drive
One base-limit pair and two base-limit pairs
I/O Devices



Manufacturer provides device driver (talks to the device).
OS talks to device driver.
Three ways to handle I/O operations:



Busy waiting.
Interrupt driven
Direct Memory Access (DMA)
(a)
(a)
(b)
Steps in starting an I/O device and getting interrupt
(b) How the CPU is interrupted
Structure of a large Pentium system
Operating System Concepts

A process tree


A created two child processes, B and C
B created three child processes, D, E, and F
Operating System Concepts
(a) A potential deadlock. (b) an actual deadlock.
Operating System Concepts
File system for a university department
Operating System Concepts

Before mounting,


files on floppy are inaccessible
After mounting floppy on b,

files on floppy are part of file hierarchy
Operating System Concepts
Two processes connected by a pipe
Steps in Making a System Call
There are 11 steps in making the system call
read (fd, buffer, nbytes)
Some System Calls For Process
Management
Some System Calls For File Management