1 .text 2 .globl molly_start, molly_to_kernel_transition 3 4 // ........................................ 5 // 6 // Entry point. Initialize a stack and branch to the 7 // C entry point in molly_init.c 8molly_start: 9 lea (molly_kernel_stack + 4096)(%rip), %rsp 10 call molly_init 11 int3 12 13 // Never reached 14halt: hlt 15 jmp halt 16 17 // ........................................ 18 // 19 // Transfer control to the proper kernel once it has 20 // been loaded and relocated. The caller supplies the 21 // RAX RBX values through which the kernel expects 22 // the multiboot magic and info. 23molly_to_kernel_transition: 24 mov %rsi, %rax 25 mov %rdx, %rbx 26 call *%rdi 27 28 // ........................................ 29 // 30 // Stack for use by the C molly kernel. 31 32 .data 33molly_kernel_stack: 34 .skip 4096 35 36 37