dev: added signon strings and some other basic bootup code
This commit is contained in:
parent
fc244f8481
commit
95344d73cb
2 changed files with 62 additions and 22 deletions
2
boot.asm
2
boot.asm
|
|
@ -9,8 +9,10 @@
|
|||
; This is the cold boot entry point!
|
||||
; It is linked to land at 0xC3C3
|
||||
; ==================================
|
||||
|
||||
_start:
|
||||
zone_setup:
|
||||
ld a, ixl
|
||||
ld sp, 0x6FFF
|
||||
jp os_main_loop
|
||||
|
||||
|
|
|
|||
56
zone.asm
56
zone.asm
|
|
@ -4,33 +4,30 @@
|
|||
; ZONE OS main section
|
||||
; ============================================================
|
||||
.section "zone", "acrx"
|
||||
.global zone_start
|
||||
.global os_print_vec
|
||||
.global os_getch_vec
|
||||
.global os_outbyte_vec
|
||||
.global os_inbyte_vec
|
||||
.global os_main_loop
|
||||
.local os_print_signon
|
||||
|
||||
.set UARTSTATUS, 6
|
||||
.set UARTDATA, 7
|
||||
|
||||
zone_start:
|
||||
ret
|
||||
|
||||
os_print_vec:
|
||||
; this takes a character in a and sends it to the UART
|
||||
push af
|
||||
push bc
|
||||
push de
|
||||
ld d, a
|
||||
ld bc, UARTSTATUS
|
||||
ld c, UARTSTATUS
|
||||
|
||||
$1:
|
||||
in a, (c); get status byte
|
||||
bit 0, a; test bit 0
|
||||
jr z, $1; jump back if UART not ready
|
||||
ld a, d
|
||||
ld bc, UARTDATA
|
||||
ld c, UARTDATA
|
||||
out (c), a; send byte to uart
|
||||
pop de
|
||||
pop bc
|
||||
|
|
@ -38,6 +35,17 @@ $1:
|
|||
ret
|
||||
|
||||
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
|
||||
|
||||
os_outbyte_vec:
|
||||
|
|
@ -63,13 +71,43 @@ os_inbyte_vec:
|
|||
ret
|
||||
|
||||
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:
|
||||
.string "ZONE OS ver. 0.01"
|
||||
.byte "ZONE OS ver. 0.01"
|
||||
.byte 10, 13, 0
|
||||
|
||||
zoneCopyright:
|
||||
.string "(c) A.M. Rowsell, license MPLv2"
|
||||
.byte "(c) A.M. Rowsell, license MPLv2"
|
||||
.byte 10, 13, 0
|
||||
|
||||
zonePrompt:
|
||||
.string "z] "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue