root/zBoot/head.S

/* [previous][next][first][last][top][bottom][index][help] */
   1 /*
   2  *  linux/boot/head.S
   3  *
   4  *  Copyright (C) 1991, 1992, 1993  Linus Torvalds
   5  */
   6 
   7 /*
   8  *  head.S contains the 32-bit startup code.
   9  *
  10  * NOTE!!! Startup happens at absolute address 0x00000000, which is also where
  11  * the page directory will exist. The startup code will be overwritten by
  12  * the page directory.
  13  */
  14 .text
  15 
  16 #include <linux/segment.h>
  17 
  18 startup_32:
  19         cld
  20         cli
  21         movl $KERNEL_DS,%eax
  22         mov %ax,%ds
  23         mov %ax,%es
  24         mov %ax,%fs
  25         mov %ax,%gs
  26         lss _stack_start,%esp
  27         xorl %eax,%eax
  28 1:      incl %eax               # check that A20 really IS enabled
  29         movl %eax,0x000000      # loop forever if it isn't
  30         cmpl %eax,0x100000
  31         je 1b
  32 /*
  33  * Initialize eflags.  Some BIOS's leave bits like NT set.  This would
  34  * confuse the debugger if this code is traced.
  35  * XXX - best to initialize before switching to protected mode.
  36  */
  37         pushl $0
  38         popfl
  39 /*
  40  * Clear BSS
  41  */
  42         xorl %eax,%eax
  43         movl $__edata,%edi
  44         movl $__end,%ecx
  45         subl %edi,%ecx
  46         cld
  47         rep
  48         stosb
  49 /*
  50  * Do the decompression, and jump to the new kernel..
  51  */
  52         call _decompress_kernel
  53         ljmp $KERNEL_CS, $0x100000

/* [previous][next][first][last][top][bottom][index][help] */