2018-05-06 20:25:29 +01:00
|
|
|
.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
|
2018-05-06 20:25:29 +01:00
|
|
|
.align 16
|
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:
|
2018-05-06 20:25:29 +01:00
|
|
|
|
|
|
|
.size _start, . - _start
|