From aba1a50e0fe47327e9268ec47bd44b0e25b7f6cd Mon Sep 17 00:00:00 2001 From: Gale Faraday Date: Sun, 19 Oct 2025 18:36:50 -0500 Subject: [PATCH] feat(bios): split apart MEMTEST EF and CHIBIO BIOS interface --- src/{utils.inc => biosint.inc} | 5 ++-- src/biosint.s | 28 +++++++++++++++++++ src/{utils.s => progs.s} | 51 ++++------------------------------ 3 files changed, 35 insertions(+), 49 deletions(-) rename src/{utils.inc => biosint.inc} (51%) create mode 100644 src/biosint.s rename src/{utils.s => progs.s} (52%) diff --git a/src/utils.inc b/src/biosint.inc similarity index 51% rename from src/utils.inc rename to src/biosint.inc index c41e3c6..3e864b9 100644 --- a/src/utils.inc +++ b/src/biosint.inc @@ -1,8 +1,7 @@ -; CHIBI PC-09 Prototype #1 -- BIOS Utilities Header +; CHIBI PC-09 Prototype #1 -- BIOS Interface Header ; Copyright (c) 2025 Amber Zeller, Gale Faraday ; Licensed under MIT ; vim: ft=asm -ROBIT IMPORT -PRINTVER IMPORT +CHIBIO IMPORT diff --git a/src/biosint.s b/src/biosint.s new file mode 100644 index 0000000..786f102 --- /dev/null +++ b/src/biosint.s @@ -0,0 +1,28 @@ +; CHIBI PC-09 Prototype #1 Boot ROM -- BIOS Interface +; Copyright (c) 2024-2025 Amber Zeller, Gale Faraday +; Licensed under MIT + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; 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 $8000 ; TODO Implement BIOS function wrappers (serial, etc) diff --git a/src/utils.s b/src/progs.s similarity index 52% rename from src/utils.s rename to src/progs.s index d3d3746..3eed332 100644 --- a/src/utils.s +++ b/src/progs.s @@ -1,62 +1,21 @@ -; CHIBI PC-09 Prototype #1 Boot ROM -- BIOS Utilities +; CHIBI PC-09 Prototype #1 Boot ROM -- Onboard Programs or BUZBEE "EFs" ; Copyright (c) 2024-2025 Amber Zeller, Gale Faraday ; Licensed under MIT +; These are onboard programs with fixed locations in the linkerscript for +; starting from a machine language monitor + INCLUDE "hardware.inc" 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 -;; -;; This family of BIOS routines does not return, upon completion the CHIBI must -;; be reset. +;; Memory Testing Routine ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SECTION MEMTEST - EXPORT ROBIT - ; RAM testing routine. Ported to 6809 from 6800, based on source for ROBIT-2 for ; MIKBUG. ROBIT