From 9d077d1f3bb7b2c2940872e76cefa0b84ac67336 Mon Sep 17 00:00:00 2001 From: pjht Date: Wed, 29 Mar 2023 09:47:55 -0500 Subject: [PATCH] Document functions --- kernel/pmem.68k | 15 +++++++++++---- kernel/term.68k | 2 ++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/kernel/pmem.68k b/kernel/pmem.68k index 5db9efc..69f6171 100644 --- a/kernel/pmem.68k +++ b/kernel/pmem.68k @@ -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 diff --git a/kernel/term.68k b/kernel/term.68k index 30eea45..e9d760a 100644 --- a/kernel/term.68k +++ b/kernel/term.68k @@ -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