When I try to build my kernel with elf, there's the error message:
"ld: kernel.bin: Not enough space for program headers, try linking with -N"
Ok, I did so and it worked. Now I tried to load my kernel with GRUB, but the following error message is printed:
"Kernel does not fit into memory"
What's wrong? My kernel is only 10878 bytes big...
Can somebody help me please?
Kernel doesn't fit into memory (?)
Re:Kernel doesn't fit into memory (?)
Ok now I do not have the message
"Not enough room for program headers..."
anymore - I fixed s.th. in the linker script.
But still, GRUB sais that the kernel doesn't fit into memory...
Please help me...
This here is my linker script:
Help, please
"Not enough room for program headers..."
anymore - I fixed s.th. in the linker script.
But still, GRUB sais that the kernel doesn't fit into memory...
Please help me...
This here is my linker script:
Code: Select all
OUTPUT_FORMAT("elf32-i386")
ENTRY(start)
SECTIONS
{
.text 0x100000 : /* 1 meg */
{
/* kernel code */
code = .; _code = .; __code = .;
*(.text)
}
.data :
{
/* kernel data */
data = .; _data = .; __data = .;
*(.data)
}
.bss :
{
/* kernel BSS */
bss = .; _bss = .; __bss = .;
*(.bss)
*(COMMON) /* GNU C "common" variables */
}
end = .; _end = .; __end = .;
}
Re:Kernel doesn't fit into memory (?)
Hey, really nobody ever had this problem before me?
Come on...
Come on...
Re:Kernel doesn't fit into memory (?)
Hm, perhaps GRUB cannot load my kernel because I move the GDT to 0x500. Might this be the problem?
Re:Kernel doesn't fit into memory (?)
No. GRUB doesn't know where your GDT is.
Did you perhaps declare an exceptionally large array somewhere in your C code? If so, it would get stuck in the .bss section and wouldn't show up in your file size.
What does objdump -h show you?
Did you perhaps declare an exceptionally large array somewhere in your C code? If so, it would get stuck in the .bss section and wouldn't show up in your file size.
What does objdump -h show you?
Re:Kernel doesn't fit into memory (?)
Hm, I have created a bss section (zero'd it) and reserved 4096 bytes (4Kb) for it. This should be enough, shouldn't it?
Of course I reserve some char-arrays (char buffer[MAXLEN], MAXLEN is 500), but this should be sufficient...
I really am in big trouble, I do not know what to do..
Of course I reserve some char-arrays (char buffer[MAXLEN], MAXLEN is 500), but this should be sufficient...
I really am in big trouble, I do not know what to do..