Prekernel.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2021, Gunnar Beutner <gbeutner@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #ifdef __cplusplus
  8. # include <Kernel/Multiboot.h>
  9. # include <Kernel/PhysicalAddress.h>
  10. # include <Kernel/VirtualAddress.h>
  11. #endif
  12. #define MAX_KERNEL_SIZE 0x4000000
  13. #ifdef __cplusplus
  14. namespace Kernel {
  15. struct [[gnu::packed]] BootInfo {
  16. u32 start_of_prekernel_image;
  17. u32 end_of_prekernel_image;
  18. u64 physical_to_virtual_offset;
  19. u64 kernel_mapping_base;
  20. u64 default_kernel_load_base;
  21. u64 kernel_load_base;
  22. # if ARCH(X86_64)
  23. u32 gdt64ptr;
  24. u16 code64_sel;
  25. u32 boot_pml4t;
  26. # endif
  27. u32 boot_pdpt;
  28. u32 boot_pd0;
  29. u32 boot_pd_kernel;
  30. u64 boot_pd_kernel_pt1023;
  31. u64 kernel_cmdline;
  32. u32 multiboot_flags;
  33. u64 multiboot_memory_map;
  34. u32 multiboot_memory_map_count;
  35. u64 multiboot_modules;
  36. u32 multiboot_modules_count;
  37. u64 multiboot_framebuffer_addr;
  38. u32 multiboot_framebuffer_pitch;
  39. u32 multiboot_framebuffer_width;
  40. u32 multiboot_framebuffer_height;
  41. u8 multiboot_framebuffer_bpp;
  42. u8 multiboot_framebuffer_type;
  43. };
  44. }
  45. #endif