port clipper to boot using grub

This commit is contained in:
Robert 2023-09-03 20:11:33 +02:00
parent 040e083658
commit 7adc0c7ce1
7 changed files with 104 additions and 239 deletions

36
src/kernel/boot.asm Normal file
View file

@ -0,0 +1,36 @@
;
; Bootstrap code for the Clipper operating system
;
MBALIGN equ 1 << 0
MEMINFO equ 1 << 1
FLAGS equ MBALIGN | MEMINFO
MAGIC equ 0x1BADB002
CHECKSUM equ -(MAGIC + FLAGS)
; multiboot header
section .multiboot
align 4
dd MAGIC
dd FLAGS
dd CHECKSUM
section .bss
align 16
stack_bottom:
resb 16384
stack_top:
section .text
global _start: function (_start.end - _start)
_start:
mov esp, stack_top
extern kmain
call kmain
cli
.hang:
hlt
jmp .hang
.end:

View file

15
src/kernel/kmain.c Normal file
View file

@ -0,0 +1,15 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#if defined(__linux__)
# error "Please use a platform agnostic compiler"
#endif
#if !defined(__i386__)
# error "Please use an ix86-elf compiler"
#endif
void kmain(void) {
return;
}