1 diff -ruN --exclude Makefile bios/acpi-dsdt.dsl bios.new/acpi-dsdt.dsl
2 --- bios/acpi-dsdt.dsl 1970-01-01 01:00:00.000000000 +0100
3 +++ bios.new/acpi-dsdt.dsl 2006-09-24 20:27:54.000000000 +0200
6 + * QEMU ACPI DSDT ASL definition
8 + * Copyright (c) 2006 Fabrice Bellard
10 + * This library is free software; you can redistribute it and/or
11 + * modify it under the terms of the GNU Lesser General Public
12 + * License version 2 as published by the Free Software Foundation.
14 + * This library is distributed in the hope that it will be useful,
15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 + * Lesser General Public License for more details.
19 + * You should have received a copy of the GNU Lesser General Public
20 + * License along with this library; if not, write to the Free Software
21 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 + "acpi-dsdt.aml", // Output Filename
25 + "DSDT", // Signature
26 + 0x01, // DSDT Compliance Revision
28 + "QEMUDSDT", // TABLE ID
34 + /* CMOS memory access */
35 + OperationRegion (CMS, SystemIO, 0x70, 0x02)
36 + Field (CMS, ByteAcc, NoLock, Preserve)
41 + Method (CMRD, 1, NotSerialized)
44 + Store (CMSD, Local0)
49 + OperationRegion (DBG, SystemIO, 0xb044, 0x04)
50 + Field (DBG, DWordAcc, NoLock, Preserve)
57 + /* PCI Bus definition */
60 + Name (_HID, EisaId ("PNP0A03"))
63 + Name(_PRT, Package() {
64 + /* PCI IRQ routing table, example from ACPI 2.0a specification,
66 + /* Note: we provide the same info as the PCI routing
67 + table of the Bochs BIOS */
70 + Package() {0x0000ffff, 0, LNKD, 0},
71 + Package() {0x0000ffff, 1, LNKA, 0},
72 + Package() {0x0000ffff, 2, LNKB, 0},
73 + Package() {0x0000ffff, 3, LNKC, 0},
76 + Package() {0x0001ffff, 0, LNKA, 0},
77 + Package() {0x0001ffff, 1, LNKB, 0},
78 + Package() {0x0001ffff, 2, LNKC, 0},
79 + Package() {0x0001ffff, 3, LNKD, 0},
82 + Package() {0x0002ffff, 0, LNKB, 0},
83 + Package() {0x0002ffff, 1, LNKC, 0},
84 + Package() {0x0002ffff, 2, LNKD, 0},
85 + Package() {0x0002ffff, 3, LNKA, 0},
88 + Package() {0x0003ffff, 0, LNKC, 0},
89 + Package() {0x0003ffff, 1, LNKD, 0},
90 + Package() {0x0003ffff, 2, LNKA, 0},
91 + Package() {0x0003ffff, 3, LNKB, 0},
94 + Package() {0x0004ffff, 0, LNKD, 0},
95 + Package() {0x0004ffff, 1, LNKA, 0},
96 + Package() {0x0004ffff, 2, LNKB, 0},
97 + Package() {0x0004ffff, 3, LNKC, 0},
100 + Package() {0x0005ffff, 0, LNKA, 0},
101 + Package() {0x0005ffff, 1, LNKB, 0},
102 + Package() {0x0005ffff, 2, LNKC, 0},
103 + Package() {0x0005ffff, 3, LNKD, 0},
106 + Method (_CRS, 0, NotSerialized)
108 + Name (MEMP, ResourceTemplate ()
110 + WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
111 + 0x0000, // Address Space Granularity
112 + 0x0000, // Address Range Minimum
113 + 0x00FF, // Address Range Maximum
114 + 0x0000, // Address Translation Offset
115 + 0x0100, // Address Length
118 + 0x0CF8, // Address Range Minimum
119 + 0x0CF8, // Address Range Maximum
120 + 0x01, // Address Alignment
121 + 0x08, // Address Length
123 + WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
124 + 0x0000, // Address Space Granularity
125 + 0x0000, // Address Range Minimum
126 + 0x0CF7, // Address Range Maximum
127 + 0x0000, // Address Translation Offset
128 + 0x0CF8, // Address Length
130 + WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
131 + 0x0000, // Address Space Granularity
132 + 0x0D00, // Address Range Minimum
133 + 0xFFFF, // Address Range Maximum
134 + 0x0000, // Address Translation Offset
135 + 0xF300, // Address Length
137 + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
138 + 0x00000000, // Address Space Granularity
139 + 0x000A0000, // Address Range Minimum
140 + 0x000BFFFF, // Address Range Maximum
141 + 0x00000000, // Address Translation Offset
142 + 0x00020000, // Address Length
143 + ,, , AddressRangeMemory, TypeStatic)
144 + DWordMemory (ResourceProducer, PosDecode, MinNotFixed, MaxFixed, NonCacheable, ReadWrite,
145 + 0x00000000, // Address Space Granularity
146 + 0x00000000, // Address Range Minimum
147 + 0xFEBFFFFF, // Address Range Maximum
148 + 0x00000000, // Address Translation Offset
149 + 0x00000000, // Address Length
150 + ,, MEMF, AddressRangeMemory, TypeStatic)
152 + CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._MIN, PMIN)
153 + CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._MAX, PMAX)
154 + CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._LEN, PLEN)
155 + /* compute available RAM */
156 + Add(CMRD(0x34), ShiftLeft(CMRD(0x35), 8), Local0)
157 + ShiftLeft(Local0, 16, Local0)
158 + Add(Local0, 0x1000000, Local0)
159 + /* update field of last region */
160 + Store(Local0, PMIN)
161 + Subtract (PMAX, PMIN, PLEN)
170 + /* PIIX3 ISA bridge */
172 + Name (_ADR, 0x00010000)
174 + /* PIIX PCI to ISA irq remapping */
175 + OperationRegion (P40C, PCI_Config, 0x60, 0x04)
178 + /* Keyboard seems to be important for WinXP install */
181 + Name (_HID, EisaId ("PNP0303"))
182 + Method (_STA, 0, NotSerialized)
187 + Method (_CRS, 0, NotSerialized)
189 + Name (TMP, ResourceTemplate ()
192 + 0x0060, // Address Range Minimum
193 + 0x0060, // Address Range Maximum
194 + 0x01, // Address Alignment
195 + 0x01, // Address Length
198 + 0x0064, // Address Range Minimum
199 + 0x0064, // Address Range Maximum
200 + 0x01, // Address Alignment
201 + 0x01, // Address Length
213 + Name (_HID, EisaId ("PNP0F13"))
214 + Method (_STA, 0, NotSerialized)
219 + Method (_CRS, 0, NotSerialized)
221 + Name (TMP, ResourceTemplate ()
229 + /* PS/2 floppy controller */
232 + Name (_HID, EisaId ("PNP0700"))
233 + Method (_STA, 0, NotSerialized)
237 + Method (_CRS, 0, NotSerialized)
239 + Name (BUF0, ResourceTemplate ()
241 + IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
242 + IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
244 + DMA (Compatibility, NotBusMaster, Transfer8) {2}
250 + /* Parallel port */
253 + Name (_HID, EisaId ("PNP0400"))
254 + Method (_STA, 0, NotSerialized)
256 + Store (\_SB.PCI0.PX13.DRSA, Local0)
257 + And (Local0, 0x80000000, Local0)
258 + If (LEqual (Local0, 0))
267 + Method (_CRS, 0, NotSerialized)
269 + Name (BUF0, ResourceTemplate ()
271 + IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
281 + Name (_HID, EisaId ("PNP0501"))
283 + Method (_STA, 0, NotSerialized)
285 + Store (\_SB.PCI0.PX13.DRSC, Local0)
286 + And (Local0, 0x08000000, Local0)
287 + If (LEqual (Local0, 0))
296 + Method (_CRS, 0, NotSerialized)
298 + Name (BUF0, ResourceTemplate ()
300 + IO (Decode16, 0x03F8, 0x03F8, 0x00, 0x08)
309 + Name (_HID, EisaId ("PNP0501"))
311 + Method (_STA, 0, NotSerialized)
313 + Store (\_SB.PCI0.PX13.DRSC, Local0)
314 + And (Local0, 0x80000000, Local0)
315 + If (LEqual (Local0, 0))
324 + Method (_CRS, 0, NotSerialized)
326 + Name (BUF0, ResourceTemplate ()
328 + IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
338 + Name (_ADR, 0x00010003)
340 + OperationRegion (P13C, PCI_Config, 0x5c, 0x24)
341 + Field (P13C, DWordAcc, NoLock, Preserve)
358 + Field (\_SB.PCI0.ISA.P40C, ByteAcc, NoLock, Preserve)
367 + Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
369 + Name(_PRS, ResourceTemplate(){
370 + IRQ (Level, ActiveLow, Shared)
371 + {3,4,5,6,7,9,10,11,12}
373 + Method (_STA, 0, NotSerialized)
375 + Store (0x0B, Local0)
376 + If (And (0x80, PRQ0, Local1))
378 + Store (0x09, Local0)
382 + Method (_DIS, 0, NotSerialized)
384 + Or (PRQ0, 0x80, PRQ0)
386 + Method (_CRS, 0, NotSerialized)
388 + Name (PRR0, ResourceTemplate ()
390 + IRQ (Level, ActiveLow, Shared)
393 + CreateWordField (PRR0, 0x01, TMP)
394 + Store (PRQ0, Local0)
395 + If (LLess (Local0, 0x80))
397 + ShiftLeft (One, Local0, TMP)
405 + Method (_SRS, 1, NotSerialized)
407 + CreateWordField (Arg0, 0x01, TMP)
408 + FindSetRightBit (TMP, Local0)
410 + Store (Local0, PRQ0)
414 + Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
416 + Name(_PRS, ResourceTemplate(){
417 + IRQ (Level, ActiveLow, Shared)
418 + {3,4,5,6,7,9,10,11,12}
420 + Method (_STA, 0, NotSerialized)
422 + Store (0x0B, Local0)
423 + If (And (0x80, PRQ1, Local1))
425 + Store (0x09, Local0)
429 + Method (_DIS, 0, NotSerialized)
431 + Or (PRQ1, 0x80, PRQ1)
433 + Method (_CRS, 0, NotSerialized)
435 + Name (PRR0, ResourceTemplate ()
437 + IRQ (Level, ActiveLow, Shared)
440 + CreateWordField (PRR0, 0x01, TMP)
441 + Store (PRQ1, Local0)
442 + If (LLess (Local0, 0x80))
444 + ShiftLeft (One, Local0, TMP)
452 + Method (_SRS, 1, NotSerialized)
454 + CreateWordField (Arg0, 0x01, TMP)
455 + FindSetRightBit (TMP, Local0)
457 + Store (Local0, PRQ1)
461 + Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
463 + Name(_PRS, ResourceTemplate(){
464 + IRQ (Level, ActiveLow, Shared)
465 + {3,4,5,6,7,9,10,11,12}
467 + Method (_STA, 0, NotSerialized)
469 + Store (0x0B, Local0)
470 + If (And (0x80, PRQ2, Local1))
472 + Store (0x09, Local0)
476 + Method (_DIS, 0, NotSerialized)
478 + Or (PRQ2, 0x80, PRQ2)
480 + Method (_CRS, 0, NotSerialized)
482 + Name (PRR0, ResourceTemplate ()
484 + IRQ (Level, ActiveLow, Shared)
487 + CreateWordField (PRR0, 0x01, TMP)
488 + Store (PRQ2, Local0)
489 + If (LLess (Local0, 0x80))
491 + ShiftLeft (One, Local0, TMP)
499 + Method (_SRS, 1, NotSerialized)
501 + CreateWordField (Arg0, 0x01, TMP)
502 + FindSetRightBit (TMP, Local0)
504 + Store (Local0, PRQ2)
508 + Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
510 + Name(_PRS, ResourceTemplate(){
511 + IRQ (Level, ActiveLow, Shared)
512 + {3,4,5,6,7,9,10,11,12}
514 + Method (_STA, 0, NotSerialized)
516 + Store (0x0B, Local0)
517 + If (And (0x80, PRQ3, Local1))
519 + Store (0x09, Local0)
523 + Method (_DIS, 0, NotSerialized)
525 + Or (PRQ3, 0x80, PRQ3)
527 + Method (_CRS, 0, NotSerialized)
529 + Name (PRR0, ResourceTemplate ()
531 + IRQ (Level, ActiveLow, Shared)
534 + CreateWordField (PRR0, 0x01, TMP)
535 + Store (PRQ3, Local0)
536 + If (LLess (Local0, 0x80))
538 + ShiftLeft (One, Local0, TMP)
546 + Method (_SRS, 1, NotSerialized)
548 + CreateWordField (Arg0, 0x01, TMP)
549 + FindSetRightBit (TMP, Local0)
551 + Store (Local0, PRQ3)
556 + /* S5 = power off state */
557 + Name (_S5, Package (4) {
558 + 0x00, // PM1a_CNT.SLP_TYP
559 + 0x00, // PM2a_CNT.SLP_TYP
564 diff -ruN --exclude Makefile bios/acpi-dsdt.hex bios.new/acpi-dsdt.hex
565 --- bios/acpi-dsdt.hex 1970-01-01 01:00:00.000000000 +0100
566 +++ bios.new/acpi-dsdt.hex 2006-09-24 20:27:54.000000000 +0200
570 + * Intel ACPI Component Architecture
571 + * ASL Optimizing Compiler version 20060421 [Apr 29 2006]
572 + * Copyright (C) 2000 - 2006 Intel Corporation
573 + * Supports ACPI Specification Revision 3.0a
575 + * Compilation of "/usr/local/home/bellard/qemu-current/hw/acpi-dsdt.dsl" - Wed Jun 14 20:09:53 2006
577 + * C source code output
580 +unsigned char AmlCode[] =
582 + 0x44,0x53,0x44,0x54,0x32,0x08,0x00,0x00, /* 00000000 "DSDT2..." */
583 + 0x01,0x5B,0x51,0x45,0x4D,0x55,0x00,0x00, /* 00000008 ".[QEMU.." */
584 + 0x51,0x45,0x4D,0x55,0x44,0x53,0x44,0x54, /* 00000010 "QEMUDSDT" */
585 + 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
586 + 0x21,0x04,0x06,0x20,0x10,0x4F,0x04,0x5C, /* 00000020 "!.. .O.\" */
587 + 0x00,0x5B,0x80,0x43,0x4D,0x53,0x5F,0x01, /* 00000028 ".[.CMS_." */
588 + 0x0A,0x70,0x0A,0x02,0x5B,0x81,0x10,0x43, /* 00000030 ".p..[..C" */
589 + 0x4D,0x53,0x5F,0x01,0x43,0x4D,0x53,0x49, /* 00000038 "MS_.CMSI" */
590 + 0x08,0x43,0x4D,0x53,0x44,0x08,0x14,0x14, /* 00000040 ".CMSD..." */
591 + 0x43,0x4D,0x52,0x44,0x01,0x70,0x68,0x43, /* 00000048 "CMRD.phC" */
592 + 0x4D,0x53,0x49,0x70,0x43,0x4D,0x53,0x44, /* 00000050 "MSIpCMSD" */
593 + 0x60,0xA4,0x60,0x5B,0x80,0x44,0x42,0x47, /* 00000058 "`.`[.DBG" */
594 + 0x5F,0x01,0x0B,0x44,0xB0,0x0A,0x04,0x5B, /* 00000060 "_..D...[" */
595 + 0x81,0x0B,0x44,0x42,0x47,0x5F,0x03,0x44, /* 00000068 "..DBG_.D" */
596 + 0x42,0x47,0x4C,0x20,0x10,0x4E,0x25,0x5F, /* 00000070 "BGL .N%_" */
597 + 0x53,0x42,0x5F,0x5B,0x82,0x46,0x25,0x50, /* 00000078 "SB_[.F%P" */
598 + 0x43,0x49,0x30,0x08,0x5F,0x48,0x49,0x44, /* 00000080 "CI0._HID" */
599 + 0x0C,0x41,0xD0,0x0A,0x03,0x08,0x5F,0x41, /* 00000088 ".A...._A" */
600 + 0x44,0x52,0x00,0x08,0x5F,0x55,0x49,0x44, /* 00000090 "DR.._UID" */
601 + 0x01,0x08,0x5F,0x50,0x52,0x54,0x12,0x47, /* 00000098 ".._PRT.G" */
602 + 0x15,0x18,0x12,0x0B,0x04,0x0B,0xFF,0xFF, /* 000000A0 "........" */
603 + 0x00,0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0B, /* 000000A8 ".LNKD..." */
604 + 0x04,0x0B,0xFF,0xFF,0x01,0x4C,0x4E,0x4B, /* 000000B0 ".....LNK" */
605 + 0x41,0x00,0x12,0x0C,0x04,0x0B,0xFF,0xFF, /* 000000B8 "A......." */
606 + 0x0A,0x02,0x4C,0x4E,0x4B,0x42,0x00,0x12, /* 000000C0 "..LNKB.." */
607 + 0x0C,0x04,0x0B,0xFF,0xFF,0x0A,0x03,0x4C, /* 000000C8 ".......L" */
608 + 0x4E,0x4B,0x43,0x00,0x12,0x0D,0x04,0x0C, /* 000000D0 "NKC....." */
609 + 0xFF,0xFF,0x01,0x00,0x00,0x4C,0x4E,0x4B, /* 000000D8 ".....LNK" */
610 + 0x41,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF, /* 000000E0 "A......." */
611 + 0x01,0x00,0x01,0x4C,0x4E,0x4B,0x42,0x00, /* 000000E8 "...LNKB." */
612 + 0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x01,0x00, /* 000000F0 "........" */
613 + 0x0A,0x02,0x4C,0x4E,0x4B,0x43,0x00,0x12, /* 000000F8 "..LNKC.." */
614 + 0x0E,0x04,0x0C,0xFF,0xFF,0x01,0x00,0x0A, /* 00000100 "........" */
615 + 0x03,0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0D, /* 00000108 ".LNKD..." */
616 + 0x04,0x0C,0xFF,0xFF,0x02,0x00,0x00,0x4C, /* 00000110 ".......L" */
617 + 0x4E,0x4B,0x42,0x00,0x12,0x0D,0x04,0x0C, /* 00000118 "NKB....." */
618 + 0xFF,0xFF,0x02,0x00,0x01,0x4C,0x4E,0x4B, /* 00000120 ".....LNK" */
619 + 0x43,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF, /* 00000128 "C......." */
620 + 0x02,0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x44, /* 00000130 "....LNKD" */
621 + 0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x02, /* 00000138 "........" */
622 + 0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x41,0x00, /* 00000140 "...LNKA." */
623 + 0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x03,0x00, /* 00000148 "........" */
624 + 0x00,0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0D, /* 00000150 ".LNKC..." */
625 + 0x04,0x0C,0xFF,0xFF,0x03,0x00,0x01,0x4C, /* 00000158 ".......L" */
626 + 0x4E,0x4B,0x44,0x00,0x12,0x0E,0x04,0x0C, /* 00000160 "NKD....." */
627 + 0xFF,0xFF,0x03,0x00,0x0A,0x02,0x4C,0x4E, /* 00000168 "......LN" */
628 + 0x4B,0x41,0x00,0x12,0x0E,0x04,0x0C,0xFF, /* 00000170 "KA......" */
629 + 0xFF,0x03,0x00,0x0A,0x03,0x4C,0x4E,0x4B, /* 00000178 ".....LNK" */
630 + 0x42,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF, /* 00000180 "B......." */
631 + 0x04,0x00,0x00,0x4C,0x4E,0x4B,0x44,0x00, /* 00000188 "...LNKD." */
632 + 0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x04,0x00, /* 00000190 "........" */
633 + 0x01,0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0E, /* 00000198 ".LNKA..." */
634 + 0x04,0x0C,0xFF,0xFF,0x04,0x00,0x0A,0x02, /* 000001A0 "........" */
635 + 0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0E,0x04, /* 000001A8 "LNKB...." */
636 + 0x0C,0xFF,0xFF,0x04,0x00,0x0A,0x03,0x4C, /* 000001B0 ".......L" */
637 + 0x4E,0x4B,0x43,0x00,0x12,0x0D,0x04,0x0C, /* 000001B8 "NKC....." */
638 + 0xFF,0xFF,0x05,0x00,0x00,0x4C,0x4E,0x4B, /* 000001C0 ".....LNK" */
639 + 0x41,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF, /* 000001C8 "A......." */
640 + 0x05,0x00,0x01,0x4C,0x4E,0x4B,0x42,0x00, /* 000001D0 "...LNKB." */
641 + 0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x05,0x00, /* 000001D8 "........" */
642 + 0x0A,0x02,0x4C,0x4E,0x4B,0x43,0x00,0x12, /* 000001E0 "..LNKC.." */
643 + 0x0E,0x04,0x0C,0xFF,0xFF,0x05,0x00,0x0A, /* 000001E8 "........" */
644 + 0x03,0x4C,0x4E,0x4B,0x44,0x00,0x14,0x4C, /* 000001F0 ".LNKD..L" */
645 + 0x0D,0x5F,0x43,0x52,0x53,0x00,0x08,0x4D, /* 000001F8 "._CRS..M" */
646 + 0x45,0x4D,0x50,0x11,0x42,0x07,0x0A,0x6E, /* 00000200 "EMP.B..n" */
647 + 0x88,0x0D,0x00,0x02,0x0C,0x00,0x00,0x00, /* 00000208 "........" */
648 + 0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x01, /* 00000210 "........" */
649 + 0x47,0x01,0xF8,0x0C,0xF8,0x0C,0x01,0x08, /* 00000218 "G......." */
650 + 0x88,0x0D,0x00,0x01,0x0C,0x03,0x00,0x00, /* 00000220 "........" */
651 + 0x00,0x00,0xF7,0x0C,0x00,0x00,0xF8,0x0C, /* 00000228 "........" */
652 + 0x88,0x0D,0x00,0x01,0x0C,0x03,0x00,0x00, /* 00000230 "........" */
653 + 0x00,0x0D,0xFF,0xFF,0x00,0x00,0x00,0xF3, /* 00000238 "........" */
654 + 0x87,0x17,0x00,0x00,0x0C,0x03,0x00,0x00, /* 00000240 "........" */
655 + 0x00,0x00,0x00,0x00,0x0A,0x00,0xFF,0xFF, /* 00000248 "........" */
656 + 0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000250 "........" */
657 + 0x02,0x00,0x87,0x17,0x00,0x00,0x08,0x01, /* 00000258 "........" */
658 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000260 "........" */
659 + 0xFF,0xFF,0xBF,0xFE,0x00,0x00,0x00,0x00, /* 00000268 "........" */
660 + 0x00,0x00,0x00,0x00,0x79,0x00,0x8A,0x4D, /* 00000270 "....y..M" */
661 + 0x45,0x4D,0x50,0x0A,0x5C,0x50,0x4D,0x49, /* 00000278 "EMP.\PMI" */
662 + 0x4E,0x8A,0x4D,0x45,0x4D,0x50,0x0A,0x60, /* 00000280 "N.MEMP.`" */
663 + 0x50,0x4D,0x41,0x58,0x8A,0x4D,0x45,0x4D, /* 00000288 "PMAX.MEM" */
664 + 0x50,0x0A,0x68,0x50,0x4C,0x45,0x4E,0x72, /* 00000290 "P.hPLENr" */
665 + 0x43,0x4D,0x52,0x44,0x0A,0x34,0x79,0x43, /* 00000298 "CMRD.4yC" */
666 + 0x4D,0x52,0x44,0x0A,0x35,0x0A,0x08,0x00, /* 000002A0 "MRD.5..." */
667 + 0x60,0x79,0x60,0x0A,0x10,0x60,0x72,0x60, /* 000002A8 "`y`..`r`" */
668 + 0x0C,0x00,0x00,0x00,0x01,0x60,0x70,0x60, /* 000002B0 ".....`p`" */
669 + 0x50,0x4D,0x49,0x4E,0x74,0x50,0x4D,0x41, /* 000002B8 "PMINtPMA" */
670 + 0x58,0x50,0x4D,0x49,0x4E,0x50,0x4C,0x45, /* 000002C0 "XPMINPLE" */
671 + 0x4E,0x75,0x50,0x4C,0x45,0x4E,0xA4,0x4D, /* 000002C8 "NuPLEN.M" */
672 + 0x45,0x4D,0x50,0x10,0x42,0x26,0x2E,0x5F, /* 000002D0 "EMP.B&._" */
673 + 0x53,0x42,0x5F,0x50,0x43,0x49,0x30,0x5B, /* 000002D8 "SB_PCI0[" */
674 + 0x82,0x43,0x20,0x49,0x53,0x41,0x5F,0x08, /* 000002E0 ".C ISA_." */
675 + 0x5F,0x41,0x44,0x52,0x0C,0x00,0x00,0x01, /* 000002E8 "_ADR...." */
676 + 0x00,0x5B,0x80,0x50,0x34,0x30,0x43,0x02, /* 000002F0 ".[.P40C." */
677 + 0x0A,0x60,0x0A,0x04,0x5B,0x82,0x44,0x04, /* 000002F8 ".`..[.D." */
678 + 0x4B,0x42,0x44,0x5F,0x08,0x5F,0x48,0x49, /* 00000300 "KBD_._HI" */
679 + 0x44,0x0C,0x41,0xD0,0x03,0x03,0x14,0x09, /* 00000308 "D.A....." */
680 + 0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,0x0F, /* 00000310 "_STA...." */
681 + 0x14,0x29,0x5F,0x43,0x52,0x53,0x00,0x08, /* 00000318 ".)_CRS.." */
682 + 0x54,0x4D,0x50,0x5F,0x11,0x18,0x0A,0x15, /* 00000320 "TMP_...." */
683 + 0x47,0x01,0x60,0x00,0x60,0x00,0x01,0x01, /* 00000328 "G.`.`..." */
684 + 0x47,0x01,0x64,0x00,0x64,0x00,0x01,0x01, /* 00000330 "G.d.d..." */
685 + 0x22,0x02,0x00,0x79,0x00,0xA4,0x54,0x4D, /* 00000338 ""..y..TM" */
686 + 0x50,0x5F,0x5B,0x82,0x33,0x4D,0x4F,0x55, /* 00000340 "P_[.3MOU" */
687 + 0x5F,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41, /* 00000348 "_._HID.A" */
688 + 0xD0,0x0F,0x13,0x14,0x09,0x5F,0x53,0x54, /* 00000350 "....._ST" */
689 + 0x41,0x00,0xA4,0x0A,0x0F,0x14,0x19,0x5F, /* 00000358 "A......_" */
690 + 0x43,0x52,0x53,0x00,0x08,0x54,0x4D,0x50, /* 00000360 "CRS..TMP" */
691 + 0x5F,0x11,0x08,0x0A,0x05,0x22,0x00,0x10, /* 00000368 "_....".." */
692 + 0x79,0x00,0xA4,0x54,0x4D,0x50,0x5F,0x5B, /* 00000370 "y..TMP_[" */
693 + 0x82,0x47,0x04,0x46,0x44,0x43,0x30,0x08, /* 00000378 ".G.FDC0." */
694 + 0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x07, /* 00000380 "_HID.A.." */
695 + 0x00,0x14,0x09,0x5F,0x53,0x54,0x41,0x00, /* 00000388 "..._STA." */
696 + 0xA4,0x0A,0x0F,0x14,0x2C,0x5F,0x43,0x52, /* 00000390 "....,_CR" */
697 + 0x53,0x00,0x08,0x42,0x55,0x46,0x30,0x11, /* 00000398 "S..BUF0." */
698 + 0x1B,0x0A,0x18,0x47,0x01,0xF2,0x03,0xF2, /* 000003A0 "...G...." */
699 + 0x03,0x00,0x04,0x47,0x01,0xF7,0x03,0xF7, /* 000003A8 "...G...." */
700 + 0x03,0x00,0x01,0x22,0x40,0x00,0x2A,0x04, /* 000003B0 "..."@.*." */
701 + 0x00,0x79,0x00,0xA4,0x42,0x55,0x46,0x30, /* 000003B8 ".y..BUF0" */
702 + 0x5B,0x82,0x4B,0x05,0x4C,0x50,0x54,0x5F, /* 000003C0 "[.K.LPT_" */
703 + 0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0, /* 000003C8 "._HID.A." */
704 + 0x04,0x00,0x14,0x28,0x5F,0x53,0x54,0x41, /* 000003D0 "...(_STA" */
705 + 0x00,0x70,0x5E,0x5E,0x5E,0x2E,0x50,0x58, /* 000003D8 ".p^^^.PX" */
706 + 0x31,0x33,0x44,0x52,0x53,0x41,0x60,0x7B, /* 000003E0 "13DRSA`{" */
707 + 0x60,0x0C,0x00,0x00,0x00,0x80,0x60,0xA0, /* 000003E8 "`.....`." */
708 + 0x06,0x93,0x60,0x00,0xA4,0x00,0xA1,0x04, /* 000003F0 "..`....." */
709 + 0xA4,0x0A,0x0F,0x14,0x21,0x5F,0x43,0x52, /* 000003F8 "....!_CR" */
710 + 0x53,0x00,0x08,0x42,0x55,0x46,0x30,0x11, /* 00000400 "S..BUF0." */
711 + 0x10,0x0A,0x0D,0x47,0x01,0x78,0x03,0x78, /* 00000408 "...G.x.x" */
712 + 0x03,0x08,0x08,0x22,0x80,0x00,0x79,0x00, /* 00000410 "..."..y." */
713 + 0xA4,0x42,0x55,0x46,0x30,0x5B,0x82,0x41, /* 00000418 ".BUF0[.A" */
714 + 0x06,0x43,0x4F,0x4D,0x31,0x08,0x5F,0x48, /* 00000420 ".COM1._H" */
715 + 0x49,0x44,0x0C,0x41,0xD0,0x05,0x01,0x08, /* 00000428 "ID.A...." */
716 + 0x5F,0x55,0x49,0x44,0x01,0x14,0x28,0x5F, /* 00000430 "_UID..(_" */
717 + 0x53,0x54,0x41,0x00,0x70,0x5E,0x5E,0x5E, /* 00000438 "STA.p^^^" */
718 + 0x2E,0x50,0x58,0x31,0x33,0x44,0x52,0x53, /* 00000440 ".PX13DRS" */
719 + 0x43,0x60,0x7B,0x60,0x0C,0x00,0x00,0x00, /* 00000448 "C`{`...." */
720 + 0x08,0x60,0xA0,0x06,0x93,0x60,0x00,0xA4, /* 00000450 ".`...`.." */
721 + 0x00,0xA1,0x04,0xA4,0x0A,0x0F,0x14,0x21, /* 00000458 ".......!" */
722 + 0x5F,0x43,0x52,0x53,0x00,0x08,0x42,0x55, /* 00000460 "_CRS..BU" */
723 + 0x46,0x30,0x11,0x10,0x0A,0x0D,0x47,0x01, /* 00000468 "F0....G." */
724 + 0xF8,0x03,0xF8,0x03,0x00,0x08,0x22,0x10, /* 00000470 "......"." */
725 + 0x00,0x79,0x00,0xA4,0x42,0x55,0x46,0x30, /* 00000478 ".y..BUF0" */
726 + 0x5B,0x82,0x42,0x06,0x43,0x4F,0x4D,0x32, /* 00000480 "[.B.COM2" */
727 + 0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0, /* 00000488 "._HID.A." */
728 + 0x05,0x01,0x08,0x5F,0x55,0x49,0x44,0x0A, /* 00000490 "..._UID." */
729 + 0x02,0x14,0x28,0x5F,0x53,0x54,0x41,0x00, /* 00000498 "..(_STA." */
730 + 0x70,0x5E,0x5E,0x5E,0x2E,0x50,0x58,0x31, /* 000004A0 "p^^^.PX1" */
731 + 0x33,0x44,0x52,0x53,0x43,0x60,0x7B,0x60, /* 000004A8 "3DRSC`{`" */
732 + 0x0C,0x00,0x00,0x00,0x80,0x60,0xA0,0x06, /* 000004B0 ".....`.." */
733 + 0x93,0x60,0x00,0xA4,0x00,0xA1,0x04,0xA4, /* 000004B8 ".`......" */
734 + 0x0A,0x0F,0x14,0x21,0x5F,0x43,0x52,0x53, /* 000004C0 "...!_CRS" */
735 + 0x00,0x08,0x42,0x55,0x46,0x30,0x11,0x10, /* 000004C8 "..BUF0.." */
736 + 0x0A,0x0D,0x47,0x01,0xF8,0x02,0xF8,0x02, /* 000004D0 "..G....." */
737 + 0x00,0x08,0x22,0x08,0x00,0x79,0x00,0xA4, /* 000004D8 ".."..y.." */
738 + 0x42,0x55,0x46,0x30,0x5B,0x82,0x40,0x05, /* 000004E0 "BUF0[.@." */
739 + 0x50,0x58,0x31,0x33,0x08,0x5F,0x41,0x44, /* 000004E8 "PX13._AD" */
740 + 0x52,0x0C,0x03,0x00,0x01,0x00,0x5B,0x80, /* 000004F0 "R.....[." */
741 + 0x50,0x31,0x33,0x43,0x02,0x0A,0x5C,0x0A, /* 000004F8 "P13C..\." */
742 + 0x24,0x5B,0x81,0x33,0x50,0x31,0x33,0x43, /* 00000500 "$[.3P13C" */
743 + 0x03,0x44,0x52,0x53,0x41,0x20,0x44,0x52, /* 00000508 ".DRSA DR" */
744 + 0x53,0x42,0x20,0x44,0x52,0x53,0x43,0x20, /* 00000510 "SB DRSC " */
745 + 0x44,0x52,0x53,0x45,0x20,0x44,0x52,0x53, /* 00000518 "DRSE DRS" */
746 + 0x46,0x20,0x44,0x52,0x53,0x47,0x20,0x44, /* 00000520 "F DRSG D" */
747 + 0x52,0x53,0x48,0x20,0x44,0x52,0x53,0x49, /* 00000528 "RSH DRSI" */
748 + 0x20,0x44,0x52,0x53,0x4A,0x20,0x10,0x4F, /* 00000530 " DRSJ .O" */
749 + 0x2E,0x5F,0x53,0x42,0x5F,0x5B,0x81,0x24, /* 00000538 "._SB_[.$" */
750 + 0x2F,0x03,0x50,0x43,0x49,0x30,0x49,0x53, /* 00000540 "/.PCI0IS" */
751 + 0x41,0x5F,0x50,0x34,0x30,0x43,0x01,0x50, /* 00000548 "A_P40C.P" */
752 + 0x52,0x51,0x30,0x08,0x50,0x52,0x51,0x31, /* 00000550 "RQ0.PRQ1" */
753 + 0x08,0x50,0x52,0x51,0x32,0x08,0x50,0x52, /* 00000558 ".PRQ2.PR" */
754 + 0x51,0x33,0x08,0x5B,0x82,0x4E,0x0A,0x4C, /* 00000560 "Q3.[.N.L" */
755 + 0x4E,0x4B,0x41,0x08,0x5F,0x48,0x49,0x44, /* 00000568 "NKA._HID" */
756 + 0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55, /* 00000570 ".A...._U" */
757 + 0x49,0x44,0x01,0x08,0x5F,0x50,0x52,0x53, /* 00000578 "ID.._PRS" */
758 + 0x11,0x09,0x0A,0x06,0x23,0xF8,0x1E,0x18, /* 00000580 "....#..." */
759 + 0x79,0x00,0x14,0x1A,0x5F,0x53,0x54,0x41, /* 00000588 "y..._STA" */
760 + 0x00,0x70,0x0A,0x0B,0x60,0xA0,0x0D,0x7B, /* 00000590 ".p..`..{" */
761 + 0x0A,0x80,0x50,0x52,0x51,0x30,0x61,0x70, /* 00000598 "..PRQ0ap" */
762 + 0x0A,0x09,0x60,0xA4,0x60,0x14,0x11,0x5F, /* 000005A0 "..`.`.._" */
763 + 0x44,0x49,0x53,0x00,0x7D,0x50,0x52,0x51, /* 000005A8 "DIS.}PRQ" */
764 + 0x30,0x0A,0x80,0x50,0x52,0x51,0x30,0x14, /* 000005B0 "0..PRQ0." */
765 + 0x3F,0x5F,0x43,0x52,0x53,0x00,0x08,0x50, /* 000005B8 "?_CRS..P" */
766 + 0x52,0x52,0x30,0x11,0x09,0x0A,0x06,0x23, /* 000005C0 "RR0....#" */
767 + 0x02,0x00,0x18,0x79,0x00,0x8B,0x50,0x52, /* 000005C8 "...y..PR" */
768 + 0x52,0x30,0x01,0x54,0x4D,0x50,0x5F,0x70, /* 000005D0 "R0.TMP_p" */
769 + 0x50,0x52,0x51,0x30,0x60,0xA0,0x0C,0x95, /* 000005D8 "PRQ0`..." */
770 + 0x60,0x0A,0x80,0x79,0x01,0x60,0x54,0x4D, /* 000005E0 "`..y.`TM" */
771 + 0x50,0x5F,0xA1,0x07,0x70,0x00,0x54,0x4D, /* 000005E8 "P_..p.TM" */
772 + 0x50,0x5F,0xA4,0x50,0x52,0x52,0x30,0x14, /* 000005F0 "P_.PRR0." */
773 + 0x1B,0x5F,0x53,0x52,0x53,0x01,0x8B,0x68, /* 000005F8 "._SRS..h" */
774 + 0x01,0x54,0x4D,0x50,0x5F,0x82,0x54,0x4D, /* 00000600 ".TMP_.TM" */
775 + 0x50,0x5F,0x60,0x76,0x60,0x70,0x60,0x50, /* 00000608 "P_`v`p`P" */
776 + 0x52,0x51,0x30,0x5B,0x82,0x4F,0x0A,0x4C, /* 00000610 "RQ0[.O.L" */
777 + 0x4E,0x4B,0x42,0x08,0x5F,0x48,0x49,0x44, /* 00000618 "NKB._HID" */
778 + 0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55, /* 00000620 ".A...._U" */
779 + 0x49,0x44,0x0A,0x02,0x08,0x5F,0x50,0x52, /* 00000628 "ID..._PR" */
780 + 0x53,0x11,0x09,0x0A,0x06,0x23,0xF8,0x1E, /* 00000630 "S....#.." */
781 + 0x18,0x79,0x00,0x14,0x1A,0x5F,0x53,0x54, /* 00000638 ".y..._ST" */
782 + 0x41,0x00,0x70,0x0A,0x0B,0x60,0xA0,0x0D, /* 00000640 "A.p..`.." */
783 + 0x7B,0x0A,0x80,0x50,0x52,0x51,0x31,0x61, /* 00000648 "{..PRQ1a" */
784 + 0x70,0x0A,0x09,0x60,0xA4,0x60,0x14,0x11, /* 00000650 "p..`.`.." */
785 + 0x5F,0x44,0x49,0x53,0x00,0x7D,0x50,0x52, /* 00000658 "_DIS.}PR" */
786 + 0x51,0x31,0x0A,0x80,0x50,0x52,0x51,0x31, /* 00000660 "Q1..PRQ1" */
787 + 0x14,0x3F,0x5F,0x43,0x52,0x53,0x00,0x08, /* 00000668 ".?_CRS.." */
788 + 0x50,0x52,0x52,0x30,0x11,0x09,0x0A,0x06, /* 00000670 "PRR0...." */
789 + 0x23,0x02,0x00,0x18,0x79,0x00,0x8B,0x50, /* 00000678 "#...y..P" */
790 + 0x52,0x52,0x30,0x01,0x54,0x4D,0x50,0x5F, /* 00000680 "RR0.TMP_" */
791 + 0x70,0x50,0x52,0x51,0x31,0x60,0xA0,0x0C, /* 00000688 "pPRQ1`.." */
792 + 0x95,0x60,0x0A,0x80,0x79,0x01,0x60,0x54, /* 00000690 ".`..y.`T" */
793 + 0x4D,0x50,0x5F,0xA1,0x07,0x70,0x00,0x54, /* 00000698 "MP_..p.T" */
794 + 0x4D,0x50,0x5F,0xA4,0x50,0x52,0x52,0x30, /* 000006A0 "MP_.PRR0" */
795 + 0x14,0x1B,0x5F,0x53,0x52,0x53,0x01,0x8B, /* 000006A8 ".._SRS.." */
796 + 0x68,0x01,0x54,0x4D,0x50,0x5F,0x82,0x54, /* 000006B0 "h.TMP_.T" */
797 + 0x4D,0x50,0x5F,0x60,0x76,0x60,0x70,0x60, /* 000006B8 "MP_`v`p`" */
798 + 0x50,0x52,0x51,0x31,0x5B,0x82,0x4F,0x0A, /* 000006C0 "PRQ1[.O." */
799 + 0x4C,0x4E,0x4B,0x43,0x08,0x5F,0x48,0x49, /* 000006C8 "LNKC._HI" */
800 + 0x44,0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F, /* 000006D0 "D.A...._" */
801 + 0x55,0x49,0x44,0x0A,0x03,0x08,0x5F,0x50, /* 000006D8 "UID..._P" */
802 + 0x52,0x53,0x11,0x09,0x0A,0x06,0x23,0xF8, /* 000006E0 "RS....#." */
803 + 0x1E,0x18,0x79,0x00,0x14,0x1A,0x5F,0x53, /* 000006E8 "..y..._S" */
804 + 0x54,0x41,0x00,0x70,0x0A,0x0B,0x60,0xA0, /* 000006F0 "TA.p..`." */
805 + 0x0D,0x7B,0x0A,0x80,0x50,0x52,0x51,0x32, /* 000006F8 ".{..PRQ2" */
806 + 0x61,0x70,0x0A,0x09,0x60,0xA4,0x60,0x14, /* 00000700 "ap..`.`." */
807 + 0x11,0x5F,0x44,0x49,0x53,0x00,0x7D,0x50, /* 00000708 "._DIS.}P" */
808 + 0x52,0x51,0x32,0x0A,0x80,0x50,0x52,0x51, /* 00000710 "RQ2..PRQ" */
809 + 0x32,0x14,0x3F,0x5F,0x43,0x52,0x53,0x00, /* 00000718 "2.?_CRS." */
810 + 0x08,0x50,0x52,0x52,0x30,0x11,0x09,0x0A, /* 00000720 ".PRR0..." */
811 + 0x06,0x23,0x02,0x00,0x18,0x79,0x00,0x8B, /* 00000728 ".#...y.." */
812 + 0x50,0x52,0x52,0x30,0x01,0x54,0x4D,0x50, /* 00000730 "PRR0.TMP" */
813 + 0x5F,0x70,0x50,0x52,0x51,0x32,0x60,0xA0, /* 00000738 "_pPRQ2`." */
814 + 0x0C,0x95,0x60,0x0A,0x80,0x79,0x01,0x60, /* 00000740 "..`..y.`" */
815 + 0x54,0x4D,0x50,0x5F,0xA1,0x07,0x70,0x00, /* 00000748 "TMP_..p." */
816 + 0x54,0x4D,0x50,0x5F,0xA4,0x50,0x52,0x52, /* 00000750 "TMP_.PRR" */
817 + 0x30,0x14,0x1B,0x5F,0x53,0x52,0x53,0x01, /* 00000758 "0.._SRS." */
818 + 0x8B,0x68,0x01,0x54,0x4D,0x50,0x5F,0x82, /* 00000760 ".h.TMP_." */
819 + 0x54,0x4D,0x50,0x5F,0x60,0x76,0x60,0x70, /* 00000768 "TMP_`v`p" */
820 + 0x60,0x50,0x52,0x51,0x32,0x5B,0x82,0x4F, /* 00000770 "`PRQ2[.O" */
821 + 0x0A,0x4C,0x4E,0x4B,0x44,0x08,0x5F,0x48, /* 00000778 ".LNKD._H" */
822 + 0x49,0x44,0x0C,0x41,0xD0,0x0C,0x0F,0x08, /* 00000780 "ID.A...." */
823 + 0x5F,0x55,0x49,0x44,0x0A,0x04,0x08,0x5F, /* 00000788 "_UID..._" */
824 + 0x50,0x52,0x53,0x11,0x09,0x0A,0x06,0x23, /* 00000790 "PRS....#" */
825 + 0xF8,0x1E,0x18,0x79,0x00,0x14,0x1A,0x5F, /* 00000798 "...y..._" */
826 + 0x53,0x54,0x41,0x00,0x70,0x0A,0x0B,0x60, /* 000007A0 "STA.p..`" */
827 + 0xA0,0x0D,0x7B,0x0A,0x80,0x50,0x52,0x51, /* 000007A8 "..{..PRQ" */
828 + 0x33,0x61,0x70,0x0A,0x09,0x60,0xA4,0x60, /* 000007B0 "3ap..`.`" */
829 + 0x14,0x11,0x5F,0x44,0x49,0x53,0x00,0x7D, /* 000007B8 ".._DIS.}" */
830 + 0x50,0x52,0x51,0x33,0x0A,0x80,0x50,0x52, /* 000007C0 "PRQ3..PR" */
831 + 0x51,0x33,0x14,0x3F,0x5F,0x43,0x52,0x53, /* 000007C8 "Q3.?_CRS" */
832 + 0x00,0x08,0x50,0x52,0x52,0x30,0x11,0x09, /* 000007D0 "..PRR0.." */
833 + 0x0A,0x06,0x23,0x02,0x00,0x18,0x79,0x00, /* 000007D8 "..#...y." */
834 + 0x8B,0x50,0x52,0x52,0x30,0x01,0x54,0x4D, /* 000007E0 ".PRR0.TM" */
835 + 0x50,0x5F,0x70,0x50,0x52,0x51,0x33,0x60, /* 000007E8 "P_pPRQ3`" */
836 + 0xA0,0x0C,0x95,0x60,0x0A,0x80,0x79,0x01, /* 000007F0 "...`..y." */
837 + 0x60,0x54,0x4D,0x50,0x5F,0xA1,0x07,0x70, /* 000007F8 "`TMP_..p" */
838 + 0x00,0x54,0x4D,0x50,0x5F,0xA4,0x50,0x52, /* 00000800 ".TMP_.PR" */
839 + 0x52,0x30,0x14,0x1B,0x5F,0x53,0x52,0x53, /* 00000808 "R0.._SRS" */
840 + 0x01,0x8B,0x68,0x01,0x54,0x4D,0x50,0x5F, /* 00000810 "..h.TMP_" */
841 + 0x82,0x54,0x4D,0x50,0x5F,0x60,0x76,0x60, /* 00000818 ".TMP_`v`" */
842 + 0x70,0x60,0x50,0x52,0x51,0x33,0x08,0x5F, /* 00000820 "p`PRQ3._" */
843 + 0x53,0x35,0x5F,0x12,0x06,0x04,0x00,0x00, /* 00000828 "S5_....." */
846 Binary files bios/BIOS-bochs-latest and bios.new/BIOS-bochs-latest differ
847 diff -ruN --exclude Makefile bios/Makefile.in bios.new/Makefile.in
848 --- bios/Makefile.in 2006-01-13 18:36:27.000000000 +0100
849 +++ bios.new/Makefile.in 2006-09-24 20:26:39.000000000 +0200
853 @RMCOMMAND@ *.o *.a *.s _rombios*_.c rombios*.txt rombios*.sym
854 - @RMCOMMAND@ usage biossums
855 + @RMCOMMAND@ usage biossums rombios16.bin
856 + @RMCOMMAND@ rombios32.bin rombios32.out pad tmp32.bin
862 @RMCOMMAND@ BIOS-bochs-*
864 -BIOS-bochs-latest: rombios.c apmbios.S biossums
865 +rombios16.bin: rombios.c apmbios.S biossums
866 $(GCC) $(BIOS_BUILD_DATE) -E -P $< > _rombios_.c
867 $(BCC) -o rombios.s -C-c -D__i86__ -0 -S _rombios_.c
868 sed -e 's/^\.text//' -e 's/^\.data//' rombios.s > _rombios_.s
869 $(AS86) _rombios_.s -b tmp.bin -u- -w- -g -0 -j -O -l rombios.txt
870 -perl ${srcdir}/makesym.perl < rombios.txt > rombios.sym
871 - mv tmp.bin BIOS-bochs-latest
872 - ./biossums BIOS-bochs-latest
873 + mv tmp.bin rombios16.bin
874 + ./biossums rombios16.bin
878 +rombios32.bin: rombios32.out pad
879 + objcopy -O binary $< tmp32.bin
880 + ./pad < tmp32.bin > $@ 65536 0xff
882 +rombios32.out: rombios32start.o rombios32.o rombios32.ld
883 + ld -o $@ -T rombios32.ld rombios32start.o rombios32.o
885 +rombios32.o: rombios32.c
886 + $(GCC) -O2 -Wall -c -o $@ $<
888 +rombios32start.o: rombios32start.S
891 +BIOS-bochs-latest: rombios16.bin rombios32.bin
892 + cat rombios32.bin rombios16.bin > $@
898 $(GCC) -o biossums biossums.c
899 diff -ruN --exclude Makefile bios/pad.c bios.new/pad.c
900 --- bios/pad.c 1970-01-01 01:00:00.000000000 +0100
901 +++ bios.new/pad.c 2006-09-24 20:22:58.000000000 +0200
906 +int main(int argc, char **argv)
908 + int len, val, i, c;
910 + len = strtol(argv[1], NULL, 0);
911 + val = strtol(argv[2], NULL, 0);
912 + for(i = 0 ; i < len; i++) {
918 + for( ; i < len; i++) {
923 diff -ruN --exclude Makefile bios/rombios32.c bios.new/rombios32.c
924 --- bios/rombios32.c 1970-01-01 01:00:00.000000000 +0100
925 +++ bios.new/rombios32.c 2006-09-24 20:22:58.000000000 +0200
927 +// 32 bit Bochs BIOS init code
928 +// Copyright (C) 2006 Fabrice Bellard
930 +// This library is free software; you can redistribute it and/or
931 +// modify it under the terms of the GNU Lesser General Public
932 +// License as published by the Free Software Foundation; either
933 +// version 2 of the License, or (at your option) any later version.
935 +// This library is distributed in the hope that it will be useful,
936 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
937 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
938 +// Lesser General Public License for more details.
940 +// You should have received a copy of the GNU Lesser General Public
941 +// License along with this library; if not, write to the Free Software
942 +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
946 +typedef signed char int8_t;
947 +typedef short int16_t;
948 +typedef int int32_t;
949 +typedef long long int64_t;
950 +typedef unsigned char uint8_t;
951 +typedef unsigned short uint16_t;
952 +typedef unsigned int uint32_t;
953 +typedef unsigned long long uint64_t;
955 +/* if true, put the MP float table and ACPI RSDT in EBDA and the MP
956 + table in RAM. Unfortunately, Linux has bugs with that, so we prefer
957 + to modify the BIOS in shadow RAM */
958 +//#define BX_USE_EBDA_TABLES
960 +/* define it if the (emulated) hardware supports SMM mode */
963 +#define BX_INFO(fmt, args...) bios_printf(0, fmt, ## args);
965 +#define INFO_PORT 0x402
967 +#define cpuid(index, eax, ebx, ecx, edx) \
968 + asm volatile ("cpuid" \
969 + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) \
972 +#define CPUID_APIC (1 << 9)
974 +#define APIC_BASE ((uint8_t *)0xfee00000)
975 +#define APIC_ICR_LOW 0x300
976 +#define APIC_SVR 0x0F0
977 +#define APIC_ID 0x020
978 +#define APIC_LVT3 0x370
980 +#define APIC_ENABLED 0x0100
982 +#define CPU_COUNT_ADDR 0xf000
983 +#define AP_BOOT_ADDR 0x10000
985 +#define MPTABLE_MAX_SIZE 0x00002000
986 +#define ACPI_DATA_SIZE 0x00010000
987 +#define SMI_CMD_IO_ADDR 0xb2
988 +#define PM_IO_BASE 0xb000
990 +#define BIOS_TMP_STORAGE 0x00030000 /* 64 KB used to copy the BIOS to shadow RAM */
992 +static inline void outl(int addr, int val)
994 + asm volatile ("outl %1, %w0" : : "d" (addr), "a" (val));
997 +static inline void outw(int addr, int val)
999 + asm volatile ("outw %w1, %w0" : : "d" (addr), "a" (val));
1002 +static inline void outb(int addr, int val)
1004 + asm volatile ("outb %b1, %w0" : : "d" (addr), "a" (val));
1007 +static inline uint32_t inl(int addr)
1010 + asm volatile ("inl %w1, %0" : "=a" (val) : "d" (addr));
1014 +static inline uint16_t inw(int addr)
1017 + asm volatile ("inw %w1, %w0" : "=a" (val) : "d" (addr));
1021 +static inline uint8_t inb(int addr)
1024 + asm volatile ("inb %w1, %b0" : "=a" (val) : "d" (addr));
1028 +static inline void writel(void *addr, uint32_t val)
1030 + *(volatile uint32_t *)addr = val;
1033 +static inline void writew(void *addr, uint16_t val)
1035 + *(volatile uint16_t *)addr = val;
1038 +static inline void writeb(void *addr, uint8_t val)
1040 + *(volatile uint8_t *)addr = val;
1043 +static inline uint32_t readl(const void *addr)
1045 + return *(volatile const uint32_t *)addr;
1048 +static inline uint16_t readw(const void *addr)
1050 + return *(volatile const uint16_t *)addr;
1053 +static inline uint8_t readb(const void *addr)
1055 + return *(volatile const uint8_t *)addr;
1058 +static inline void putc(int c)
1060 + outb(INFO_PORT, c);
1063 +static inline int isdigit(int c)
1065 + return c >= '0' && c <= '9';
1068 +void *memset(void *d1, int val, size_t len)
1078 +void *memcpy(void *d1, const void *s1, size_t len)
1081 + const uint8_t *s = s1;
1089 +void *memmove(void *d1, const void *s1, size_t len)
1092 + const uint8_t *s = s1;
1108 +size_t strlen(const char *s)
1111 + for(s1 = s; *s1 != '\0'; s1++);
1115 +/* from BSD ppp sources */
1116 +int vsnprintf(char *buf, int buflen, const char *fmt, va_list args)
1119 + int width, prec, fillch;
1120 + int base, len, neg;
1121 + unsigned long val = 0;
1125 + static const char hexchars[] = "0123456789abcdef";
1129 + while (buflen > 0) {
1130 + for (f = fmt; *f != '%' && *f != 0; ++f)
1136 + memcpy(buf, fmt, len);
1151 + width = va_arg(args, int);
1154 + while (isdigit(c)) {
1155 + width = width * 10 + c - '0';
1162 + prec = va_arg(args, int);
1165 + while (isdigit(c)) {
1166 + prec = prec * 10 + c - '0';
1185 + i = va_arg(args, int);
1194 + val = va_arg(args, unsigned int);
1199 + val = va_arg(args, unsigned int);
1203 + val = (unsigned long) va_arg(args, void *);
1208 + str = va_arg(args, char *);
1211 + num[0] = va_arg(args, int);
1218 + --fmt; /* so %z outputs %z etc. */
1223 + str = num + sizeof(num);
1225 + while (str > num + neg) {
1226 + *--str = hexchars[val % base];
1228 + if (--prec <= 0 && val == 0)
1240 + len = num + sizeof(num) - 1 - str;
1242 + len = strlen(str);
1243 + if (prec > 0 && len > prec)
1247 + if (width > buflen)
1249 + if ((n = width - len) > 0) {
1251 + for (; n > 0; --n)
1257 + memcpy(buf, str, len);
1262 + return buf - buf0;
1265 +void bios_printf(int flags, const char *fmt, ...)
1271 + va_start(ap, fmt);
1272 + vsnprintf(buf, sizeof(buf), fmt, ap);
1279 +/* approximative ! */
1280 +void delay_ms(int n)
1283 + for(i = 0; i < n; i++) {
1284 + for(j = 0; j < 1000000; j++);
1289 +uint32_t cpuid_features;
1290 +uint32_t cpuid_ext_features;
1291 +unsigned long ram_size;
1292 +#ifdef BX_USE_EBDA_TABLES
1293 +unsigned long ebda_cur_addr;
1296 +uint32_t pm_io_base;
1298 +unsigned long bios_table_cur_addr;
1299 +unsigned long bios_table_end_addr;
1301 +void cpu_probe(void)
1303 + uint32_t eax, ebx, ecx, edx;
1304 + cpuid(1, eax, ebx, ecx, edx);
1305 + cpuid_features = edx;
1306 + cpuid_ext_features = ecx;
1309 +static int cmos_readb(int addr)
1315 +void ram_probe(void)
1317 + ram_size = (cmos_readb(0x34) | (cmos_readb(0x35) << 8)) * 65536 +
1319 +#ifdef BX_USE_EBDA_TABLES
1320 + ebda_cur_addr = ((*(uint16_t *)(0x40e)) << 4) + 0x380;
1322 + BX_INFO("ram_size=0x%08lx\n");
1325 +/****************************************************/
1328 +extern uint8_t smp_ap_boot_code_start;
1329 +extern uint8_t smp_ap_boot_code_end;
1331 +/* find the number of CPUs by launching a SIPI to them */
1332 +void smp_probe(void)
1334 + uint32_t val, sipi_vector;
1337 + if (cpuid_features & CPUID_APIC) {
1339 + /* enable local APIC */
1340 + val = readl(APIC_BASE + APIC_SVR);
1341 + val |= APIC_ENABLED;
1342 + writel(APIC_BASE + APIC_SVR, val);
1344 + writew((void *)CPU_COUNT_ADDR, 1);
1345 + /* copy AP boot code */
1346 + memcpy((void *)AP_BOOT_ADDR, &smp_ap_boot_code_start,
1347 + &smp_ap_boot_code_end - &smp_ap_boot_code_start);
1349 + /* broadcast SIPI */
1350 + writel(APIC_BASE + APIC_ICR_LOW, 0x000C4500);
1351 + sipi_vector = AP_BOOT_ADDR >> 12;
1352 + writel(APIC_BASE + APIC_ICR_LOW, 0x000C4600 | sipi_vector);
1356 + smp_cpus = readw((void *)CPU_COUNT_ADDR);
1358 + BX_INFO("Found %d cpus\n", smp_cpus);
1361 +/****************************************************/
1364 +#define PCI_ADDRESS_SPACE_MEM 0x00
1365 +#define PCI_ADDRESS_SPACE_IO 0x01
1366 +#define PCI_ADDRESS_SPACE_MEM_PREFETCH 0x08
1368 +#define PCI_ROM_SLOT 6
1369 +#define PCI_NUM_REGIONS 7
1371 +#define PCI_DEVICES_MAX 64
1373 +#define PCI_VENDOR_ID 0x00 /* 16 bits */
1374 +#define PCI_DEVICE_ID 0x02 /* 16 bits */
1375 +#define PCI_COMMAND 0x04 /* 16 bits */
1376 +#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */
1377 +#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */
1378 +#define PCI_CLASS_DEVICE 0x0a /* Device class */
1379 +#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */
1380 +#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */
1381 +#define PCI_MIN_GNT 0x3e /* 8 bits */
1382 +#define PCI_MAX_LAT 0x3f /* 8 bits */
1384 +typedef struct PCIDevice {
1389 +static uint32_t pci_bios_io_addr;
1390 +static uint32_t pci_bios_mem_addr;
1391 +/* host irqs corresponding to PCI irqs A-D */
1392 +static uint8_t pci_irqs[4] = { 11, 9, 11, 9 };
1393 +static PCIDevice i440_pcidev;
1395 +static void pci_config_writel(PCIDevice *d, uint32_t addr, uint32_t val)
1397 + outl(0xcf8, 0x80000000 | (d->bus << 16) | (d->devfn << 8) | (addr & 0xfc));
1401 +static void pci_config_writew(PCIDevice *d, uint32_t addr, uint32_t val)
1403 + outl(0xcf8, 0x80000000 | (d->bus << 16) | (d->devfn << 8) | (addr & 0xfc));
1404 + outw(0xcfc + (addr & 2), val);
1407 +static void pci_config_writeb(PCIDevice *d, uint32_t addr, uint32_t val)
1409 + outl(0xcf8, 0x80000000 | (d->bus << 16) | (d->devfn << 8) | (addr & 0xfc));
1410 + outb(0xcfc + (addr & 3), val);
1413 +static uint32_t pci_config_readl(PCIDevice *d, uint32_t addr)
1415 + outl(0xcf8, 0x80000000 | (d->bus << 16) | (d->devfn << 8) | (addr & 0xfc));
1416 + return inl(0xcfc);
1419 +static uint32_t pci_config_readw(PCIDevice *d, uint32_t addr)
1421 + outl(0xcf8, 0x80000000 | (d->bus << 16) | (d->devfn << 8) | (addr & 0xfc));
1422 + return inw(0xcfc + (addr & 2));
1425 +static uint32_t pci_config_readb(PCIDevice *d, uint32_t addr)
1427 + outl(0xcf8, 0x80000000 | (d->bus << 16) | (d->devfn << 8) | (addr & 0xfc));
1428 + return inb(0xcfc + (addr & 3));
1431 +static void pci_set_io_region_addr(PCIDevice *d, int region_num, uint32_t addr)
1434 + uint32_t ofs, old_addr;
1436 + if ( region_num == PCI_ROM_SLOT ) {
1439 + ofs = 0x10 + region_num * 4;
1442 + old_addr = pci_config_readl(d, ofs);
1444 + pci_config_writel(d, ofs, addr);
1445 + BX_INFO("region %d: 0x%08x\n", region_num, addr);
1447 + /* enable memory mappings */
1448 + cmd = pci_config_readw(d, PCI_COMMAND);
1449 + if ( region_num == PCI_ROM_SLOT )
1451 + else if (old_addr & PCI_ADDRESS_SPACE_IO)
1455 + pci_config_writew(d, PCI_COMMAND, cmd);
1458 +/* return the global irq number corresponding to a given device irq
1459 + pin. We could also use the bus number to have a more precise
1461 +static int pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num)
1464 + slot_addend = (pci_dev->devfn >> 3) - 1;
1465 + return (irq_num + slot_addend) & 3;
1468 +static int find_bios_table_area(void)
1470 + unsigned long addr;
1471 + for(addr = 0xf0000; addr < 0x100000; addr += 16) {
1472 + if (*(uint32_t *)addr == 0xaafb4442) {
1473 + bios_table_cur_addr = addr + 8;
1474 + bios_table_end_addr = bios_table_cur_addr + *(uint32_t *)(addr + 4);
1475 + BX_INFO("bios_table_addr: 0x%08lx end=0x%08lx\n",
1476 + bios_table_cur_addr, bios_table_end_addr);
1483 +static void bios_shadow_init(PCIDevice *d)
1487 + if (find_bios_table_area() < 0)
1490 + /* remap the BIOS to shadow RAM an keep it read/write while we
1491 + are writing tables */
1492 + memcpy((void *)BIOS_TMP_STORAGE, (void *)0x000f0000, 0x10000);
1493 + v = pci_config_readb(d, 0x67);
1494 + v = (v & 0x0f) | (0x30);
1495 + pci_config_writeb(d, 0x67, v);
1496 + memcpy((void *)0x000f0000, (void *)BIOS_TMP_STORAGE, 0x10000);
1501 +static void bios_lock_shadow_ram(void)
1503 + PCIDevice *d = &i440_pcidev;
1506 + v = pci_config_readb(d, 0x67);
1507 + v = (v & 0x0f) | (0x20);
1508 + pci_config_writeb(d, 0x67, v);
1511 +static void pci_bios_init_bridges(PCIDevice *d)
1513 + uint16_t vendor_id, device_id;
1515 + vendor_id = pci_config_readw(d, PCI_VENDOR_ID);
1516 + device_id = pci_config_readw(d, PCI_DEVICE_ID);
1518 + if (vendor_id == 0x8086 && device_id == 0x7000) {
1522 + /* PIIX3 bridge */
1526 + for(i = 0; i < 4; i++) {
1527 + irq = pci_irqs[i];
1528 + /* set to trigger level */
1529 + elcr[irq >> 3] |= (1 << (irq & 7));
1530 + /* activate irq remapping in PIIX */
1531 + pci_config_writeb(d, 0x60 + i, irq);
1533 + outb(0x4d0, elcr[0]);
1534 + outb(0x4d1, elcr[1]);
1535 + BX_INFO("PIIX3 init: elcr=%02x %02x\n",
1536 + elcr[0], elcr[1]);
1537 + } else if (vendor_id == 0x8086 && device_id == 0x1237) {
1538 + /* i440 PCI bridge */
1539 + bios_shadow_init(d);
1543 +extern uint8_t smm_relocation_start, smm_relocation_end;
1544 +extern uint8_t smm_code_start, smm_code_end;
1547 +static void smm_init(void)
1549 + /* copy the SMM relocation code */
1550 + memcpy((void *)0x38000, &smm_relocation_start,
1551 + &smm_relocation_end - &smm_relocation_start);
1552 + /* raise an SMI interrupt */
1555 + /* enable the SMM memory window */
1556 + pci_config_writel(&i440_pcidev, 0x6c, (1 << 26) | 0x000a);
1558 + /* copy the SMM code */
1559 + memcpy((void *)0xa8000, &smm_code_start,
1560 + &smm_code_end - &smm_code_start);
1562 + /* close the SMM memory window and enable normal SMM */
1563 + pci_config_writel(&i440_pcidev, 0x6c, (1 << 31) | 0x000a);
1567 +static void pci_bios_init_device(PCIDevice *d)
1571 + int i, pin, pic_irq, vendor_id, device_id;
1573 + class = pci_config_readw(d, PCI_CLASS_DEVICE);
1574 + vendor_id = pci_config_readw(d, PCI_VENDOR_ID);
1575 + device_id = pci_config_readw(d, PCI_DEVICE_ID);
1576 + BX_INFO("PCI: bus=%d devfn=0x%02x: vendor_id=0x%04x device_id=0x%04x\n",
1577 + d->bus, d->devfn, vendor_id, device_id);
1580 + if (vendor_id == 0x8086 && device_id == 0x7010) {
1582 + pci_config_writew(d, 0x40, 0x8000); // enable IDE0
1583 + pci_config_writew(d, 0x42, 0x8000); // enable IDE1
1586 + /* IDE: we map it as in ISA mode */
1587 + pci_set_io_region_addr(d, 0, 0x1f0);
1588 + pci_set_io_region_addr(d, 1, 0x3f4);
1589 + pci_set_io_region_addr(d, 2, 0x170);
1590 + pci_set_io_region_addr(d, 3, 0x374);
1594 + if (vendor_id != 0x1234)
1596 + /* VGA: map frame buffer to default Bochs VBE address */
1597 + pci_set_io_region_addr(d, 0, 0xE0000000);
1601 + if (vendor_id == 0x1014) {
1603 + if (device_id == 0x0046 || device_id == 0xFFFF) {
1604 + /* MPIC & MPIC2 */
1605 + pci_set_io_region_addr(d, 0, 0x80800000 + 0x00040000);
1610 + if (vendor_id == 0x0106b &&
1611 + (device_id == 0x0017 || device_id == 0x0022)) {
1612 + /* macio bridge */
1613 + pci_set_io_region_addr(d, 0, 0x80800000);
1618 + /* default memory mappings */
1619 + for(i = 0; i < PCI_NUM_REGIONS; i++) {
1621 + uint32_t val, size ;
1623 + if (i == PCI_ROM_SLOT)
1626 + ofs = 0x10 + i * 4;
1627 + pci_config_writel(d, ofs, 0xffffffff);
1628 + val = pci_config_readl(d, ofs);
1630 + size = (~(val & ~0xf)) + 1;
1631 + if (val & PCI_ADDRESS_SPACE_IO)
1632 + paddr = &pci_bios_io_addr;
1634 + paddr = &pci_bios_mem_addr;
1635 + *paddr = (*paddr + size - 1) & ~(size - 1);
1636 + pci_set_io_region_addr(d, i, *paddr);
1643 + /* map the interrupt */
1644 + pin = pci_config_readb(d, PCI_INTERRUPT_PIN);
1646 + pin = pci_slot_get_pirq(d, pin - 1);
1647 + pic_irq = pci_irqs[pin];
1648 + pci_config_writeb(d, PCI_INTERRUPT_LINE, pic_irq);
1651 + if (vendor_id == 0x8086 && device_id == 0x7113) {
1652 + /* PIIX4 Power Management device (for ACPI) */
1653 + pm_io_base = PM_IO_BASE;
1654 + pci_config_writel(d, 0x40, pm_io_base | 1);
1655 + pci_config_writeb(d, 0x80, 0x01); /* enable PM io space */
1656 + pm_sci_int = pci_config_readb(d, PCI_INTERRUPT_LINE);
1664 +void pci_for_each_device(void (*init_func)(PCIDevice *d))
1666 + PCIDevice d1, *d = &d1;
1668 + uint16_t vendor_id, device_id;
1670 + for(bus = 0; bus < 1; bus++) {
1671 + for(devfn = 0; devfn < 256; devfn++) {
1674 + vendor_id = pci_config_readw(d, PCI_VENDOR_ID);
1675 + device_id = pci_config_readw(d, PCI_DEVICE_ID);
1676 + if (vendor_id != 0xffff || device_id != 0xffff) {
1683 +void pci_bios_init(void)
1685 + pci_bios_io_addr = 0xc000;
1686 + pci_bios_mem_addr = 0xf0000000;
1688 + pci_for_each_device(pci_bios_init_bridges);
1690 + pci_for_each_device(pci_bios_init_device);
1693 +/****************************************************/
1694 +/* Multi Processor table init */
1696 +static void putb(uint8_t **pp, int val)
1704 +static void putstr(uint8_t **pp, const char *str)
1713 +static void putle16(uint8_t **pp, int val)
1722 +static void putle32(uint8_t **pp, int val)
1733 +static int mpf_checksum(const uint8_t *data, int len)
1737 + for(i = 0; i < len; i++)
1739 + return sum & 0xff;
1742 +static unsigned long align(unsigned long addr, unsigned long v)
1744 + return (addr + v - 1) & ~(v - 1);
1747 +static void mptable_init(void)
1749 + uint8_t *mp_config_table, *q, *float_pointer_struct;
1750 + int ioapic_id, i, len;
1751 + int mp_config_table_size;
1753 + if (smp_cpus <= 1)
1756 +#ifdef BX_USE_EBDA_TABLES
1757 + mp_config_table = (uint8_t *)(ram_size - ACPI_DATA_SIZE - MPTABLE_MAX_SIZE);
1759 + bios_table_cur_addr = align(bios_table_cur_addr, 16);
1760 + mp_config_table = (uint8_t *)bios_table_cur_addr;
1762 + q = mp_config_table;
1763 + putstr(&q, "PCMP"); /* "PCMP signature */
1764 + putle16(&q, 0); /* table length (patched later) */
1765 + putb(&q, 4); /* spec rev */
1766 + putb(&q, 0); /* checksum (patched later) */
1767 + putstr(&q, "QEMUCPU "); /* OEM id */
1768 + putstr(&q, "0.1 "); /* vendor id */
1769 + putle32(&q, 0); /* OEM table ptr */
1770 + putle16(&q, 0); /* OEM table size */
1771 + putle16(&q, 20); /* entry count */
1772 + putle32(&q, 0xfee00000); /* local APIC addr */
1773 + putle16(&q, 0); /* ext table length */
1774 + putb(&q, 0); /* ext table checksum */
1775 + putb(&q, 0); /* reserved */
1777 + for(i = 0; i < smp_cpus; i++) {
1778 + putb(&q, 0); /* entry type = processor */
1779 + putb(&q, i); /* APIC id */
1780 + putb(&q, 0x11); /* local APIC version number */
1782 + putb(&q, 3); /* cpu flags: enabled, bootstrap cpu */
1784 + putb(&q, 1); /* cpu flags: enabled */
1785 + putb(&q, 0); /* cpu signature */
1789 + putle16(&q, 0x201); /* feature flags */
1792 + putle16(&q, 0); /* reserved */
1799 + putb(&q, 1); /* entry type = bus */
1800 + putb(&q, 0); /* bus ID */
1801 + putstr(&q, "ISA ");
1804 + ioapic_id = smp_cpus;
1805 + putb(&q, 2); /* entry type = I/O APIC */
1806 + putb(&q, ioapic_id); /* apic ID */
1807 + putb(&q, 0x11); /* I/O APIC version number */
1808 + putb(&q, 1); /* enable */
1809 + putle32(&q, 0xfec00000); /* I/O APIC addr */
1812 + for(i = 0; i < 16; i++) {
1813 + putb(&q, 3); /* entry type = I/O interrupt */
1814 + putb(&q, 0); /* interrupt type = vectored interrupt */
1815 + putb(&q, 0); /* flags: po=0, el=0 */
1817 + putb(&q, 0); /* source bus ID = ISA */
1818 + putb(&q, i); /* source bus IRQ */
1819 + putb(&q, ioapic_id); /* dest I/O APIC ID */
1820 + putb(&q, i); /* dest I/O APIC interrupt in */
1822 + /* patch length */
1823 + len = q - mp_config_table;
1824 + mp_config_table[4] = len;
1825 + mp_config_table[5] = len >> 8;
1827 + mp_config_table[7] = -mpf_checksum(mp_config_table, q - mp_config_table);
1829 + mp_config_table_size = q - mp_config_table;
1831 +#ifndef BX_USE_EBDA_TABLES
1832 + bios_table_cur_addr += mp_config_table_size;
1835 + /* floating pointer structure */
1836 +#ifdef BX_USE_EBDA_TABLES
1837 + ebda_cur_addr = align(ebda_cur_addr, 16);
1838 + float_pointer_struct = (uint8_t *)ebda_cur_addr;
1840 + bios_table_cur_addr = align(bios_table_cur_addr, 16);
1841 + float_pointer_struct = (uint8_t *)bios_table_cur_addr;
1843 + q = float_pointer_struct;
1844 + putstr(&q, "_MP_");
1845 + /* pointer to MP config table */
1846 + putle32(&q, (unsigned long)mp_config_table);
1848 + putb(&q, 1); /* length in 16 byte units */
1849 + putb(&q, 4); /* MP spec revision */
1850 + putb(&q, 0); /* checksum (patched later) */
1851 + putb(&q, 0); /* MP feature byte 1 */
1857 + float_pointer_struct[10] =
1858 + -mpf_checksum(float_pointer_struct, q - float_pointer_struct);
1859 +#ifdef BX_USE_EBDA_TABLES
1860 + ebda_cur_addr += (q - float_pointer_struct);
1862 + bios_table_cur_addr += (q - float_pointer_struct);
1864 + BX_INFO("MP table addr=0x%08lx MPC table addr=0x%08lx size=0x%x\n",
1865 + (unsigned long)float_pointer_struct,
1866 + (unsigned long)mp_config_table,
1867 + mp_config_table_size);
1870 +/****************************************************/
1871 +/* ACPI tables init */
1873 +/* Table structure from Linux kernel (the ACPI tables are under the
1876 +#define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \
1877 + uint8_t signature [4]; /* ACPI signature (4 ASCII characters) */\
1878 + uint32_t length; /* Length of table, in bytes, including header */\
1879 + uint8_t revision; /* ACPI Specification minor version # */\
1880 + uint8_t checksum; /* To make sum of entire table == 0 */\
1881 + uint8_t oem_id [6]; /* OEM identification */\
1882 + uint8_t oem_table_id [8]; /* OEM table identification */\
1883 + uint32_t oem_revision; /* OEM revision number */\
1884 + uint8_t asl_compiler_id [4]; /* ASL compiler vendor ID */\
1885 + uint32_t asl_compiler_revision; /* ASL compiler revision number */
1888 +struct acpi_table_header /* ACPI common table header */
1890 + ACPI_TABLE_HEADER_DEF
1893 +struct rsdp_descriptor /* Root System Descriptor Pointer */
1895 + uint8_t signature [8]; /* ACPI signature, contains "RSD PTR " */
1896 + uint8_t checksum; /* To make sum of struct == 0 */
1897 + uint8_t oem_id [6]; /* OEM identification */
1898 + uint8_t revision; /* Must be 0 for 1.0, 2 for 2.0 */
1899 + uint32_t rsdt_physical_address; /* 32-bit physical address of RSDT */
1900 + uint32_t length; /* XSDT Length in bytes including hdr */
1901 + uint64_t xsdt_physical_address; /* 64-bit physical address of XSDT */
1902 + uint8_t extended_checksum; /* Checksum of entire table */
1903 + uint8_t reserved [3]; /* Reserved field must be 0 */
1907 + * ACPI 1.0 Root System Description Table (RSDT)
1909 +struct rsdt_descriptor_rev1
1911 + ACPI_TABLE_HEADER_DEF /* ACPI common table header */
1912 + uint32_t table_offset_entry [2]; /* Array of pointers to other */
1917 + * ACPI 1.0 Firmware ACPI Control Structure (FACS)
1919 +struct facs_descriptor_rev1
1921 + uint8_t signature[4]; /* ACPI Signature */
1922 + uint32_t length; /* Length of structure, in bytes */
1923 + uint32_t hardware_signature; /* Hardware configuration signature */
1924 + uint32_t firmware_waking_vector; /* ACPI OS waking vector */
1925 + uint32_t global_lock; /* Global Lock */
1926 + uint32_t S4bios_f : 1; /* Indicates if S4BIOS support is present */
1927 + uint32_t reserved1 : 31; /* Must be 0 */
1928 + uint8_t resverved3 [40]; /* Reserved - must be zero */
1933 + * ACPI 1.0 Fixed ACPI Description Table (FADT)
1935 +struct fadt_descriptor_rev1
1937 + ACPI_TABLE_HEADER_DEF /* ACPI common table header */
1938 + uint32_t firmware_ctrl; /* Physical address of FACS */
1939 + uint32_t dsdt; /* Physical address of DSDT */
1940 + uint8_t model; /* System Interrupt Model */
1941 + uint8_t reserved1; /* Reserved */
1942 + uint16_t sci_int; /* System vector of SCI interrupt */
1943 + uint32_t smi_cmd; /* Port address of SMI command port */
1944 + uint8_t acpi_enable; /* Value to write to smi_cmd to enable ACPI */
1945 + uint8_t acpi_disable; /* Value to write to smi_cmd to disable ACPI */
1946 + uint8_t S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
1947 + uint8_t reserved2; /* Reserved - must be zero */
1948 + uint32_t pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */
1949 + uint32_t pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */
1950 + uint32_t pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
1951 + uint32_t pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */
1952 + uint32_t pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */
1953 + uint32_t pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */
1954 + uint32_t gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */
1955 + uint32_t gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */
1956 + uint8_t pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */
1957 + uint8_t pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */
1958 + uint8_t pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */
1959 + uint8_t pm_tmr_len; /* Byte Length of ports at pm_tm_blk */
1960 + uint8_t gpe0_blk_len; /* Byte Length of ports at gpe0_blk */
1961 + uint8_t gpe1_blk_len; /* Byte Length of ports at gpe1_blk */
1962 + uint8_t gpe1_base; /* Offset in gpe model where gpe1 events start */
1963 + uint8_t reserved3; /* Reserved */
1964 + uint16_t plvl2_lat; /* Worst case HW latency to enter/exit C2 state */
1965 + uint16_t plvl3_lat; /* Worst case HW latency to enter/exit C3 state */
1966 + uint16_t flush_size; /* Size of area read to flush caches */
1967 + uint16_t flush_stride; /* Stride used in flushing caches */
1968 + uint8_t duty_offset; /* Bit location of duty cycle field in p_cnt reg */
1969 + uint8_t duty_width; /* Bit width of duty cycle field in p_cnt reg */
1970 + uint8_t day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */
1971 + uint8_t mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */
1972 + uint8_t century; /* Index to century in RTC CMOS RAM */
1973 + uint8_t reserved4; /* Reserved */
1974 + uint8_t reserved4a; /* Reserved */
1975 + uint8_t reserved4b; /* Reserved */
1977 + uint32_t wb_invd : 1; /* The wbinvd instruction works properly */
1978 + uint32_t wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */
1979 + uint32_t proc_c1 : 1; /* All processors support C1 state */
1980 + uint32_t plvl2_up : 1; /* C2 state works on MP system */
1981 + uint32_t pwr_button : 1; /* Power button is handled as a generic feature */
1982 + uint32_t sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */
1983 + uint32_t fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */
1984 + uint32_t rtcs4 : 1; /* RTC wakeup stat not possible from S4 */
1985 + uint32_t tmr_val_ext : 1; /* The tmr_val width is 32 bits (0 = 24 bits) */
1986 + uint32_t reserved5 : 23; /* Reserved - must be zero */
1993 + * MADT values and structures
1996 +/* Values for MADT PCATCompat */
1999 +#define MULTIPLE_APIC 1
2004 +struct multiple_apic_table
2006 + ACPI_TABLE_HEADER_DEF /* ACPI common table header */
2007 + uint32_t local_apic_address; /* Physical address of local APIC */
2009 + uint32_t PCATcompat : 1; /* A one indicates system also has dual 8259s */
2010 + uint32_t reserved1 : 31;
2017 +/* Values for Type in APIC_HEADER_DEF */
2019 +#define APIC_PROCESSOR 0
2021 +#define APIC_XRUPT_OVERRIDE 2
2023 +#define APIC_LOCAL_NMI 4
2024 +#define APIC_ADDRESS_OVERRIDE 5
2025 +#define APIC_IO_SAPIC 6
2026 +#define APIC_LOCAL_SAPIC 7
2027 +#define APIC_XRUPT_SOURCE 8
2028 +#define APIC_RESERVED 9 /* 9 and greater are reserved */
2031 + * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE)
2033 +#define APIC_HEADER_DEF /* Common APIC sub-structure header */\
2037 +/* Sub-structures for MADT */
2039 +struct madt_processor_apic
2042 + uint8_t processor_id; /* ACPI processor id */
2043 + uint8_t local_apic_id; /* Processor's local APIC id */
2045 + uint32_t processor_enabled: 1; /* Processor is usable if set */
2046 + uint32_t reserved2 : 31; /* Reserved, must be zero */
2052 +struct madt_io_apic
2055 + uint8_t io_apic_id; /* I/O APIC ID */
2056 + uint8_t reserved; /* Reserved - must be zero */
2057 + uint32_t address; /* APIC physical address */
2058 + uint32_t interrupt; /* Global system interrupt where INTI
2062 +#include "acpi-dsdt.hex"
2064 +static inline uint16_t cpu_to_le16(uint16_t x)
2069 +static inline uint32_t cpu_to_le32(uint32_t x)
2074 +static int acpi_checksum(const uint8_t *data, int len)
2078 + for(i = 0; i < len; i++)
2080 + return (-sum) & 0xff;
2083 +static void acpi_build_table_header(struct acpi_table_header *h,
2084 + char *sig, int len)
2086 + memcpy(h->signature, sig, 4);
2087 + h->length = cpu_to_le32(len);
2089 + memcpy(h->oem_id, "QEMU ", 6);
2090 + memcpy(h->oem_table_id, "QEMU", 4);
2091 + memcpy(h->oem_table_id + 4, sig, 4);
2092 + h->oem_revision = cpu_to_le32(1);
2093 + memcpy(h->asl_compiler_id, "QEMU", 4);
2094 + h->asl_compiler_revision = cpu_to_le32(1);
2095 + h->checksum = acpi_checksum((void *)h, len);
2098 +/* base_addr must be a multiple of 4KB */
2099 +void acpi_bios_init(void)
2101 + struct rsdp_descriptor *rsdp;
2102 + struct rsdt_descriptor_rev1 *rsdt;
2103 + struct fadt_descriptor_rev1 *fadt;
2104 + struct facs_descriptor_rev1 *facs;
2105 + struct multiple_apic_table *madt;
2107 + uint32_t base_addr, rsdt_addr, fadt_addr, addr, facs_addr, dsdt_addr;
2108 + uint32_t acpi_tables_size, madt_addr, madt_size;
2111 + /* reserve memory space for tables */
2112 +#ifdef BX_USE_EBDA_TABLES
2113 + ebda_cur_addr = align(ebda_cur_addr, 16);
2114 + rsdp = (void *)(ebda_cur_addr);
2115 + ebda_cur_addr += sizeof(*rsdp);
2117 + bios_table_cur_addr = align(bios_table_cur_addr, 16);
2118 + rsdp = (void *)(bios_table_cur_addr);
2119 + bios_table_cur_addr += sizeof(*rsdp);
2122 + addr = base_addr = ram_size - ACPI_DATA_SIZE;
2124 + rsdt = (void *)(addr);
2125 + addr += sizeof(*rsdt);
2128 + fadt = (void *)(addr);
2129 + addr += sizeof(*fadt);
2131 + /* XXX: FACS should be in RAM */
2132 + addr = (addr + 63) & ~63; /* 64 byte alignment for FACS */
2134 + facs = (void *)(addr);
2135 + addr += sizeof(*facs);
2138 + dsdt = (void *)(addr);
2139 + addr += sizeof(AmlCode);
2141 + addr = (addr + 7) & ~7;
2143 + madt_size = sizeof(*madt) +
2144 + sizeof(struct madt_processor_apic) * smp_cpus +
2145 + sizeof(struct madt_io_apic);
2146 + madt = (void *)(addr);
2147 + addr += madt_size;
2149 + acpi_tables_size = addr - base_addr;
2151 + BX_INFO("ACPI tables: RSDP addr=0x%08lx ACPI DATA addr=0x%08lx size=0x%x\n",
2152 + (unsigned long)rsdp,
2153 + (unsigned long)rsdt, acpi_tables_size);
2156 + memset(rsdp, 0, sizeof(*rsdp));
2157 + memcpy(rsdp->signature, "RSD PTR ", 8);
2158 + memcpy(rsdp->oem_id, "QEMU ", 6);
2159 + rsdp->rsdt_physical_address = cpu_to_le32(rsdt_addr);
2160 + rsdp->checksum = acpi_checksum((void *)rsdp, 20);
2163 + rsdt->table_offset_entry[0] = cpu_to_le32(fadt_addr);
2164 + rsdt->table_offset_entry[1] = cpu_to_le32(madt_addr);
2165 + acpi_build_table_header((struct acpi_table_header *)rsdt,
2166 + "RSDT", sizeof(*rsdt));
2169 + memset(fadt, 0, sizeof(*fadt));
2170 + fadt->firmware_ctrl = cpu_to_le32(facs_addr);
2171 + fadt->dsdt = cpu_to_le32(dsdt_addr);
2173 + fadt->reserved1 = 0;
2174 + fadt->sci_int = cpu_to_le16(pm_sci_int);
2175 + fadt->smi_cmd = cpu_to_le32(SMI_CMD_IO_ADDR);
2176 + fadt->acpi_enable = 0xf1;
2177 + fadt->acpi_disable = 0xf0;
2178 + fadt->pm1a_evt_blk = cpu_to_le32(pm_io_base);
2179 + fadt->pm1a_cnt_blk = cpu_to_le32(pm_io_base + 0x04);
2180 + fadt->pm_tmr_blk = cpu_to_le32(pm_io_base + 0x08);
2181 + fadt->pm1_evt_len = 4;
2182 + fadt->pm1_cnt_len = 2;
2183 + fadt->pm_tmr_len = 4;
2184 + fadt->plvl2_lat = cpu_to_le16(50);
2185 + fadt->plvl3_lat = cpu_to_le16(50);
2186 + fadt->plvl3_lat = cpu_to_le16(50);
2187 + /* WBINVD + PROC_C1 + PWR_BUTTON + SLP_BUTTON + FIX_RTC */
2188 + fadt->flags = cpu_to_le32((1 << 0) | (1 << 2) | (1 << 4) | (1 << 5) | (1 << 6));
2189 + acpi_build_table_header((struct acpi_table_header *)fadt, "FACP",
2193 + memset(facs, 0, sizeof(*facs));
2194 + memcpy(facs->signature, "FACS", 4);
2195 + facs->length = cpu_to_le32(sizeof(*facs));
2198 + memcpy(dsdt, AmlCode, sizeof(AmlCode));
2202 + struct madt_processor_apic *apic;
2203 + struct madt_io_apic *io_apic;
2205 + memset(madt, 0, madt_size);
2206 + madt->local_apic_address = cpu_to_le32(0xfee00000);
2207 + madt->flags = cpu_to_le32(1);
2208 + apic = (void *)(madt + 1);
2209 + for(i=0;i<smp_cpus;i++) {
2210 + apic->type = APIC_PROCESSOR;
2211 + apic->length = sizeof(*apic);
2212 + apic->processor_id = i;
2213 + apic->local_apic_id = i;
2214 + apic->flags = cpu_to_le32(1);
2217 + io_apic = (void *)apic;
2218 + io_apic->type = APIC_IO;
2219 + io_apic->length = sizeof(*io_apic);
2220 + io_apic->io_apic_id = smp_cpus;
2221 + io_apic->address = cpu_to_le32(0xfec00000);
2222 + io_apic->interrupt = cpu_to_le32(0);
2224 + acpi_build_table_header((struct acpi_table_header *)madt,
2225 + "APIC", madt_size);
2229 +void rombios32_init(void)
2231 + BX_INFO("Starting rombios32\n");
2241 + if (bios_table_cur_addr != 0) {
2248 + bios_lock_shadow_ram();
2251 diff -ruN --exclude Makefile bios/rombios32.ld bios.new/rombios32.ld
2252 --- bios/rombios32.ld 1970-01-01 01:00:00.000000000 +0100
2253 +++ bios.new/rombios32.ld 2006-09-24 20:28:05.000000000 +0200
2255 +OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
2261 + .text : { *(.text) }
2262 + .rodata : { *(.rodata) }
2264 + .data : { *(.data) }
2266 + .bss : { *(.bss) *(COMMON) }
2268 + /DISCARD/ : { *(.stab)
2274 diff -ruN --exclude Makefile bios/rombios32start.S bios.new/rombios32start.S
2275 --- bios/rombios32start.S 1970-01-01 01:00:00.000000000 +0100
2276 +++ bios.new/rombios32start.S 2006-09-24 20:22:58.000000000 +0200
2279 +.globl smp_ap_boot_code_start
2280 +.globl smp_ap_boot_code_end
2281 +.global smm_relocation_start
2282 +.global smm_relocation_end
2283 +.global smm_code_start
2284 +.global smm_code_end
2286 +#define PM_IO_BASE 0xb000
2289 + /* clear bss section */
2291 + mov $__bss_start, %edi
2296 + jmp rombios32_init
2298 +#define CPU_COUNT 0xf000
2301 +smp_ap_boot_code_start:
2308 +smp_ap_boot_code_end:
2310 +/* code to relocate SMBASE to 0xa0000 */
2311 +smm_relocation_start:
2312 + mov $0x38000 + 0x7efc, %ebx
2313 + mov (%ebx), %al /* revision ID to see if x86_64 or x86 */
2316 + mov $0x38000 + 0x7ef8, %ebx
2319 + mov $0x38000 + 0x7f00, %ebx
2321 + movl $0xa0000, %eax
2324 +smm_relocation_end:
2326 +/* minimal SMM code to enable or disable ACPI */
2333 + /* ACPI disable */
2334 + mov $PM_IO_BASE + 0x04, %dx /* PMCNTRL */
2346 + mov $PM_IO_BASE + 0x04, %dx /* PMCNTRL */
2354 diff -ruN --exclude Makefile bios/rombios.c bios.new/rombios.c
2355 --- bios/rombios.c 2006-08-11 19:34:12.000000000 +0200
2356 +++ bios.new/rombios.c 2006-09-24 20:35:47.000000000 +0200
2358 // License along with this library; if not, write to the Free Software
2359 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2361 -// ROM BIOS for use with Bochs/Plex x86 emulation environment
2362 +// ROM BIOS for use with Bochs/Plex x86/QEMU emulation environment
2365 // ROM BIOS compatability entry points:
2367 #define BX_FLOPPY_ON_CNT 37 /* 2 seconds */
2368 #define BX_PCIBIOS 1
2370 +#define BX_ROMBIOS32 1
2372 #define BX_USE_ATADRV 1
2373 #define BX_ELTORITO_BOOT 1
2375 #define BIOS_REVISION 1
2376 #define BIOS_CONFIG_TABLE 0xe6f5
2378 +/* define it to include QEMU specific code */
2381 #ifndef BIOS_BUILD_DATE
2382 # define BIOS_BUILD_DATE "06/23/99"
2385 #define BASE_MEM_IN_K (640 - EBDA_SIZE)
2387 // Define the application NAME
2389 +#if defined(BX_QEMU)
2390 +# define BX_APPNAME "QEMU"
2391 +#elif defined(PLEX86)
2392 # define BX_APPNAME "Plex86"
2394 # define BX_APPNAME "Bochs"
2395 @@ -1826,6 +1832,9 @@
2396 #ifdef BX_ELTORITO_BOOT
2399 +#ifdef BX_ROMBIOS32
2405 @@ -4085,6 +4094,24 @@
2406 case 0x20: // coded by osmaker aka K.J.
2407 if(regs.u.r32.edx == 0x534D4150)
2409 + extended_memory_size = inb_cmos(0x35);
2410 + extended_memory_size <<= 8;
2411 + extended_memory_size |= inb_cmos(0x34);
2412 + extended_memory_size *= 64;
2413 + // greater than EFF00000???
2414 + if(extended_memory_size > 0x3bc000) {
2415 + extended_memory_size = 0x3bc000; // everything after this is reserved memory until we get to 0x100000000
2417 + extended_memory_size *= 1024;
2418 + extended_memory_size += (16L * 1024 * 1024);
2420 + if(extended_memory_size <= (16L * 1024 * 1024)) {
2421 + extended_memory_size = inb_cmos(0x31);
2422 + extended_memory_size <<= 8;
2423 + extended_memory_size |= inb_cmos(0x30);
2424 + extended_memory_size *= 1024;
2427 switch(regs.u.r16.bx)
2430 @@ -4115,27 +4142,9 @@
2434 - extended_memory_size = inb_cmos(0x35);
2435 - extended_memory_size <<= 8;
2436 - extended_memory_size |= inb_cmos(0x34);
2437 - extended_memory_size *= 64;
2438 - if(extended_memory_size > 0x3bc000) // greater than EFF00000???
2440 - extended_memory_size = 0x3bc000; // everything after this is reserved memory until we get to 0x100000000
2442 - extended_memory_size *= 1024;
2443 - extended_memory_size += (16L * 1024 * 1024);
2445 - if(extended_memory_size <= (16L * 1024 * 1024))
2447 - extended_memory_size = inb_cmos(0x31);
2448 - extended_memory_size <<= 8;
2449 - extended_memory_size |= inb_cmos(0x30);
2450 - extended_memory_size *= 1024;
2453 set_e820_range(ES, regs.u.r16.di,
2454 - 0x00100000L, extended_memory_size, 1);
2456 + extended_memory_size - 0x10000L, 1);
2458 regs.u.r32.eax = 0x534D4150;
2459 regs.u.r32.ecx = 0x14;
2460 @@ -4143,6 +4152,16 @@
2464 + set_e820_range(ES, regs.u.r16.di,
2465 + extended_memory_size - 0x10000L,
2466 + extended_memory_size, 3); // ACPI RAM
2467 + regs.u.r32.ebx = 5;
2468 + regs.u.r32.eax = 0x534D4150;
2469 + regs.u.r32.ecx = 0x14;
2474 /* 256KB BIOS area at the end of 4 GB */
2475 set_e820_range(ES, regs.u.r16.di,
2476 0xfffc0000L, 0x00000000L, 2);
2477 @@ -8757,6 +8776,9 @@
2482 + and dword ptr[esp+8],0xfffffffc ;; reset CS.RPL for kqemu
2487 @@ -8868,6 +8890,9 @@
2492 + and dword ptr[esp+8],0xfffffffc ;; reset CS.RPL for kqemu
2497 @@ -8875,6 +8900,9 @@
2502 + and dword ptr[esp+8],0xfffffffc ;; reset CS.RPL for kqemu
2507 @@ -9183,227 +9211,118 @@
2509 pci_routing_table_structure_end:
2513 +#endif // BX_PCIBIOS
2515 -pcibios_init_sel_reg:
2517 - mov eax, #0x800000
2527 -pcibios_init_iomem_bases:
2530 - mov eax, #0xe0000000 ;; base for memory init
2532 - mov ax, #0xc000 ;; base for i/o init
2534 - mov ax, #0x0010 ;; start at base address #0
2537 + ;; save a20 and enable it
2543 - call pcibios_init_sel_reg
2548 - mov dl, #0x04 ;; disable i/o and memory space access
2549 - call pcibios_init_sel_reg
2556 - call pcibios_init_sel_reg
2562 - mov eax, #0xffffffff
2567 - xor eax, #0xffffffff
2571 - add eax, ecx ;; calculate next free mem base
2572 - add eax, #0x01000000
2573 - and eax, #0xff000000
2587 - add ax, cx ;; calculate next free i/o base
2595 - je enable_iomem_space
2596 - mov byte ptr[bp-8], al
2597 - jmp pci_init_io_loop2
2598 -enable_iomem_space:
2599 - mov dl, #0x04 ;; enable i/o and memory space access if available
2600 - call pcibios_init_sel_reg
2606 - mov byte ptr[bp-8], #0x10
2609 - jne pci_init_io_loop1
2616 -pcibios_init_set_elcr:
2634 + ;; save SS:SP to the BDA
2645 - mov dx, #0x04d0 ;; reset ELCR1 + ELCR2
2650 - mov si, #pci_routing_table_structure
2654 - call pcibios_init_sel_reg
2657 - cmp eax, [si+12] ;; check irq router
2660 - call pcibios_init_sel_reg
2661 - push bx ;; save irq router bus + devfunc
2664 - out dx, ax ;; reset PIRQ route control
2672 - add si, #0x20 ;; set pointer to 1st entry
2674 - mov ax, #pci_irq_list
2678 -pci_init_irq_loop1:
2681 -pci_init_irq_loop2:
2683 - call pcibios_init_sel_reg
2687 - jnz pci_test_int_pin
2693 - call pcibios_init_sel_reg
2698 - dec al ;; determine pirq reg
2707 - call pcibios_init_sel_reg
2714 - mov bx, [bp-2] ;; pci irq list pointer
2719 - call pcibios_init_set_elcr
2723 - add bl, [bp-3] ;; pci function number
2725 - call pcibios_init_sel_reg
2729 - inc byte ptr[bp-3]
2732 - jnz pci_init_irq_loop2
2735 - mov byte ptr[bp-3], #0x00
2736 - loop pci_init_irq_loop1
2743 + lidt [pmode_IDT_info]
2745 + lgdt [rombios32_gdt_48]
2746 + ;; set PE bit in CR0
2750 + ;; start protected mode code: ljmpl 0x10:rombios32_init1
2753 + dw 0x000f ;; high 16 bit address
2758 + ;; init data segments
2768 + ;; copy rombios32 code to ram (ram offset = 1MB)
2769 + mov esi, #0xfffe0000
2770 + mov edi, #0x00040000
2771 + mov ecx, #0x10000 / 4
2775 + ;; init the stack pointer
2776 + mov esp, #0x00080000
2778 + ;; call rombios32 code
2779 + mov eax, #0x00040000
2782 + ;; return to 16 bit protected mode first
2789 + ;; restore data segment limits to 0xffff
2797 + ;; reset PE bit in CR0
2802 + ;; far jump to flush CPU queue after transition to real mode
2803 + JMP_AP(0xf000, rombios32_real_mode)
2805 +rombios32_real_mode:
2806 + ;; restore IDT to normal real-mode defaults
2808 + lidt [rmode_IDT_info]
2816 + ;; restore SS:SP from the BDA
2823 -#endif // BX_PCIBIOS
2833 + dw 0xffff, 0, 0x9b00, 0x00cf ; 32 bit flat code segment (0x10)
2834 + dw 0xffff, 0, 0x9300, 0x00cf ; 32 bit flat data segment (0x18)
2835 + dw 0xffff, 0, 0x9b0f, 0x0000 ; 16 bit code segment base=0xf0000 limit=0xffff
2836 + dw 0xffff, 0, 0x9300, 0x0000 ; 16 bit data segment base=0x0 limit=0xffff
2840 ; parallel port detection: base address in DX, index in BX, timeout in CL
2842 @@ -9535,10 +9454,17 @@
2843 ;; DATA_SEG_DEFS_HERE
2846 +;; the following area can be used to write dynamically generated tables
2848 +bios_table_area_start:
2850 + dd bios_table_area_end - bios_table_area_start - 8;
2855 .org 0xe05b ; POST Entry Point
2856 +bios_table_area_end:
2860 @@ -9802,9 +9728,9 @@
2862 out 0xa1, AL ;slave pic: unmask IRQ 12, 13, 14
2864 - call pcibios_init_iomem_bases
2865 - call pcibios_init_irqs
2868 + call rombios32_init
2872 call _print_bios_banner