Browse Source

Update all prefixes currently referring to _load_size to include a

compressor fixup section.
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
84551d485e

+ 9
- 4
src/arch/i386/prefix/dskprefix.S View File

@@ -1,10 +1,7 @@
1 1
 /* NOTE: this boot sector contains instructions that need at least an 80186.
2 2
  * Yes, as86 has a bug somewhere in the valid instruction set checks.
3 3
  *
4
- * SYS_SIZE is the number of clicks (16 bytes) to be loaded.
5 4
  */
6
-.globl	SYSSIZE
7
-.equ	SYSSIZE, _load_size_pgh
8 5
 
9 6
 /*	floppyload.S Copyright (C) 1991, 1992 Linus Torvalds
10 7
  *	modified by Drew Eckhardt
@@ -147,6 +144,14 @@ got_sectors:
147 144
 	/* Jump to loaded copy */
148 145
 	ljmp	$SYSSEG, $start_runtime
149 146
 
147
+endseg:	.word SYSSEG + _load_size_pgh
148
+	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
149
+	.ascii	"SUBW"
150
+	.long	endseg
151
+	.long	16
152
+	.long	0
153
+	.previous
154
+
150 155
 /* This routine loads the system at address SYSSEG<<4, making sure no 64kB
151 156
  * boundaries are crossed. We try to load it as fast as possible, loading whole
152 157
  * tracks whenever we can.
@@ -165,7 +170,7 @@ rp_read:
165 170
 	movb	$4, %cl
166 171
 	shrw	%cl,%dx			/* bx is always divisible by 16 */
167 172
 	addw	%dx,%ax
168
-	cmpw	$SYSSEG+SYSSIZE, %ax	/* have we loaded all yet? */
173
+	cmpw	endseg, %ax	/* have we loaded all yet? */
169 174
 	jb	ok1_read
170 175
 	ret
171 176
 ok1_read: 

+ 10
- 2
src/arch/i386/prefix/hdprefix.S View File

@@ -58,12 +58,20 @@ load_image:
58 58
 	ja	1b
59 59
 	ljmp	$BOOT_SEG, $start_image
60 60
 
61
-load_length:
62
-	.long	_load_size_sect
63 61
 max_sector:
64 62
 	.byte	0
65 63
 max_head:
66 64
 	.byte	0
65
+load_length:
66
+	.long	_load_size_sect
67
+	
68
+	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
69
+	.ascii	"SUBL"
70
+	.long	load_length
71
+	.long	512
72
+	.long	0
73
+	.previous
74
+
67 75
 
68 76
 load_failed:
69 77
 	movw	$10f, %si

+ 8
- 0
src/arch/i386/prefix/lkrnprefix.S View File

@@ -105,6 +105,14 @@ boot_flag:
105 105
 
106 106
 
107 107
 	.org	512
108
+
109
+	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
110
+	.ascii	"SUBW"
111
+	.long	syssize
112
+	.long	16
113
+	.long	0
114
+	.previous
115
+	
108 116
 /*
109 117
 	We're now at the beginning of the second sector of the image -
110 118
 	where the setup code goes.

+ 13
- 2
src/arch/i386/prefix/nbiprefix.S View File

@@ -32,10 +32,21 @@ segment_header:
32 32
 	.byte	0
33 33
 	.byte	0x04		/* Last segment */
34 34
 	.long	0x00007e00
35
-	.long	_load_size - 512
36
-	.long	_load_size - 512
35
+imglen:	.long	_load_size - 512
36
+memlen:	.long	_load_size - 512
37 37
 	.size	segment_header, . - segment_header
38 38
 
39
+	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
40
+	.ascii	"SUBL"
41
+	.long	imglen
42
+	.long	1
43
+	.long	0
44
+	.ascii	"SUBL"
45
+	.long	memlen
46
+	.long	1
47
+	.long	0
48
+	.previous
49
+
39 50
 /*****************************************************************************
40 51
  * NBI entry point
41 52
  *****************************************************************************

+ 15
- 13
src/arch/i386/prefix/romprefix.S View File

@@ -23,6 +23,13 @@ romheader_size:	.byte _load_size_sect	/* Size in 512-byte blocks */
23 23
 	.org	0x1a
24 24
 	.word	pnpheader
25 25
 	.size romheader, . - romheader
26
+	
27
+	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
28
+	.ascii	"SUBB"
29
+	.long	romheader_size
30
+	.long	512
31
+	.long	0
32
+	.previous
26 33
 
27 34
 pciheader:
28 35
 	.ascii	"PCIR"			/* Signature */
@@ -41,6 +48,13 @@ pciheader_size:	.word _load_size_sect	/* Image length same as offset 02h */
41 48
 	.word	0x0000			/* reserved */
42 49
 	.equ pciheader_len, . - pciheader
43 50
 	.size pciheader, . - pciheader
51
+	
52
+	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
53
+	.ascii	"SUBW"
54
+	.long	pciheader_size
55
+	.long	512
56
+	.long	0
57
+	.previous
44 58
 
45 59
 pnpheader:
46 60
 	.ascii	"$PnP"			/* Signature */
@@ -124,7 +138,7 @@ notpnp_message:
124 138
 	.size notpnp_message, . - notpnp_message
125 139
 
126 140
 /* Boot execution vector
127
- *
141
+ *pciheader_size
128 142
  * Called by the PnP BIOS when it wants to boot us, or via the hooked
129 143
  * INT 19 if we detected a non-PnP BIOS.
130 144
  */	
@@ -215,15 +229,3 @@ print_message:
215 229
 	popw	%ax
216 230
 	ret
217 231
 	.size print_message, . - print_message
218
-
219
-
220
-	/* Data update information for the compressor */
221
-	.section ".zinfo.fixup", "a"
222
-	.ascii	"SUBB"
223
-	.long	romheader_size
224
-	.long	512
225
-	.long	0
226
-	.ascii	"SUBW"
227
-	.long	pciheader_size
228
-	.long	512
229
-	.long	0

+ 6
- 0
src/arch/i386/scripts/i386.lds View File

@@ -269,6 +269,12 @@ SECTIONS {
269 269
      */
270 270
     _text16_size_pgh	= ( ( _text16_size + 15 ) / 16 );
271 271
     _data16_size_pgh	= ( ( _data16_size + 15 ) / 16 );
272
+
273
+    /*
274
+     * Load sizes in paragraphs and sectors.  Note that wherever the
275
+     * _load_size variables are used, there must be a corresponding
276
+     * .zinfo.fixup section.
277
+     */
272 278
     _load_size_pgh	= ( ( _load_size + 15 ) / 16 );
273 279
     _load_size_sect	= ( ( _load_size + 511 ) / 512 );
274 280
 }

Loading…
Cancel
Save