Exemple #1
0
/**
 *  파일 시스템을 초기화
 */
BOOL kInitializeFileSystem( void )
{
    // 자료구조 초기화와 동기화 객체 초기화
    kMemSet( &gs_stFileSystemManager, 0, sizeof( gs_stFileSystemManager ) );
    kInitializeMutex( &( gs_stFileSystemManager.stMutex ) );
    
    // 하드 디스크를 초기화
    if( kInitializeHDD() == TRUE )
    {
        // 초기화가 성공하면 함수 포인터를 하드 디스크용 함수로 설정
        gs_pfReadHDDInformation = kReadHDDInformation;
        gs_pfReadHDDSector = kReadHDDSector;
        gs_pfWriteHDDSector = kWriteHDDSector;
    }
    else
    {
        return FALSE;
    }
    
    // 파일 시스템 연결
    if( kMount() == FALSE )
    {
        return FALSE;
    }
    
    return TRUE;
}
Exemple #2
0
void Main( void )
{
	int iCursorX, iCursorY;
	kPrintString( 45, 10,"Pass" );
	kInitializeConsole( 0, 11);
	kPrintf("Success to enter 64-bit C Kernel\n");
	kPrintf("Console Initialization......................[Pass]\n");
	// 부팅상황
	kGetCursor( &iCursorX, &iCursorY );
	kPrintf("GDT Initialize And Switch For 64bit Mode....[    ]");
	kInitializeGDTTableAndTSS();
	kLoadGDTR( GDTR_STARTADDRESS );
	kSetCursor( 45, iCursorY++);
	kPrintf("Pass\n");

	kPrintf("TSS Segment Load............................[    ]" );
	kLoadTR( GDT_TSSSEGMENT );
	kSetCursor( 45, iCursorY++);
	kPrintf("Pass\n");

	kPrintf("IDT Initialize..............................[    ]" );
	kInitializeIDTTables();
	kLoadIDTR( IDTR_STARTADDRESS );
	kSetCursor( 45, iCursorY++);
	kPrintf("Pass\n");


	kPrintf("Total RAM Size Check........................[    ]" );
	kCheckTotalRAMSize();
	kSetCursor( 45, iCursorY++);
	kPrintf("Pass], Size = %d MB\n", kGetTotalRAMSize());

	kPrintf("TCB Pool And Scheduler Initialize...........[Pass]\n" );
	iCursorY++;
	kInitializeScheduler();

	kPrintf("Dynamic Memory Initialize...................[Pass]\n");
	iCursorY++;
	kInitializeDynamicMemory();

	// 1ms 당 인터럽트 발생
	kInitializePIT( MSTOCOUNT(1), 1 );

	kPrintf("Keyboard Activation.........................[    ]" );
	if( kInitializeKeyboard() == TRUE )
	{
		kSetCursor( 45, iCursorY++);
		kPrintf("Pass\n");
		kChangeKeyboardLED(FALSE, FALSE, FALSE);
	}
	else
	{
		kSetCursor( 45, iCursorY++);
		kPrintf("Fail\n");
		while(1)
		{
			;
		}
	}

	kPrintf("PIC Controller And Interrupt Initialize.....[    ]" );
	kInitializePIC();
	kMaskPICInterrupt( 0 );
	kEnableInterrupt();
	kSetCursor( 45, iCursorY++);
	kPrintf("Pass\n");

	kPrintf("HDD Initialize..............................[    ]" );
	if(kInitializeHDD() == TRUE)
	{
		kSetCursor( 45, iCursorY++);
		kPrintf("Pass\n");
	}
	else
	{
		kSetCursor( 45, iCursorY++);
		kPrintf("Fail\n");
	}
	kPrintf("File System Initialize......................[    ]" );
	if(kInitializeFileSystem() == TRUE)
	{
		kSetCursor( 45, iCursorY++);
		kPrintf("Pass\n");
	}
	else
	{
		kSetCursor( 45, iCursorY++);
		kPrintf("Fail\n");
	}


	kCreateTask( TASK_FLAGS_LOWEST | TASK_FLAGS_IDLE | TASK_FLAGS_SYSTEM | TASK_FLAGS_THREAD , 0, 0, (QWORD) kIdleTask );
	kStartConsoleShell();
}