Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .intel_syntax noprefix
- # ----------------------------------------------------------------------
- # .multiboot: declare header in mutliboot standard
- .section .multiboot
- .align 4
- # some constants for multiboot header:
- .set ALIGN, 1<<0 # align loaded modules on page boundaries
- .set MEMINFO, 1<<1 # provide memory map
- .set FLAGS, ALIGN | MEMINFO # mutliboot flags
- .set MAGIC, 0x1BADB002 # 'magic number' lets bootloader find header
- .set CHECKSUM, -(MAGIC + FLAGS) # checksum of the mboot header
- .long MAGIC
- .long FLAGS
- .long CHECKSUM
- # ----------------------------------------------------------------------
- # allocate some stack space
- .section .bootstrap_stack, "aw", @nobits
- stack_bottom:
- .skip 16384 # 16 KB
- stack_top:
- # ----------------------------------------------------------------------
- # .text: the global function _start represents our kernel entry point in
- # our .text segment
- .section .text
- .globl _start
- .type _start, @function
- _start:
- # first, setup a stack:
- mov esp, stack_top
- call _init
- call k_early_init
- call k_main
- endless:
- jmp endless
- # ----------------------------------------------------------------------
- # signalize end of module: size of the code -- for debugging purposes:
- .size _start, . - _start
Advertisement
Add Comment
Please, Sign In to add comment