Okay, I know it's been a long time, but here's that code that I promised back then!!!
Code: Select all
%ifndef __X86LIB_RMVIDEO__
%define __X86LIB_RMVIDEO__
;===========================================================================
; Description: Prints a null-terminated string to the screen.
;---------------------------------------------------------------------------
; Parameters:-
; DS:SI - The segment:offset of the null-terminated string.
; BL - The foreground colour.
; BH - The page number.
;===========================================================================
rmPrintString:
push ax
push ds
push si
mov ah, 0x0E
.printCharacter:
lodsb
or al, al
jz .done
int 0x10
jmp .printCharacter
.done:
pop si
pop ds
pop ax
ret
;===========================================================================
; Description: Prints an 8-bit unsigned integer to the screen.
;---------------------------------------------------------------------------
; Parameters:-
; AL - The 8-bit unsigned integer.
; BL - The foreground colour.
; BH - The page number.
; CL - The base to print in (2 to 16).
; CH - The minimum number of digits to print (use 0 for no padding).
;===========================================================================
rmPrintUInt8:
push eax
movzx eax, al
jmp rmPrintUInt32.initialise
;===========================================================================
; Description: Prints a 16-bit unsigned integer to the screen.
;---------------------------------------------------------------------------
; Parameters:-
; AX - The 16-bit unsigned integer.
; BL - The foreground colour.
; BH - The page number.
; CL - The base to print in (2 to 16).
; CH - The minimum number of digits to print (use 0 for no padding).
;===========================================================================
rmPrintUInt16:
push eax
movzx eax, ax
jmp rmPrintUInt32.initialise
;===========================================================================
; Description: Prints a 32-bit unsigned integer to the screen.
;---------------------------------------------------------------------------
; Parameters:-
; EAX - The 32-bit unsigned integer.
; BL - The foreground colour.
; BH - The page number.
; CL - The base to print in (2 to 16).
; CH - The minimum number of digits to print (use 0 for no padding).
;===========================================================================
rmPrintUInt32:
push eax
.initialise:
push ebx
push cx
push edx
mov [cs:.tempBX], bx
movzx ebx, cl
xor cl, cl
jmp .pushDigit
.tempBX: dw 0
.pushDigit:
xor edx, edx
div ebx
push dx
inc cl
or eax, eax
jnz .pushDigit
mov al, '0'
mov ah, 0x0E
mov bx, [cs:.tempBX]
.printPadding:
cmp cl, ch
jge .popDigit
int 0x10
dec ch
jmp .printPadding
.popDigit:
pop ax
dec cl
and al, 0x0F
add al, 0x30
cmp al, 0x39
jle .printDigit
add al, 0x07
.printDigit:
mov ah, 0x0E
int 0x10
or cl, cl
jnz .popDigit
pop edx
pop cx
pop ebx
pop eax
ret
%endif
Anyways, I seem to have hit a dead end. I've written some code to scan from physical addresses C0000 to EFFFF (segmented addresses C000:0000 to E000:FFFF) at every 2kb boundry (e.g. C000:0000, C000:0800, C000:1000 .etc.) and read in the first 2 bytes, comparing them to 0xAA55 (I also tried 0x55AA), but my code didn't find anything...
I've attached the code files for searching for option ROMs. The rmConvertAddressToSegmentOffset (which is confirmed as working) takes a physical address in EBX and returns its segment in DS and its offset in SI (e.g. if EBX = 0x000F1234, calling the function would set DS = 0xF000 and SI = 0x1234).