1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-08-03 10:24:57 +00:00

Descriptor tables are always at most 64kb.

This commit is contained in:
Thomas Harte
2025-05-13 14:07:28 -04:00
parent 159f3cb780
commit 9e5235fd30
2 changed files with 2 additions and 2 deletions

View File

@@ -195,7 +195,7 @@ private:
template <typename DescriptorT, typename LinearMemoryT>
//requires is_linear_memory<LinearMemoryT>
DescriptorT descriptor_at(LinearMemoryT &memory, const DescriptorTablePointer table, const uint32_t offset) {
DescriptorT descriptor_at(LinearMemoryT &memory, const DescriptorTablePointer table, const uint16_t offset) {
if(offset > table.limit - 8) {
printf("TODO: descriptor table overrun exception.\n");
assert(false);

View File

@@ -652,7 +652,7 @@ void interrupt(
if constexpr (ContextT::model >= Model::i80286) {
if(context.registers.msw() & MachineStatus::ProtectedModeEnable) {
const auto call_gate = descriptor_at<InstructionSet::x86::InterruptDescriptor>(
context.linear_memory, table_pointer, uint32_t(exception.vector) << 3);
context.linear_memory, table_pointer, uint16_t(exception.vector << 3));
if(!call_gate.present()) {
printf("TODO: should throw for non-present IDT entry\n");