From 56553b7318d2a1466ad07c1955d30a5744b16f12 Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Wed, 10 Sep 2008 14:34:50 -0400 Subject: [PATCH 1/1] Add little multiboot stub --- grubload/multiboot.S | 21 +++++++++++++++++++++ grubload/multiboot_c.c | 6 ++++++ 2 files changed, 27 insertions(+) create mode 100644 grubload/multiboot.S create mode 100644 grubload/multiboot_c.c diff --git a/grubload/multiboot.S b/grubload/multiboot.S new file mode 100644 index 0000000..bddd8fd --- /dev/null +++ b/grubload/multiboot.S @@ -0,0 +1,21 @@ +.globl _start + +_start: + jmp multiboot_entry + + .align 4 +multiboot_header: + .long 0x1badb002 /* Magic value */ + .long 0x00000001 /* Flags -- "Please align modules for me" */ + .long 0xE4524FFD /* Checksum */ + +multiboot_entry: + mov $_stack_top, %esp + pushl %ebx /* Multiboot info structure */ + pushl %eax /* Magic number */ + jmp c_start + + .align 4 +_stack: + .space 16384 +_stack_top: diff --git a/grubload/multiboot_c.c b/grubload/multiboot_c.c new file mode 100644 index 0000000..7c6a4fd --- /dev/null +++ b/grubload/multiboot_c.c @@ -0,0 +1,6 @@ +void c_start(unsigned int magic, void *wee) +{ + *(unsigned char *)0xB8000 = 'A'; + while (1) + ; +} -- 2.43.0