Nagsasanay ako sa Linux system at umuunlad ng kernel.
1. make
2. sudo insmod 'driver'.ko
3. dmesg | tail -n 10
4. sudo mknod /dev/'driver' c <num> 0
5. sudo rmmod <driver>.ko
6. rm /dev/'driver'
1. make
2. sudo rmmod hid_generic
3. sudo rmmod usbhid
4. sudo rmmod hid_led
5. sudo rmmod hid
6. sudo insmod blinkDeviceDriver.ko
- Creates /dev/notakeylogger to communicate with a user
- Registers a module with the keyboard driver's notification list
- Translates those scan codes into a buffer backing /dev/notakeylogger
- Key strokes may be read from /dev/notakeylogger
cd Modules/myKeyLogger; make clean; make lkm
sudo insmod myKeyLoggingModule.ko
- Type things
sudo cat /dev/notakeylogger
- Type more things
sudo cat /dev/notakeylogger
sudo rmmod myKeyLoggingModule
[X] Hello World lkm
[X] Basic Character Driver
[/] "Unk" USB Device Driver (blink(1), RGB LED)
[ ] Get/create/allocate struct usb_interface for the device (...but how?)
[ ] Convert between struct usb_interface and struct usb_device using interface_to_usbdev()? (see: Ch 13 Pg 332)
[ ] Create an URB w/ usb_alloc_urb() (Init?)
[ ] Fill in URB w/ usb_fill_int_urb() (Init?)
[ ] Send data w/ usb_submit_urb() (Probe? New function?)
[ ] Handle URB Completion (see: Ch 13 - Completing Urbs: The Completion Callback Handler)
[ ] NOTE: Continue reading Ch 13 at "Writing a USB Driver"
[ ] Dynamically read in the three strings (Make, Model, Serial #)
[ ] "Unk" USB Device Driver (Nerf-style turret)
[ ] [LKM to Intercept Syscalls](https://dl.packetstormsecurity.net/docs/hack/LKM_HACKING.html#II.1.)
[ ] Manage concurrent execution
* include <linux/sched.h>
* printk(KERN_INFO "The process is \"%s\" (pid %i)\n", current->comm, current->pid);
* See: Linux Device Drivers Chapter 2
[ ] Read [this](https://www.kernel.org/doc/html/v4.13/driver-api/usb/hotplug.html) to attempt to discover a reason why blinkDeviceDriver is failing to 'hotplug'
- http://opensourceforu.com/2011/10/usb-drivers-in-linux-1/
- http://matthias.vallentin.net/blog/2007/04/writing-a-linux-kernel-driver-for-an-unknown-usb-device/
- https://kernel.readthedocs.io/en/sphinx-samples/writing_usb_driver.html
- http://www.linuxjournal.com/article/7353
- https://www.safaribooksonline.com/library/view/linux-device-drivers/0596005903/ch13.html
- http://www.tldp.org/HOWTO/html_single/Module-HOWTO/
- http://derekmolloy.ie/kernel-gpio-programming-buttons-and-leds/
- http://www.beyondlogic.org/usbnutshell/usb6.shtml
- http://www.usbmadesimple.co.uk/ums_4.htm
- https://msdn.microsoft.com/en-us/library/windows/hardware/ff539261(v=vs.85).aspx
- https://stackoverflow.com/questions/9505105/usb-getting-data-from-a-device
- https://github.com/todbot/blink1
- Linux Device Drivers 3rd Edition
- Write/Read USB Device
- USB Device Driver slideshow by Michael Mitchell
- Peke_Ito/Kernels/linux-4.4.79/Documentation/usb/URB.txt
- Kernel Data Types
- USB Descriptor Tables
- USB Endpoint Descriptor Details
- USB Interrupt Transfers in a Nutshell
- USB Made Simple
- USB Complete 3rd Edition
- USB HID Report Descriptors
- Reverse Engineering SET_REPORT Packets
- Universal Serial Bus Specification v2.0
- Most drivers do not use 'usb_fill_control_urb', as it is much simpler to use the synchronous API calls as described in Chapter 13 Section 5
- Read and Write USB Device
- struct urb Man Page
- The Linux Kernel Module Programming Guide
- LKM Online Reading List - Referenced at the end of the The Linux Kernel Module Programming Guide
- (nearly) Complete Linux Loadable Kernel Modules
- Interrupt vs Polling Chararacter Drivers
- Common Device Driver Functionality
- Phrack - an ezine written by and for hackers
- Phantom Keystroker from ThinkGeek