1
0
Fork 0
mirror of https://gitlab.com/bztsrc/bootboot.git synced 2023-02-13 20:54:32 -05:00

Initial Risc-V64 support

This commit is contained in:
bzt 2021-01-18 03:32:17 +01:00
parent 3794ee43da
commit 0351e963a1
3 changed files with 52 additions and 1 deletions

View file

@ -1,6 +1,7 @@
# platform, either x86 or rpi
# platform, either x86, rpi or icicle
PLATFORM=x86
#PLATFORM=rpi
#PLATFORM=icicle
# the path to OVMF.fd (for testing with EFI)
OVMF=/usr/share/qemu/bios-TianoCoreEFI.bin
@ -16,7 +17,11 @@ initdir:
ifeq ($(PLATFORM),x86)
cp ../mykernel/c/mykernel.x86_64.elf initrd/sys/core
else
ifeq ($(PLATFORM),rpi)
cp ../mykernel/c/mykernel.aarch64.elf initrd/sys/core
else
cp ../mykernel/c/mykernel.riscv64.elf initrd/sys/core
endif
endif
# create hybrid disk / cdrom image or ROM image
@ -68,6 +73,9 @@ linux:
sdcard:
qemu-system-aarch64 -M raspi3 -kernel ../dist/bootboot.img -drive file=disk-rpi.img,if=sd,format=raw -serial stdio
riscv:
qemu-system-riscv64 -M microchip-icicle-kit -kernel ../dist/bootboot.rv64 -drive file=disk-icicle.img,if=sd,format=raw -serial stdio
coreboot:
ifeq ($(PLATFORM),x86)
qemu-system-x86_64 -bios coreboot-x86.rom -drive file=disk-x86.img,format=raw -serial stdio

BIN
mykernel/mykernel.riscv64.elf Executable file

Binary file not shown.

View file

@ -0,0 +1,43 @@
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: RISC-V
Version: 0x1
Entry point address: 0xffffffffffe02000
Start of program headers: 64 (bytes into file)
Start of section headers: 4032 (bytes into file)
Flags: 0x5, RVC, double-float ABI
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 1
Size of section headers: 64 (bytes)
Number of section headers: 9
Section header string table index: 8
Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flags Align
LOAD 0x0000000000000078 0xffffffffffe02000 0xffffffffffe02000
0x0000000000000db8 0x0000000000000dc0 RWE 0x8
Section to Segment mapping:
Segment Sections...
00 .text .got .got.plt .bss
Symbol table '.symtab' contains 10 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: ffffffffffe02000 0 SECTION LOCAL DEFAULT 1
2: ffffffffffe02d88 0 SECTION LOCAL DEFAULT 2
3: ffffffffffe02da8 0 SECTION LOCAL DEFAULT 3
4: ffffffffffe02db8 0 SECTION LOCAL DEFAULT 4
5: 0000000000000000 0 SECTION LOCAL DEFAULT 5
6: ffffffffffe01000 0 NOTYPE GLOBAL DEFAULT 1 environment
7: fffffffffc000000 0 NOTYPE GLOBAL DEFAULT ABS fb
8: ffffffffffe00000 0 NOTYPE GLOBAL DEFAULT 1 bootboot
9: fffffffff8000000 0 NOTYPE GLOBAL DEFAULT ABS mmio