Add terminal card driver
This commit is contained in:
parent
7ab1c4a9a7
commit
2a0ebb88df
@ -1,6 +1,7 @@
|
|||||||
.global main
|
.global main
|
||||||
main:
|
main:
|
||||||
move.l #inital_stack, a7 | Load the initial stack pointer
|
move.l #inital_stack, a7 | Load the initial stack pointer
|
||||||
|
jsr term_init
|
||||||
jsr pmem_init
|
jsr pmem_init
|
||||||
move.l #0x1000, d0
|
move.l #0x1000, d0
|
||||||
jsr push_page
|
jsr push_page
|
||||||
|
33
kernel/term.68k
Normal file
33
kernel/term.68k
Normal 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
|
Loading…
Reference in New Issue
Block a user