From 1e3383b8be6788888451a7938df651d730ce34a8 Mon Sep 17 00:00:00 2001 From: Test_User Date: Fri, 7 Oct 2022 15:26:23 +0200 Subject: Add basic CPU-related ideas. --- cpu/interrupts/hardware/execution.txt | 10 ++++++++++ cpu/interrupts/hardware/irqt.txt | 4 ++++ cpu/interrupts/software/execution.txt | 8 ++++++++ cpu/interrupts/software/idt.txt | 11 +++++++++++ 4 files changed, 33 insertions(+) create mode 100644 cpu/interrupts/hardware/execution.txt create mode 100644 cpu/interrupts/hardware/irqt.txt create mode 100644 cpu/interrupts/software/execution.txt create mode 100644 cpu/interrupts/software/idt.txt (limited to 'cpu/interrupts') diff --git a/cpu/interrupts/hardware/execution.txt b/cpu/interrupts/hardware/execution.txt new file mode 100644 index 0000000..c3cc5f5 --- /dev/null +++ b/cpu/interrupts/hardware/execution.txt @@ -0,0 +1,10 @@ +When a hardware interrut occurs: + OPR gets set to the PR from the previous code running + OIP gets set to the IP from the previous code running + PR is set to all 1s + +The next hardware interrupt will not occur until after the current processing has been finished via `ireth` + +When returning via ireth: + PR is set to OPR + Execution jumps to OIP diff --git a/cpu/interrupts/hardware/irqt.txt b/cpu/interrupts/hardware/irqt.txt new file mode 100644 index 0000000..f1f5792 --- /dev/null +++ b/cpu/interrupts/hardware/irqt.txt @@ -0,0 +1,4 @@ +Each entry is n bits long, where n is the current mode in bits +TODO: Specify a limit for them + +Each entry is a pointer to the code to be executed diff --git a/cpu/interrupts/software/execution.txt b/cpu/interrupts/software/execution.txt new file mode 100644 index 0000000..0cad31b --- /dev/null +++ b/cpu/interrupts/software/execution.txt @@ -0,0 +1,8 @@ +When calling a software interrupt: + R0 gets overwritten with the current PR + R1 gets overwritten with a pointer of the same segment as IP, pointing to the next instruction + PR is set to all 1s + +When returning via iretp: + PR is set to R0 + Execution jumps to R1 diff --git a/cpu/interrupts/software/idt.txt b/cpu/interrupts/software/idt.txt new file mode 100644 index 0000000..04cafd9 --- /dev/null +++ b/cpu/interrupts/software/idt.txt @@ -0,0 +1,11 @@ +Each enty is n*2 bits long, where n is the current mode in bits +TODO: Specify a limit for them + +It uses the following format: + (higher address) + +--------------------------------+ + | Pointer to executable code run | + +--------------------------------+ + | Privileges required for usage | + +--------------------------------+ + (lower address) -- cgit v1.2.3