EECE-4029 Operating Systems Fall 2016
Device Drivers

processes, mutex, semaphores, memory management, producer-consumer, files, deadlock, more..

Sample code and documentation

Archive:
   
drivers_basic.tar     All code and Makefile in a tar file
   
Makefile:
   
Makefile.basic     Makefile for all drivers on this page
   
Kernel Code:
   
driver-01.c     A simple device - just an array of 100 bytes
driver-02.c     Add module initialization linking functions to device operations
driver-03.c     Implement open, release, read, and write - copy between user and kernel
driver-04.c     Record bytes written so reads can be done precisely
driver-05.c     Read/write semaphores
driver-06.c     Send bytes to and receive bytes from a port
driver-07.c     Use ioctl to interface with kernel and control device
chardev.h     Needed by driver-07.c
driver-08.c     Enter a wait queue until a condition results in a wakeup
driver-09.c     Simple block device - a ramdisk
   
Execution Scripts:
driver-01_load    driver-01_unload     Run and stop driver-01
driver-02_load    driver-02_unload     Run and stop driver-02
driver-03_load    driver-03_unload     Run and stop driver-03
driver-04_load    driver-04_unload     Run and stop driver-04
driver-05_load    driver-05_unload     Run and stop driver-05
driver-06_load    driver-06_unload     Run and stop driver-06
driver-07_load    driver-07_unload     Run and stop driver-07
driver-08_load    driver-08_unload     Run and stop driver-08
driver-09_load    driver-09_unload     Run and stop driver-09
   
Userland Code:
   
tryit_03.c     Application for driver-03 above
tryit_04.c     Application for driver-04 above
tryit_05.c     Application for driver-05 above
flash_06.c     Application for driver-06 above
ioctl_07.c     Application for driver-07 above
tryit_08.c     Application for driver-08 above
tryit_09.c     Application for driver-09 above
 
Documentation:
Linux Device Driver    
readme for driver-01    
readme for driver-02    
readme for driver-03    
readme for driver-04    
readme for driver-05    
readme for driver-06    
readme for driver-07    
readme for driver-08    
readme for driver-09    
Block device drivers    
Linux radix tree    
Block driver request mechanism    
struct bio