This is the linker script:
Code: Select all
KERNEL_VMA = 0x100000;
KERNEL_LMA = 0x100000;
ALIGN_VAL = 0x1000;
OUTPUT_FORMAT("elf32-x86-64")
ENTRY(_start64)
SECTIONS
{
. = KERNEL_LMA;
linker_kernelStart = .;
_boot = .;
.boot :
{
CMakeFiles/phios.elf.dir/kernel/src/arch/x86/boot64.s.o (.text)
}
_eboot = .;
_text = .;
.text :
{
*(EXCLUDE_FILE(CMakeFiles/phios.elf.dir/kernel/src/arch/x86/boot64.s.o) .text)
}
_etext = .;
_data = .;
.data :
{
*(.data)
}
_edata = .;
_eh_frame = .;
.eh_frame :
{
*(.eh_frame)
}
_eeh_frame = .;
_bss = .;
.bss :
{
*(.bss)
*(COMMON)
}
_ebss = .;
linker_kernelEnd = .;
.comment :
{
*(.comment)
}
}
Code: Select all
.section .text
.code32
multiboot_header_begin:
.align 4
.long 0xe85250d6
.long 0
.long multiboot_header_end - multiboot_header_begin
.long -(0xe85250d6 + (multiboot_header_end - multiboot_header_begin))
.short 0
.short 0
.long 8
multiboot_header_end:
.global _start64
.type _start64, @function
_start64:
# 64-bit initialization should go here
# and jump...
1:
hlt
jmp 1b
.size _start64, . - _start64
.section .bss
.align 16
stack_bottom:
.skip 16384 # 16 KiB
stack_top: