Skip to content
This repository was archived by the owner on Dec 12, 2022. It is now read-only.

HalGenerateIDTDesc

NullException edited this page Aug 5, 2020 · 2 revisions

HalGenerateIDTDesc Function

Description

This function generates a valid IDT descriptor structure for later use

Syntax

idt_descriptor HalGenerateIDTDesc(dword baseAddress, 
                                  word selector, 
                                  idtflags idtFlags
);

Parameters

baseAddress

The base address of the desired interrupt handler


selector

Selector to use when processing the interrupt. Must be a code selector


idtFlags

The bitflags used for the descriptor

idt_type_32bitTaskGate
The interrupt is a 32 bit task gate. This flag cannot be specified with any other flags that start with idt_type

idt_type_16bitInterruptGate
The interrupt is a 16 bit interrupt gate. This flag cannot be specified with any other flags that start with idt_type

idt_type_16bitTrapGate
The interrupt is a 16 bit trap gate. This flag cannot be specified with any other flags that start with idt_type

idt_type_32bitInterruptGate
The interrupt is a 32 bit interrupt gate. This flag cannot be specified with any other flags that start with idt_type

idt_type_32bitTrapGate
The interrupt is a 32 bit trap gate. This flag cannot be specified with any other flags that start with idt_type

idt_storage_segment
Only specify this flag for task gates. Otherwise it won't work.

idt_ring0
This flag specifies the descriptor is accessible from ring 0. Not valid with gdt_ring1, gdt_ring2 or gdt_ring3

idt_ring1
This flag specifies the descriptor is accessible from ring 1. Not valid with gdt_ring0, gdt_ring2 or gdt_ring3

idt_ring2
This flag specifies the descriptor is accessible from ring 2. Not valid with gdt_ring0, gdt_ring1 or gdt_ring3

idt_ring3
This flag specifies the descriptor is accessible from ring 3. Not valid with gdt_ring0, gdt_ring1 or gdt_ring2

idt_present
This flag enables the decriptor. It must be specified or the descriptor will be ignored

Return Value

This function always returns a IDT descriptor structure.

Clone this wiki locally