Segmentation & O/S Input/Output

27
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3 , 2007

description

Segmentation & O/S Input/Output. Chapter 4 & 5 Tuesday, April 3 , 2007. Today’s Schedule. Memory Management - Chapter 4 Segmentation Multics & Intel Pentium – Segmentation & Paging Input/Output Device Types Goals of I/O Devices for O/S Layers of I/O s/w System. Objectives. - PowerPoint PPT Presentation

Transcript of Segmentation & O/S Input/Output

Page 1: Segmentation &  O/S Input/Output

Segmentation & O/S Input/Output

Chapter 4 & 5

Tuesday, April 3 , 2007

Page 2: Segmentation &  O/S Input/Output

Today’s Schedule Memory Management - Chapter 4

Segmentation Multics & Intel Pentium – Segmentation & Paging

Input/Output Device Types Goals of I/O Devices for O/S Layers of I/O s/w System

Page 3: Segmentation &  O/S Input/Output

Objectives

You will be able to describe: Advantages of Segmentation for Memory

management Types of I/O Devices Goals of I/O Software from O/S view Layers of I/O s/w and what happens in

each

Page 4: Segmentation &  O/S Input/Output

What is Segmentation? Having two or more separate virtual

address spaces Provide several independent address spaces

called segments Each segment goes from 0 to some max Segments can have varying lengths Length can change during execution Programmer will now have to specify the

segment number

Can now use one segment for shared libraries

Page 5: Segmentation &  O/S Input/Output

Segmentation

One-dimensional address space with growing tables One table may bump into another

Page 6: Segmentation &  O/S Input/Output

Segmentation – Logical View

Allows each table to grow or shrink, independently

Page 7: Segmentation &  O/S Input/Output

Segmentation vs Paging?

Paging is incidental

Page-data is heterogeneous

Statically Sized

Segments are intentional

Segment data is homogenous

Dynamically Sized

Page 8: Segmentation &  O/S Input/Output

Pure Segmentation

Segment size varies and changes External Fragmentation

Also called “Checkerboarding”Swapping large segments for smallResolution: Compaction

Page 9: Segmentation &  O/S Input/Output

Implementation of Pure Segmentation

Removal of the checkerboarding by compaction

Page 10: Segmentation &  O/S Input/Output

MULTICS Implementation

Similar to Multi-Level Paging Address contains Segment # for table Segment table holds Segment Descriptors Descriptor contains page table location Standard Page Table

Has 218 segments 216 Pages With 36-bit entries 234 Total Pages

Page 11: Segmentation &  O/S Input/Output

Segmentation with Paging: MULTICS

Descriptor segment points to page tables Segment descriptor – numbers are field lengths

Page 12: Segmentation &  O/S Input/Output

Segmentation with Paging: MULTICS

A 34-bit MULTICS virtual address

Page 13: Segmentation &  O/S Input/Output

Segmentation with Paging: MULTICS

Conversion of a 2-part MULTICS address into a main memory address

Page 14: Segmentation &  O/S Input/Output

Input & Output Device types

Block DeviceStores fixed size block Independently addressabledisks

Character DevicesStream of charactersNo seek operation, not addressableKeyboard, printer, n/w interface

Page 15: Segmentation &  O/S Input/Output

I/O Hardware

Some typical device, network, and data base rates

Page 16: Segmentation &  O/S Input/Output

Device Controllers I/O devices have components:

mechanical component electronic component

The electronic component is the device controllermay be able to handle multiple devices

Controller's tasksconvert serial bit stream to block of bytesperform error correction as necessarymake available to main memory

Page 17: Segmentation &  O/S Input/Output

Goals of I/O Software Device independence

programs can access any I/O device without specifying device in advance

· (floppy, hard drive, or CD-ROM)

Uniform namingname of a file or device a string or an integernot depending on which machine

Error handlinghandle as close to the hardware as possible

Page 18: Segmentation &  O/S Input/Output

Goals of I/O Software (cont’d) Synchronous vs. asynchronous

transfersblocked transfers vs. interrupt-driven

Bufferingdata coming off a device cannot be stored

in final destination Sharable vs. dedicated devices

disks are sharable tape drives would not be

Page 19: Segmentation &  O/S Input/Output

I/O Software Layers

Layers of the I/O Software System

Page 20: Segmentation &  O/S Input/Output

Interrupt Handlers

Interrupt handlers are best hidden have driver starting an I/O operation block until

interrupt notifies of completion

Interrupt procedure does its task then unblocks driver that started it

Page 21: Segmentation &  O/S Input/Output

Device Drivers

Logical position of device drivers is shown here Communications between drivers and device controllers goes

over the bus

Page 22: Segmentation &  O/S Input/Output

Device-Independent I/O Software

Functions of the device-independent I/O software

Uniform interfacing for device drivers

Buffering

Error reporting

Allocating and releasing dedicated devices

Providing a device-independent block size

Page 23: Segmentation &  O/S Input/Output

Device-Independent I/O Software

(a) Without a standard driver interface

(b) With a standard driver interface

Page 24: Segmentation &  O/S Input/Output

Device-Independent I/O Software

(a) Unbuffered input(b) Buffering in user space(c) Buffering in the kernel followed by copying to user space(d) Double buffering in the kernel

Page 25: Segmentation &  O/S Input/Output

Summary User-Space I/O Software

Layers of the I/O system and the main functions of each layer

Page 26: Segmentation &  O/S Input/Output

Summary

Advantages of Segmentation for Memory management

Types of I/O Devices Goals of I/O Software from O/S view Layers of I/O s/w and what happens in

each

Page 27: Segmentation &  O/S Input/Output

Thursday, April 5

Read Chapter 55.1.1 & 5.1.2 I/O Devices5.2.1 Goals of I/O in O/S5.3.1 to 5.3.35.4 Disks