1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-06 10:56:30 -05:00
libkernaux/examples/bootloader-multiboot2-grub/linker.ld

38 lines
603 B
Text

OUTPUT_ARCH("i386")
ENTRY(_start)
_kernel_offset = 0xC0000000; /* 3 GiB */
_kernel_phys_base = 4M;
_kernel_virt_base = (_kernel_phys_base + _kernel_offset);
_kernel_stack_size = _kernel_stack_end - _kernel_stack_start;
SECTIONS
{
. = _kernel_phys_base;
.text BLOCK(4K) : ALIGN(4K)
{
*(.multiboot2);
*(.text);
}
.rodata BLOCK(4K) : ALIGN(4K)
{
*(.rodata);
}
.data BLOCK(4K) : ALIGN(4K)
{
*(.data);
}
.bss BLOCK(4K) : ALIGN(4K)
{
*(COMMON);
*(.bss);
}
_kernel_size = . - _kernel_phys_base;
}