From 9140c47f2a6deb64bb4df342d7b926c709248e88 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Sun, 6 Jan 2008 21:00:08 +0000 Subject: [PATCH] Merge SF tracker BIOS patches --- rombios.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/rombios.c b/rombios.c index b215589..4624289 100644 --- a/rombios.c +++ b/rombios.c @@ -9924,8 +9924,8 @@ rom_scan: ;; 2 ROM length in 512-byte blocks ;; 3 ROM initialization entry point (FAR CALL) - mov cx, #0xc000 rom_scan_loop: + push ax ;; Save AX mov ds, cx mov ax, #0x0004 ;; start with increment of 4 (512-byte) blocks = 2k cmp [0], #0xAA55 ;; look for signature @@ -10006,7 +10006,8 @@ rom_scan_increment: shl ax, #5 ;; convert 512-bytes blocks to 16-byte increments ;; because the segment selector is shifted left 4 bits. add cx, ax - cmp cx, #0xe000 + pop ax ;; Restore AX + cmp cx, ax jbe rom_scan_loop xor ax, ax ;; Restore DS back to 0000: @@ -10290,6 +10291,12 @@ post_default_ints: #endif out 0xa1, AL ;slave pic: unmask IRQ 12, 13, 14 + mov cx, #0xc000 ;; init vga bios + mov ax, #0xc780 + call rom_scan + + call _print_bios_banner + #if BX_ROMBIOS32 call rombios32_init #else @@ -10299,12 +10306,6 @@ post_default_ints: #endif //BX_PCIBIOS #endif - call _init_boot_vectors - - call rom_scan - - call _print_bios_banner - ;; ;; Floppy setup ;; @@ -10340,10 +10341,15 @@ post_default_ints: ;; #endif // BX_ELTORITO_BOOT + call _init_boot_vectors + + mov cx, #0xc800 ;; init option roms + mov ax, #0xe000 + call rom_scan + sti ;; enable interrupts int #0x19 - .org 0xe2c3 ; NMI Handler Entry Point nmi: ;; FIXME the NMI handler should not panic -- 2.11.4.GIT