Docsity

Operating Systems: Modules, Interfaces and Structure - Lecture 2 - Prof. Geoffrey M. Voelk, Study notes of Computer Science

Toggle sidebar
bg1
1
CSE 120
CSE 120
Principles of Operating
Principles of Operating
Systems
Systems
Fall 2004
Fall 2004
Lecture 2: Operating System Modules
Lecture 2: Operating System Modules
and Interfaces
and Interfaces
Geoffrey M. Voelker
Geoffrey M. Voelker
September 23, 2002 CSE 120 – Lecture 2 – Modules and Interfaces 2
Modules, Interfaces, Structure
Modules, Interfaces, Structure
zWe roughly defined an OS as the layer of software
between hardware and applications
zNow we’re going to survey the support OSes provide
to applications
Modules – OS services and abstractions
Interfaces – operations supported by components
Structure – how components get hooked together
»Will discuss in depth later in the quarter
»Makes more sense after being exposed to much of the material
zThis is all a high-level preview of what we are going to
cover in the course
pf3
pf4
pf5
pf8

Partial preview of the text

Download Operating Systems: Modules, Interfaces and Structure - Lecture 2 - Prof. Geoffrey M. Voelk and more Study notes Computer Science in PDF only on Docsity!

CSE 120 CSE 120

Principles of OperatingPrinciples of Operating

SystemsSystems

Fall 2004Fall 2004

Lecture 2: Operating System Modules Lecture 2: Operating System Modules

and Interfacesand Interfaces

Geoffrey M. VoelkerGeoffrey M. Voelker

September 23, 2002 CSE 120 – Lecture 2 – Modules and Interfaces 2

Modules, Interfaces, StructureModules, Interfaces, Structure

z We roughly defined an OS as the layer of software

between hardware and applications

z Now we’re going to survey the support OSes provide

to applications

‹ Modules – OS services and abstractions

‹ Interfaces – operations supported by components

‹ Structure – how components get hooked together

» Will discuss in depth later in the quarter

» Makes more sense after being exposed to much of the material

z This is all a high-level preview of what we are going to

cover in the course

September 23, 2002 CSE 120 – Lecture 2 – Modules and Interfaces 3

OS Module OverviewOS Module Overview

z Common OS modules

‹ Processes

‹ Memory

‹ I/O

‹ Secondary storage

‹ Files

‹ Protection

‹ Accounting

‹ Command interpreter (shell, window system)

z We’ll survey each module and discuss its interface

September 23, 2002 CSE 120 – Lecture 2 – Modules and Interfaces 4

Process ModuleProcess Module

z An OS executes many kinds of activities

‹ User programs

‹ Batch jobs or command scripts

‹ System programs (daemons): print spoolers, name servers,

file servers, Web servers, etc.

‹ Run “ps -edaf” on Solaris – What is all that stuff?

z Each “execution entity” is encapsulated in a process

‹ A process includes both the program (code, data) and

execution context (PC, regs, address space, resources, etc.)

z Process module manages processes

‹ Creation, scheduling, deletion, etc.

September 23, 2002 CSE 120 – Lecture 2 – Modules and Interfaces 7

Input/Output (I/O)Input/Output (I/O)

z Much of an OS deals with device I/O

‹ One of the main reasons we use OSes

‹ Hundreds of thousands of lines of code in NT for I/O, drivers

z The OS provides a standard interface between

programs (user or system) and devices

‹ File system (disks), sockets (network), frame buffer (video)

z Device drivers are the routines responsible for

controlling I/O devices

‹ OS defines an interface for each class of devices (e.g., disks)

‹ A driver implements interface, encapsulates device-specific

knowledge (initiation and control, interrupt handling, errors)

September 23, 2002 CSE 120 – Lecture 2 – Modules and Interfaces 8

Secondary StorageSecondary Storage

z Secondary storage (disk) is the persistent memory

‹ It endures system failures (for the most part)

z Low-level OS routines are often responsible for low-

level disk functions

‹ Read/write blocks

‹ Schedule requests (optimize arm movement)

‹ Device errors

z Usually independent of file system

‹ Although there might be cooperation (e.g., free space

management)

‹ Low-level knowledge can help FS performance (placement)

September 23, 2002 CSE 120 – Lecture 2 – Modules and Interfaces 9

File SystemFile System

z Secondary storage devices are too crude to use

directly for long-term storage

‹ Read/write physical device blocks too low-level for programs

z The file system provides a much higher-level, more

convenient abstraction for persistent storage

‹ Objects (files, directories) and interfaces (read, write, etc.)

z Files are the basic storage entity

‹ A file is a named collection of persistent information

z Directories are special files that contain the names of

other files + metadata (data about files, attributes)

‹ Directories have all properties of files (“inheritance”)

September 23, 2002 CSE 120 – Lecture 2 – Modules and Interfaces 10

File System InterfaceFile System Interface

z File system interface provides standard file operations

‹ Existence: File/directory creation, deletion

‹ Manipulation: open, read, write, append, rename, close, etc.

‹ Sometimes higher-level operations

» File copy, change notification (NT)

» Records (IBM)

z File system also provides general services

‹ Backup

‹ Consistency

‹ Compression

‹ Encryption

‹ Accounting and quotas

September 23, 2002 CSE 120 – Lecture 2 – Modules and Interfaces 13

Command Interpreter (Shell)Command Interpreter (Shell)

z Process that:

‹ Handles user input (commands)

‹ Manages subprocesses

‹ Executes script files (files of commands)

z On some systems, CI is part of OS

‹ Users constrained to use that CI (DOS)

z Others, it is just another user-level process

‹ Unix shell

‹ Any program can be a CI (sh, csh, ksh, bash, etc.)

z Or, there may not be a command language at all

‹ Original MacOS (hey, where’s the shell?)

‹ What about MacOS 10?

September 23, 2002 CSE 120 – Lecture 2 – Modules and Interfaces 14

The Challenge of StructureThe Challenge of Structure

z It is clear what modules an OS should provide

z Not so clear how to hook them together (well)…

File System

Process

Management

Memory

Management

I/O

Subsystem

Accounting

Command

Interpreter

Secondary

Storage

Protection

September 23, 2002 CSE 120 – Lecture 2 – Modules and Interfaces 15

For next class…For next class…

z Browse the course web

‹ http://www.cse.ucsd.edu/classes/fa04/cse120/

z Read Chapters 1, 2, and 3

z Start reading Nachos Chapter, Appendix C (online)

z Start thinking about partners for project groups

z No discussion this Friday (nothing to discuss)

z Accounts available soon