mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[boot] Restructure boot paging and program loading
Restructuring paging into an object that carries its page cache with it and makes for simpler code. Program loading is also changed to not copy the pages loaded from the file into new pages - we can impose a new constraint that anything loaded by boot have a simple, page-aligned layout so that we can just map the existing pages into the right addresses. Also included are some linker script changes to help accommodate this.
This commit is contained in:
43
src/user/srv.init/init.ld
Normal file
43
src/user/srv.init/init.ld
Normal file
@@ -0,0 +1,43 @@
|
||||
PHDRS
|
||||
{
|
||||
rodata PT_LOAD PHDRS FILEHDR FLAGS (4) /* read-only */;
|
||||
text PT_LOAD ;
|
||||
rwdata PT_LOAD ;
|
||||
bss PT_LOAD ;
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x20000000 + SIZEOF_HEADERS ;
|
||||
|
||||
.rodata : {
|
||||
*(.rodata*)
|
||||
} :rodata
|
||||
|
||||
.text ALIGN(4K) : {
|
||||
*(.text*)
|
||||
} :text
|
||||
|
||||
.data ALIGN(4K) : {
|
||||
*(.data*)
|
||||
} :rwdata
|
||||
|
||||
.init_array : {
|
||||
*(.init_array*)
|
||||
} :rwdata
|
||||
|
||||
.got : {
|
||||
*(.got*)
|
||||
} :rwdata
|
||||
|
||||
.bss ALIGN(4K) : {
|
||||
__bss_start = .;
|
||||
*(.bss*)
|
||||
__bss_end = .;
|
||||
} :bss
|
||||
|
||||
/DISCARD/ : {
|
||||
*(.gcc_except_table*)
|
||||
*(.eh_frame*)
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ init = module("srv.init",
|
||||
targets = [ "user" ],
|
||||
deps = [ "libc", "elf", "bootproto", "zstd" ],
|
||||
description = "Init server",
|
||||
ld_script = "init.ld",
|
||||
sources = [
|
||||
"j6romfs.cpp",
|
||||
"loader.cpp",
|
||||
|
||||
Reference in New Issue
Block a user