1 # Multiboot header, for multiboot boot loaders like GNU Grub.
2 # http://www.gnu.org/software/grub/manual/multiboot/multiboot.html
4 # Using GRUB 2, you can boot xv6 from a file stored in a
5 # Linux file system by copying kernel or kernelmemfs to /boot
6 # and then adding this menu entry:
10 # set root='(hd0,msdos1)'
11 # set kernel='/boot/kernel'
12 # echo "Loading ${kernel}..."
13 # multiboot ${kernel} ${kernel}
18 #include "memlayout.h"
22 # Multiboot header. Data to direct multiboot loader.
25 .globl multiboot_header
27 #define magic 0x1badb002
33 # By convention, the _start symbol specifies the ELF entry point.
34 # Since we haven't set up virtual memory yet, our entry point is
35 # the physical address of 'entry'.
37 _start = V2P_WO(entry)
39 # Entering xv6 on boot processor, with paging off.
42 # Turn on page size extension for 4Mbyte pages
47 movl $(V2P_WO(entrypgdir)), %eax
51 orl $(CR0_PG|CR0_WP), %eax
54 # Set up the stack pointer.
55 movl $(stack + KSTACKSIZE), %esp
57 # Jump to main(), and switch to executing at
58 # high addresses. The indirect call is needed because
59 # the assembler produces a PC-relative instruction
64 .comm stack, KSTACKSIZE