Max OS 0.3
Loading...
Searching...
No Matches
interrupts.h File Reference

Defines a InterruptManager and InterruptHandler for managing hardware and software interrupts. More...

#include <cstdint>
#include <libcommon/port.h>
#include <libcommon/inputStream.h>
#include <libcommon/outputStream.h>
#include <libcommon/map.h>
#include <system/gdt.h>
#include <system/cpu.h>
#include <hardwarecommunication/apic.h>

Go to the source code of this file.

Classes

class  MaxOS::hardwarecommunication::InterruptHandler
 Handles a certain interrupt number. More...
 
class  MaxOS::hardwarecommunication::ExceptionHandler
 Base class for handing CPU expection interrupts. More...
 
class  MaxOS::hardwarecommunication::DivideByZeroHandler
 Handles an attempt to divide by 0. More...
 
class  MaxOS::hardwarecommunication::InvaildOpCodeHandler
 Handles calling an invalid assembly instruction for the configuration running on this architecture. More...
 
class  MaxOS::hardwarecommunication::GeneralProtectionHandler
 Handles a general protection exception. More...
 
class  MaxOS::hardwarecommunication::PageFaultHandler
 Handles a page fault exception. More...
 
class  MaxOS::hardwarecommunication::CPUStopHandler
 Handles a interrupt that tells a CPU core to stop running. More...
 
struct  MaxOS::hardwarecommunication::IDTR
 A struct that holds the Interrupt Descriptor Table Register (IDTR) More...
 
struct  MaxOS::hardwarecommunication::InterruptDescriptor
 An entry in the Interrupt Descriptor Table (IDT) More...
 
class  MaxOS::hardwarecommunication::ExceptionHandlers
 Holds and instantiates the CPU exception handlers. More...
 
class  MaxOS::hardwarecommunication::InterruptManager
 Handles all interrupts and passes them to the correct handler. More...
 

Typedefs

typedef struct PACKED MaxOS::hardwarecommunication::IDTR MaxOS::hardwarecommunication::idtr_t
 Alias for IDTR struct.
 
typedef struct PACKED MaxOS::hardwarecommunication::InterruptDescriptor MaxOS::hardwarecommunication::interrupt_descriptor_t
 Alias for InterruptDescriptor struct.
 

Enumerations

enum class  MaxOS::hardwarecommunication::InterruptPrivilegeLevel { KERNEL_ONLY , RING_1 , RING_2 , USERSPACE }
 Represents the CPU ring level that a interrupt is handler is executed in. More...
 

Variables

constexpr uint16_t MaxOS::hardwarecommunication::HARDWARE_INTERRUPT_OFFSET = 0x20
 The offset in the IDT where interrupts from hardware start.
 
constexpr uint16_t MaxOS::hardwarecommunication::MAX_INTERRUPT_HANDLERS = 256
 The maximum number of interrupt handlers.
 

Detailed Description

Defines a InterruptManager and InterruptHandler for managing hardware and software interrupts.

Date
10th July 2022
Author
Max Tyson

Definition in file interrupts.h.

Enumeration Type Documentation

◆ InterruptPrivilegeLevel

Represents the CPU ring level that a interrupt is handler is executed in.

Definition at line 32 of file interrupts.h.

33 {
34 KERNEL_ONLY,
35 RING_1,
36 RING_2,
37 USERSPACE
38 };

Variable Documentation

◆ HARDWARE_INTERRUPT_OFFSET

constexpr uint16_t MaxOS::hardwarecommunication::HARDWARE_INTERRUPT_OFFSET = 0x20
constexpr

The offset in the IDT where interrupts from hardware start.

Definition at line 169 of file interrupts.h.

Referenced by MaxOS::hardwarecommunication::InterruptManager::handle_interrupt_request(), and MaxOS::hardwarecommunication::InterruptManager::InterruptManager().

◆ MAX_INTERRUPT_HANDLERS

constexpr uint16_t MaxOS::hardwarecommunication::MAX_INTERRUPT_HANDLERS = 256
constexpr

The maximum number of interrupt handlers.

Definition at line 170 of file interrupts.h.