From 155b6ce38153910808bf2f6a82b775af6b09d0f9 Mon Sep 17 00:00:00 2001 From: Test_User Date: Sun, 19 Mar 2023 15:43:22 -0400 Subject: Add less-braindead paging idea as an optional feature (incomplete) --- cpu/features/all.txt | 1 + cpu/features/optional.txt | 1 + .../optional/segmented_paging/structures.txt | 25 ++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 cpu/features/optional.txt create mode 100644 cpu/features/optional/segmented_paging/structures.txt diff --git a/cpu/features/all.txt b/cpu/features/all.txt index e69de29..222e764 100644 --- a/cpu/features/all.txt +++ b/cpu/features/all.txt @@ -0,0 +1 @@ +segmented paging diff --git a/cpu/features/optional.txt b/cpu/features/optional.txt new file mode 100644 index 0000000..222e764 --- /dev/null +++ b/cpu/features/optional.txt @@ -0,0 +1 @@ +segmented paging diff --git a/cpu/features/optional/segmented_paging/structures.txt b/cpu/features/optional/segmented_paging/structures.txt new file mode 100644 index 0000000..d7de77b --- /dev/null +++ b/cpu/features/optional/segmented_paging/structures.txt @@ -0,0 +1,25 @@ +TODO: Assign bit in FR + +Offset: 9 + (n/16) + +Replaces the offset field in the gdt with the following: + Width: half the number of bits for the current mode + Value: pointer to array of chunks, physical address + +Array of chunks: + Width: half the number of bits for the current mode + + Value: + Upper (n - offset) bits: + Pointer to physical address >> offset + Lowest bit: + Present + Remaining bits: + Unused by this system + + + Each value in the array represents 1 << offset bytes of memory. + Physical address is calculated from a reference such that: + Physical address = (gdt[segment].chunks[addr>>offset].address << offset) | (lowest offset bits of addr) + + Triggers a page fault if the present bit is not set -- cgit v1.2.3