In my kernel linker script I have a symbol to easily point to the last address used by the kernel:
Code: Select all
...
.bss ALIGN (0x1000) :
{
sbss = .;
*(COMMON)
*(.bss)
*(.gnu.linkonce.b*)
ebss = .;
}
kernel_end = .;
}
This is some data around 4KiB after the address:
Note I'm using qemu, so unitialised addresses read 0 instead of garbage data. Could it be data from qemu or GRUB's multiboot data? All I'm doing in the kernel is loading a GDT with statically defined structs and utilising a simple kprintf() function. All the static data is supposedly located before kernel_end, no?