dev: added signon strings and some other basic bootup code

This commit is contained in:
A.M. Rowsell 2026-01-23 16:44:05 -05:00
commit 95344d73cb
Signed by: amr
GPG key ID: E0879EDBDB0CA7B1
2 changed files with 62 additions and 22 deletions

View file

@ -1,18 +1,20 @@
; SPDX-License-Identifier: MPL-2.0 ; SPDX-License-Identifier: MPL-2.0
; SPDX-FileCopyrightText: (c) 2025 A.M. Rowsell ; SPDX-FileCopyrightText: (c) 2025 A.M. Rowsell
.section "boot","acrx" .section "boot", "acrx"
.global zone_setup .global zone_setup
.global os_warm_boot .global os_warm_boot
.extern os_main_loop .extern os_main_loop
; ==================================
; This is the cold boot entry point!
; It is linked to land at 0xC3C3
; ==================================
; ==================================
; This is the cold boot entry point!
; It is linked to land at 0xC3C3
; ==================================
_start: _start:
zone_setup: zone_setup:
ld sp, 0x6FFF ld a, ixl
jp os_main_loop ld sp, 0x6FFF
jp os_main_loop
os_warm_boot: os_warm_boot:
ret ret

View file

@ -4,33 +4,30 @@
; ZONE OS main section ; ZONE OS main section
; ============================================================ ; ============================================================
.section "zone", "acrx" .section "zone", "acrx"
.global zone_start
.global os_print_vec .global os_print_vec
.global os_getch_vec .global os_getch_vec
.global os_outbyte_vec .global os_outbyte_vec
.global os_inbyte_vec .global os_inbyte_vec
.global os_main_loop .global os_main_loop
.local os_print_signon
.set UARTSTATUS, 6 .set UARTSTATUS, 6
.set UARTDATA, 7 .set UARTDATA, 7
zone_start:
ret
os_print_vec: os_print_vec:
; this takes a character in a and sends it to the UART ; this takes a character in a and sends it to the UART
push af push af
push bc push bc
push de push de
ld d, a ld d, a
ld bc, UARTSTATUS ld c, UARTSTATUS
$1: $1:
in a, (c); get status byte in a, (c); get status byte
bit 0, a; test bit 0 bit 0, a; test bit 0
jr z, $1; jump back if UART not ready jr z, $1; jump back if UART not ready
ld a, d ld a, d
ld bc, UARTDATA ld c, UARTDATA
out (c), a; send byte to uart out (c), a; send byte to uart
pop de pop de
pop bc pop bc
@ -38,6 +35,17 @@ $1:
ret ret
os_getch_vec: os_getch_vec:
; this gets a character from the UART and puts in in a
push bc
ld c, UARTSTATUS
a2:
in a, (c); get status byte
bit 1, a
jr z, a2
ld c, UARTDATA
in a, (c)
pop bc
ret ret
os_outbyte_vec: os_outbyte_vec:
@ -63,13 +71,43 @@ os_inbyte_vec:
ret ret
os_main_loop: os_main_loop:
jp os_main_loop call os_print_signon
os_busy_loop:
jp os_busy_loop
; ======================
; non-vectored functions
; ======================
os_print_signon:
ld hl, zoneSignon
ld a, (hl)
$2:
call os_print_vec
inc hl
ld a, (hl)
jr nz, $2
$3:
ld hl, zoneCopyright
ld a, (hl)
$4:
call os_print_vec
inc hl
ld a, (hl)
jr nz, $4
ret
zoneSignon: zoneSignon:
.string "ZONE OS ver. 0.01" .byte "ZONE OS ver. 0.01"
.byte 10, 13, 0
zoneCopyright: zoneCopyright:
.string "(c) A.M. Rowsell, license MPLv2" .byte "(c) A.M. Rowsell, license MPLv2"
.byte 10, 13, 0
zonePrompt: zonePrompt:
.string "z] " .string "z] "