예제 #1
0
파일: kernel.c 프로젝트: ZaG799/TPE-Arqui
int main()
{	
	// no se usa idtr, el bootloader de Pure ya lo setea en 0x0 y usa ese



	set_idt_entry(0x20, 0x08, (uint64_t)&_irq00Handler, 0x8E);    
	set_idt_entry (0x21, 0x08, (uint64_t)&_irq01Handler, 0x8E );
	//Chequiar bootloader (idt)
	


	//Todas las interrupciones habilitadas.
	picMasterMask(0xFC);
	picSlaveMask(0xFF);
        
	_sti();
	

	ncPrint("[Finished]");
	ncNewline();

	while (1) {

	}

	return 0;
}
예제 #2
0
int main()
{	

	
	setup_IDT_entry(0x20, 0x8,(uint64_t) &_irq00Handler, 0x8E);	
	setup_IDT_entry(0x21, 0x8, (uint64_t)&_irq01Handler, 0x8E);
	setup_IDT_entry(0x80, 0x8,(uint64_t) &syscallHandler, 0x8E);
	

	picMasterMask(0xFC); 
	picSlaveMask(0xFF);

	_sti();

	ncPrint("[Kernel Main]");
	ncNewline();
	ncPrint("  Sample code module at 0x");
	ncPrintHex((uint64_t)sampleCodeModuleAddress);
	ncNewline();
	
	ncPrint("  Calling the sample code module returned: ");
	ncPrintHex(((EntryPoint)sampleCodeModuleAddress)());
	ncNewline();
	ncNewline();

	ncPrint("  Sample data module at 0x");
	ncPrintHex((uint64_t)sampleDataModuleAddress);
	ncNewline();
	ncPrint("  Sample data module contents: ");
	ncPrint((char*)sampleDataModuleAddress);
	ncNewline();

	ncPrint("[Finished]");

	while(1);

	ncClear();

	

	return 0;
}
예제 #3
0
void load_idt()
{

	setup_IDT_entry (0x20, 0x08, (uint64_t)&_irq00Handler, ACS_INT);
	setup_IDT_entry (0x21, 0x08, (uint64_t)&_irq01Handler, ACS_INT);
	setup_IDT_entry (0x80, 0x08, (uint64_t)&_syscallHandler, ACS_INT);

	idtr.base = 0;
	idtr.base += (uint64_t) &idt;
	idtr.limit = (uint16_t) sizeof(idt)-1;
	
	_lidt(&idtr);	


	//Solo interrupcion de teclado y timer tick habilitadas 
	picMasterMask(0xFC); 
	picSlaveMask(0xFF);
        
	_sti();

	
}