1 / 14

Linux Device Driver

Linux Device Driver. NCTU OS Lab Chi-Wei Yang. Outline. Overall Architecture Character Driver Block Driver Network Driver Support Functions. Overall Architecture. VFS Driver Types character block network. Overall Architecture (cont.). Overall Architecture (cont.). Operation Modes

natala
Download Presentation

Linux Device Driver

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Linux Device Driver NCTU OS Lab Chi-Wei Yang

  2. Outline • Overall Architecture • Character Driver • Block Driver • Network Driver • Support Functions

  3. Overall Architecture • VFS • Driver Types • character • block • network

  4. Overall Architecture (cont.)

  5. Overall Architecture (cont.) • Operation Modes • polling • interrupt • DMA

  6. Character Driver • Device Properties • can’t be randomly accessed • can’t be buffered • usually are slow devices • Export Interface • file_operations • Data Flow in read/write

  7. Character Driver (cont.)

  8. Block Driver • Device Properties • can be randomly accessed • accessed in units of blocks • to speed up access, buffer cache is used • Export Interface • file_operations • request_fn() • Data Flow in read/write

  9. Block Driver (cont.)

  10. Network Driver • Export Interface • Data Flow in read/write

  11. Network Driver (cont.)

  12. Network Driver (cont.)

  13. Support Functions • I/O ports reservations • request_region() • Memory Allocations • kmalloc(), vmalloc(), get_free_page() • Interrupt Handler Registration • request_irq() • Data Transfer between User/Kernel • memcpy_fromfs()

  14. Support Functions (cont.) • Bottom Halves • mark_bh() • its main purpose is to provide fewer blocking time due to interrupts • top half/bottom half • priority-based • limitions in writing bottom halves • can't call schedule(), can't block

More Related