From dc2e2cc9dc9d7790e23dd9a4ccc265d7bb6d76aa Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 20 Dec 2021 12:28:30 +0200 Subject: Added init back --- arch/riscv/conf/apos.its | 4 ++-- arch/riscv/conf/init | Bin 0 -> 1032 bytes arch/riscv/conf/init-link.S | 30 ++++++++++++++++++++++++++++++ arch/riscv/conf/initrd | Bin 0 -> 1536 bytes arch/riscv/conf/initrd.txt | 1 - arch/riscv/conf/kernel-link.S | 4 ++-- arch/riscv/conf/s.S | 4 ++++ 7 files changed, 38 insertions(+), 5 deletions(-) create mode 100755 arch/riscv/conf/init create mode 100644 arch/riscv/conf/init-link.S create mode 100644 arch/riscv/conf/initrd delete mode 100644 arch/riscv/conf/initrd.txt create mode 100644 arch/riscv/conf/s.S (limited to 'arch/riscv/conf') diff --git a/arch/riscv/conf/apos.its b/arch/riscv/conf/apos.its index 1581025..15db4a4 100644 --- a/arch/riscv/conf/apos.its +++ b/arch/riscv/conf/apos.its @@ -7,7 +7,7 @@ images { kernel { description = "Garbaggio"; - data = /incbin/("../../../kernel.bin"); + data = /incbin/("../../../apos.bin"); type = "kernel"; arch = "riscv"; os = "apos"; @@ -21,7 +21,7 @@ initrd { description = "Gargabbio initrd"; - data = /incbin/("initrd.txt"); + data = /incbin/("initrd"); type = "ramdisk"; arch = "riscv"; os = "apos"; diff --git a/arch/riscv/conf/init b/arch/riscv/conf/init new file mode 100755 index 0000000..06e61e0 Binary files /dev/null and b/arch/riscv/conf/init differ diff --git a/arch/riscv/conf/init-link.S b/arch/riscv/conf/init-link.S new file mode 100644 index 0000000..642e831 --- /dev/null +++ b/arch/riscv/conf/init-link.S @@ -0,0 +1,30 @@ +OUTPUT_ARCH(riscv) +ENTRY(main) + +SECTIONS { + . = ABSOLUTE(PM_KERN); + __init_start = .; + + /* objcopy only copies these three sections (as far as I'm aware) into the + produces binary, so __init_end should point to the correct location in the + final binary + */ + .text ALIGN(4K) : AT(0) { + *(.init.start) + *(.text*); + } + + .rodata : { + *(.rodata*) + } + + .data : { + *(.data*) + } + + .bss : { + *(.bss*) *(COMMON) + } + + __init_end = . ; +} diff --git a/arch/riscv/conf/initrd b/arch/riscv/conf/initrd new file mode 100644 index 0000000..8dc931b Binary files /dev/null and b/arch/riscv/conf/initrd differ diff --git a/arch/riscv/conf/initrd.txt b/arch/riscv/conf/initrd.txt deleted file mode 100644 index e965047..0000000 --- a/arch/riscv/conf/initrd.txt +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/arch/riscv/conf/kernel-link.S b/arch/riscv/conf/kernel-link.S index bf0ad28..d3b1223 100644 --- a/arch/riscv/conf/kernel-link.S +++ b/arch/riscv/conf/kernel-link.S @@ -2,10 +2,10 @@ OUTPUT_ARCH(riscv) ENTRY(main) SECTIONS { - . = ABSOLUTE(PM_KERN); + . = ABSOLUTE(VM_KERN); __kernel_start = .; - .text : AT(0) { + .text ALIGN(4K) : AT(0) { *(.kernel.start); *(.text*); } diff --git a/arch/riscv/conf/s.S b/arch/riscv/conf/s.S new file mode 100644 index 0000000..7b796ce --- /dev/null +++ b/arch/riscv/conf/s.S @@ -0,0 +1,4 @@ +.text +.global _start +_start: +loop: j loop -- cgit v1.3