Commit ca7b25e3ab8a49e46484bd436fedf72940f02887

Authored by aliguori
1 parent 44d3749c

Update to the latest Bochs BIOS

Update the PC BIOS to the latest version, split out the patches into 
patch series, and update the README to point to the new location of the 
Bochs BIOS source tree.

Also update the gitignore to allow the patch queue directory to be used.



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6077 c046a42c-6fe2-441c-8c8c-71466251a162
.gitignore
@@ -32,3 +32,4 @@ qemu-nbd.pod @@ -32,3 +32,4 @@ qemu-nbd.pod
32 *.d 32 *.d
33 .pc 33 .pc
34 patches 34 patches
  35 +pc-bios/bios-pq/status
pc-bios/README
1 -- The PC BIOS comes from the Bochs project  
2 - (http://bochs.sourceforge.net/). A patch from bios.diff was applied. 1 +- The PC BIOS comes from the Bochs project (http://bochs.sourceforge.net/).
  2 + The patches in bios-pq have been applied. The binary is based on the revision
  3 + in bios-pq/HEAD with the patches in bios-pq/series applied. The git repo
  4 + that HEAD refers to is located at http://repo.or.cz/w/bochs-mirror.git
3 5
4 - The VGA BIOS and the Cirrus VGA BIOS come from the LGPL VGA bios 6 - The VGA BIOS and the Cirrus VGA BIOS come from the LGPL VGA bios
5 project (http://www.nongnu.org/vgabios/). 7 project (http://www.nongnu.org/vgabios/).
pc-bios/bios-pq/0001_bx-qemu.patch 0 → 100644
  1 +--- bochs-2.3.7.orig/bios/rombios.h
  2 ++++ bochs-2.3.7/bios/rombios.h
  3 +@@ -19,7 +19,7 @@
  4 + // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  5 +
  6 + /* define it to include QEMU specific code */
  7 +-//#define BX_QEMU
  8 ++#define BX_QEMU
  9 +
  10 + #ifndef LEGACY
  11 + # define BX_ROMBIOS32 1
pc-bios/bios.diff renamed to pc-bios/bios-pq/0002_e820-high-mem.patch
1 ---- bochs-2.3.7.orig/bios/rombios.h  
2 -+++ bochs-2.3.7/bios/rombios.h  
3 -@@ -19,7 +19,7 @@  
4 - // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA  
5 -  
6 - /* define it to include QEMU specific code */  
7 --//#define BX_QEMU  
8 -+#define BX_QEMU  
9 -  
10 - #ifndef LEGACY  
11 - # define BX_ROMBIOS32 1  
12 ---- bochs-2.3.7.orig/bios/rombios.c  
13 -+++ bochs-2.3.7/bios/rombios.c  
14 -@@ -4404,22 +4404,25 @@ 1 +From: Izik Eidus <izike@qumranet.com>
  2 +
  3 +add support to memory above the pci hole
  4 +
  5 +the new memory region is mapped after address 0x100000000,
  6 +the bios take the size of the memory after the 0x100000000 from
  7 +three new cmos bytes.
  8 +
  9 +diff --git a/bios/rombios.c b/bios/rombios.c
  10 +index 1be0816..b70f249 100644
  11 +--- a/bios/rombios.c
  12 ++++ b/bios/rombios.c
  13 +@@ -4442,22 +4442,25 @@ BX_DEBUG_INT15("case default:\n");
15 #endif // BX_USE_PS2_MOUSE 14 #endif // BX_USE_PS2_MOUSE
16 15
17 16
@@ -40,7 +39,7 @@ @@ -40,7 +39,7 @@
40 write_word(ES, DI+14, 0x0000); 39 write_word(ES, DI+14, 0x0000);
41 40
42 write_word(ES, DI+16, type); 41 write_word(ES, DI+16, type);
43 -@@ -4432,7 +4435,9 @@ 42 +@@ -4470,7 +4473,9 @@ int15_function32(regs, ES, DS, FLAGS)
44 Bit16u ES, DS, FLAGS; 43 Bit16u ES, DS, FLAGS;
45 { 44 {
46 Bit32u extended_memory_size=0; // 64bits long 45 Bit32u extended_memory_size=0; // 64bits long
@@ -50,7 +49,7 @@ @@ -50,7 +49,7 @@
50 49
51 BX_DEBUG_INT15("int15 AX=%04x\n",regs.u.r16.ax); 50 BX_DEBUG_INT15("int15 AX=%04x\n",regs.u.r16.ax);
52 51
53 -@@ -4506,11 +4511,18 @@ 52 +@@ -4544,11 +4549,18 @@ ASM_END
54 extended_memory_size += (1L * 1024 * 1024); 53 extended_memory_size += (1L * 1024 * 1024);
55 } 54 }
56 55
@@ -65,21 +64,21 @@ @@ -65,21 +64,21 @@
65 { 64 {
66 case 0: 65 case 0:
67 set_e820_range(ES, regs.u.r16.di, 66 set_e820_range(ES, regs.u.r16.di,
68 -- 0x0000000L, 0x0009fc00L, 1);  
69 -+ 0x0000000L, 0x0009fc00L, 0, 0, 1); 67 +- 0x0000000L, 0x0009f000L, 1);
  68 ++ 0x0000000L, 0x0009f000L, 0, 0, 1);
70 regs.u.r32.ebx = 1; 69 regs.u.r32.ebx = 1;
71 regs.u.r32.eax = 0x534D4150; 70 regs.u.r32.eax = 0x534D4150;
72 regs.u.r32.ecx = 0x14; 71 regs.u.r32.ecx = 0x14;
73 -@@ -4519,7 +4531,7 @@ 72 +@@ -4557,7 +4569,7 @@ ASM_END
74 break; 73 break;
75 case 1: 74 case 1:
76 set_e820_range(ES, regs.u.r16.di, 75 set_e820_range(ES, regs.u.r16.di,
77 -- 0x0009fc00L, 0x000a0000L, 2);  
78 -+ 0x0009fc00L, 0x000a0000L, 0, 0, 2); 76 +- 0x0009f000L, 0x000a0000L, 2);
  77 ++ 0x0009f000L, 0x000a0000L, 0, 0, 2);
79 regs.u.r32.ebx = 2; 78 regs.u.r32.ebx = 2;
80 regs.u.r32.eax = 0x534D4150; 79 regs.u.r32.eax = 0x534D4150;
81 regs.u.r32.ecx = 0x14; 80 regs.u.r32.ecx = 0x14;
82 -@@ -4528,7 +4540,7 @@ 81 +@@ -4566,7 +4578,7 @@ ASM_END
83 break; 82 break;
84 case 2: 83 case 2:
85 set_e820_range(ES, regs.u.r16.di, 84 set_e820_range(ES, regs.u.r16.di,
@@ -88,7 +87,7 @@ @@ -88,7 +87,7 @@
88 regs.u.r32.ebx = 3; 87 regs.u.r32.ebx = 3;
89 regs.u.r32.eax = 0x534D4150; 88 regs.u.r32.eax = 0x534D4150;
90 regs.u.r32.ecx = 0x14; 89 regs.u.r32.ecx = 0x14;
91 -@@ -4539,7 +4551,7 @@ 90 +@@ -4577,7 +4589,7 @@ ASM_END
92 #if BX_ROMBIOS32 91 #if BX_ROMBIOS32
93 set_e820_range(ES, regs.u.r16.di, 92 set_e820_range(ES, regs.u.r16.di,
94 0x00100000L, 93 0x00100000L,
@@ -97,7 +96,7 @@ @@ -97,7 +96,7 @@
97 regs.u.r32.ebx = 4; 96 regs.u.r32.ebx = 4;
98 #else 97 #else
99 set_e820_range(ES, regs.u.r16.di, 98 set_e820_range(ES, regs.u.r16.di,
100 -@@ -4555,7 +4567,7 @@ 99 +@@ -4593,7 +4605,7 @@ ASM_END
101 case 4: 100 case 4:
102 set_e820_range(ES, regs.u.r16.di, 101 set_e820_range(ES, regs.u.r16.di,
103 extended_memory_size - ACPI_DATA_SIZE, 102 extended_memory_size - ACPI_DATA_SIZE,
@@ -106,7 +105,7 @@ @@ -106,7 +105,7 @@
106 regs.u.r32.ebx = 5; 105 regs.u.r32.ebx = 5;
107 regs.u.r32.eax = 0x534D4150; 106 regs.u.r32.eax = 0x534D4150;
108 regs.u.r32.ecx = 0x14; 107 regs.u.r32.ecx = 0x14;
109 -@@ -4565,7 +4577,20 @@ 108 +@@ -4603,7 +4615,20 @@ ASM_END
110 case 5: 109 case 5:
111 /* 256KB BIOS area at the end of 4 GB */ 110 /* 256KB BIOS area at the end of 4 GB */
112 set_e820_range(ES, regs.u.r16.di, 111 set_e820_range(ES, regs.u.r16.di,
@@ -128,18 +127,3 @@ @@ -128,18 +127,3 @@
128 regs.u.r32.ebx = 0; 127 regs.u.r32.ebx = 0;
129 regs.u.r32.eax = 0x534D4150; 128 regs.u.r32.eax = 0x534D4150;
130 regs.u.r32.ecx = 0x14; 129 regs.u.r32.ecx = 0x14;
131 ---- bochs-2.3.7.orig/bios/rombios32.c  
132 -+++ bochs-2.3.7/bios/rombios32.c  
133 -@@ -479,7 +479,12 @@  
134 - sipi_vector = AP_BOOT_ADDR >> 12;  
135 - writel(APIC_BASE + APIC_ICR_LOW, 0x000C4600 | sipi_vector);  
136 -  
137 -+#ifndef BX_QEMU  
138 - delay_ms(10);  
139 -+#else  
140 -+ while (cmos_readb(0x5f) + 1 != readw((void *)CPU_COUNT_ADDR))  
141 -+ ;  
142 -+#endif  
143 -  
144 - smp_cpus = readw((void *)CPU_COUNT_ADDR);  
145 - }  
pc-bios/bios-pq/0003_smp-startup-poll.patch 0 → 100644
  1 +From: Avi Kivity <avi@qumranet.com>
  2 +
  3 +instead of timing out, wait until all cpus are up
  4 +
  5 +diff --git a/bios/rombios32.c b/bios/rombios32.c
  6 +index ef98a41..05ba40d 100644
  7 +--- a/bios/rombios32.c
  8 ++++ b/bios/rombios32.c
  9 +@@ -512,7 +512,12 @@ void smp_probe(void)
  10 + sipi_vector = AP_BOOT_ADDR >> 12;
  11 + writel(APIC_BASE + APIC_ICR_LOW, 0x000C4600 | sipi_vector);
  12 +
  13 ++#ifndef BX_QEMU
  14 + delay_ms(10);
  15 ++#else
  16 ++ while (cmos_readb(0x5f) + 1 != readw(&smp_cpus))
  17 ++ ;
  18 ++#endif
  19 + }
  20 + BX_INFO("Found %d cpu(s)\n", readw(&smp_cpus));
  21 + }
pc-bios/bios-pq/0004_no-stack-protector.patch 0 → 100644
  1 +Disable stack protector for BIOS
  2 +
  3 +Some distro GCCs (like Ubuntu) enable stack protection by default. Since the
  4 +BIOS doesn't link against libgcc, this results in undefined references unless
  5 +the stack protector is disabled.
  6 +
  7 +Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  8 +
  9 +diff --git a/bios/Makefile.in b/bios/Makefile.in
  10 +index af674b4..5c7bd4f 100644
  11 +--- a/bios/Makefile.in
  12 ++++ b/bios/Makefile.in
  13 +@@ -41,7 +41,7 @@ RANLIB = @RANLIB@
  14 +
  15 + BCC = bcc
  16 + GCC = gcc
  17 +-GCC32 = gcc -m32
  18 ++GCC32 = gcc -m32 -fno-stack-protector
  19 + AS86 = as86
  20 +
  21 + BX_INCDIRS = -I.. -I$(srcdir)/.. -I../iodev -I$(srcdir)/../iodev
pc-bios/bios-pq/HEAD 0 → 100644
  1 +8d4e158f0ea5fa00fa0276f487ff21609fbb0894
pc-bios/bios-pq/series 0 → 100644
  1 +0001_bx-qemu.patch
  2 +0002_e820-high-mem.patch
  3 +0003_smp-startup-poll.patch
  4 +0004_no-stack-protector.patch
pc-bios/bios.bin
No preview for this file type