]> git.proxmox.com Git - qemu.git/blame - pc-bios/bios.diff
enabled DMA
[qemu.git] / pc-bios / bios.diff
CommitLineData
3f433d2c
FB
1Index: rombios.c
2===================================================================
3RCS file: /cvsroot/bochs/bochs/bios/rombios.c,v
678f2df6
FB
4retrieving revision 1.110
5diff -u -w -r1.110 rombios.c
6--- rombios.c 31 May 2004 13:11:27 -0000 1.110
a4c4785b 7+++ rombios.c 7 Oct 2004 21:23:50 -0000
678f2df6
FB
8@@ -137,6 +137,7 @@
9 #define DEBUG_INT16 0
10 #define DEBUG_INT1A 0
11 #define DEBUG_INT74 0
12+#define DEBUG_APM 0
3f433d2c 13
678f2df6
FB
14 #define BX_CPU 3
15 #define BX_USE_PS2_MOUSE 1
16@@ -145,6 +146,7 @@
17 #define BX_SUPPORT_FLOPPY 1
18 #define BX_FLOPPY_ON_CNT 37 // 2 seconds
19 #define BX_PCIBIOS 1
20+#define BX_APM 1
5b1214a4 21
678f2df6
FB
22 #define BX_USE_ATADRV 1
23 #define BX_ELTORITO_BOOT 1
24@@ -230,17 +232,6 @@
25 out dx,ax
26 MEND
3f433d2c 27
678f2df6
FB
28-MACRO HALT2
29- ;; the HALT macro is called with the line number of the HALT call.
30- ;; The line number is then sent to the PANIC_PORT, causing Bochs/Plex
31- ;; to print a BX_PANIC message. This will normally halt the simulation
32- ;; with a message such as "BIOS panic at rombios.c, line 4091".
33- ;; However, users can choose to make panics non-fatal and continue.
34- mov dx,#PANIC_PORT2
35- mov ax,#?1
36- out dx,ax
37-MEND
38-
39 MACRO JMP_AP
40 db 0xea
41 dw ?2
42@@ -1543,15 +1534,12 @@
3f433d2c
FB
43 }
44
678f2df6
FB
45 if (action & BIOS_PRINTF_HALT) {
46- // freeze in a busy loop. If I do a HLT instruction, then in versions
47- // 1.3.pre1 and earlier, it will panic without ever updating the VGA
48- // display, so the panic message will not be visible. By waiting
49- // forever, you are certain to see the panic message on screen.
50- // After a few more versions have passed, we can turn this back into
51- // a halt or something.
52- // do {} while (1);
53+ // freeze in a busy loop.
54 ASM_START
55- HALT2(__LINE__)
56+ cli
57+ halt2_loop:
58+ hlt
59+ jmp halt2_loop
60 ASM_END
61 }
62 }
a4c4785b
FB
63@@ -5412,8 +5400,8 @@
64 case 0x03: SET_BL( 0x06 ); break;
65 }
66
67- DI = 0xefc7;
68- ES = 0xf000;
69+ DI = read_word(0x00, 0x1e*4); // INT vector 0x1E
70+ ES = read_word(0x00, 0x1e*4+2);
71 goto int13_success;
72 break;
73
74@@ -6984,8 +6972,8 @@
75 }
76
77 /* set es & di to point to 11 byte diskette param table in ROM */
78- DI = 0xefc7;
79- ES = 0xf000;
80+ DI = read_word(0x00, 0x1e*4); // INT vector 0x1E
81+ ES = read_word(0x00, 0x1e*4+2);
82 CLEAR_CF(); // success
83 /* disk status not changed upon success */
84 return;
a5ba1ca6
FB
85@@ -7880,7 +7868,7 @@
86 mov al, #0x02
87 out #0x0a, al ;; clear DMA-1 channel 2 mask bit
88
89- SET_INT_VECTOR(0x1E, #0xF000, #diskette_param_table)
90+ SET_INT_VECTOR(0x1E, #0xF000, #diskette_param_table2)
91 SET_INT_VECTOR(0x40, #0xF000, #int13_diskette)
92 SET_INT_VECTOR(0x0E, #0xF000, #int0e_handler) ;; IRQ 6
93
678f2df6
FB
94@@ -8344,6 +8332,19 @@
95 pop ax
96 iret
e58a7c24 97
678f2df6
FB
98+
99+;--------------------
100+#if BX_APM
101+use32 386
102+#define APM_PROT32
103+#include "apmbios.S"
104+use16 386
105+
106+#define APM_REAL
107+#include "apmbios.S"
108+
109+#endif
110+
111 ;--------------------
112 #if BX_PCIBIOS
113 use32 386
a5ba1ca6
FB
114@@ -9515,6 +9516,26 @@
115 pop ds
116 iret
117
118+diskette_param_table2:
119+;; New diskette parameter table adding 3 parameters from IBM
120+;; Since no provisions are made for multiple drive types, most
121+;; values in this table are ignored. I set parameters for 1.44M
122+;; floppy here
123+db 0xAF
124+db 0x02 ;; head load time 0000001, DMA used
125+db 0x25
126+db 0x02
127+db 18
128+db 0x1B
129+db 0xFF
130+db 0x6C
131+db 0xF6
132+db 0x0F
133+db 0x08
134+db 79 ;; maximum track
135+db 0 ;; data transfer rate
136+db 4 ;; drive type in cmos
137+
138 .org 0xf045 ; INT 10 Functions 0-Fh Entry Point
139 HALT(__LINE__)
140 iret
141@@ -9560,6 +9581,10 @@
678f2df6
FB
142 .org 0xf859 ; INT 15h System Services Entry Point
143 int15_handler:
144 pushf
145+#if BX_APM
146+ cmp ah, #0x53
147+ je apm_call
148+#endif
e58a7c24 149 push ds
678f2df6
FB
150 push es
151 pushad
a5ba1ca6 152@@ -9570,6 +9595,10 @@
e58a7c24 153 popf
678f2df6
FB
154 //JMPL(iret_modify_cf)
155 jmp iret_modify_cf
156+#if BX_APM
157+apm_call:
158+ jmp _apmreal_entry
159+#endif
fb9f9444 160
678f2df6
FB
161 ;; Protected mode IDT descriptor
162 ;;