Go to the documentation of this file.
44 #define FP_TO_LINEAR(seg, off) ((void*) ((((uint16_t) (seg)) << 4) + ((uint16_t) (off))))
119 "andl $0xffffbfff,(%%esp) \n"
123 :
"r" ((
char *)&loadidt)
126 for (
int i = 0;i < 256;i++)
169 gpfTSS->
eip = (
unsigned int) &
_gpf;
171 gpfTSS->
esp = gpfStack;
202 kprintf(
"idt0 - Address: [0x%X]\n", &ubixIDT);
209 void setVector(
void *handler,
unsigned char interrupt,
unsigned short controlMajor) {
210 unsigned short codesegment = 0x08;
211 asm volatile (
"movw %%cs,%0":
"=g" (codesegment));
213 ubixIDT[interrupt].gate.offsetLow = (
unsigned short) (((
unsigned long) handler) & 0xffff);
214 ubixIDT[interrupt].gate.selector = codesegment;
215 ubixIDT[interrupt].gate.access = controlMajor;
216 ubixIDT[interrupt].gate.offsetHigh = (
unsigned short) (((
unsigned long) handler) >> 16);
227 uInt16 codesegment = 0x08;
228 asm volatile (
"movw %%cs,%0":
"=g" (codesegment));
230 ubixIDT[interrupt].gate.offsetLow = 0x0;
231 ubixIDT[interrupt].gate.selector =
selector;
232 ubixIDT[interrupt].gate.access = controlMajor;
233 ubixIDT[interrupt].gate.offsetHigh = 0x0;
268 ".globl _divideError \n"
278 " call _divideError \n"
340 static void _int3() {
346 static void _int4() {
352 static void _int5() {
391 ".globl _doubleFault \n"
400 " call __doubleFault \n"
409 static void _int9() {
415 static void _int10() {
421 static void _int11() {
427 static void _int12() {
437 bool isOperand32 =
FALSE, isAddress32 =
FALSE;
450 gpfStart:
switch (ip[0]) {
460 kpanic(
"GPF OP 0x20/0x21\n");
497 if (isOperand32 ==
TRUE) {
520 if (isOperand32 ==
TRUE) {
616 ".globl _floatingPoint \n"
626 " call __floatingPoint \n"
642 ".globl _alignmentCheck \n"
643 "_alignmentCheck: \n"
651 " call __alignmentCheck \n"
667 ".globl _machineCheck \n"
677 " call __machineCheck \n"
720 ".globl _virtualization \n"
721 "_virtualization: \n"
730 " call __virtualization \n"
746 ".globl _security \n"
796 " movl _current,%eax \n"
797 " cmpl _usedMath,%eax \n"
799 " call mathStateRestore \n"
void setTaskVector(uInt8 interrupt, uInt16 controlMajor, uInt8 selector)
union descriptorTableUnion __attribute__
void __gpf(struct trapframe *)
void __nmi(struct trapframe *)
unsigned short int uInt16
void outportWord(unsigned int, unsigned short)
outputut one word to specified port
void __int6(struct trapframe *frame)
void outportByte(unsigned int, unsigned char)
outputut one byte to specified port
void __debug(struct trapframe *)
void kpanic(const char *fmt,...)
print panic message and halt system
unsigned char inportByte(unsigned int)
input one byte from specified port
void __doubleFault(struct trapframe *)
uint32_t * kernelPageDirectory
ubixDescriptorTable(ubixGDT, 11)
void __simd(struct trapframe *)
void __security(struct trapframe *)
unsigned short inportWord(unsigned int)
input one word from specified port
void __machineCheck(struct trapframe *)
void __virtualization(struct trapframe *)
void _intNull(struct trapframe *frame)
void __divideError(struct trapframe *)
void __alignmentCheck(struct trapframe *)
void __floatingPoint(struct trapframe *)
void die_if_kernel(char *str, struct trapframe *regs, long err)
void * memset(void *dst, int c, size_t length)
void irqEnable(uInt16 irqNo)
void setVector(void *handler, unsigned char interrupt, unsigned short controlMajor)
int kprintf(const char *,...)
#define FP_TO_LINEAR(seg, off)