32bit booting working

This commit is contained in:
Alex
2022-10-18 00:19:44 +03:00
parent 3df98c7c8e
commit 348aa69dcb
4 changed files with 89 additions and 99 deletions

View File

@ -3,55 +3,31 @@ OUTPUT_ARCH(i386)
ENTRY(_start)
KERNEL_VIRTUAL_BASE = 0xC0000000;
SECTIONS
{
. = 1M;
.boot :
{
*(.multiboot2 .multiboot2.*)
}
.mb2bootcode.text :
{
*(.mb2bootcode.text)
}
.mb2bootcode.data :
{
*(.mb2bootcode.data)
}
.mb2bootcode.bss :
{
*(.mb2bootcode.bss)
}
. += ALIGN(4096);
. += KERNEL_VIRTUAL_BASE;
. = 0xC0100000;
_kernel_start = .;
.text ALIGN(4096) : AT(ADDR(.text) - KERNEL_VIRTUAL_BASE)
.text ALIGN(4096) : AT(ADDR(.text) - 0xC0000000)
{
*(.multiboot2)
*(.text .text.*)
}
_kernel_text_end = .;
.data ALIGN (4096) : AT(ADDR(.data) - KERNEL_VIRTUAL_BASE)
.data ALIGN (4096) : AT(ADDR(.data) - 0xC0000000)
{
*(.data .data.*)
}
_kernel_data_end = .;
.rodata ALIGN (4096) : AT(ADDR(.rodata) - KERNEL_VIRTUAL_BASE)
.rodata ALIGN (4096) : AT(ADDR(.rodata) - 0xC0000000)
{
*(.rodata .rodata.*)
}
_kernel_rodata_end = .;
.bss ALIGN (4096) : AT(ADDR(.bss) - KERNEL_VIRTUAL_BASE)
.bss ALIGN (4096) : AT(ADDR(.bss) - 0xC0000000)
{
*(COMMON)
*(.bss .bss.*)