>
Handles Terminal I/O and Disk operations (Load and Store).
Function Number | Function Name | Arguments | Return Value |
---|---|---|---|
DISK_STORE = 1 | Disk Store | PID, Page Number, Block Number | NIL |
DISK_LOAD = 2 | Disk Load | PID, Page Number, Block Number | NIL |
TERMINAL_WRITE = 3 | Terminal Write | PID, Word | NIL |
TERMINAL_READ = 4 | Terminal Read | PID, Address | NIL |
Acquire the lock on the disk device by calling the Acquire_Disk() function in the Resource Manager module; Set the LOAD/STORE BIT, PAGE NUMBER and BLOCK NUMBER in the Disk Status Table. Use the store statement to store the memory page to disk; Set the state as (WAIT_DISK, - ); Call the switch_context() function from the Scheduler Module. return;Called by Shutdown, Buffer Read and Buffer Write.
Acquire the lock on the disk device by calling the Acquire_Disk() function in the Resource Manager module; Reset the LOAD/STORE BIT, set PAGE NUMBER and BLOCK NUMBER in the Disk Status Table. Use the load statement to load the disk block to memory; Set the state as (WAIT_DISK, - ); Call the switch_context() function from the Scheduler Module. return;Called by the Buffer Read, Buffer Write functions, exec system call (to load the first code page) and the exception handler (demand paging).
Acquire the lock on the terminal device by calling the Acquire_Terminal() function in the Resource Manager module; Use the print statement to print the contents of the word to the terminal; Release the lock on the terminal device by calling the Release_Terminal() function in the Resource Manager module; return;Called by the Write system call.
Acquire the lock on the disk device by calling the Acquire_Terminal() function in the Resource Manager module; Use the read statement to read the word from the terminal; Set the state as (WAIT_TERMINAL, - ); Call the switch_context() function from the Scheduler Module. Copy the word from the Input Buffer of the Process Table of the process corresponding to PID to the memory address provided. return;Note: The Terminal Interrupt Handler will transfer the contents of the input port P0 to the Input Buffer of the process.