コード例 #1
0
ファイル: kernel.c プロジェクト: JRWynneIII/jForth_Kernel
void kernel_main()
{
	terminal_initialize();
	kprintf("Identifying CPU...", COLOR_WHITE);
	cpuid_t cpu_data = get_cpuid();
	kprintf(cpu_data.make, COLOR_WHITE);
	kprintf("\n", COLOR_WHITE);
	kprintf("Type: ", COLOR_WHITE);
	kprintf(itoa(cpu_data.family), COLOR_WHITE);
	kprintf("\n", COLOR_WHITE);
	kprintf("Family: ", COLOR_WHITE);
	kprintf(cpu_data.family, COLOR_WHITE);
	kprintf("\n", COLOR_WHITE);
	kprintf("Model: ", COLOR_WHITE);
	kprintf(cpu_data.model, COLOR_WHITE);
	kprintf("\n", COLOR_WHITE);
	kprintf("Enabling A20 Line...\n", COLOR_WHITE);
	enable_a20();
	kprintf("Initilizing VGA Driver....\n",COLOR_WHITE);
	kprintf("Installing Global Descriptor Table....\n",COLOR_WHITE);
	gdt_install();
	kprintf("Installing Interrupt Descriptor Table....\n",COLOR_WHITE);
	idt_install();
	kprintf("Enabling paging...\n", COLOR_WHITE);
	init_paging();
	kprintf("Setting up ISRs...\n",COLOR_WHITE);
	isrs_install();
	kprintf("Remapping the PIC and setting up IRQs...\n",COLOR_WHITE);
	install_irq();
	kprintf("Initializing the Kernel Address Translation Table...\n", COLOR_WHITE);
	kATT_Init();
	kprintf("Identifying ATA drives.....\n", COLOR_WHITE);
	ATA_Init();
	kprintf(DRIVE_DATA, COLOR_WHITE);
        kprintf("Installing Timer ISR....\n",COLOR_WHITE);
 	timer_install();
//	kprintf("Checking PCI device vendors....\n",COLOR_WHITE);
//	init_PCI();
	kprintf("Starting shell....\n",COLOR_WHITE);

	init_shell();

	for (;;);
}
コード例 #2
0
ファイル: main16.c プロジェクト: gusc/mbr2gpt
/**
* Initialize Real Mode
*/
void main16(){
	// This a static location (see config.h)
	e820map_t *mem_map = (e820map_t *)E820_LOC;

	// Setup video mode
#if DEBUG == 1
	#if VIDEOMODE == 1
	set_video_mode(0x03); // Teletype
	#elif VIDEOMODE == 2
	set_svga_mode(0x011B); // 1280x1024 (24 bit) 
	#endif
#endif

	// Enable A20 gate
	enable_a20();
	// Read E820 map
	read_e820(mem_map);
	
	// Exit like we want it!
	// It's uggly, but as we can not control the entry of this function
	// at least we can control the exit. 
	RET32();
}