diff options
author | Michael Brown | 2007-07-16 18:17:26 +0200 |
---|---|---|
committer | Michael Brown | 2007-07-16 18:17:26 +0200 |
commit | 84551d485e8cec0cfa5388e6a540e79c6029443d (patch) | |
tree | 598b017e3643403441e90fe788135d3c43c559a5 /src/arch/i386 | |
parent | Rename _rom_size to _load_size_sect, since hdprefix.S also uses it. (diff) | |
download | ipxe-84551d485e8cec0cfa5388e6a540e79c6029443d.tar.gz ipxe-84551d485e8cec0cfa5388e6a540e79c6029443d.tar.xz ipxe-84551d485e8cec0cfa5388e6a540e79c6029443d.zip |
Update all prefixes currently referring to _load_size to include a
compressor fixup section.
Diffstat (limited to 'src/arch/i386')
-rw-r--r-- | src/arch/i386/prefix/dskprefix.S | 13 | ||||
-rw-r--r-- | src/arch/i386/prefix/hdprefix.S | 12 | ||||
-rw-r--r-- | src/arch/i386/prefix/lkrnprefix.S | 8 | ||||
-rw-r--r-- | src/arch/i386/prefix/nbiprefix.S | 15 | ||||
-rw-r--r-- | src/arch/i386/prefix/romprefix.S | 28 | ||||
-rw-r--r-- | src/arch/i386/scripts/i386.lds | 6 |
6 files changed, 61 insertions, 21 deletions
diff --git a/src/arch/i386/prefix/dskprefix.S b/src/arch/i386/prefix/dskprefix.S index 1a48716a..cdc43b37 100644 --- a/src/arch/i386/prefix/dskprefix.S +++ b/src/arch/i386/prefix/dskprefix.S @@ -1,10 +1,7 @@ /* NOTE: this boot sector contains instructions that need at least an 80186. * Yes, as86 has a bug somewhere in the valid instruction set checks. * - * SYS_SIZE is the number of clicks (16 bytes) to be loaded. */ -.globl SYSSIZE -.equ SYSSIZE, _load_size_pgh /* floppyload.S Copyright (C) 1991, 1992 Linus Torvalds * modified by Drew Eckhardt @@ -147,6 +144,14 @@ got_sectors: /* Jump to loaded copy */ ljmp $SYSSEG, $start_runtime +endseg: .word SYSSEG + _load_size_pgh + .section ".zinfo.fixup", "a" /* Compressor fixup information */ + .ascii "SUBW" + .long endseg + .long 16 + .long 0 + .previous + /* This routine loads the system at address SYSSEG<<4, making sure no 64kB * boundaries are crossed. We try to load it as fast as possible, loading whole * tracks whenever we can. @@ -165,7 +170,7 @@ rp_read: movb $4, %cl shrw %cl,%dx /* bx is always divisible by 16 */ addw %dx,%ax - cmpw $SYSSEG+SYSSIZE, %ax /* have we loaded all yet? */ + cmpw endseg, %ax /* have we loaded all yet? */ jb ok1_read ret ok1_read: diff --git a/src/arch/i386/prefix/hdprefix.S b/src/arch/i386/prefix/hdprefix.S index 99bb541b..56fcb36d 100644 --- a/src/arch/i386/prefix/hdprefix.S +++ b/src/arch/i386/prefix/hdprefix.S @@ -58,12 +58,20 @@ load_image: ja 1b ljmp $BOOT_SEG, $start_image -load_length: - .long _load_size_sect max_sector: .byte 0 max_head: .byte 0 +load_length: + .long _load_size_sect + + .section ".zinfo.fixup", "a" /* Compressor fixup information */ + .ascii "SUBL" + .long load_length + .long 512 + .long 0 + .previous + load_failed: movw $10f, %si diff --git a/src/arch/i386/prefix/lkrnprefix.S b/src/arch/i386/prefix/lkrnprefix.S index 0857f320..a3774d1a 100644 --- a/src/arch/i386/prefix/lkrnprefix.S +++ b/src/arch/i386/prefix/lkrnprefix.S @@ -105,6 +105,14 @@ boot_flag: .org 512 + + .section ".zinfo.fixup", "a" /* Compressor fixup information */ + .ascii "SUBW" + .long syssize + .long 16 + .long 0 + .previous + /* We're now at the beginning of the second sector of the image - where the setup code goes. diff --git a/src/arch/i386/prefix/nbiprefix.S b/src/arch/i386/prefix/nbiprefix.S index 79595a2c..d4904b73 100644 --- a/src/arch/i386/prefix/nbiprefix.S +++ b/src/arch/i386/prefix/nbiprefix.S @@ -32,10 +32,21 @@ segment_header: .byte 0 .byte 0x04 /* Last segment */ .long 0x00007e00 - .long _load_size - 512 - .long _load_size - 512 +imglen: .long _load_size - 512 +memlen: .long _load_size - 512 .size segment_header, . - segment_header + .section ".zinfo.fixup", "a" /* Compressor fixup information */ + .ascii "SUBL" + .long imglen + .long 1 + .long 0 + .ascii "SUBL" + .long memlen + .long 1 + .long 0 + .previous + /***************************************************************************** * NBI entry point ***************************************************************************** diff --git a/src/arch/i386/prefix/romprefix.S b/src/arch/i386/prefix/romprefix.S index 68123f0f..593b5d86 100644 --- a/src/arch/i386/prefix/romprefix.S +++ b/src/arch/i386/prefix/romprefix.S @@ -23,6 +23,13 @@ romheader_size: .byte _load_size_sect /* Size in 512-byte blocks */ .org 0x1a .word pnpheader .size romheader, . - romheader + + .section ".zinfo.fixup", "a" /* Compressor fixup information */ + .ascii "SUBB" + .long romheader_size + .long 512 + .long 0 + .previous pciheader: .ascii "PCIR" /* Signature */ @@ -41,6 +48,13 @@ pciheader_size: .word _load_size_sect /* Image length same as offset 02h */ .word 0x0000 /* reserved */ .equ pciheader_len, . - pciheader .size pciheader, . - pciheader + + .section ".zinfo.fixup", "a" /* Compressor fixup information */ + .ascii "SUBW" + .long pciheader_size + .long 512 + .long 0 + .previous pnpheader: .ascii "$PnP" /* Signature */ @@ -124,7 +138,7 @@ notpnp_message: .size notpnp_message, . - notpnp_message /* Boot execution vector - * + *pciheader_size * Called by the PnP BIOS when it wants to boot us, or via the hooked * INT 19 if we detected a non-PnP BIOS. */ @@ -215,15 +229,3 @@ print_message: popw %ax ret .size print_message, . - print_message - - - /* Data update information for the compressor */ - .section ".zinfo.fixup", "a" - .ascii "SUBB" - .long romheader_size - .long 512 - .long 0 - .ascii "SUBW" - .long pciheader_size - .long 512 - .long 0 diff --git a/src/arch/i386/scripts/i386.lds b/src/arch/i386/scripts/i386.lds index 511353ce..8cc715d0 100644 --- a/src/arch/i386/scripts/i386.lds +++ b/src/arch/i386/scripts/i386.lds @@ -269,6 +269,12 @@ SECTIONS { */ _text16_size_pgh = ( ( _text16_size + 15 ) / 16 ); _data16_size_pgh = ( ( _data16_size + 15 ) / 16 ); + + /* + * Load sizes in paragraphs and sectors. Note that wherever the + * _load_size variables are used, there must be a corresponding + * .zinfo.fixup section. + */ _load_size_pgh = ( ( _load_size + 15 ) / 16 ); _load_size_sect = ( ( _load_size + 511 ) / 512 ); } |