1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-24 00:46:17 +04:00

Add uboot instructions

This commit is contained in:
Jiajie Chen 2019-04-05 23:31:02 +08:00
parent a712f37c65
commit 58932e0bee
2 changed files with 36 additions and 9 deletions

18
docs/uboot_raspi3.md Normal file
View File

@ -0,0 +1,18 @@
How to use u-boot to boot rCore in Raspberry Pi
===============
Tested under QEMU.
Instructions:
1. Build u-boot
1. Download aarch64 toolchain and u-boot source
2. `make rpi_3_defconfig ARCH=arm CROSS_COMPILE=aarch64-elf-`
3. `make all ARCH=arm CROSS_COMILE=aarch64-elf-`
4. A file named `u-boot.bin` should be generated
2. Use u-boot to run rCore
1. `make run arch=aarch64 u_boot=/path/to/u-boot.bin`
2. In u-boot, enter following commands:
1. `mmc read 0x1000000 0 ${nblocks}`, where ${nblocks} can be probed if you enter a large enought number
2. `bootelf -p 0x1000000`
3. rCore should boot now

View File

@ -16,18 +16,19 @@
#
# Options:
# arch = x86_64 | riscv32 | riscv64 | aarch64
# d = int | in_asm | ... QEMU debug info
# d = int | in_asm | ... QEMU debug info
# mode = debug | release
# LOG = off | error | warn | info | debug | trace
# SFSIMG = <sfsimg> SFS image path of user programs
# smp = 1 | 2 | ... SMP core number
# graphic = on | off enable/disable qemu graphical output
# board = none Running on QEMU
# | u540 Only available on riscv64, run on HiFive U540, use Sv39
# | raspi3 Only available on aarch64, run on Raspberry Pi 3 Model B/B+
# pci_passthru = 0000:00:00.1 Only available on x86_64, passthrough the specified PCI device
# init = /bin/ls Only available on riscv64, run specified program instead of user shell
# SFSIMG = <sfsimg> SFS image path of user programs
# smp = 1 | 2 | ... SMP core number
# graphic = on | off Enable/disable qemu graphical output
# board = none Running on QEMU
# | u540 Only available on riscv64, run on HiFive U540, use Sv39
# | raspi3 Only available on aarch64, run on Raspberry Pi 3 Model B/B+
# pci_passthru = 0000:00:00.1 Only available on x86_64, passthrough the specified PCI device
# init = /bin/ls Only available on riscv64, run specified program instead of user shell
# extra_nic = on | off Only available on x86_64, add an additional e1000 nic
# u_boot = /path/to/u-boot.bin Only available on aarch64, use u-boot to boot rcore
arch ?= riscv64
board ?= none
@ -114,6 +115,10 @@ qemu_opts += \
-machine $(board) \
-serial null -serial mon:stdio \
-kernel $(kernel_img)
ifneq ($(u_boot), )
qemu_opts += \
-sd $(bootloader)
endif
endif
ifdef d
@ -262,8 +267,12 @@ else ifeq ($(arch), riscv64)
make -j && \
cp bbl $(abspath $@)
else ifeq ($(arch), aarch64)
ifneq ($(u_boot), )
@cp $(u_boot) $@
else
@$(objcopy) $(bootloader) --strip-all -O binary $@
endif
endif
kernel:
@echo Building $(arch) kernel