summaryrefslogtreecommitdiff
path: root/cpu/interrupts
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2022-10-07 15:26:23 +0200
committerTest_User <hax@andrewyu.org>2022-10-07 15:26:23 +0200
commit1e3383b8be6788888451a7938df651d730ce34a8 (patch)
tree18501cd44d400895987c915083ecf2b0c70cdad3 /cpu/interrupts
downloadspecification-1e3383b8be6788888451a7938df651d730ce34a8.tar.gz
specification-1e3383b8be6788888451a7938df651d730ce34a8.zip
Add basic CPU-related ideas.
Diffstat (limited to 'cpu/interrupts')
-rw-r--r--cpu/interrupts/hardware/execution.txt10
-rw-r--r--cpu/interrupts/hardware/irqt.txt4
-rw-r--r--cpu/interrupts/software/execution.txt8
-rw-r--r--cpu/interrupts/software/idt.txt11
4 files changed, 33 insertions, 0 deletions
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)