UbixOS  2.0
gdt.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  descriptorTableUnion
 
struct  gdtDescriptor
 
struct  gdtGate
 

Macros

#define dAcc   0x100 /* Accessed (Data or Code) */
 
#define dBig   0x40 /* Default to 32 bit mode */
 
#define dBiglim   0x80 /* Limit is in 4K units */
 
#define dBusy   0xB00 /* Busy (TSS only) was 200 */
 
#define dCall   0x0C00 /* 386 Call Gate */
 
#define dCode   0x1800 /* Code Segment */
 
#define dConform   0x400 /* Conforming (Code segments only) */
 
#define dData   0x1000 /* Data Segment */
 
#define dDpl0   0x0000 /* DPL0 or mask for DPL */
 
#define dDpl1   0x2000 /* DPL1 or mask for DPL */
 
#define dDpl2   0x4000 /* DPL2 or mask for DPL */
 
#define dDpl3   0x6000 /* DPL3 or mask for DPL */
 
#define dEexdown   0x400 /* Expand down (Data segments only) */
 
#define dInt   0x0E00 /* 386 Interrupt Gate */
 
#define dLdt   0x200 /* Local Descriptor Table (LDT) */
 
#define dNpresent   0x8000 /* Not Present */
 
#define dPresent   0x8000 /* Present */
 
#define dRead   0x200 /* Readable (Code segments only) */
 
#define dTask   0x500 /* Task gate */
 
#define dTrap   0x0F00 /* 386 Trap Gate */
 
#define dTss   0x900 /* Task State Segment (TSS) */
 
#define dWrite   0x200 /* Writable (Data segments only) */
 
#define SEL_GET_IDX(sel)   (((sel)>>3) & 0x1FFF) /* Get Selector Index */
 
#define SEL_GET_LG(sel)   ((sel)&4) /* Return Local/Global Descriptor */
 
#define SEL_GET_PL(sel)   ((sel)&3) /* Get Priority Level Of Selector */
 
#define SEL_PL_KERN   0x0
 
#define SEL_PL_USER   0x3
 
#define ubixDescriptorTable(name, length)   union descriptorTableUnion name[length] =
 
#define ubixGateDescriptor(offset, selector, control)   {.gate = {(offset & 0xffff), selector, (control+dPresent), (offset >> 16) }}
 
#define ubixStandardDescriptor(base, limit, control)   {.descriptor = {(limit & 0xffff), (base & 0xffff), ((base >> 16) & 0xff), ((control + dPresent) >> 8), (limit >> 16), ((control & 0xff) >> 4), (base >> 24)}}
 

Functions

struct gdtDescriptor __attribute__ ((packed))
 

Variables

union descriptorTableUnion __attribute__
 
unsigned char access
 
unsigned char baseHigh
 
unsigned short baseLow
 
unsigned char baseMed
 
unsigned int granularity
 
unsigned int limitHigh
 
unsigned short limitLow
 
unsigned short offsetHigh
 
unsigned short offsetLow
 
unsigned short selector
 
union descriptorTableUnion ubixGDT [11]
 

Macro Definition Documentation

◆ dAcc

#define dAcc   0x100 /* Accessed (Data or Code) */

Definition at line 56 of file gdt.h.

◆ dBig

#define dBig   0x40 /* Default to 32 bit mode */

Definition at line 62 of file gdt.h.

◆ dBiglim

#define dBiglim   0x80 /* Limit is in 4K units */

Definition at line 63 of file gdt.h.

◆ dBusy

#define dBusy   0xB00 /* Busy (TSS only) was 200 */

Definition at line 59 of file gdt.h.

◆ dCall

#define dCall   0x0C00 /* 386 Call Gate */

Definition at line 40 of file gdt.h.

◆ dCode

#define dCode   0x1800 /* Code Segment */

Definition at line 41 of file gdt.h.

◆ dConform

#define dConform   0x400 /* Conforming (Code segments only) */

Definition at line 61 of file gdt.h.

◆ dData

#define dData   0x1000 /* Data Segment */

Definition at line 42 of file gdt.h.

◆ dDpl0

#define dDpl0   0x0000 /* DPL0 or mask for DPL */

Definition at line 53 of file gdt.h.

◆ dDpl1

#define dDpl1   0x2000 /* DPL1 or mask for DPL */

Definition at line 52 of file gdt.h.

◆ dDpl2

#define dDpl2   0x4000 /* DPL2 or mask for DPL */

Definition at line 51 of file gdt.h.

◆ dDpl3

#define dDpl3   0x6000 /* DPL3 or mask for DPL */

Definition at line 50 of file gdt.h.

◆ dEexdown

#define dEexdown   0x400 /* Expand down (Data segments only) */

Definition at line 60 of file gdt.h.

◆ dInt

#define dInt   0x0E00 /* 386 Interrupt Gate */

Definition at line 43 of file gdt.h.

◆ dLdt

#define dLdt   0x200 /* Local Descriptor Table (LDT) */

Definition at line 44 of file gdt.h.

◆ dNpresent

#define dNpresent   0x8000 /* Not Present */

Definition at line 55 of file gdt.h.

◆ dPresent

#define dPresent   0x8000 /* Present */

Definition at line 54 of file gdt.h.

◆ dRead

#define dRead   0x200 /* Readable (Code segments only) */

Definition at line 58 of file gdt.h.

◆ dTask

#define dTask   0x500 /* Task gate */

Definition at line 45 of file gdt.h.

◆ dTrap

#define dTrap   0x0F00 /* 386 Trap Gate */

Definition at line 46 of file gdt.h.

◆ dTss

#define dTss   0x900 /* Task State Segment (TSS) */

Definition at line 47 of file gdt.h.

◆ dWrite

#define dWrite   0x200 /* Writable (Data segments only) */

Definition at line 57 of file gdt.h.

◆ SEL_GET_IDX

#define SEL_GET_IDX (   sel)    (((sel)>>3) & 0x1FFF) /* Get Selector Index */

Definition at line 34 of file gdt.h.

◆ SEL_GET_LG

#define SEL_GET_LG (   sel)    ((sel)&4) /* Return Local/Global Descriptor */

Definition at line 33 of file gdt.h.

◆ SEL_GET_PL

#define SEL_GET_PL (   sel)    ((sel)&3) /* Get Priority Level Of Selector */

Definition at line 32 of file gdt.h.

◆ SEL_PL_KERN

#define SEL_PL_KERN   0x0

Definition at line 36 of file gdt.h.

◆ SEL_PL_USER

#define SEL_PL_USER   0x3

Definition at line 37 of file gdt.h.

◆ ubixDescriptorTable

#define ubixDescriptorTable (   name,
  length 
)    union descriptorTableUnion name[length] =

Definition at line 89 of file gdt.h.

◆ ubixGateDescriptor

#define ubixGateDescriptor (   offset,
  selector,
  control 
)    {.gate = {(offset & 0xffff), selector, (control+dPresent), (offset >> 16) }}

Definition at line 91 of file gdt.h.

◆ ubixStandardDescriptor

#define ubixStandardDescriptor (   base,
  limit,
  control 
)    {.descriptor = {(limit & 0xffff), (base & 0xffff), ((base >> 16) & 0xff), ((control + dPresent) >> 8), (limit >> 16), ((control & 0xff) >> 4), (base >> 24)}}

Definition at line 90 of file gdt.h.

Function Documentation

◆ __attribute__()

struct gdtDescriptor __attribute__ ( (packed)  )

Variable Documentation

◆ __attribute__

struct gdtGate __attribute__

◆ access

unsigned short access

Definition at line 83 of file gdt.h.

◆ baseHigh

unsigned char baseHigh

Definition at line 86 of file gdt.h.

◆ baseLow

unsigned short baseLow

Definition at line 81 of file gdt.h.

◆ baseMed

unsigned char baseMed

Definition at line 82 of file gdt.h.

◆ granularity

unsigned int granularity

Definition at line 85 of file gdt.h.

◆ limitHigh

unsigned int limitHigh

Definition at line 84 of file gdt.h.

◆ limitLow

unsigned short limitLow

Definition at line 80 of file gdt.h.

◆ offsetHigh

unsigned short offsetHigh

Definition at line 83 of file gdt.h.

◆ offsetLow

unsigned short offsetLow

Definition at line 80 of file gdt.h.

◆ selector

unsigned short selector

Definition at line 81 of file gdt.h.

Referenced by setTaskVector().

◆ ubixGDT

union descriptorTableUnion ubixGDT[11]