mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
Kernel/riscv64: Generate Kernel.bin from kernel ELF
This is necessary for being able to use the qemu `-kernel` option. The QEMU virt machine uses OpenSBI's FW_DYNAMIC feature to pass the kernel entry address, which is the virtual entry point address specified in the kernel ELF. If we instead `objcopy` the kernel into a raw binary, OpenSBI will jump to the physical kernel load address, which is what we want it to do.
This commit is contained in:
parent
fa39a57474
commit
185715d832
1 changed files with 7 additions and 0 deletions
|
@ -806,6 +806,13 @@ if ("${SERENITY_ARCH}" STREQUAL "aarch64")
|
|||
COMMAND ${CMAKE_OBJCOPY} -O binary Kernel kernel8.img
|
||||
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/kernel8.img
|
||||
)
|
||||
elseif ("${SERENITY_ARCH}" STREQUAL "riscv64")
|
||||
add_custom_command(
|
||||
TARGET Kernel POST_BUILD
|
||||
COMMAND ${CMAKE_OBJCOPY} -O binary Kernel Kernel.bin
|
||||
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/Kernel.bin
|
||||
)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Kernel.bin" DESTINATION boot)
|
||||
endif()
|
||||
|
||||
serenity_install_headers(Kernel)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue