Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 1.62 KB

README.md

File metadata and controls

37 lines (27 loc) · 1.62 KB

COP4600 Character Device Driver

Basic Info

Character device driver made for Ubuntu v14.04.4 over Oracle VM VirtualBox.

Uses basic init and clean as well as open, close, read and write for device.

HowTo

  • clone the repo: git clone https://github.com/ntubach/cop4600.git
  • cd cop4600
  • Run make
  • Insert the module by using sudo insmod cop.ko
  • View the driver init info for the major number using sudo tail -f /var/log/syslog
  • Use mknod for node setup mknod /dev/copchar c 247 x where x is you guessing the minor number (start with 1);
  • Test the device through the supporting file using sudo ./test
  • Follow the onscreen instructions (write a string, press enter, press enter some more, see the same string given back)
  • Remove the module by using sudo rmmod cop
  • View step by step events that have been posted to the system log at any time using tail -f /var/log/syslog
    • (alternatively sudo tail -f /var/log/kern.log)
  • Congratualations, you have initialized, run, tested and removed a character device driver successfully!

👉 💥💥😎💥💥 👈

References:

Writing a Linux Kernel Module
The Linux Kernel Module Programming Guide

Acknowledgements:

Brandon Ashley
Lucas Rosa

TODO

-Limit read-in amount by buffer allotted size (1024), currently allows for any size string (very large) to be read in
-Guarentee buffer clear after printing to terminal