diff --git a/execution.txt b/execution.txt new file mode 100644 index 0000000..d566109 --- /dev/null +++ b/execution.txt @@ -0,0 +1,32 @@ +0, 1, switch to kernel mode +1, 10, context saved +11, 1, find vector 2 in memory position 0x0004 +12, 1, load address 0X0695 into the PC +13, 20, cloning the PCB +33, 0, scheduler called +33, 1, IRET +34, 10, CPU Burst +44, 1, switch to kernel mode +45, 10, context saved +55, 1, find vector 3 in memory position 0x0006 +56, 1, load address 0X042B into the PC +57, 60, The program size is 10MB +117, 150, loading program into memory +267, 3, marking partition as occupied +270, 6, updating PCB +276, 0, scheduler called +276, 1, IRET +277, 50, CPU Burst +327, 1, switch to kernel mode +328, 10, context saved +338, 1, find vector 6 in memory position 0x000C +339, 1, load address 0X0639 into the PC +340, 265, SYSCALL ISR (ADD STEPS HERE) +605, 1, IRET +606, 15, CPU Burst +621, 1, switch to kernel mode +622, 10, context saved +632, 1, find vector 6 in memory position 0x000C +633, 1, load address 0X0639 into the PC +634, 265, ENDIO ISR(ADD STEPS HERE) +899, 1, IRET diff --git a/interrupts.cpp b/interrupts.cpp index e2f2722..183e230 100644 --- a/interrupts.cpp +++ b/interrupts.cpp @@ -51,7 +51,25 @@ std::tuple simulate_trace(std::vector simulate_trace(std::vector simulate_trace(std::vector simulate_trace(std::vector wait_queue; /******************ADD YOUR VARIABLES HERE*************************/ - + /******************************************************************/ @@ -181,4 +263,4 @@ int main(int argc, char** argv) { write_output(system_status, "system_status.txt"); return 0; -} +} \ No newline at end of file diff --git a/program1.txt b/program1.txt new file mode 100644 index 0000000..2a0d2a0 --- /dev/null +++ b/program1.txt @@ -0,0 +1,4 @@ +CPU, 50 +SYSCALL, 6 +CPU, 15 +END_IO, 6 \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..4da1eca --- /dev/null +++ b/run.sh @@ -0,0 +1 @@ +./bin/interrupts trace.txt vector_table.txt device_table.txt external_files.txt \ No newline at end of file diff --git a/system_status.txt b/system_status.txt new file mode 100644 index 0000000..caa390a --- /dev/null +++ b/system_status.txt @@ -0,0 +1,13 @@ +time: 33; current trace: FORK, 20 ++------------------------------------------------------+ +| PID |program name |partition number | size | state | ++------------------------------------------------------+ +| 1 | init | 5 | 1 | running | +| 0 | init | 6 | 1 | waiting | ++------------------------------------------------------+ +time: 276; current trace: EXEC program1, 60 ++------------------------------------------------------+ +| PID |program name |partition number | size | state | ++------------------------------------------------------+ +| 0 | program1 | 4 | 10 | running | ++------------------------------------------------------+ diff --git a/trace.txt b/trace.txt new file mode 100644 index 0000000..baaa963 --- /dev/null +++ b/trace.txt @@ -0,0 +1,6 @@ +FORK, 20 +IF_CHILD, 0 +IF_PARENT, 0 +EXEC program1, 60 +ENDIF, 0 +CPU, 10 \ No newline at end of file