Debug the kernel using two computers: Difference between revisions

From KolibriOS wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:


The debug computer boots from a floppy wich contains [http://home.dei.polimi.it/fornacia/progetto_minazzi/index.html this bootloader]
The debug computer boots from a floppy wich contains [http://home.dei.polimi.it/fornacia/progetto_minazzi/index.html this bootloader]
The source code link on that site is broken, but is mirrored [http://ftp.kolibrios.org/users/hidnplayr/bootload-src.zip here]
(source code mirror [http://ftp.kolibrios.org/users/hidnplayr/bootload-src.zip 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.
This bootloader only works with RTL8139 cards. Another options is to [[Boot from PXE]].


I also connected the 2 machines via RS232 ([http://www.lammertbies.nl/comm/info/RS-232_null_modem.html null-modem]) cable.
I also connected the 2 machines via RS232 ([http://www.lammertbies.nl/comm/info/RS-232_null_modem.html null-modem]) cable.
Line 22: Line 22:
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]]
[[Category:Coding]][[Category:Manuals]]

Latest revision as of 10:42, 31 December 2012

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 (source code mirror here) This bootloader only works with RTL8139 cards. Another options is to Boot from PXE.

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.