home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 15 / boot-disc-1997-11.iso / Debian / Tools / LODLIN16.ZIP / LODLIN16 / SRC / SRCLINUX / LOADLINH.S next >
Text File  |  1996-02-09  |  967b  |  47 lines

  1. /*
  2.  *  loadlinh.S  ( part of page adjustment )
  3.  *
  4.  *  stolen from linux/boot/head.S ( Copyright (C) 1991..1995  Linus Torvalds )
  5.  */
  6.  
  7. .text
  8.  
  9. #define __ASSEMBLY__
  10. #include <linux/config.h>
  11. #include <linux/linkage.h>
  12. #include <asm/segment.h>
  13.  
  14. #define OUR_STACK 0xa0000   /* this stack is top of 640Kb */
  15.  
  16.     .globl startup_32
  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.     mov %ax,%ss
  27.     mov $(OUR_STACK),%esp
  28.     xorl %eax,%eax
  29. 1:    incl %eax        # check that A20 really IS enabled
  30.     movl %eax,0x000000    # loop forever if it isn't
  31.     cmpl %eax,0x100000
  32.     je 1b
  33. /*
  34.  * Initialize eflags.  Some BIOS's leave bits like NT set.  This would
  35.  * confuse the debugger if this code is traced.
  36.  * XXX - best to initialize before switching to protected mode.
  37.  */
  38.     pushl $0
  39.     popfl
  40. /*
  41.  * Do the page adjustment, and jump to the kernel decompressor..
  42.  */
  43.     call SYMBOL_NAME(page_adjustment)
  44.     xorl %ebx,%ebx
  45. #    ljmp $(KERNEL_CS), $0x1000
  46.     jmp  %eax
  47.