feat: initial paging setup
This commit is contained in:
22
linker.ld
22
linker.ld
@@ -10,24 +10,34 @@ SECTIONS
|
||||
loaded at by the bootloader. */
|
||||
. = 1M;
|
||||
_kernel_start = .;
|
||||
.boot.data ALIGN(4K) : {
|
||||
*(.multiboot)
|
||||
*(.boot.data)
|
||||
}
|
||||
.boot.text ALIGN(4K) : {
|
||||
*(.boot.text)
|
||||
}
|
||||
.boot.bss ALIGN(4K) : {
|
||||
*(.boot.bss)
|
||||
}
|
||||
|
||||
. += 0xC0000000;
|
||||
/* First put the multiboot header, as it is required to be put very early
|
||||
early in the image or the bootloader won't recognize the file format.
|
||||
Next we'll put the .text section. */
|
||||
.text BLOCK(4K) : ALIGN(4K)
|
||||
.text ALIGN(4K) : AT(ADDR(.text)-0xC0000000)
|
||||
{
|
||||
*(.multiboot)
|
||||
*(.text)
|
||||
}
|
||||
|
||||
/* Read-only data. */
|
||||
.rodata BLOCK(4K) : ALIGN(4K)
|
||||
.rodata ALIGN(4K) : AT(ADDR(.rodata)-0xC0000000)
|
||||
{
|
||||
*(.rodata)
|
||||
}
|
||||
|
||||
/* Read-write data (initialized) */
|
||||
.data BLOCK(4K) : ALIGN(4K)
|
||||
.data ALIGN(4K) : AT(ADDR(.data)-0xC0000000)
|
||||
{
|
||||
*(.data)
|
||||
. = ALIGN(16);
|
||||
@@ -41,12 +51,12 @@ SECTIONS
|
||||
}
|
||||
|
||||
/* Read-write data (uninitialized) and stack */
|
||||
.bss BLOCK(4K) : ALIGN(4K)
|
||||
.bss ALIGN(4K) : AT(ADDR(.bss)-0xC0000000)
|
||||
{
|
||||
*(COMMON)
|
||||
*(.bss)
|
||||
}
|
||||
_kernel_end = .;
|
||||
_kernel_end = . - 0xC0000000;
|
||||
|
||||
/DISCARD/ : {
|
||||
*(.eh_frame);
|
||||
|
||||
Reference in New Issue
Block a user