alcedo/kernel/arch/i386/boot.s

29 lines
672 B
ArmAsm
Raw Normal View History

2018-05-06 20:23:43 +01:00
# http://wiki.osdev.org/Bare_Bones_with_NASM
.set MBALIGN, 1<<0 # align loaded modules on page boundaries
.set MEMINFO, 1<<1 # provide memory map
.set FLAGS, MBALIGN | MEMINFO # this is the Multiboot 'flag' field
.set MAGIC, 0x1BADB002 # 'magic number' lets bootloader find the header
.set CHECKSUM,-(MAGIC + FLAGS) # checksum of above, to prove we are multiboot
2017-10-21 17:11:36 +01:00
2018-05-06 20:23:43 +01:00
.section .multiboot
.align 4
.long MAGIC
.long FLAGS
.long CHECKSUM
2017-10-21 17:11:36 +01:00
2018-05-06 20:23:43 +01:00
.section .bss
2017-10-21 17:11:36 +01:00
stack_bottom:
2018-05-06 20:23:43 +01:00
.skip 16384 # 16 KiB
2017-10-21 17:11:36 +01:00
stack_top:
2018-05-06 20:23:43 +01:00
.section .text
.global _start
.type _start, @function
2017-10-21 17:11:36 +01:00
_start:
2018-05-06 20:23:43 +01:00
mov $stack_top, %esp
2017-10-21 17:11:36 +01:00
call kernel_main
cli
.hang: hlt
jmp .hang
.end: