Move Multiboot headers to separate file
This commit is contained in:
parent
f5fb6241f2
commit
a44d0d7500
@ -1,25 +1,6 @@
|
|||||||
#include <multiboot.h>
|
#include <multiboot.h>
|
||||||
.intel_syntax noprefix
|
.intel_syntax noprefix
|
||||||
|
|
||||||
.section .multiboot
|
|
||||||
.align 0x1000
|
|
||||||
MultiBootHeader1:
|
|
||||||
.long MBOOT1_MAGIC
|
|
||||||
.long MBOOT1_FLAGS
|
|
||||||
.long MBOOT1_CS
|
|
||||||
|
|
||||||
.align 0x1000
|
|
||||||
MultiBootHeader2:
|
|
||||||
.long MBOOT2_MAGIC
|
|
||||||
.long MBOOT2_ARCH
|
|
||||||
.long MBOOT2_LENGTH
|
|
||||||
.long MBOOT2_CHECKSUM
|
|
||||||
|
|
||||||
.short 0
|
|
||||||
.short 0
|
|
||||||
.long 8
|
|
||||||
MultiBootHeader2End:
|
|
||||||
|
|
||||||
.section .text
|
.section .text
|
||||||
.global _start
|
.global _start
|
||||||
.code32
|
.code32
|
||||||
|
20
src/kernel/boot/multiboot_header.S
Normal file
20
src/kernel/boot/multiboot_header.S
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#include <multiboot.h>
|
||||||
|
.section .multiboot
|
||||||
|
|
||||||
|
.align 0x4
|
||||||
|
MultibootHeader1:
|
||||||
|
.long MBOOT1_MAGIC
|
||||||
|
.long MBOOT1_FLAGS
|
||||||
|
.long MBOOT1_CS
|
||||||
|
|
||||||
|
.align 0x8
|
||||||
|
MultibootHeader2:
|
||||||
|
.long MBOOT2_MAGIC
|
||||||
|
.long MBOOT2_ARCH
|
||||||
|
.long MBOOT2_LENGTH
|
||||||
|
.long MBOOT2_CHECKSUM
|
||||||
|
|
||||||
|
.short 0
|
||||||
|
.short 0
|
||||||
|
.long 8
|
||||||
|
MultibootHeader2End:
|
@ -1,12 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define MBOOT1_MAGIC 0x1BADB002
|
#define MBOOT1_MAGIC 0x1BADB002
|
||||||
|
#define MBOOT1_REPLY 0x2BADB002
|
||||||
#define MBOOT1_PALIGN 0x01
|
#define MBOOT1_PALIGN 0x01
|
||||||
#define MBOOT1_MEMINFO 0x02
|
#define MBOOT1_MEMINFO 0x02
|
||||||
#define MBOOT1_FLAGS (MBOOT1_PALIGN | MBOOT1_MEMINFO)
|
#define MBOOT1_FLAGS (MBOOT1_PALIGN | MBOOT1_MEMINFO)
|
||||||
#define MBOOT1_CS -(MBOOT1_FLAGS + MBOOT1_MAGIC)
|
#define MBOOT1_CS -(MBOOT1_FLAGS + MBOOT1_MAGIC)
|
||||||
|
|
||||||
#define MBOOT2_MAGIC 0xE85250D6
|
#define MBOOT2_MAGIC 0xE85250D6
|
||||||
|
#define MBOOT2_REPLY 0x36D76289
|
||||||
#define MBOOT2_ARCH 0
|
#define MBOOT2_ARCH 0
|
||||||
#define MBOOT2_LENGTH (MultiBootHeader2End - MultiBootHeader2)
|
#define MBOOT2_LENGTH (MultibootHeader2End - MultibootHeader2)
|
||||||
#define MBOOT2_CHECKSUM -(MBOOT2_MAGIC + MBOOT2_ARCH + MBOOT2_LENGTH)
|
#define MBOOT2_CHECKSUM -(MBOOT2_MAGIC + MBOOT2_ARCH + MBOOT2_LENGTH)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user