|
|
1.1 ! root 1: ! 2: #include <mach/machine/asm.h> ! 3: ! 4: #include "i386asm.h" ! 5: ! 6: .text ! 7: ! 8: /* We should never be entered this way. */ ! 9: .globl start,_start ! 10: start: ! 11: _start: ! 12: jmp boot_entry ! 13: ! 14: /* MultiBoot header - see multiboot.h. */ ! 15: #define MULTIBOOT_MAGIC 0x1BADB002 ! 16: #ifdef __ELF__ ! 17: #define MULTIBOOT_FLAGS 0x00000002 ! 18: #else /* __ELF__ */ ! 19: #define MULTIBOOT_FLAGS 0x00010002 ! 20: #endif /* __ELF__ */ ! 21: P2ALIGN(2) ! 22: boot_hdr: ! 23: .long MULTIBOOT_MAGIC ! 24: .long MULTIBOOT_FLAGS ! 25: /* ! 26: * The next item here is the checksum. ! 27: * XX this works OK until we need at least the 30th bit. ! 28: */ ! 29: .long - (MULTIBOOT_MAGIC+MULTIBOOT_FLAGS) ! 30: #ifndef __ELF__ /* a.out kludge */ ! 31: .long boot_hdr /* header_addr */ ! 32: .long _start /* load_addr */ ! 33: .long _edata /* load_end_addr */ ! 34: .long _end /* bss_end_addr */ ! 35: .long boot_entry /* entry */ ! 36: #endif /* __ELF__ */ ! 37: ! 38: boot_entry: ! 39: ! 40: /* Switch to our own interrupt stack. */ ! 41: movl $_intstack+INTSTACK_SIZE,%esp ! 42: ! 43: /* Reset EFLAGS to a known state. */ ! 44: pushl $0 ! 45: popf ! 46: ! 47: /* Clear uninitialized data. */ ! 48: lea _edata,%edi ! 49: lea _end,%ecx ! 50: subl %edi,%ecx ! 51: xorl %eax,%eax ! 52: rep ! 53: stosb ! 54: ! 55: /* Push the boot_info pointer to be the second argument. */ ! 56: pushl %ebx ! 57: ! 58: /* Jump into C code. */ ! 59: call EXT(c_boot_entry) ! 60: ! 61: .comm _intstack,INTSTACK_SIZE ! 62:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.