How can I debug a Linux Kernel Module Driver with the UDE?
Load a kernel module and debug from the first line:
- Start UDE
- Create a new workspace or load an existing
- After creating a new workspace, click on default to load a default configuration file
- Select your target and load the "<Target> Linux kernel debugging support" configuration
- Save the config file
- After the workspace was created, load the uncompressed Linux kernel image (vmlinux_<Target>_ram.elf)
- Load the Linux kernel module driver file (e.g.: led_driver.ko)
- UDE uploads the driver module to the target and halts the target at the driver module init-function
- Set your desired breakpoints and click on GO to start the target again
Unload a kernel module: - Load the kernel module driver (see above)
- Set a breakpoint at the driver modul exit-function if desired
- Click on Views - Simulated I/O to open the terminal window
- Login into the terminal window
- Enter "rmmod <kernel module>" (without double quotation marks)
- The target halts at the exit-function
Reload a kernel module:
- Look at "Load the kernel module driver" (see above)
- or - - Click on Views - Simulated I/O to open the terminal window
- Login into the terminal window
- Enter "modprobe <kernel module>" (without double quotation marks)
- The target halts at the init-function (if a breakpoint was set)
|