DOC PREVIEW
UCSD CSE 120 - I/O System Software

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Lecture 11I/O System SoftwareNovember 18, 2003Prof. Joe PasqualeDepartment of Computer Science and EngineeringUniversity of California, San Diego© 2003 by Joseph PasqualeCSE 120: Principles of Operating Systems2Before We Begin …Read Chapter 11 (on I/O Systems)3What is I/OInput/output between CPU/memory and I/O devicesProblems• So many different types of I/O devices• Wide range in speed, operation, data transferunitsQuestions• How does a process initiate I/O?• How is synchronization achieved?• How is data transferred?4Background on I/O HardwareI/O bus interconnects CPU, memory, I/O devsA device generally connects to the bus via a controllerController has registers that CPU can read/write via• I/O instructions• memory instructions (memory-mapped)Data transfer: programmed I/O vs. DMASynchronization: polling vs. interrupts5Classifying DevicesSo many different types of devices• classify by shared characteristics• imposes structure: shared code, lower complexityDimensions• character stream vs. block• sequential vs. random-access• synchronous vs. asynchronous• sharable vs. dedicated• speed of operation6I/O Layered Software StructureDevicedriverDevice-Independent I/O(buffering, caching, block vs. char, …)User I/O (stdio library)DevicedriverDevicecontrollerDevicedriverDevice Dev DevDevicecontrollerDevicecontrollerDevicecontrollerDevice Dev DevUserKernelHardware7Device DriversEncapsulates device-dependent codeGenerally must implement a standard interfaceCode contains device-specific register reads/writesInterrupt handlers• Handler executes when I/O operation completes• May be converted to a “software interrupt”• Updates data structures• Wakes up process that was waiting8Device-Independent I/O SoftwareUniform interfacing for device driversNaming, protectionBuffering, cachingDevice-independent block sizeStorage allocation for block devicesLocking (dedicated devices)Error handling9User-Space I/O SoftwareRicher or simplified interface• e.g., putchar/getchar vs. read/writeUser-level buffering• e.g. stdio librarySpooling daemons• Printer10Overall OperationUser ProcessDevice-Independent I/ODevice Driver: Upper (synch)Interrupt Handlers (asynch)HardwarePerform I/OoperationWakeup driverwhen I/OcompletedControl via deviceregisters; checkstatusNaming, protection,blocking, buffering,allocationMake I/O call;format I./O;spoolingI/OrequestI/Oresponse11Example: Unix I/OFile SubsystemDevice DriversCharacterBlockBuffer Cache12Unix: I/O System CallsVia file system interface• open• close• read• write• Ioctl13Unix: Buffered vs. Unbuffered I/OBuffered I/O• system buffers: buffer cache, character queuesUnbuffered I/O• data transferred directly between proc and dev• can be via DMA14Unix: Standard I/O Libraryfopen, fread, fwrite, fprintf, fscanf, fclosePrivate buffer kept in user spaceMinimizes the number of I/O system calls15Unix: Block vs. Character DevicesBlock• transfer units in fixed-size blocks• blocks are addressable (random access)• kept in buffer cacheCharacter• transfer units in variable-size sequence of bytes• used for all non-block devices• linked list of character queues16Unix: The Buffer CacheCache of recently used blocksEach block has an address (device #, block #)Three lists• device list (hash table + linked lists)• free list• driver I/O queueLRU is used for


View Full Document

UCSD CSE 120 - I/O System Software

Documents in this Course
Threads

Threads

14 pages

Deadlocks

Deadlocks

19 pages

Processes

Processes

14 pages

Paging

Paging

13 pages

Processes

Processes

18 pages

Threads

Threads

29 pages

Security

Security

16 pages

Paging

Paging

13 pages

Processes

Processes

32 pages

Lecture 2

Lecture 2

13 pages

Paging

Paging

8 pages

Threads

Threads

14 pages

Paging

Paging

13 pages

Paging

Paging

26 pages

Paging

Paging

13 pages

Lecture

Lecture

13 pages

Processes

Processes

14 pages

Paging

Paging

13 pages

Security

Security

17 pages

Threads

Threads

15 pages

Processes

Processes

34 pages

Structure

Structure

10 pages

Lecture 3

Lecture 3

13 pages

Lecture 1

Lecture 1

28 pages

Threads

Threads

15 pages

Paging

Paging

30 pages

Load more
Download I/O System Software
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view I/O System Software and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view I/O System Software 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?