Skip to content

Instantly share code, notes, and snippets.

@yottatsa
Last active November 13, 2022 22:25
Show Gist options
  • Save yottatsa/3882c4e3e67ac5824187e6516183d02d to your computer and use it in GitHub Desktop.
Save yottatsa/3882c4e3e67ac5824187e6516183d02d to your computer and use it in GitHub Desktop.
Debugging NEC Versa Series ROM BIOS 1.01.11, 04/19/90
via https://bochs.sourceforge.io/techspec/PORTS.LST
via https://docs.oracle.com/cd/E19121-01/sf.v40z/817-7184-12/post_codes.html
bios code: Copyright (C) 1985-1992 Phoenix Technologies Ltd.
cpuid
mov %eax,%edx
shl $0x10,%edx
ret
cli
mov $0x80,%al
out %al,$0x70 ;disable nmi
in $0x92,%al
and $-2,%al
out %al,$0x92 ;disable A20
cld
mov $0x8f,%al
out %al,$0x70
jmp 0
in $0x71,%al
cmp $11,%al ; 0B = return IRETS through 40:67
jne 0xf011c
in $0x64,%al
test $4,%al ; bit 2 system flag status: 0=power up or reset 1=selftest OK
out %al,$0x70
mov $0,%al
out %al,$0x71 ; storing normal execution of post
; acting on shutdown status byte
out %al,$0xf1 ; math coprocessor reset
; Programmable Interrupt Controller 8259
; yada-yada
mov $0x43,%dx ; Programmable Interrupt Timer 8253, 8254
mov $0x54,%al
out %al,(%dx) ; PIT mode 2 select - rate generator
mov $0x12,%al
out %al,(%dx) ; PIT counter 1, RAM refresh counter
mov $0xc0,%al
out %al,$0x80 ; POST: Try to boot with interrupt 19
; yada-yada
; POST: Initialize error display function
; yada-yada
; reads 0x61: mirrors timer 2 output condition
; awaits different values
; messes up with EISA
; im lost here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment