The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
isr.h File Reference
#include "common/stdint.h"

Go to the source code of this file.

Data Structures

struct  registers
 saved register state pushed onto the stack by ISR stubs. More...

Macros

#define REG_IP(r)
#define REG_SP(r)
#define REG_FP(r)
#define REG_FLAGS(r)
#define REG_RESULT(r)
#define EFLAGS_IF   0x200u

Typedefs

typedef void(*) isr_handler_t(struct registers *regs)
 interrupt service routine handler function type.

Functions

struct registers __attribute__ ((packed))
void isr_initialize (void)
 initialize the interrupt service routine subsystem.
void isr_register_handler (int vector, isr_handler_t handler)
 register a handler function for a specific interrupt vector.

Variables

uint32_t ds
uint32_t edi
uint32_t esi
uint32_t ebp
uint32_t kern_esp
uint32_t ebx
uint32_t edx
uint32_t ecx
uint32_t eax
uint32_t interrupt
uint32_t error
uint32_t eip
uint32_t cs
uint32_t eflags
uint32_t esp
uint32_t ss

Macro Definition Documentation

◆ REG_IP

#define REG_IP ( r)
Value:
((r)->eip)

◆ REG_SP

#define REG_SP ( r)
Value:
((r)->esp)

◆ REG_FP

#define REG_FP ( r)
Value:
((r)->ebp)

◆ REG_FLAGS

#define REG_FLAGS ( r)
Value:
((r)->eflags)

◆ REG_RESULT

#define REG_RESULT ( r)
Value:
((r)->eax)

◆ EFLAGS_IF

#define EFLAGS_IF   0x200u

Typedef Documentation

◆ isr_handler_t

typedef void(*) isr_handler_t(struct registers *regs)

interrupt service routine handler function type.

Parameters
regspointer to the saved register state at the time of the interrupt.

Function Documentation

◆ __attribute__()

struct registers __attribute__ ( (packed) )

◆ isr_initialize()

void isr_initialize ( void )

initialize the interrupt service routine subsystem.

initialize the interrupt system.

installs all 256 ISR gates into the IDT and enables them.

initialize the interrupt service routine subsystem.

installs all 256 ISR stubs into the IDT without marking any gate present. a gate becomes present only when a handler is registered via isr_register_handler(), making the present-bit meaningful rather than a blanket "everything is active" flag.

◆ isr_register_handler()

void isr_register_handler ( int vector,
isr_handler_t handler )

register a handler function for a specific interrupt vector.

register a handler for an interrupt vector.

Parameters
vectorinterrupt vector number (0–255).
handlerpointer to the handler function to call when this interrupt fires.

register a handler function for a specific interrupt vector.

Variable Documentation

◆ ds

◆ edi

uint32_t edi

◆ esi

uint32_t esi

◆ ebp

uint32_t ebp

◆ kern_esp

uint32_t kern_esp

◆ ebx

uint32_t ebx

◆ edx

uint32_t edx

◆ ecx

uint32_t ecx

◆ eax

uint32_t eax

◆ interrupt

uint32_t interrupt

◆ error

uint32_t error

◆ eip

uint32_t eip

◆ cs

◆ eflags

uint32_t eflags

◆ esp

uint32_t esp

◆ ss