Skip to content

Commit

Permalink
Pre Stage 27
Browse files Browse the repository at this point in the history
  • Loading branch information
0xadeeb committed Nov 24, 2022
1 parent d5e2f94 commit e84259a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion spl/spl_progs/file_manager_module.spl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ endif;
if (functionNum == BUFFERED_READ) then
alias blockNo R2;
alias offset R3;
alias writeAdr R4;
alias writeAdr R4; // logical address

alias bufferIdx R5;
bufferIdx = blockNo % MAX_BUFFER;
Expand Down Expand Up @@ -152,6 +152,7 @@ if (functionNum == BUFFERED_READ) then
[bufferEntry] = blockNo;
endif;

writeAdr = [PTBR + 2 * writeAdr / PAGE_SIZE] * PAGE_SIZE + (writeAdr % PAGE_SIZE); //physical address
[writeAdr] = [BUFFER + PAGE_SIZE * bufferIdx + offset];

multipush(R1);
Expand Down
2 changes: 1 addition & 1 deletion spl/spl_progs/int6.spl
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ if ( arg1 != -1 ) then

alias wordAddress R7;
wordAddress = [[PTBR + 2 * (userSP - 3) / PAGE_SIZE] * PAGE_SIZE + (userSP - 3) % PAGE_SIZE]; //virtual address
wordAddress = [PTBR + 2 * wordAddress / PAGE_SIZE] * PAGE_SIZE + (wordAddress % PAGE_SIZE); //physical address

if ([openTableEntry] == INODE_ROOT) then
if (lseek == 8 * MAX_FILE_NUM) then
[retAdr] = -2;
goto release_and_return;
endif;

wordAddress = [PTBR + 2 * wordAddress / PAGE_SIZE] * PAGE_SIZE + (wordAddress % PAGE_SIZE); //physical address
[wordAddress] = [ROOT_FILE + lseek];
else
if (lseek == [inodeEntry + 2]) then
Expand Down

0 comments on commit e84259a

Please sign in to comment.