2004-05-16 22:21:17 +08:00
|
|
|
Index: rombios.c
|
|
|
|
===================================================================
|
|
|
|
RCS file: /cvsroot/bochs/bochs/bios/rombios.c,v
|
2004-06-20 21:12:23 +08:00
|
|
|
retrieving revision 1.110
|
|
|
|
diff -u -w -r1.110 rombios.c
|
|
|
|
--- rombios.c 31 May 2004 13:11:27 -0000 1.110
|
|
|
|
+++ rombios.c 20 Jun 2004 13:10:07 -0000
|
|
|
|
@@ -137,6 +137,7 @@
|
|
|
|
#define DEBUG_INT16 0
|
|
|
|
#define DEBUG_INT1A 0
|
|
|
|
#define DEBUG_INT74 0
|
|
|
|
+#define DEBUG_APM 0
|
2004-05-16 22:21:17 +08:00
|
|
|
|
2004-06-20 21:12:23 +08:00
|
|
|
#define BX_CPU 3
|
|
|
|
#define BX_USE_PS2_MOUSE 1
|
|
|
|
@@ -145,6 +146,7 @@
|
|
|
|
#define BX_SUPPORT_FLOPPY 1
|
|
|
|
#define BX_FLOPPY_ON_CNT 37 // 2 seconds
|
|
|
|
#define BX_PCIBIOS 1
|
|
|
|
+#define BX_APM 1
|
2004-05-16 23:52:12 +08:00
|
|
|
|
2004-06-20 21:12:23 +08:00
|
|
|
#define BX_USE_ATADRV 1
|
|
|
|
#define BX_ELTORITO_BOOT 1
|
|
|
|
@@ -230,17 +232,6 @@
|
|
|
|
out dx,ax
|
|
|
|
MEND
|
2004-05-16 22:21:17 +08:00
|
|
|
|
2004-06-20 21:12:23 +08:00
|
|
|
-MACRO HALT2
|
|
|
|
- ;; the HALT macro is called with the line number of the HALT call.
|
|
|
|
- ;; The line number is then sent to the PANIC_PORT, causing Bochs/Plex
|
|
|
|
- ;; to print a BX_PANIC message. This will normally halt the simulation
|
|
|
|
- ;; with a message such as "BIOS panic at rombios.c, line 4091".
|
|
|
|
- ;; However, users can choose to make panics non-fatal and continue.
|
|
|
|
- mov dx,#PANIC_PORT2
|
|
|
|
- mov ax,#?1
|
|
|
|
- out dx,ax
|
|
|
|
-MEND
|
|
|
|
-
|
|
|
|
MACRO JMP_AP
|
|
|
|
db 0xea
|
|
|
|
dw ?2
|
|
|
|
@@ -1543,15 +1534,12 @@
|
2004-05-16 22:21:17 +08:00
|
|
|
}
|
|
|
|
|
2004-06-20 21:12:23 +08:00
|
|
|
if (action & BIOS_PRINTF_HALT) {
|
|
|
|
- // freeze in a busy loop. If I do a HLT instruction, then in versions
|
|
|
|
- // 1.3.pre1 and earlier, it will panic without ever updating the VGA
|
|
|
|
- // display, so the panic message will not be visible. By waiting
|
|
|
|
- // forever, you are certain to see the panic message on screen.
|
|
|
|
- // After a few more versions have passed, we can turn this back into
|
|
|
|
- // a halt or something.
|
|
|
|
- // do {} while (1);
|
|
|
|
+ // freeze in a busy loop.
|
|
|
|
ASM_START
|
|
|
|
- HALT2(__LINE__)
|
|
|
|
+ cli
|
|
|
|
+ halt2_loop:
|
|
|
|
+ hlt
|
|
|
|
+ jmp halt2_loop
|
|
|
|
ASM_END
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -8344,6 +8332,19 @@
|
|
|
|
pop ax
|
|
|
|
iret
|
2004-05-24 00:28:35 +08:00
|
|
|
|
2004-06-20 21:12:23 +08:00
|
|
|
+
|
|
|
|
+;--------------------
|
|
|
|
+#if BX_APM
|
|
|
|
+use32 386
|
|
|
|
+#define APM_PROT32
|
|
|
|
+#include "apmbios.S"
|
|
|
|
+use16 386
|
|
|
|
+
|
|
|
|
+#define APM_REAL
|
|
|
|
+#include "apmbios.S"
|
|
|
|
+
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
;--------------------
|
|
|
|
#if BX_PCIBIOS
|
|
|
|
use32 386
|
|
|
|
@@ -9560,6 +9561,10 @@
|
|
|
|
.org 0xf859 ; INT 15h System Services Entry Point
|
|
|
|
int15_handler:
|
|
|
|
pushf
|
|
|
|
+#if BX_APM
|
|
|
|
+ cmp ah, #0x53
|
|
|
|
+ je apm_call
|
|
|
|
+#endif
|
2004-05-24 00:28:35 +08:00
|
|
|
push ds
|
2004-06-20 21:12:23 +08:00
|
|
|
push es
|
|
|
|
pushad
|
|
|
|
@@ -9570,6 +9575,10 @@
|
2004-05-24 00:28:35 +08:00
|
|
|
popf
|
2004-06-20 21:12:23 +08:00
|
|
|
//JMPL(iret_modify_cf)
|
|
|
|
jmp iret_modify_cf
|
|
|
|
+#if BX_APM
|
|
|
|
+apm_call:
|
|
|
|
+ jmp _apmreal_entry
|
|
|
|
+#endif
|
2004-05-23 00:27:00 +08:00
|
|
|
|
2004-06-20 21:12:23 +08:00
|
|
|
;; Protected mode IDT descriptor
|
|
|
|
;;
|