Update all prefixes currently referring to _load_size to include a
authorMichael Brown <mcb30@etherboot.org>
Mon, 16 Jul 2007 16:17:26 +0000 (17:17 +0100)
committerMichael Brown <mcb30@etherboot.org>
Mon, 16 Jul 2007 16:17:26 +0000 (17:17 +0100)
compressor fixup section.

src/arch/i386/prefix/dskprefix.S
src/arch/i386/prefix/hdprefix.S
src/arch/i386/prefix/lkrnprefix.S
src/arch/i386/prefix/nbiprefix.S
src/arch/i386/prefix/romprefix.S
src/arch/i386/scripts/i386.lds

index 1a48716..cdc43b3 100644 (file)
@@ -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: 
index 99bb541..56fcb36 100644 (file)
@@ -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
index 0857f32..a3774d1 100644 (file)
@@ -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.
index 79595a2..d4904b7 100644 (file)
@@ -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
  *****************************************************************************
index 68123f0..593b5d8 100644 (file)
@@ -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
index 511353c..8cc715d 100644 (file)
@@ -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 );
 }