Download presentation
Presentation is loading. Please wait.
Published byKathleen Norman Modified over 9 years ago
1
Linux Device Driver NCTU OS Lab Chi-Wei Yang
2
Outline b Overall Architecture b Character Driver b Block Driver b Network Driver b Support Functions
3
Overall Architecture b VFS b Driver Types charactercharacter blockblock networknetwork
4
Overall Architecture (cont.)
5
b Operation Modes pollingpolling interruptinterrupt DMADMA
6
Character Driver b Device Properties can’t be randomly accessedcan’t be randomly accessed can’t be bufferedcan’t be buffered usually are slow devicesusually are slow devices b Export Interface file_operationsfile_operations b Data Flow in read/write
7
Character Driver (cont.)
8
Block Driver b Device Properties can be randomly accessedcan be randomly accessed accessed in units of blocksaccessed in units of blocks to speed up access, buffer cache is usedto speed up access, buffer cache is used b Export Interface file_operationsfile_operations request_fn()request_fn() b Data Flow in read/write
9
Block Driver (cont.)
10
Network Driver b Export Interface b Data Flow in read/write
11
Network Driver (cont.)
13
Support Functions b I/O ports reservations request_region()request_region() b Memory Allocations kmalloc(), vmalloc(), get_free_page()kmalloc(), vmalloc(), get_free_page() b Interrupt Handler Registration request_irq()request_irq() b Data Transfer between User/Kernel memcpy_fromfs()memcpy_fromfs()
14
Support Functions (cont.) b Bottom Halves mark_bh()mark_bh() its main purpose is to provide fewer blocking time due to interruptsits main purpose is to provide fewer blocking time due to interrupts top half/bottom halftop half/bottom half priority-basedpriority-based limitions in writing bottom halveslimitions in writing bottom halves –can't call schedule(), can't block
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.