Better docs and structure
This commit is contained in:
18
kernel.ld
18
kernel.ld
@@ -1,25 +1,33 @@
|
||||
/*
|
||||
* kernel.ld – Linker script for the ELF64 kernel.
|
||||
*
|
||||
* The kernel is loaded at physical address 0x100000 (1 MB) by the
|
||||
* UEFI loader. Each section is page-aligned (4 KB) so that page-
|
||||
* level permissions can be applied later if desired.
|
||||
*/
|
||||
|
||||
ENTRY(kmain)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x100000;
|
||||
. = 0x100000; /* load address: 1 MB */
|
||||
|
||||
.text : ALIGN(0x1000)
|
||||
.text : ALIGN(0x1000) /* executable code */
|
||||
{
|
||||
*(.text*)
|
||||
}
|
||||
|
||||
.rodata : ALIGN(0x1000)
|
||||
.rodata : ALIGN(0x1000) /* read-only data / string literals */
|
||||
{
|
||||
*(.rodata*)
|
||||
}
|
||||
|
||||
.data : ALIGN(0x1000)
|
||||
.data : ALIGN(0x1000) /* initialised read-write data */
|
||||
{
|
||||
*(.data*)
|
||||
}
|
||||
|
||||
.bss : ALIGN(0x1000)
|
||||
.bss : ALIGN(0x1000) /* zero-initialised data */
|
||||
{
|
||||
*(COMMON)
|
||||
*(.bss*)
|
||||
|
||||
Reference in New Issue
Block a user