mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:37:45 +00:00
Kernel: Introduce basic pre-kernel environment
This implements a simple bootloader that is capable of loading ELF64 kernel images. It does this by using QEMU/GRUB to load the kernel image from disk and pass it to our bootloader as a Multiboot module. The bootloader then parses the ELF image and sets it up appropriately. The kernel's entry point is a C++ function with architecture-native code. Co-authored-by: Liav A <liavalb@gmail.com>
This commit is contained in:
parent
357ddd393e
commit
7e94b090fe
30 changed files with 1207 additions and 181 deletions
28
Kernel/Prekernel/multiboot.S
Normal file
28
Kernel/Prekernel/multiboot.S
Normal file
|
@ -0,0 +1,28 @@
|
|||
.code32
|
||||
.set MULTIBOOT_MAGIC, 0x1badb002
|
||||
.set MULTIBOOT_PAGE_ALIGN, 0x1
|
||||
.set MULTIBOOT_MEMORY_INFO, 0x2
|
||||
.set MULTIBOOT_VIDEO_MODE, 0x4
|
||||
.set multiboot_flags, MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO
|
||||
.set multiboot_checksum, -(MULTIBOOT_MAGIC + multiboot_flags)
|
||||
|
||||
.section .multiboot, "a"
|
||||
.align 4
|
||||
|
||||
.long MULTIBOOT_MAGIC
|
||||
.long multiboot_flags
|
||||
.long multiboot_checksum
|
||||
|
||||
|
||||
/* for MULTIBOOT_MEMORY_INFO */
|
||||
.long 0x00000000 /* header_addr */
|
||||
.long 0x00000000 /* load_addr */
|
||||
.long 0x00000000 /* load_end_addr */
|
||||
.long 0x00000000 /* bss_end_addr */
|
||||
.long 0x00000000 /* entry_addr */
|
||||
|
||||
/* for MULTIBOOT_VIDEO_MODE */
|
||||
.long 0x00000000 /* mode_type */
|
||||
.long 1280 /* width */
|
||||
.long 1024 /* height */
|
||||
.long 32 /* depth */
|
Loading…
Add table
Add a link
Reference in a new issue