Grub: error loading a kernel when compiled with -g
Posted: Wed Apr 11, 2007 1:44 pm
Hi
I'm using Bochs-2.3 compiled with the --enable-gdb-stub option under mandriva 10.2 linux, with gcc 3.4.3 and nasm 0.98.39.
Basically, I'm trying to debug a simple kernel to find where a fault is triggered, using gdb remotely.
My kernel (a mixture of C and ASM) is loaded by Grub, and this works fine normally. However, if I compile with the -g option in gcc (I believe this to be the correct switch to compile with debugging information, please tell me if I'm wrong), grub complains that the kernel does not fit in memory.
I find this strange as the kernel is only ~20kb, and the emulated memory size is 128mb.
I am aware that it sometimes reports this message even if the error is something else, but what other scenarios cause this error?
I tried using 'strip -d kernel.bin -o kernel.debug', but this does not affect the size of the kernel.bin binary (or the error message for that matter). I'm unfamiliar with this tool though, so I am possibly doing something stupid.
My kernel format is elf32-i386, and it is loaded at 0x00100000.
Hope I've provided enough information. Do you need to see my makefile/link script?
Even suggestions/guesses/hunches are welcome
Thanks
I'm using Bochs-2.3 compiled with the --enable-gdb-stub option under mandriva 10.2 linux, with gcc 3.4.3 and nasm 0.98.39.
Basically, I'm trying to debug a simple kernel to find where a fault is triggered, using gdb remotely.
My kernel (a mixture of C and ASM) is loaded by Grub, and this works fine normally. However, if I compile with the -g option in gcc (I believe this to be the correct switch to compile with debugging information, please tell me if I'm wrong), grub complains that the kernel does not fit in memory.
I find this strange as the kernel is only ~20kb, and the emulated memory size is 128mb.
I am aware that it sometimes reports this message even if the error is something else, but what other scenarios cause this error?
I tried using 'strip -d kernel.bin -o kernel.debug', but this does not affect the size of the kernel.bin binary (or the error message for that matter). I'm unfamiliar with this tool though, so I am possibly doing something stupid.
My kernel format is elf32-i386, and it is loaded at 0x00100000.
Hope I've provided enough information. Do you need to see my makefile/link script?
Even suggestions/guesses/hunches are welcome
Thanks