mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:57:45 +00:00
Kernel/aarch64: Embed disk image into kernel binary
This allows us to actually boot to userspace in the next commit! :^)
This commit is contained in:
parent
da89cd948f
commit
3b65fd64fc
4 changed files with 18 additions and 3 deletions
|
@ -38,9 +38,6 @@ bool g_pci_access_is_disabled_from_commandline { false };
|
||||||
|
|
||||||
// x86 init
|
// x86 init
|
||||||
|
|
||||||
multiboot_module_entry_t multiboot_copy_boot_modules_array[16];
|
|
||||||
size_t multiboot_copy_boot_modules_count;
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
READONLY_AFTER_INIT PhysicalAddress start_of_prekernel_image;
|
READONLY_AFTER_INIT PhysicalAddress start_of_prekernel_image;
|
||||||
READONLY_AFTER_INIT PhysicalAddress end_of_prekernel_image;
|
READONLY_AFTER_INIT PhysicalAddress end_of_prekernel_image;
|
||||||
|
|
|
@ -43,6 +43,12 @@ uintptr_t __stack_chk_guard;
|
||||||
|
|
||||||
READONLY_AFTER_INIT bool g_in_early_boot;
|
READONLY_AFTER_INIT bool g_in_early_boot;
|
||||||
|
|
||||||
|
extern "C" const u32 disk_image_start;
|
||||||
|
extern "C" const u32 disk_image_size;
|
||||||
|
|
||||||
|
multiboot_module_entry_t multiboot_copy_boot_modules_array[16];
|
||||||
|
size_t multiboot_copy_boot_modules_count;
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
static void draw_logo(u8* framebuffer_data);
|
static void draw_logo(u8* framebuffer_data);
|
||||||
|
@ -111,6 +117,12 @@ extern "C" [[noreturn]] void init()
|
||||||
multiboot_memory_map = mmap;
|
multiboot_memory_map = mmap;
|
||||||
multiboot_memory_map_count = 1;
|
multiboot_memory_map_count = 1;
|
||||||
|
|
||||||
|
multiboot_flags = 0x4;
|
||||||
|
multiboot_copy_boot_modules_count = 1;
|
||||||
|
auto disk_image_start_physical_addr = ((FlatPtr)&disk_image_start - kernel_load_base);
|
||||||
|
multiboot_copy_boot_modules_array[0].start = disk_image_start_physical_addr;
|
||||||
|
multiboot_copy_boot_modules_array[0].end = disk_image_start_physical_addr + disk_image_size;
|
||||||
|
|
||||||
dbgln("Welcome to Serenity OS!");
|
dbgln("Welcome to Serenity OS!");
|
||||||
dbgln("Imagine this being your ideal operating system.");
|
dbgln("Imagine this being your ideal operating system.");
|
||||||
dbgln("Observed deviations from that ideal are shortcomings of your imagination.");
|
dbgln("Observed deviations from that ideal are shortcomings of your imagination.");
|
||||||
|
|
|
@ -80,6 +80,11 @@ SECTIONS
|
||||||
page_tables_phys_end = .;
|
page_tables_phys_end = .;
|
||||||
|
|
||||||
end_of_kernel_image = .;
|
end_of_kernel_image = .;
|
||||||
|
|
||||||
|
disk_image ALIGN(4K) : AT (ADDR(disk_image) - KERNEL_MAPPING_BASE)
|
||||||
|
{
|
||||||
|
*(disk_image)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_of_bss_divided_by_8 = (end_of_bss - start_of_bss + 7) / 8;
|
size_of_bss_divided_by_8 = (end_of_bss - start_of_bss + 7) / 8;
|
||||||
|
|
|
@ -726,6 +726,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kernel.map" DESTINATION res)
|
||||||
|
|
||||||
if ("${SERENITY_ARCH}" STREQUAL "aarch64")
|
if ("${SERENITY_ARCH}" STREQUAL "aarch64")
|
||||||
embed_resource(Kernel serenity_boot_logo "Arch/aarch64/SerenityLogoRGB.ppm")
|
embed_resource(Kernel serenity_boot_logo "Arch/aarch64/SerenityLogoRGB.ppm")
|
||||||
|
embed_resource(Kernel disk_image "../Build/aarch64/_disk_image")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET Kernel POST_BUILD
|
TARGET Kernel POST_BUILD
|
||||||
COMMAND ${CMAKE_OBJCOPY} -O binary Kernel kernel8.img
|
COMMAND ${CMAKE_OBJCOPY} -O binary Kernel kernel8.img
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue