feat(bios): BIOS interface accessible through SWI3
This commit is contained in:
10
linkscript
10
linkscript
@@ -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
|
||||
|
||||
|
@@ -4,7 +4,6 @@
|
||||
|
||||
INCLUDE "buzbee.inc"
|
||||
INCLUDE "hardware.inc"
|
||||
INCLUDE "memtest.inc"
|
||||
INCLUDE "serial.inc"
|
||||
INCLUDE "version.inc"
|
||||
|
||||
|
53
src/utils.s
53
src/utils.s
@@ -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
|
||||
|
17
src/vecs.s
17
src/vecs.s
@@ -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
|
||||
|
Reference in New Issue
Block a user