Writing an option rom, a few problems
Posted: Wed Nov 02, 2016 3:41 am
Hi,
I'm working on an AM186 system and need a way to debug while building the system.
What i have so far is a working system with a ZIF-socket for ROM/flash.
I built an "in-system" programmer using a microcontroller and some latches, driving the whole thing into reset and the bus is disconnected from the flash.
Now i want to write some test code, that can run either on a PC, an emulator or on my hardware. The hardware will be more or less PC compatible anyway. I hope i'll end up having a debug-tool on a 8bit ISA card.
I wrote the following piece of code and I'm trying to emulate this with qemu. The problem is, i want to clear the screen and write a few chars to 0,0. Nothing happens, but of a few chars from qemu-bios gets "recolored" in the color i specified in my printing routine. There's also a screenshot attached.
These routines are working when using it in bootloader code on a floppy.
ROM checksum gets calculated after assembling using a script provided by qemu (signrom.py). This seems to work. If i don't sign, nothing happens at all on boot.
nasm+qemu invocation:
Also i couldn't find any option to specifiy address in qemu for that option rom. I wonder where it gets loaded...
Thanks
I'm working on an AM186 system and need a way to debug while building the system.
What i have so far is a working system with a ZIF-socket for ROM/flash.
I built an "in-system" programmer using a microcontroller and some latches, driving the whole thing into reset and the bus is disconnected from the flash.
Now i want to write some test code, that can run either on a PC, an emulator or on my hardware. The hardware will be more or less PC compatible anyway. I hope i'll end up having a debug-tool on a 8bit ISA card.
I wrote the following piece of code and I'm trying to emulate this with qemu. The problem is, i want to clear the screen and write a few chars to 0,0. Nothing happens, but of a few chars from qemu-bios gets "recolored" in the color i specified in my printing routine. There's also a screenshot attached.
These routines are working when using it in bootloader code on a floppy.
Code: Select all
bits 16
org 0x0000
db 0x55
db 0xAA ; signature
db 16 ; length of option rom in 512b increments = 8k
call rom_init
retf
rom_init:
call clrscr
mov bl, 0x03
mov al, '@'
mov cx, 10
mov ah, 0x09
int 0x10 ; print CX n chars in AL with color BL to cursor
retn
clrscr:
mov dh, 0
mov dl, 0
call set_cursor
mov ah, 0x0a
mov al, ' '
mov bh, 0
mov cx, 2000
int 0x10
ret
; DH = row, DL = col
set_cursor:
mov ah, 0x02
int 0x10
ret
msg_init db "option rom init.", 0
; fill with zeroes till signature
times 8191-($-$$) db 0x00
db 0x00 ; checksum
; will be calculated by script
nasm+qemu invocation:
Code: Select all
nasm -f bin -o rom.bin rom.asm
python signrom.py rom.bin rom.bin.signed
qemu-system-i386 -net none -option-rom rom.bin.signed
Thanks