From 0d16d16ab860ac235a9ca8f4d4feabb1e7b1f2c8 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Sat, 19 Mar 2022 18:26:15 +0100 Subject: [PATCH] interrupts/vectors are from kernel space --- bus.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bus.cpp b/bus.cpp index cbc4e74..448bc51 100644 --- a/bus.cpp +++ b/bus.cpp @@ -247,6 +247,11 @@ uint16_t bus::read(const uint16_t a, const bool word_mode, const bool use_prev) const uint8_t apf = a >> 13; // active page field bool is_user = use_prev ? (c -> getBitPSW(12) && c -> getBitPSW(13)) : (c -> getBitPSW(14) && c -> getBitPSW(15)); + + // always retrieve interrupt etc vectors from kernel space + if (a < 256 * 4) + is_user = false; + uint32_t m_offset = pages[apf + is_user * 8].par * 64; if ((a & 1) && word_mode == 0) @@ -448,6 +453,11 @@ uint16_t bus::write(const uint16_t a, const bool word_mode, uint16_t value, cons bool is_user = use_prev ? (c -> getBitPSW(12) && c -> getBitPSW(13)) : (c -> getBitPSW(14) && c -> getBitPSW(15)); uint32_t m_offset = pages[apf + is_user * 8].par * 64; + // always write interrupt etc vectors from to kernel space + // TODO: check rights + if (a < 256 * 4) + is_user = false; + pages[apf].pdr |= 1 << 6; // page has been written to if ((a & 1) && word_mode == 0)