diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-26 22:26:48 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-26 22:27:09 +0100 |
| commit | eba8b7ddd0a455d9e49f32dcae712c5612c0093c (patch) | |
| tree | 749a3d34546d055507a920bce4ab10e8a9945719 /Private/Linker | |
| parent | dd192787a70a973f2474720aea49af3f6ddabb7a (diff) | |
Kernel: Major repository refactor.
Rework the repo into Private and Public modules.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/Linker')
| -rw-r--r-- | Private/Linker/16x0.json | 6 | ||||
| -rw-r--r-- | Private/Linker/32x0.json | 6 | ||||
| -rw-r--r-- | Private/Linker/64x0.json | 6 | ||||
| -rw-r--r-- | Private/Linker/AMD64.ld | 44 |
4 files changed, 62 insertions, 0 deletions
diff --git a/Private/Linker/16x0.json b/Private/Linker/16x0.json new file mode 100644 index 00000000..f81ba5c6 --- /dev/null +++ b/Private/Linker/16x0.json @@ -0,0 +1,6 @@ +{ + "executable_type": "kernel", + "output_name": "hKernel.out", + "start_proc": "KMain", + "format": "PEF" +}
\ No newline at end of file diff --git a/Private/Linker/32x0.json b/Private/Linker/32x0.json new file mode 100644 index 00000000..f81ba5c6 --- /dev/null +++ b/Private/Linker/32x0.json @@ -0,0 +1,6 @@ +{ + "executable_type": "kernel", + "output_name": "hKernel.out", + "start_proc": "KMain", + "format": "PEF" +}
\ No newline at end of file diff --git a/Private/Linker/64x0.json b/Private/Linker/64x0.json new file mode 100644 index 00000000..f81ba5c6 --- /dev/null +++ b/Private/Linker/64x0.json @@ -0,0 +1,6 @@ +{ + "executable_type": "kernel", + "output_name": "hKernel.out", + "start_proc": "KMain", + "format": "PEF" +}
\ No newline at end of file diff --git a/Private/Linker/AMD64.ld b/Private/Linker/AMD64.ld new file mode 100644 index 00000000..695d17c4 --- /dev/null +++ b/Private/Linker/AMD64.ld @@ -0,0 +1,44 @@ +OUTPUT_FORMAT("elf64-x86-64") + +ENTRY(KMain) + +PHDRS { + null PT_NULL FLAGS(0) ; + text PT_LOAD FLAGS((1 << 0) | (1 << 2) | (1 << 3)); + rodata PT_LOAD FLAGS((1 << 2)) ; + data PT_LOAD FLAGS((1 << 1) | (1 << 2)) ; +} + +SECTIONS { + . = 0x00080000; + + .text : { + KEEP(*(.multiboot)) + *(.text .text.*) + } :text + + . += CONSTANT(MAXPAGESIZE); + + .init : { + *(.initl) + } + + . += CONSTANT(MAXPAGESIZE); + + .rodata : { + *(.rodata .rodata.*) + } :rodata + + . += CONSTANT(MAXPAGESIZE); + + .data : { + *(.data .data.*) + } :data + + . += CONSTANT(MAXPAGESIZE); + + .bss : { + *(COMMON) + *(.bss .bss.*) + } :data +}
\ No newline at end of file |
