Steps on how to make the driver work.
- Run the make file together with the usb_driver.c
- Install the module "sudo insmod usb_driver.ko"
- Plug in your USB
- Use "dmesg" to check if the USB is recognised, if not, you may have to change the Vendor and Device id's in usb_driver.c 4.1) If USB related info is not printed in dmesg, then use "sudo rmmod uas" and "sudo rmmod usb-storage or usb_storage"
- The driver has registered the USB and allocated Character device regions which you can see in "ls /dev/" as usb_driver_dev, in "ls /sys/class" as usb_driver_sys, and "cat /proc/devices" as usb_driver_proc.
- Compile the fileOp.c using "gcc -o fileOp fileOp.c"
- run the fileOp using "./fileOp"
- Read and Write to the character device and check for additional information using "dmesg"
- To remove the module use "sudo rmmod usb_driver" (all the additional character devices ets. will be removed automatically).
- Use "sudo make clean"