use generic ELF loader
[qemu] / pc-bios / bios.diff
1 Index: rombios.c
2 ===================================================================
3 RCS file: /cvsroot/bochs/bochs/bios/rombios.c,v
4 retrieving revision 1.160
5 diff -u -w -r1.160 rombios.c
6 --- rombios.c   25 Jan 2006 17:51:49 -0000      1.160
7 +++ rombios.c   2 Apr 2006 18:29:51 -0000
8 @@ -1816,6 +1816,7 @@
9  {
10    printf(BX_APPNAME" BIOS - build: %s\n%s\nOptions: ",
11      BIOS_BUILD_DATE, bios_cvs_version_string);
12 +#if 0
13    printf(
14  #ifdef BX_APM
15    "apmbios "
16 @@ -1827,6 +1828,9 @@
17    "eltorito "
18  #endif
19    "\n\n");
20 +#else
21 +  printf("apmbios pcibios eltorito \n\n");
22 +#endif
23  }
24  
25  //--------------------------------------------------------------------------
26 @@ -8713,6 +8717,7 @@
27    mov al, #0x80
28  bios32_end:
29    popf
30 +  and dword ptr[esp+4],0xfffffffc ;; reset CS.RPL for kqemu
31    retf
32  
33  .align 16
34 @@ -8823,17 +8828,17 @@
35  pci_pro_fail:
36    pop edi
37    pop esi
38 -  sti
39    popf
40    stc
41 +  and dword ptr[esp+4],0xfffffffc ;; reset CS.RPL for kqemu
42    retf
43  pci_pro_ok:
44    xor ah, ah
45    pop edi
46    pop esi
47 -  sti
48    popf
49    clc
50 +  and dword ptr[esp+4],0xfffffffc ;; reset CS.RPL for kqemu
51    retf
52  
53  pci_pro_select_reg:
54 @@ -8971,7 +8976,7 @@
55    jmp pci_real_ok
56  pci_real_f0d: ;; write configuration dword
57    cmp al, #0x0d
58 -  jne pci_real_unknown
59 +  jne pci_real_f0e
60    call pci_real_select_reg
61    push dx
62    mov dx, #0x0cfc
63 @@ -8979,6 +8984,46 @@
64    out dx, eax
65    pop dx
66    jmp pci_real_ok
67 +pci_real_f0e: ;; get irq routing options
68 +  cmp al, #0x0e
69 +  jne pci_real_unknown
70 +  SEG ES
71 +  cmp word ptr [di], #pci_routing_table_structure_end - pci_routing_table_structure_start
72 +  jb pci_real_too_small    
73 +  SEG ES
74 +  mov word ptr [di], #pci_routing_table_structure_end - pci_routing_table_structure_start        
75 +  pushf
76 +  push ds
77 +  push es
78 +  push cx
79 +  push si
80 +  push di
81 +  cld
82 +  mov si, #pci_routing_table_structure_start
83 +  push cs
84 +  pop ds
85 +  SEG ES
86 +  mov cx, [di+2]
87 +  SEG ES
88 +  mov es, [di+4]
89 +  mov di, cx
90 +  mov cx, #pci_routing_table_structure_end - pci_routing_table_structure_start
91 +  rep 
92 +      movsb
93 +  pop di
94 +  pop si
95 +  pop cx
96 +  pop es
97 +  pop ds
98 +  popf
99 +  mov bx, #(1 << 9) | (1 << 11)   ;; irq 9 and 11 are used
100 +  jmp pci_real_ok
101 +pci_real_too_small:
102 +  SEG ES
103 +  mov word ptr [di], #pci_routing_table_structure_end - pci_routing_table_structure_start        
104 +  mov ah, #0x89
105 +  jmp pci_real_fail
106 +
107  pci_real_unknown:
108    mov ah, #0x81
109  pci_real_fail:
110 @@ -9019,6 +9064,7 @@
111    dw 0,0 ;; Miniport data
112    db 0,0,0,0,0,0,0,0,0,0,0 ;; reserved
113    db 0x07 ;; checksum
114 +pci_routing_table_structure_start:
115    ;; first slot entry PCI-to-ISA (embedded)
116    db 0 ;; pci bus number
117    db 0x08 ;; pci device number (bit 7-3)
118 @@ -9097,6 +9143,7 @@
119    dw 0xdef8 ;; IRQ bitmap INTD#
120    db 5 ;; physical slot (0 = embedded)
121    db 0 ;; reserved
122 +pci_routing_table_structure_end:
123  
124  pci_irq_list:
125    db 11, 10, 9, 5;