2017-11-01 09:23:42 -04:00
|
|
|
.set MULTIBOOT_MAGIC, 0xE85250D6
|
|
|
|
.set MULTIBOOT_ARCH, 0
|
|
|
|
.set MULTIBOOT_LENGTH, 16 + 8
|
|
|
|
.set MULTIBOOT_CHECKSUM, -(MULTIBOOT_MAGIC + MULTIBOOT_ARCH + MULTIBOOT_LENGTH)
|
2017-11-01 00:43:42 -04:00
|
|
|
|
2017-11-01 09:23:42 -04:00
|
|
|
.section .multiboot
|
2017-11-01 04:53:27 -04:00
|
|
|
.align 4
|
2017-11-01 09:23:42 -04:00
|
|
|
.long MULTIBOOT_MAGIC
|
|
|
|
.long MULTIBOOT_ARCH
|
|
|
|
.long MULTIBOOT_LENGTH
|
|
|
|
.long MULTIBOOT_CHECKSUM
|
2017-11-01 05:45:56 -04:00
|
|
|
.long 0
|
|
|
|
.long 8
|
2017-11-01 04:53:27 -04:00
|
|
|
|
2017-11-01 00:43:42 -04:00
|
|
|
.section .bss
|
|
|
|
.align 16
|
|
|
|
.skip 16384 # 16 KiB
|
2017-11-05 10:26:30 -05:00
|
|
|
_kernel_stack_top:
|
|
|
|
|
|
|
|
.global _kernel_stack_top
|
2017-11-01 00:43:42 -04:00
|
|
|
|
|
|
|
.section .text
|
|
|
|
|
|
|
|
.global _start
|
2017-11-03 22:35:17 -04:00
|
|
|
|
2017-11-01 00:43:42 -04:00
|
|
|
.type _start, @function
|
2017-11-03 22:35:17 -04:00
|
|
|
.type halt, @function
|
|
|
|
|
2017-11-01 00:43:42 -04:00
|
|
|
_start:
|
2017-11-05 10:26:30 -05:00
|
|
|
mov $_kernel_stack_top, %esp // Initialize stack
|
2017-11-03 22:25:57 -04:00
|
|
|
|
|
|
|
push %ebx // Multiboot information pointer
|
|
|
|
push %eax // Multiboot magic number
|
2017-11-08 07:22:46 -05:00
|
|
|
call main
|
2017-11-03 22:32:23 -04:00
|
|
|
|
2017-11-05 10:26:30 -05:00
|
|
|
mov $_kernel_stack_top, %esp // Initialize stack
|
2017-11-03 22:32:23 -04:00
|
|
|
|
2017-11-04 06:38:28 -04:00
|
|
|
push %eax // Kernel information pointer
|
2017-11-08 07:22:46 -05:00
|
|
|
call init
|
2017-11-03 22:32:23 -04:00
|
|
|
|
2017-11-07 23:49:30 -05:00
|
|
|
call halt
|
2017-11-01 00:43:42 -04:00
|
|
|
|
|
|
|
.size _start, . - _start
|