Document functions

This commit is contained in:
pjht 2023-03-29 09:47:55 -05:00
parent 4e8d025345
commit 9d077d1f3b
Signed by: pjht
GPG Key ID: CA239FC6934E6F3A
2 changed files with 13 additions and 4 deletions

View File

@ -1,20 +1,24 @@
.text
.global pmem_init
| Initialize the physical memory manager
| Clobbers d0 and a0
pmem_init:
move.b #0x5, d0 | Get the pointer to the MMU card
jsr find_first_card
adda.l #0x10, a0
move.l a0, mmu_tlb_clear_addr
move.l #((map_page - 0xC00000)), d1 | Get the entry offset for the mapping page in d1
lsr.l #8, d1
lsr.l #2, d1
move.l #((map_page - 0xC00000)), d0 | Get the entry offset for the mapping page in d0
lsr.l #8, d0
lsr.l #2, d0
move.l #kernel_map_page, a0 | Get the address of the mapping entry for the mapping page in a0
adda.l d1, a0
adda.l d0, a0
move.l a0, map_page_entry_addr
rts
.global push_frame
| Pushes a frame onto the stack
| Frame to push in d0
| Clobbers d0, d1, and a0
push_frame:
move.l map_page_entry_addr, a0
move.l (a0), d1 | Read the mapping entry into d1
@ -27,6 +31,9 @@ move.l d1, (map_page)
rts
.global pop_frame
| Pops a frame off the stack
| Returns frame address in d0
| Clobbers d1 and a0
pop_frame:
move.l map_page_entry_addr, a0
move.l (a0), d0 | Read the mapping entry into d0

View File

@ -1,4 +1,6 @@
.global term_init
| Initializes the terminal card driver
| Clobbers d0, d1, and a0
term_init:
move.b #0x3, d0 | Get the pointer to the terminal card
jsr find_first_card