Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions kernel.asm
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ find_block_loop_top:
find_block_continue_loop:
;; Advance to the next entry.
ADDUS %G2 %G2 12
JUMP +find_device_loop_top
JUMP +find_block_loop_top
find_block_loop_failure:
;; Set the return value to a null pointer.
HALT
Expand Down Expand Up @@ -1175,7 +1175,8 @@ fd2:
JUMP *+return ;Jump to the return address specified in stack


;; check if file exists
;; check if file exists, returns block # if it does, returns 0 if it does not.
;; basically map's string to inode. Takes pointer to a filename as it's parameter.
fileExists_Args:
SUBUS %SP %SP 4
JUMP +fArgs
Expand All @@ -1186,16 +1187,6 @@ fileExists:
COPY %G0 +return2
CALL +fCall *%G0

mapStringToInode_Args:
SUBUS %SP %SP 4
JUMP +fArgs

mapStringToInode:
SUBUS %SP %SP 4
COPY *%SP 1
COPY %G0 +return2
CALL +fCall *%G0

;; block_trigger, block_base, block_limit, block_num
COPY *+block_num 0x01 ;; first block, has filename -> inode number mappings
COPY *+block_trigger 0x00
Expand All @@ -1222,6 +1213,7 @@ parseFileNameTop: ;; inner loop (goes through characters in filename)
parseFileNameEnd: ;; file found at this point!
ADDUS %G2 %G2 12
COPY *%SP *%G2 ;; save file number into stack where return value should be
JUMP +fDone


parseFileFail:
Expand All @@ -1231,6 +1223,7 @@ parseFileFail:

searchFilesFail:
COPY *%SP 0x00
JUMP +fDone


;COPY %G0 +return
Expand Down