root / pc-bios / bios.diff @ ee6c0b51
History | View | Annotate | Download (8.5 kB)
1 | a1e75473 | bellard | Index: apmbios.S
|
---|---|---|---|
2 | a1e75473 | bellard | ===================================================================
|
3 | a1e75473 | bellard | RCS file: /cvsroot/bochs/bochs/bios/apmbios.S,v
|
4 | a1e75473 | bellard | retrieving revision 1.4
|
5 | a1e75473 | bellard | diff -u -w -r1.4 apmbios.S
|
6 | a1e75473 | bellard | --- apmbios.S 26 Dec 2005 10:35:51 -0000 1.4
|
7 | 10765455 | bellard | +++ apmbios.S 3 May 2006 21:22:46 -0000
|
8 | a1e75473 | bellard | @@ -225,6 +225,7 @@
|
9 | a1e75473 | bellard | APMSYM(05): |
10 | a1e75473 | bellard | cmp al, #0x05 |
11 | a1e75473 | bellard | jne APMSYM(07) |
12 | a1e75473 | bellard | + sti
|
13 | a1e75473 | bellard | hlt |
14 | a1e75473 | bellard | jmp APMSYM(ok) |
15 | a1e75473 | bellard | |
16 | 3f433d2c | bellard | Index: rombios.c
|
17 | 3f433d2c | bellard | ===================================================================
|
18 | 3f433d2c | bellard | RCS file: /cvsroot/bochs/bochs/bios/rombios.c,v
|
19 | 307b0c24 | bellard | retrieving revision 1.160
|
20 | 307b0c24 | bellard | diff -u -w -r1.160 rombios.c
|
21 | 307b0c24 | bellard | --- rombios.c 25 Jan 2006 17:51:49 -0000 1.160
|
22 | 10765455 | bellard | +++ rombios.c 3 May 2006 21:22:48 -0000
|
23 | 307b0c24 | bellard | @@ -1816,6 +1816,7 @@
|
24 | 307b0c24 | bellard | { |
25 | 307b0c24 | bellard | printf(BX_APPNAME" BIOS - build: %s\n%s\nOptions: ",
|
26 | 307b0c24 | bellard | BIOS_BUILD_DATE, bios_cvs_version_string); |
27 | 307b0c24 | bellard | +#if 0
|
28 | 307b0c24 | bellard | printf( |
29 | 307b0c24 | bellard | #ifdef BX_APM
|
30 | 307b0c24 | bellard | "apmbios "
|
31 | 307b0c24 | bellard | @@ -1827,6 +1828,9 @@
|
32 | 307b0c24 | bellard | "eltorito "
|
33 | 307b0c24 | bellard | #endif
|
34 | 307b0c24 | bellard | "\n\n");
|
35 | 307b0c24 | bellard | +#else
|
36 | 307b0c24 | bellard | + printf("apmbios pcibios eltorito \n\n");
|
37 | 307b0c24 | bellard | +#endif
|
38 | 307b0c24 | bellard | } |
39 | a5ba1ca6 | bellard | |
40 | 307b0c24 | bellard | //--------------------------------------------------------------------------
|
41 | 10765455 | bellard | @@ -3999,6 +4003,29 @@
|
42 | 10765455 | bellard | } |
43 | 10765455 | bellard | #endif
|
44 | 10765455 | bellard | |
45 | 10765455 | bellard | +
|
46 | 10765455 | bellard | +void set_e820_range(ES, DI, start, end, type)
|
47 | 10765455 | bellard | + Bit16u ES;
|
48 | 10765455 | bellard | + Bit16u DI;
|
49 | 10765455 | bellard | + Bit32u start;
|
50 | 10765455 | bellard | + Bit32u end;
|
51 | 10765455 | bellard | + Bit16u type;
|
52 | 10765455 | bellard | +{
|
53 | 10765455 | bellard | + write_word(ES, DI, start);
|
54 | 10765455 | bellard | + write_word(ES, DI+2, start >> 16);
|
55 | 10765455 | bellard | + write_word(ES, DI+4, 0x00);
|
56 | 10765455 | bellard | + write_word(ES, DI+6, 0x00);
|
57 | 10765455 | bellard | +
|
58 | 10765455 | bellard | + end -= start;
|
59 | 10765455 | bellard | + write_word(ES, DI+8, end);
|
60 | 10765455 | bellard | + write_word(ES, DI+10, end >> 16);
|
61 | 10765455 | bellard | + write_word(ES, DI+12, 0x0000);
|
62 | 10765455 | bellard | + write_word(ES, DI+14, 0x0000);
|
63 | 10765455 | bellard | +
|
64 | 10765455 | bellard | + write_word(ES, DI+16, type);
|
65 | 10765455 | bellard | + write_word(ES, DI+18, 0x0);
|
66 | 10765455 | bellard | +}
|
67 | 10765455 | bellard | +
|
68 | 10765455 | bellard | void
|
69 | 10765455 | bellard | int15_function32(regs, ES, DS, FLAGS) |
70 | 10765455 | bellard | pushad_regs_t regs; // REGS pushed via pushad
|
71 | 10765455 | bellard | @@ -4063,19 +4090,8 @@
|
72 | 10765455 | bellard | switch(regs.u.r16.bx)
|
73 | 10765455 | bellard | { |
74 | 10765455 | bellard | case 0: |
75 | 10765455 | bellard | - write_word(ES, regs.u.r16.di, 0x00);
|
76 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+2, 0x00);
|
77 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+4, 0x00);
|
78 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+6, 0x00);
|
79 | 10765455 | bellard | -
|
80 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+8, 0xFC00);
|
81 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+10, 0x0009);
|
82 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+12, 0x0000);
|
83 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+14, 0x0000);
|
84 | 10765455 | bellard | -
|
85 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+16, 0x1);
|
86 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+18, 0x0);
|
87 | 10765455 | bellard | -
|
88 | 10765455 | bellard | + set_e820_range(ES, regs.u.r16.di,
|
89 | 10765455 | bellard | + 0x0000000L, 0x0009fc00L, 1);
|
90 | 10765455 | bellard | regs.u.r32.ebx = 1;
|
91 | 10765455 | bellard | regs.u.r32.eax = 0x534D4150;
|
92 | 10765455 | bellard | regs.u.r32.ecx = 0x14;
|
93 | 10765455 | bellard | @@ -4083,6 +4099,24 @@
|
94 | 10765455 | bellard | return;
|
95 | 10765455 | bellard | break;
|
96 | 10765455 | bellard | case 1: |
97 | 10765455 | bellard | + set_e820_range(ES, regs.u.r16.di,
|
98 | 10765455 | bellard | + 0x0009fc00L, 0x000a0000L, 2);
|
99 | 10765455 | bellard | + regs.u.r32.ebx = 2;
|
100 | 10765455 | bellard | + regs.u.r32.eax = 0x534D4150;
|
101 | 10765455 | bellard | + regs.u.r32.ecx = 0x14;
|
102 | 10765455 | bellard | + CLEAR_CF();
|
103 | 10765455 | bellard | + return;
|
104 | 10765455 | bellard | + break;
|
105 | 10765455 | bellard | + case 2:
|
106 | 10765455 | bellard | + set_e820_range(ES, regs.u.r16.di,
|
107 | 10765455 | bellard | + 0x000e8000L, 0x00100000L, 2);
|
108 | 10765455 | bellard | + regs.u.r32.ebx = 3;
|
109 | 10765455 | bellard | + regs.u.r32.eax = 0x534D4150;
|
110 | 10765455 | bellard | + regs.u.r32.ecx = 0x14;
|
111 | 10765455 | bellard | + CLEAR_CF();
|
112 | 10765455 | bellard | + return;
|
113 | 10765455 | bellard | + break;
|
114 | 10765455 | bellard | + case 3:
|
115 | 10765455 | bellard | extended_memory_size = inb_cmos(0x35);
|
116 | 10765455 | bellard | extended_memory_size <<= 8;
|
117 | 10765455 | bellard | extended_memory_size |= inb_cmos(0x34);
|
118 | 10765455 | bellard | @@ -4092,9 +4126,9 @@
|
119 | 10765455 | bellard | extended_memory_size = 0x3bc000; // everything after this is reserved memory until we get to 0x100000000 |
120 | 10765455 | bellard | } |
121 | 10765455 | bellard | extended_memory_size *= 1024;
|
122 | 10765455 | bellard | - extended_memory_size += 15728640; // make up for the 16mb of memory that is chopped off
|
123 | 10765455 | bellard | + extended_memory_size += (16L * 1024 * 1024);
|
124 | 10765455 | bellard | |
125 | 10765455 | bellard | - if(extended_memory_size <= 15728640)
|
126 | 10765455 | bellard | + if(extended_memory_size <= (16L * 1024 * 1024))
|
127 | 10765455 | bellard | { |
128 | 10765455 | bellard | extended_memory_size = inb_cmos(0x31);
|
129 | 10765455 | bellard | extended_memory_size <<= 8;
|
130 | 10765455 | bellard | @@ -4102,28 +4136,23 @@
|
131 | 10765455 | bellard | extended_memory_size *= 1024;
|
132 | 10765455 | bellard | } |
133 | 10765455 | bellard | |
134 | 10765455 | bellard | - write_word(ES, regs.u.r16.di, 0x0000);
|
135 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+2, 0x0010);
|
136 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+4, 0x0000);
|
137 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+6, 0x0000);
|
138 | 10765455 | bellard | -
|
139 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+8, extended_memory_size);
|
140 | 10765455 | bellard | - extended_memory_size >>= 16;
|
141 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+10, extended_memory_size);
|
142 | 10765455 | bellard | - extended_memory_size >>= 16;
|
143 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+12, extended_memory_size);
|
144 | 10765455 | bellard | - extended_memory_size >>= 16;
|
145 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+14, extended_memory_size);
|
146 | 10765455 | bellard | -
|
147 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+16, 0x1);
|
148 | 10765455 | bellard | - write_word(ES, regs.u.r16.di+18, 0x0);
|
149 | 10765455 | bellard | -
|
150 | 10765455 | bellard | - regs.u.r32.ebx = 0;
|
151 | 10765455 | bellard | + set_e820_range(ES, regs.u.r16.di,
|
152 | 10765455 | bellard | + 0x00100000L, extended_memory_size, 1);
|
153 | 10765455 | bellard | + regs.u.r32.ebx = 4;
|
154 | 10765455 | bellard | regs.u.r32.eax = 0x534D4150;
|
155 | 10765455 | bellard | regs.u.r32.ecx = 0x14;
|
156 | 10765455 | bellard | CLEAR_CF(); |
157 | 10765455 | bellard | return;
|
158 | 10765455 | bellard | break;
|
159 | 10765455 | bellard | + case 4:
|
160 | 10765455 | bellard | + /* 256KB BIOS area at the end of 4 GB */
|
161 | 10765455 | bellard | + set_e820_range(ES, regs.u.r16.di,
|
162 | 10765455 | bellard | + 0xfffc0000L, 0x00000000L, 2);
|
163 | 10765455 | bellard | + regs.u.r32.ebx = 0;
|
164 | 10765455 | bellard | + regs.u.r32.eax = 0x534D4150;
|
165 | 10765455 | bellard | + regs.u.r32.ecx = 0x14;
|
166 | 10765455 | bellard | + CLEAR_CF();
|
167 | 10765455 | bellard | + return;
|
168 | 10765455 | bellard | default: /* AX=E820, DX=534D4150, BX unrecognized */ |
169 | 10765455 | bellard | goto int15_unimplemented;
|
170 | 10765455 | bellard | break;
|
171 | 10765455 | bellard | @@ -8713,6 +8742,7 @@
|
172 | e0b3073f | bellard | mov al, #0x80
|
173 | e0b3073f | bellard | bios32_end:
|
174 | e0b3073f | bellard | popf |
175 | e0b3073f | bellard | + and dword ptr[esp+4],0xfffffffc ;; reset CS.RPL for kqemu
|
176 | e0b3073f | bellard | retf |
177 | e0b3073f | bellard | |
178 | e0b3073f | bellard | .align 16
|
179 | 10765455 | bellard | @@ -8823,17 +8853,17 @@
|
180 | e0b3073f | bellard | pci_pro_fail:
|
181 | e0b3073f | bellard | pop edi |
182 | e0b3073f | bellard | pop esi |
183 | e0b3073f | bellard | - sti
|
184 | e0b3073f | bellard | popf |
185 | e0b3073f | bellard | stc |
186 | e0b3073f | bellard | + and dword ptr[esp+4],0xfffffffc ;; reset CS.RPL for kqemu
|
187 | e0b3073f | bellard | retf |
188 | e0b3073f | bellard | pci_pro_ok:
|
189 | e0b3073f | bellard | xor ah, ah |
190 | e0b3073f | bellard | pop edi |
191 | e0b3073f | bellard | pop esi |
192 | e0b3073f | bellard | - sti
|
193 | e0b3073f | bellard | popf |
194 | e0b3073f | bellard | clc |
195 | e0b3073f | bellard | + and dword ptr[esp+4],0xfffffffc ;; reset CS.RPL for kqemu
|
196 | e0b3073f | bellard | retf |
197 | e0b3073f | bellard | |
198 | e0b3073f | bellard | pci_pro_select_reg:
|
199 | 10765455 | bellard | @@ -8971,7 +9001,7 @@
|
200 | 307b0c24 | bellard | jmp pci_real_ok |
201 | 307b0c24 | bellard | pci_real_f0d: ;; write configuration dword
|
202 | 307b0c24 | bellard | cmp al, #0x0d
|
203 | 307b0c24 | bellard | - jne pci_real_unknown
|
204 | 307b0c24 | bellard | + jne pci_real_f0e
|
205 | 307b0c24 | bellard | call pci_real_select_reg |
206 | 307b0c24 | bellard | push dx |
207 | 307b0c24 | bellard | mov dx, #0x0cfc
|
208 | 10765455 | bellard | @@ -8979,6 +9009,46 @@
|
209 | 307b0c24 | bellard | out dx, eax |
210 | 307b0c24 | bellard | pop dx |
211 | 307b0c24 | bellard | jmp pci_real_ok |
212 | 307b0c24 | bellard | +pci_real_f0e: ;; get irq routing options
|
213 | 307b0c24 | bellard | + cmp al, #0x0e
|
214 | 307b0c24 | bellard | + jne pci_real_unknown
|
215 | 307b0c24 | bellard | + SEG ES
|
216 | 307b0c24 | bellard | + cmp word ptr [di], #pci_routing_table_structure_end - pci_routing_table_structure_start
|
217 | 307b0c24 | bellard | + jb pci_real_too_small
|
218 | 307b0c24 | bellard | + SEG ES
|
219 | 307b0c24 | bellard | + mov word ptr [di], #pci_routing_table_structure_end - pci_routing_table_structure_start
|
220 | 307b0c24 | bellard | + pushf
|
221 | 307b0c24 | bellard | + push ds
|
222 | 307b0c24 | bellard | + push es
|
223 | 307b0c24 | bellard | + push cx
|
224 | 307b0c24 | bellard | + push si
|
225 | 307b0c24 | bellard | + push di
|
226 | 307b0c24 | bellard | + cld
|
227 | 307b0c24 | bellard | + mov si, #pci_routing_table_structure_start
|
228 | 307b0c24 | bellard | + push cs
|
229 | 307b0c24 | bellard | + pop ds
|
230 | 307b0c24 | bellard | + SEG ES
|
231 | 307b0c24 | bellard | + mov cx, [di+2]
|
232 | 307b0c24 | bellard | + SEG ES
|
233 | 307b0c24 | bellard | + mov es, [di+4]
|
234 | 307b0c24 | bellard | + mov di, cx
|
235 | 307b0c24 | bellard | + mov cx, #pci_routing_table_structure_end - pci_routing_table_structure_start
|
236 | 307b0c24 | bellard | + rep
|
237 | 307b0c24 | bellard | + movsb
|
238 | 307b0c24 | bellard | + pop di
|
239 | 307b0c24 | bellard | + pop si
|
240 | 307b0c24 | bellard | + pop cx
|
241 | 307b0c24 | bellard | + pop es
|
242 | 307b0c24 | bellard | + pop ds
|
243 | 307b0c24 | bellard | + popf
|
244 | 307b0c24 | bellard | + mov bx, #(1 << 9) | (1 << 11) ;; irq 9 and 11 are used
|
245 | 307b0c24 | bellard | + jmp pci_real_ok
|
246 | 307b0c24 | bellard | +pci_real_too_small:
|
247 | 307b0c24 | bellard | + SEG ES
|
248 | 307b0c24 | bellard | + mov word ptr [di], #pci_routing_table_structure_end - pci_routing_table_structure_start
|
249 | 307b0c24 | bellard | + mov ah, #0x89
|
250 | 307b0c24 | bellard | + jmp pci_real_fail
|
251 | a5ba1ca6 | bellard | +
|
252 | 307b0c24 | bellard | pci_real_unknown:
|
253 | 307b0c24 | bellard | mov ah, #0x81
|
254 | 307b0c24 | bellard | pci_real_fail:
|
255 | 10765455 | bellard | @@ -9019,6 +9089,7 @@
|
256 | 307b0c24 | bellard | dw 0,0 ;; Miniport data |
257 | 307b0c24 | bellard | db 0,0,0,0,0,0,0,0,0,0,0 ;; reserved |
258 | 307b0c24 | bellard | db 0x07 ;; checksum
|
259 | 307b0c24 | bellard | +pci_routing_table_structure_start:
|
260 | 307b0c24 | bellard | ;; first slot entry PCI-to-ISA (embedded) |
261 | 307b0c24 | bellard | db 0 ;; pci bus number
|
262 | 307b0c24 | bellard | db 0x08 ;; pci device number (bit 7-3) |
263 | 10765455 | bellard | @@ -9097,6 +9168,7 @@
|
264 | 307b0c24 | bellard | dw 0xdef8 ;; IRQ bitmap INTD# |
265 | 307b0c24 | bellard | db 5 ;; physical slot (0 = embedded) |
266 | 307b0c24 | bellard | db 0 ;; reserved
|
267 | 307b0c24 | bellard | +pci_routing_table_structure_end:
|
268 | fb9f9444 | bellard | |
269 | 307b0c24 | bellard | pci_irq_list:
|
270 | 307b0c24 | bellard | db 11, 10, 9, 5; |