Exemple #1
0
VOID
HookInterrupt(UCHAR iVec, void (*InterruptHandler)( void ))
{
	IDT			Idt;
	INT_VECTOR	Vec;
	ULONG		i;
	
	LoadIDT( &Idt );

	LoadINTVector(
			&Idt,
			iVec,
			&Vec);

	KdPrint( ( "HookInterrupt: Vector -- %X, 0x%p, 0x%p\n", iVec, VEC_OFFSET_TO_ADDR( Vec ), InterruptHandler));
	ADDR_TO_VEC_OFFSET( Vec, (ULONG64) InterruptHandler);

	//Vec.wSelector = selector;

	SaveINTVector(
			&Idt,
			iVec,
			&Vec );

}
Exemple #2
0
VOID
BackupInterrupt(UCHAR iVec, OUT PINT_VECTOR Vec)
{
	IDT			Idt;
	ULONG		i;

	LoadIDT( &Idt );

	LoadINTVector(
			&Idt,
			iVec,
			Vec);
}
Exemple #3
0
VOID
RestoreInterrupt(UCHAR iVec, IN PINT_VECTOR Vec)
{
	IDT			Idt;
	ULONG		i;

	LoadIDT( &Idt );

	SaveINTVector(
			&Idt,
			iVec,
			Vec);
}
Exemple #4
0
/** Kernel (real) entry point **/
void kmain(struct mb_partial_info *mbi)
{
    printk("RAM detected : %uk (lower), %uk (upper)\n", mbi->low_mem, mbi->high_mem);
    printk("Command line got: %s \n", mbi->cmdline);
	printk ("Initialize GDT ... ");
	InitGDT();
    asm("   movw $0x18, %ax \n \
                movw %ax, %ss \n \
                movl $0x1FFF0, %esp");
	OkMsg();
    
	LoadIDT();
    printk ("IDT loaded  éè\n");
    InitPIC();

	sti;
	while(1) { }
}
Exemple #5
0
VOID
CopyInterrupt(UCHAR fromVec, UCHAR toVec)
{
	IDT			Idt;
	INT_VECTOR	Vec;
	ULONG		i;

	LoadIDT( &Idt );

	LoadINTVector(
			&Idt,
			fromVec,
			&Vec);

	KdPrint( ( "CopyInterrupt: Vector, 0x%p\n", VEC_OFFSET_TO_ADDR( Vec )));

	SaveINTVector(
			&Idt,
			toVec,
			&Vec );

}