palanivel
(Palanivel)
January 3, 2023, 7:53am
1
Hi,
I am trying to boot Linux OS on QEMU for U540 board.
I have built EDK2 firmware for U540 board.
I am getting UEFI Shell prompt when I run qemu.
I would like to know how to boot the Linux directly from UEFI.
I have built vmlinux with initramfs statically linked.
Any help is appreciated.
Regards
Palanivel
palanivel
(Palanivel)
January 4, 2023, 4:23am
3
Hi Tommy,
Thanks for the link provided.
I followed the steps/commands given.
mkfs.msdos -C linux.iso 64000
sudo losetup /dev/loop20 linux.iso
sudo mount /dev/loop20 /mnt
sudo cp linux-riscv64.efi /mnt
sudo umount /mnt
sudo losetup -d /dev/loop20
Copy ramdisk and DTB into your clone of edk2-platforms
cp linux.iso edk2-platforms/Silicon/RISC-V/ProcessorPkg/Universal/EspRamdisk/linux.iso
cp U540.dtb edk2-platforms/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/U540.dtb
source edk2/edksetup.sh
make -C edk2/BaseTools clean
make -C edk2/BaseTools
source edk2/edksetup.sh BaseTools
build -a RISCV64 -p Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc -t GCC5
cp -v ./Build/FreedomU540HiFiveUnleashed/DEBUG_GCC5/FV/U540.fd .
qemu-system-riscv64 -cpu sifive-u54 -machine sifive_u -bios U540.fd -m 4096 -nographic -smp cpus=5,maxcpus=5
On uefi shell:
embeddedramdisk 4f2f3d7b-35ef-411b-9d26-e76ecacbaf8b
map -r
fs0:
linux-riscv64.efi root=/dev/ram rootwait console=ttySIF0 earlycon
I am getting error when I run embeddedramdisk command on UEFI shell.
Shell> embeddedramdisk 4f2f3d7b-35ef-411b-9d26-e76ecacbaf8b
‘embeddedramdisk’ is not recognized as an internal or external command, operable program, or script file.
Shell> map -r
map: Status: Not Found
Shell>
Shell> fs0:
‘fs0:’ is not a valid mapping.
Downloaded EDK2 from the following repos:
Any patch needs to be applied?
jrtc27
(Jessica Clarke)
January 6, 2023, 9:41pm
5
This sounds like a question for QEMU and/or EDK2 support venues, not SiFive, given this is neither SiFive’s emulator nor SiFive’s firmware.
1 Like
tom
(tom)
July 10, 2023, 2:21am
6
tom
(tom)
July 11, 2023, 8:07am
7
Does any one have any update?
tgm
(Tommy Murphy)
July 12, 2023, 10:10am
8
Not sure what you’re expecting given earlier posts - in particular @jrtc27 ’s most recent one?
eden
(eden)
July 19, 2023, 12:53am
9
Did you add the fat.inf module to the dsc / fdf file?
tom
(tom)
July 25, 2023, 8:15am
10
this one : ‘embeddedramdisk’ is not recognized as an internal or external command, operable program, or script file.