Devices can be classed broadly into a small number of categories o character

Devices can be classed broadly into a small number of

This preview shows page 3 - 6 out of 9 pages.

Devices can be classed broadly into a small number of categories: o character (byte) devices ] modem, keyboard, maybe mouse o block (bulk) devices ] disk, net, screen l Categories are an engineering trade-off to keep reasonable efficiency and functionality
Image of page 3
Department of Computer Science University College London 1B11 - Operating Systems 12/06/99 4 1B11-5 1999 Slide 7 Internal to Device Driver l Driver needs to cope with device characteristics: ] polled, DMA and interrupts ] memory mapped ] device controller commands etc l So typical device driver includes: ] initialise device (at OS boot time) ] start output ] start input ] control device (seek or rewind) ] shutdown device (at OS shutdown time) ] interrupt service routine for input (and output and control) 1B11-5 1999 Slide 8 System Call Handler (TRAPs) The Big Picture Disk Device Driver Keyb’d Device Driver Screen Device Driver Disk Device Driver Disk C Generic file and I/O Handler C C C Keyb’d Screen Disk Hardware Kernel Space User Space Application File Extra Library ISAM Library Threads Library OS Interface
Image of page 4
Department of Computer Science University College London 1B11 - Operating Systems 12/06/99 5 1B11-5 1999 Slide 9 Example - Write to Disk l Simplified version! l User makes system call to write specified block of data to disk l Processor switches to kernel mode l System Call Handler invoked (TRAP) and syscall parameters checked l Generic file and I/O Handler called (TRAP function indicates I/O) l User data copied to OS buffer or locked to prevent it being swapped out while I/O pending (or overwritten by user if asynchronous I/O) l Device driver start() method called - buffer passed as argument l Device driver adds buffer to queue of pending I/O requests o may order queue e.g. to minimise disk head movement o will get processed in due course l Return to generic I/O handler which suspends user process and resumes next ready process
Image of page 5
Image of page 6

You've reached the end of your free preview.

Want to read all 9 pages?

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors