Debug the kernel using two computers: Difference between revisions

From KolibriOS wiki
Jump to navigation Jump to search
(Created page with 'To debug the kernel, you could make use of virtual machines. But sometimes it is needed to test your code on live hardware. Both computers are connected to my home network. The ...')
 
No edit summary
Line 21: Line 21:


To automate the process even further, I created a batch file to compile all files of interest, and copy them to the virtual floppy drive and kernel file locations.
To automate the process even further, I created a batch file to compile all files of interest, and copy them to the virtual floppy drive and kernel file locations.
[[Category:Manuals]]

Revision as of 12:45, 13 January 2011

To debug the kernel, you could make use of virtual machines. But sometimes it is needed to test your code on live hardware.

Both computers are connected to my home network. The develop computer runs a TFTP server (Tftpd32 in my case) wich hosts two files, the KolibriOS kernel and the Floppy image containing the programs etc. To easily update a driver or program in the virtual floppy, you can mount it on the develop computer using VFD

The debug computer boots from a floppy wich contains this bootloader The source code link on that site is broken, but is mirrored here This bootloader only works with RTL8139 cards, but if you are creative, you might be able to use a more universal bootloader such as gPXE.

I also connected the 2 machines via RS232 (null-modem) cable. This cable sends the debug output from the debug machine to the develop machine. I have included an option (at compile time) in the KolibriOS kernel to enable this debug output. You can view the debug info on the other computer using putty or another program. The advantage of putty is, it's free, and it can save the received input into a log file.

So, when the driver/kernel code you're debugging crashes, you'll know where because of all the debug output you placed in your code, and you'll be able to easily fix it, recompile it and just reboot your debug PC.

Once TCP works stable, you'll be able to use Synergy to share the same keyboard and mouse for both machines !

To automate the process even further, I created a batch file to compile all files of interest, and copy them to the virtual floppy drive and kernel file locations.