Add terminal card driver

This commit is contained in:
pjht 2023-03-28 12:26:39 -05:00
parent 7ab1c4a9a7
commit 2a0ebb88df
Signed by: pjht
GPG Key ID: CA239FC6934E6F3A
2 changed files with 34 additions and 0 deletions

View File

@ -1,6 +1,7 @@
.global main
main:
move.l #inital_stack, a7 | Load the initial stack pointer
jsr term_init
jsr pmem_init
move.l #0x1000, d0
jsr push_page

33
kernel/term.68k Normal file
View File

@ -0,0 +1,33 @@
.global term_init
term_init:
move.b #0x3, d0 | Get the pointer to the terminal card
jsr find_first_card
move.l a0, term_io_base
rts
| Prints the string pointed to by a0
| Clobbers d0, a1
.global term_print
term_print:
move.l term_io_base, a1
term_print_loop:
move.b (a0)+, d0
cmpi.b #0, d0
beq.b term_print_done
move.b d0, (a1)
bra.b term_print
term_print_done:
rts
| Prints the string pointed to by a0 followed by a newline
| Clobbers d0, a1
.global term_println
term_println:
bsr.b term_print
move.b #'\n, (a1)
rts
.bss
term_io_base:
.ds.b 4