Debugging Linux Kernel in VMWare with Windows host -


I am working on my first kernel module so that I am slightly new on this ...

My modules are sometimes creating panic and I can not get it using the print below. As far as I can tell my options for debugging:

1. Find Generated Oops Messages and Use ksymoops

or

2.) Try Remote Debug Using Kgdb

I'm working on a Windows host And I'm running Ubuntu in VMware so that things get a bit complicated. I want to try the OOPS message first but I do not know how to capture it. Do I need to run a serial console when this happens? If so, how can I do with a Windows host? Do I need two VMs?

Like I said, I am slightly new to this (and in general, Linux), so I can actually use some guidance. Thanks!

Some time ago I used the technique "Elinirus" successfully explained that part in detail I've actually used it directly from the Windows host:

Therefore after installing VM (primarily after enabling remote debugging and downloading the kernel (vmlinux file, not vmlinuz file which can not be interpreted by GDB), you do the following

  1. Install a recent GDB on your Windows machine (I use one in the Sigwin).
  2. Start the GDB with the vmlinux file, And then "Luck to the localhost Note: Connect to 8832 "VM (when it is running).

This is the code that you need to debug, which is connected to the kernel steadily. You can try to add your module permanently and will be sufficient above. An additional step is required to set up debugging for dynamically connected modules so that gdb is notified to use your module file S How area, and interpretation of file sections.

After 3a module load and run the script down on .ko file (before it crashes)).

3b As a result, "add-symbol-file mymodule.ko 0xe8884000 ..." paste the lines into GDB, GDB will then load your module, unless it is in the current directory or the path you specify Can find.

script

 #! # Bin / sh # # gdbline module is # # output to add # gdb to check loaded module # gdb # is an add-symbol-file line suitable # cd / sys / module / $ 1 / classes PROG = $ { 1} .ko echo -n AD-symbol-file $ {PROG} `/ bin / cat Take second argument for the name of the program / object file to be GDB name for the text '#echo -n add-symbol-file $ 2` / bin / cat .text` # section. [Az] * *; If [section $! = ".text"]; Then "\\" echo -n "-s" $ section `/ bin / cat $ section 'echo 

make more things that you want to do. To make real source-level debugging, you would want to suck all the kernel and module source code so that GDB can find it. And there are some things that you can use to compile your modules without compatibility.

You may also want to see the Technical Notes of Workstation 7.0 on the replay debugging, which contains debugging kernel modules. VMware knows its stuff.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -