Compare commits
2 Commits
7ab1c4a9a7
...
0f7ab3941f
Author | SHA1 | Date | |
---|---|---|---|
0f7ab3941f | |||
2a0ebb88df |
@ -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
|
||||
|
@ -42,8 +42,13 @@ move.l mmu_tlb_clear_addr, a0 | Clear the TLB entry for the mapping page
|
||||
move.l #map_page, (a0)
|
||||
rts
|
||||
pop_no_page:
|
||||
move.l #oom_error_str, a0
|
||||
jsr term_println
|
||||
stop #2700
|
||||
|
||||
.data
|
||||
oom_error_str: .asciz "Out of physical memory"
|
||||
|
||||
.bss
|
||||
mmu_tlb_clear_addr:
|
||||
.ds.b 4
|
||||
|
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