Navigation Menu

Skip to content

Commit

Permalink
Update all prefixes currently referring to _load_size to include a
Browse files Browse the repository at this point in the history
compressor fixup section.
  • Loading branch information
Michael Brown committed Jul 16, 2007
1 parent 0929142 commit 84551d4
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 21 deletions.
13 changes: 9 additions & 4 deletions 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
Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand Down
12 changes: 10 additions & 2 deletions src/arch/i386/prefix/hdprefix.S
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/arch/i386/prefix/lkrnprefix.S
Expand Up @@ -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.
Expand Down
15 changes: 13 additions & 2 deletions src/arch/i386/prefix/nbiprefix.S
Expand Up @@ -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
*****************************************************************************
Expand Down
28 changes: 15 additions & 13 deletions src/arch/i386/prefix/romprefix.S
Expand Up @@ -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 */
Expand All @@ -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 */
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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
6 changes: 6 additions & 0 deletions src/arch/i386/scripts/i386.lds
Expand Up @@ -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 );
}

0 comments on commit 84551d4

Please sign in to comment.