[x86 BSP] hello App + GRUB Image Built follow Documentation Fails to Output in QEMU Launch

Issue Description:

When launching a manually crafted hello application (with x86_64/amd64efi ) via GRUB EFI boot image under QEMU, no console output is observed.

Environment Details:

follow 2.4 & 2.5

  1. Install the Tool Suite
../source-builder/sb-set-builder --prefix=$PREFIX 6/rtems-x86_64.bset
  1. Build a Board Support Package
../source-builder/sb-set-builder 
    --log=bsp_build.log \
    --prefix=$PREFIX \
    --with-rtems-bsp=x86_64/amd64efi \
    6/rtems-kernel

Then the tool kit and BSP structure file directory were generated on $PREFIX

Build Hello Application

follow 2.7

  1. Setup Waf build system and git
curl https://waf.io/waf-2.0.19 > waf
chmod +x waf

git init

git submodule add https://gitlab.rtems.org/rtems/tools/rtems_waf.git rtems_waf
  1. Create three files

init.c, hello.c, wscript

Exactly the same as in the manual but rtems_version = "6".

  1. Build
./waf configure --rtems=$PREFIX --rtems-bsp=x86_64/amd64efi

./waf

Successfully generated the exe file.

Create GRUB boot system

follow 8.13

  1. Build OVMF

Successfully build.

  1. Create ESP Partition
.
├── EFI
│   └── BOOT
│       ├── BOOTX64.EFI
│       └── grub.cfg
└── rtems

Create an image and start under QEMU

makefs -t msdos -s 50m RTEMS-GRUB.img RTEMS-GRUB

The image created at this time seems to still be FAT16, but I also tried converting it to FAT32, and it had no change on the result.

qemu-system-x86_64 -no-reboot -nographic -m 256M -bios OVMF.fd -drive file=RTEMS-GRUB.img,format=raw,media=disk -serial mon:stdio

No output after startup, no response, so I tried to view it through QEMU’s GDB mode.

Debug

qemu-system-x86_64 -no-reboot -nographic -m 256M -bios OVMF.fd -drive file=RTEMS-GRUB.img,format=raw,media=disk -serial mon:stdio -s -S

gdb-multiarch  .../RTEMS-GRUB/rtems

I found that all the assembly instructions inside are add:

I don’t know which step went wrong, thank you for your help.