fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / x86_64 / boot / setup.S
index fc52ed8..770940c 100644 (file)
@@ -33,7 +33,7 @@
  * Transcribed from Intel (as86) -> AT&T (gas) by Chris Noe, May 1999.
  * <stiker@northlink.com>
  *
- * Fix to work around buggy BIOSes which dont use carry bit correctly
+ * Fix to work around buggy BIOSes which don't use carry bit correctly
  * and/or report extended memory in CX/DX for e801h memory size detection 
  * call.  As a result the kernel got wrong figures.  The int15/e801h docs
  * from Ralf Brown interrupt list seem to indicate AX/BX should be used
@@ -45,9 +45,8 @@
  * Added long mode checking and SSE force. March 2003, Andi Kleen.             
  */
 
-#include <linux/config.h>
 #include <asm/segment.h>
-#include <linux/version.h>
+#include <linux/utsrelease.h>
 #include <linux/compile.h>
 #include <asm/boot.h>
 #include <asm/e820.h>
@@ -81,7 +80,7 @@ start:
 # This is the setup header, and it must start at %cs:2 (old 0x9020:2)
 
                .ascii  "HdrS"          # header signature
-               .word   0x0203          # header version number (>= 0x0105)
+               .word   0x0204          # header version number (>= 0x0105)
                                        # or else old loadlin-1.5 will fail)
 realmode_swtch:        .word   0, 0            # default_switch, SETUPSEG
 start_sys_seg: .word   SYSSEG
@@ -158,7 +157,9 @@ cmd_line_ptr:       .long 0                 # (Header version 0x0202 or later)
 ramdisk_max:   .long 0xffffffff
        
 trampoline:    call    start_of_setup
-               .space  1024
+               .align 16
+                                       # The offset at this point is 0x240
+               .space  (0xeff-0x240+1) # E820 & EDD space (ending at 0xeff)
 # End of setup header #####################################################
 
 start_of_setup:
@@ -381,7 +382,7 @@ sse_ok:
 # a whole bunch of different types, and allows memory holes and
 # everything.  We scan through this memory map and build a list
 # of the first 32 memory areas, which we return at [E820MAP].
-# This is documented at http://www.teleport.com/~acpi/acpihtml/topic245.htm
+# This is documented at http://www.acpi.info/, in the ACPI 2.0 specification.
 
 #define SMAP  0x534d4150
 
@@ -410,9 +411,9 @@ jmpe820:
        # sizeof(e820rec).
        #
 good820:
-       movb    (E820NR), %al                   # up to 32 entries
+       movb    (E820NR), %al                   # up to 128 entries
        cmpb    $E820MAX, %al
-       jnl     bail820
+       jae     bail820
 
        incb    (E820NR)
        movw    %di, %ax
@@ -434,7 +435,7 @@ bail820:
 
 meme801:
        stc                                     # fix to work around buggy
-       xorw    %cx,%cx                         # BIOSes which dont clear/set
+       xorw    %cx,%cx                         # BIOSes which don't clear/set
        xorw    %dx,%dx                         # carry on pass/error of
                                                # e801h memory size call
                                                # or merely pass cx,dx though
@@ -525,12 +526,12 @@ is_disk1:
        movw    %cs, %ax                        # aka SETUPSEG
        subw    $DELTA_INITSEG, %ax             # aka INITSEG
        movw    %ax, %ds
-       movw    $0, (0x1ff)                     # default is no pointing device
+       movb    $0, (0x1ff)                     # default is no pointing device
        int     $0x11                           # int 0x11: equipment list
        testb   $0x04, %al                      # check if mouse installed
        jz      no_psmouse
 
-       movw    $0xAA, (0x1ff)                  # device present
+       movb    $0xAA, (0x1ff)                  # device present
 no_psmouse:
 
 #include "../../i386/boot/edd.S"
@@ -731,7 +732,7 @@ flush_instr:
 #
 #      but we yet haven't reloaded the CS register, so the default size 
 #      of the target offset still is 16 bit.
-#       However, using an operant prefix (0x66), the CPU will properly
+#      However, using an operand prefix (0x66), the CPU will properly
 #      take our 48 bit far pointer. (INTeL 80386 Programmer's Reference
 #      Manual, Mixing 16-bit and 32-bit code, page 16-6)
 
@@ -835,13 +836,12 @@ gdt:
        .word   0x9200                          # data read/write
        .word   0x00CF                          # granularity = 4096, 386
                                                #  (+5th nibble of limit)
+gdt_end:
 idt_48:
        .word   0                               # idt limit = 0
        .word   0, 0                            # idt base = 0L
 gdt_48:
-       .word   0x8000                          # gdt limit=2048,
-                                               #  256 GDT entries
-
+       .word   gdt_end-gdt-1                   # gdt limit
        .word   0, 0                            # gdt base (filled in later)
 
 # Include video setup & detection code