summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-06-24 13:00:17 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-25 15:19:09 +0200
commit13e4093da4e94e2a5bb5576fa8d3faedaa78dd46 (patch)
treef78f0de1e62379594c40da827587949ca29363a0 /Kernel
parent19c0498ccc635ae9e9cc9f574588f12c5636738a (diff)
downloadserenity-13e4093da4e94e2a5bb5576fa8d3faedaa78dd46.zip
Kernel: Move Multiboot header into a separate file
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Arch/x86/common/Boot/multiboot.S28
-rw-r--r--Kernel/Arch/x86/i386/Boot/boot.S28
-rw-r--r--Kernel/Arch/x86/x86_64/Boot/boot.S28
-rw-r--r--Kernel/CMakeLists.txt1
4 files changed, 29 insertions, 56 deletions
diff --git a/Kernel/Arch/x86/common/Boot/multiboot.S b/Kernel/Arch/x86/common/Boot/multiboot.S
new file mode 100644
index 0000000000..1d43fa799b
--- /dev/null
+++ b/Kernel/Arch/x86/common/Boot/multiboot.S
@@ -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 */
diff --git a/Kernel/Arch/x86/i386/Boot/boot.S b/Kernel/Arch/x86/i386/Boot/boot.S
index 33e48097df..8b1b8f53c3 100644
--- a/Kernel/Arch/x86/i386/Boot/boot.S
+++ b/Kernel/Arch/x86/i386/Boot/boot.S
@@ -1,31 +1,3 @@
-.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 */
-
.section .stack, "aw", @nobits
stack_bottom:
.skip 32768
diff --git a/Kernel/Arch/x86/x86_64/Boot/boot.S b/Kernel/Arch/x86/x86_64/Boot/boot.S
index 1716536df4..59920cf3aa 100644
--- a/Kernel/Arch/x86/x86_64/Boot/boot.S
+++ b/Kernel/Arch/x86/x86_64/Boot/boot.S
@@ -1,32 +1,4 @@
.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 | MULTIBOOT_VIDEO_MODE
-.set multiboot_checksum, -(MULTIBOOT_MAGIC + multiboot_flags)
-
-.section .multiboot
-.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 */
-
.section .stack, "aw", @nobits
stack_bottom:
.skip 32768
diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt
index b3bfdf8de0..86d17579b4 100644
--- a/Kernel/CMakeLists.txt
+++ b/Kernel/CMakeLists.txt
@@ -281,6 +281,7 @@ set(KERNEL_SOURCES
set(KERNEL_SOURCES
${KERNEL_SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/Arch/x86/common/ASM_wrapper.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/Arch/x86/common/Boot/multiboot.S
${CMAKE_CURRENT_SOURCE_DIR}/Arch/x86/common/CPU.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Arch/x86/common/Interrupts.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Arch/x86/common/Processor.cpp