feat(bios): BIOS interface accessible through SWI3

This commit is contained in:
2025-10-15 17:51:02 -05:00
parent 0c4055d685
commit f978834857
4 changed files with 52 additions and 29 deletions

View File

@@ -2,15 +2,15 @@
section RESET load 8000
section SERIAL
; BIOS Interface and Utilities
section BIOSINT load 8800
section MEMTEST
; BUZBEE Monitor
section BUZBEE
section BBHASHES
; Utility functions
section MEMTEST load 8800
section INTEGRITY
; Static data
; Static Data
section VECTORS high 100000
section VERSION high

View File

@@ -4,7 +4,6 @@
INCLUDE "buzbee.inc"
INCLUDE "hardware.inc"
INCLUDE "memtest.inc"
INCLUDE "serial.inc"
INCLUDE "version.inc"

View File

@@ -6,6 +6,44 @@
INCLUDE "serial.inc"
INCLUDE "version.inc"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; CHIBI/O Stable BIOS Interface
;;
;; Called through SWI3
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
SECTION BIOSINT
EXPORT CHIBIO
; CHIBI/O Entrypoint -- Stable, but defined by linkerscript $8800
; @param A: Function ID
CHIBIO
tfr a,d ; 8-to-16 tfr, fill both a and b
clra ; Clear MSB
asld ; Convert to word offset
tfr d,x ; Put in X for indexing mode
jmp [CHIBIOPTRTBL,x] ; Jump!
; Jump table TODO: Document function IDs and pointers
CHIBIOPTRTBL
fdb IOPRINTVER ; Print the firmware version string
fdb $0000 ; TODO: Interactive BIOS setup utilitiy call
fdb ROBIT ; Access the ROBIT memory test
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; CHIBI/O Function Implementations
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Prints the firmware's version information
IOPRINTVER
PZSTR VERMSG
rti
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Memory Testing Routines
@@ -59,18 +97,3 @@ LOOP@
MSG_FINISH
fcc "Memory test finished! Please reset"
fcb $0D,$0A,$00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; CHIBI PC-09 Integrity Functions
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
SECTION INTEGRITY
EXPORT PRINTVER
; Prints the ROM's version string
PRINTVER
PZSTR VERMSG
rts

View File

@@ -3,6 +3,7 @@
; Licensed under MIT
INCLUDE "reset.inc"
INCLUDE "utils.inc"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
@@ -13,11 +14,11 @@
SECTION VECTORS
VECTORS
fdb $0000 ; Exception
fdb $0000 ; SWI3
fdb $0000 ; SWI2
fdb $0000 ; FIRQ
fdb $0000 ; IRQ
fdb $0000 ; SWI
fdb $0000 ; NMI
fdb RESET ; Reset
fdb $0000 ; Exception
fdb CHIBIO ; SWI3
fdb $0000 ; SWI2
fdb $0000 ; FIRQ
fdb $0000 ; IRQ
fdb $0000 ; SWI
fdb $0000 ; NMI
fdb RESET ; Reset