Skip to content

ntubach/COP4600

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published