From eed77bd2970a00d1394ed027ceca5b646e4671ce Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 17 Jun 2020 18:31:46 +0200 Subject: Started rewrite --- src/entry.asm | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/entry.asm (limited to 'src/entry.asm') diff --git a/src/entry.asm b/src/entry.asm new file mode 100644 index 0000000..35cede5 --- /dev/null +++ b/src/entry.asm @@ -0,0 +1,49 @@ +bits 32 + +kernel_stack equ 0x4000 +multiboot_magic equ 0xe85250d6 + +section .text + align 4 + + multiboot: + header_start: + dd multiboot_magic + dd 0 + dd header_end - header_start + dd 0x100000000 - (multiboot_magic + 0 + (header_end - header_start)) + + ; Information tag + align 8 + dw 1 + dw 1 + dd 24 + dd 2 ; bootloader name + dd 4 ; meminfo + dd 6 ; mmap + dd 13 ; smbios + + ; Empty tag + align 8 + dw 0 + dw 0 + dd 8 + header_end: + + global boot + ;extern kernel_main + boot: + mov esp, stack_top + push esp + push ebx + push eax + cli + ;call kernel_main + hlt + jmp $ + +section .bss + align 32 + stack_bottom: + resb kernel_stack + stack_top: -- cgit v1.2.3