Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Kernel Debugging Wiki: (2 Items)
   
Kernel Debugging Wiki  
I've been able to debug the kernel over a physical serial port, but I had to do some things a little different than the 
wiki page says.

In the suggested boot section of the build file, on the wiki we have:

[virtual=x86,bios +compress] boot = {
    # Reserve 64k of video memory to handle multiple video cards
    startup-bios -s64k -Dconsole -K3f8..9600

    gdb_kdebug

    # PATH is the *safe* path for executables (confstr(_CS_PATH...))
    # LD_LIBRARY_PATH is the *safe* path for libraries (confstr(_CS_LIBPATH))
    #    i.e. This is the path searched for libs in setuid/setgid executables.
[+keeplinked]
    PATH=/proc/boot:/bin:/usr/bin:/opt/bin LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib procnto-instr -P
}


I've only got it to work with:
    # for second serial port
    startup-bios -s64k -Dconsole -K 8250.3f8.9600
    # for first serial port
    startup-bios -s64k -Dconsole -K 8250.2f8.9600


Maybe that's hardware dependent, so is intentionally left out of the wiki.


My other major problem was that I needed the debug variant of procnto-instr, so I had to change the line to reflect that
:

    PATH=/proc/boot:/bin:/usr/bin:/opt/bin LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dll:/opt/lib procnto-instr_g -P


This is actually not built by default, because there is a Makefile.dnm within services/system/proc/x86/o.instr.g, so 
that has to be removed to build this variant.  I probably could have used procnto_g, which does get built by default.

Anyway, without the debug variant built, I wasn't having much luck.  I know that it should be completely obvious, but I 
like to be able to cut and paste sections from guides and trust that they are correct, so I think the wiki should be 
updated.

Thanks

   -SM

PS - I'll be posting a guide on kernel debugging with QEMU shortly.  It will be under the same "QEMU and Neutrino" page 
under debugging on the kernel wiki.
Re: Kernel Debugging Wiki  
> I've only got it to work with:
>     # for second serial port
>     startup-bios -s64k -Dconsole -K 8250.3f8.9600
>     # for first serial port
>     startup-bios -s64k -Dconsole -K 8250.2f8.9600
> 
> 
> Maybe that's hardware dependent, so is intentionally left out of the wiki.

It is hardware (board) dependent, but the example in the wiki had an extra period between the port and baud rate - I've 
fixed it up.


> This is actually not built by default, because there is a Makefile.dnm within 
> services/system/proc/x86/o.instr.g, so that has to be removed to build this 
> variant.  I probably could have used procnto_g, which does get built by 
> default.
> 

Actually, you don't have to remove the file if you don't want to. The "Makefile.dnm"'s only prevent a make from an upper
 level from recursing into that particular directory. If you cd directly to that directory  and type "make" there, it 
will build.