-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1f754f
commit 032eab7
Showing
6 changed files
with
98 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
ENTRY(start_protected_mode) | ||
|
||
SECTIONS | ||
{ | ||
. = 0x0; | ||
.boot : | ||
{ | ||
KEEP(*(.multiboot_header)); | ||
*(.boot) | ||
} | ||
|
||
/* Page table addresses already defined in boot.asm, but ensure alignment */ | ||
. = ALIGN(4096); /* Page size */ | ||
__page_table_start = .; | ||
_p4 = PML4; /* Reference PML4 address from boot.asm */ | ||
_p3 = PDPT; /* Reference PDPT address from boot.asm */ | ||
_p2 = PD; /* Reference PD address from boot.asm */ | ||
_p1 = PT; /* Reference PT address from boot.asm */ | ||
__page_table_end = .; | ||
|
||
/* Stack setup handled in boot.asm */ | ||
_stack_start = stack_bottom; /* Stack defined in boot.asm */ | ||
_stack_end = stack_top; | ||
|
||
/* Memory map section for bootloader metadata */ | ||
__bootloader_start = .; | ||
_memory_map = .; /* Memory map entry */ | ||
. += 4096; /* Reserve 4KB for memory map */ | ||
|
||
/* Kernel metadata section */ | ||
.kernel : | ||
{ | ||
KEEP(*(.kernel)) | ||
} | ||
|
||
/* Text section: contains code */ | ||
.text : | ||
{ | ||
*(.text) | ||
} | ||
|
||
.bss ALIGN(4096): | ||
{ | ||
__bss_start = .; | ||
*(.bss) | ||
*(COMMON) | ||
__bss_end = .; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,17 @@ | ||
ENTRY(start) | ||
ENTRY(start_protected_mode) | ||
|
||
SECTIONS | ||
{ | ||
/* Reserve a buffer for kernel loading */ | ||
. = 0x0; | ||
.boot : | ||
{ | ||
KEEP(*(.multiboot_header)); | ||
*(.boot) | ||
} | ||
|
||
/* Page table addresses already defined in boot.asm, but ensure alignment */ | ||
. = ALIGN(4096); /* Page size */ | ||
__page_table_start = .; | ||
_p4 = PML4; /* Reference PML4 address from boot.asm */ | ||
_p3 = PDPT; /* Reference PDPT address from boot.asm */ | ||
_p2 = PD; /* Reference PD address from boot.asm */ | ||
_p1 = PT; /* Reference PT address from boot.asm */ | ||
__page_table_end = .; | ||
|
||
/* Stack setup handled in boot.asm */ | ||
_stack_start = stack_bottom; /* Stack defined in boot.asm */ | ||
_stack_end = stack_top; | ||
. = 1M; | ||
|
||
/* Memory map section for bootloader metadata */ | ||
__bootloader_start = .; | ||
_memory_map = .; /* Memory map entry */ | ||
. += 4096; /* Reserve 4KB for memory map */ | ||
|
||
/* Kernel metadata section */ | ||
.kernel : | ||
{ | ||
KEEP(*(.kernel)) | ||
} | ||
|
||
/* Text section: contains code */ | ||
.text : | ||
{ | ||
*(.text) | ||
} | ||
.boot : | ||
{ | ||
KEEP(*(.multiboot_header)) | ||
*(.boot) | ||
} | ||
|
||
.bss ALIGN(4096): | ||
{ | ||
__bss_start = .; | ||
*(.bss) | ||
*(COMMON) | ||
__bss_end = .; | ||
} | ||
.text : | ||
{ | ||
*(.text) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters