Building a multiboot 1 compatible executable

This commit is contained in:
2017-10-24 16:04:09 +02:00
parent 0df19ec2b7
commit 39b43d825a
3 changed files with 56 additions and 0 deletions

26
src/kernel/boot/boot.S Normal file
View File

@@ -0,0 +1,26 @@
#define MBOOT1_MAGIC 0x1BADB002
#define MBOOT1_PALIGN 0x01
#define MBOOT1_MEMINFO 0x02
#define MBOOT1_FLAGS (MBOOT1_PALIGN | MBOOT1_MEMINFO)
#define MBOOT1_CS -(MBOOT1_FLAGS + MBOOT1_MAGIC)
.intel_syntax noprefix
.section .multiboot
.align 0x1000
MultiBootHeader1:
.long MBOOT1_MAGIC
.long MBOOT1_FLAGS
.long MBOOT1_CS
.section .text
.global _start
.code32
_start:
cli
// Print a red exclamation mark in top left corner
mov eax, 0x0421
mov short [0xB8000], ax
// and loop infinitely
jmp $