X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fx86_64%2Fboot%2Fsetup.S;h=12ea0b6c52e2a8b48cea525ec530d49b8c1d97a5;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=48479ec1ad365401062d931e5e911368e7e63bb2;hpb=daddc0d38b3571bed170afa273a49a0eba090c1e;p=linux-2.6.git diff --git a/arch/x86_64/boot/setup.S b/arch/x86_64/boot/setup.S index 48479ec1a..12ea0b6c5 100644 --- a/arch/x86_64/boot/setup.S +++ b/arch/x86_64/boot/setup.S @@ -33,7 +33,7 @@ * Transcribed from Intel (as86) -> AT&T (gas) by Chris Noe, May 1999. * * - * 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 @@ -81,7 +81,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 @@ -132,7 +132,7 @@ ramdisk_image: .long 0 # address of loaded ramdisk image ramdisk_size: .long 0 # its size in bytes bootsect_kludge: - .word bootsect_helper, SETUPSEG + .long 0 # obsolete heap_end_ptr: .word modelist+1024 # (Header version 0x0201 or later) # space from here (exclusive) down to @@ -158,7 +158,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 +383,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 +412,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 +436,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 @@ -731,7 +733,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) @@ -759,87 +761,6 @@ default_switch: outb %al, $0x70 lret -# This routine only gets called, if we get loaded by the simple -# bootsect loader _and_ have a bzImage to load. -# Because there is no place left in the 512 bytes of the boot sector, -# we must emigrate to code space here. -bootsect_helper: - cmpw $0, %cs:bootsect_es - jnz bootsect_second - - movb $0x20, %cs:type_of_loader - movw %es, %ax - shrw $4, %ax - movb %ah, %cs:bootsect_src_base+2 - movw %es, %ax - movw %ax, %cs:bootsect_es - subw $SYSSEG, %ax - lret # nothing else to do for now - -bootsect_second: - pushw %cx - pushw %si - pushw %bx - testw %bx, %bx # 64K full? - jne bootsect_ex - - movw $0x8000, %cx # full 64K, INT15 moves words - pushw %cs - popw %es - movw $bootsect_gdt, %si - movw $0x8700, %ax - int $0x15 - jc bootsect_panic # this, if INT15 fails - - movw %cs:bootsect_es, %es # we reset %es to always point - incb %cs:bootsect_dst_base+2 # to 0x10000 -bootsect_ex: - movb %cs:bootsect_dst_base+2, %ah - shlb $4, %ah # we now have the number of - # moved frames in %ax - xorb %al, %al - popw %bx - popw %si - popw %cx - lret - -bootsect_gdt: - .word 0, 0, 0, 0 - .word 0, 0, 0, 0 - -bootsect_src: - .word 0xffff - -bootsect_src_base: - .byte 0x00, 0x00, 0x01 # base = 0x010000 - .byte 0x93 # typbyte - .word 0 # limit16,base24 =0 - -bootsect_dst: - .word 0xffff - -bootsect_dst_base: - .byte 0x00, 0x00, 0x10 # base = 0x100000 - .byte 0x93 # typbyte - .word 0 # limit16,base24 =0 - .word 0, 0, 0, 0 # BIOS CS - .word 0, 0, 0, 0 # BIOS DS - -bootsect_es: - .word 0 - -bootsect_panic: - pushw %cs - popw %ds - cld - leaw bootsect_panic_mess, %si - call prtstr - -bootsect_panic_loop: - jmp bootsect_panic_loop - -bootsect_panic_mess: - .string "INT15 refuses to access high mem, giving up." # This routine checks that the keyboard command queue is empty # (after emptying the output buffers)