예제 #1
0
파일: timer.c 프로젝트: apandit/RTOS
/*
 * Entry point, check with m68k-coff-nm
 */
int main( void )
{
    UINT32 mask;

    /* Disable all interupts */
    asm( "move.w #0x2700,%sr" );

    coldfire_vbr_init();

    /*
     * Store the timer ISR at auto-vector #6
     */
    asm( "move.l #asm_timer_entry,%d0" );
    asm( "move.l %d0,0x10000078" );

    /*
     * Setup to use auto-vectored interupt level 6, priority 3
     */
    TIMER0_ICR = 0x9B;

    /*
     * Set the reference counts, ~10ms
     */
    TIMER0_TRR = 1758;

    /*
     * Setup the timer prescaler and stuff
     */
    TIMER0_TMR = 0xFF1B;

    /*
     * Set the interupt mask
     */
    mask = SIM_IMR;
    mask &= 0x0003fdff;
    SIM_IMR = mask;    

    /* Let the timer interrupt fire, lower running priority */
    asm( "move.w #0x2000,%sr" );
    
    rtx_dbug_outs( (CHAR *) "Timer started\n\r" );
    timer_count = 0;
	
	int seconds_count = 0;

    while ( 1 ){
		// Check that timer is at 5 seconds; reset timer in block
		// or block is evaluated true again (timer doesn't reset fast enough)
		if ( timer_count &&  timer_count % 500 == 0 ) {
            timer_count = 0;
			seconds_count += 5;

            BinToDec( seconds_count );
		}
	};
    return 0;
}
예제 #2
0
파일: serial.c 프로젝트: gkcampbe/ECE354
/*
 * * Entry point, check with m68k-coff-nm
 * */
int main( void ) { 
    coldfire_vbr_init();

    prepare_serial();

    rtx_dbug_outs((CHAR *) "Type Q or q on RTX terminal to quit.\n\r" );

    /* Busy Loop */
    while( CharIn != 'q' && CharIn != 'Q' ) {
        if( !Caught ) {
            Caught = TRUE;
            CharOut = CharIn;

            if (CharOut == CR || CharOut == LF ) {
                c_serial_charOut_CR_LF();
            } else {
                /* enable tx interrupts */
                SERIAL1_IMR = 3;
            }

#ifdef _DEBUG_
            /* Nasty hack to get a dynamic string format,
             * * grab the character before turning the interrupts back on.
             * */
            StringHack[12] = CharIn;

            /* Now print the string to debug,
             * * note that interrupts are now back on.
             * */
            rtx_dbug_outs( StringHack );

#endif /* _DEBUG_*/
        }
    }

    /* Disable all interupts */
    asm( "move.w #0x2700,%sr" );

    /* Reset globals so we can run again */
    CharIn = '\0';
    Caught = TRUE;
    return 0;
}
예제 #3
0
파일: timer.c 프로젝트: gkcampbe/ECE354
int main( void ) {
    coldfire_vbr_init();

    prepare_serial();

    prepare_timer();

    CharIn = '\0';

    UINT32 OriginalCounter = 0;


    //msCounter = 86390;
    msCounter = 0;

    msCounter*=1000;

    char time_chars[TIME_FORMAT_SIZE];

    while( CharIn != ESC ) {
        if (OriginalCounter != msCounter) {
            OriginalCounter = msCounter;

            get_time_chars(msCounter/1000, time_chars);

            char * tmp = time_chars;
            while (CharOut = *tmp++) {
                c_serial_charOut_blocking();
            }
            CharOut = CR;
            c_serial_charOut_blocking();
        }
    }

    return 0;
}
예제 #4
0
파일: timer0.c 프로젝트: Josh-L/OS-Kernel
/*
 * Entry point, check with m68k-coff-nm
 */
int main( void )
{
    UINT32 mask;
    
    /* Disable all interupts */
    asm( "move.w #0x2700,%sr" );

    coldfire_vbr_init();

    /*
     * Store the timer ISR at auto-vector #6
     */
    asm( "move.l #asm_timer_entry,%d0" );
    asm( "move.l %d0,0x10000078" );

    /*
     * Setup to use auto-vectored interupt level 6, priority 3
     */
    TIMER0_ICR = 0x9B;

    /*
     * Set the reference counts, ~10ms
     */
    TIMER0_TRR = 0xFFFF;

    /*
     * Setup the timer prescaler and stuff
     */
    TIMER0_TMR = 0x2A1D;
    
    /*
	* Store the timer output ISR at user vector #64
	*/
    asm( "move.l #asm_timer_output_char,%d0" );
    asm( "move.l %d0,0x10000100" );
    /* Reset the entire UART */
    SERIAL1_UCR = 0x10;
    /* Reset the receiver */
    SERIAL1_UCR = 0x20;
    /* Reset the transmitter */
    SERIAL1_UCR = 0x30;
    /* Reset the error condition */
    SERIAL1_UCR = 0x40;
    /* Install the interupt */
    SERIAL1_ICR = 0x17;
    SERIAL1_IVR = 64;
    /* enable interrupts on tx only */
    SERIAL1_IMR = 0x01;
	
    /* Setup for transmit only */
    SERIAL1_UCR = 0x06;
    
    /*
     * Set the interupt mask
     */
    mask = SIM_IMR;
    mask &= 0x0003fdff;
    SIM_IMR = mask;
    
    /* Enable all interupts */
    asm( "move.w #0x2000,%sr" );
    
    while(TRUE);
    return 0;
}
예제 #5
0
파일: serial.c 프로젝트: apandit/RTOS
/*
 * Entry point, check with m68k-coff-nm
 */
int main( void )
{
	UINT32 mask;

    //disable all interupts 
    asm( "move.w #0x2700,%sr" );
    
    coldfire_vbr_init();
        
    //store the serial ISR at user vector #64
    asm( "move.l #asm_serial_entry,%d0" );
    asm( "move.l %d0,0x10000100" );

    //reset the entire UART 
    SERIAL1_UCR = 0x10;

    //reset the receiver 
    SERIAL1_UCR = 0x20;
    
    //reset the transmitter 
    SERIAL1_UCR = 0x30;

    //reset the error condition
    SERIAL1_UCR = 0x40;

    //install the interupt
    SERIAL1_ICR = 0x17;
    SERIAL1_IVR = 64;

    //enable interrupts on rx only
    SERIAL1_IMR = 0x02;

    //set the baud rate
    SERIAL1_UBG1 = 0x00;
#ifdef _CFSERVER_           /* add -D_CFSERVER_ for cf-server build */
    SERIAL1_UBG2 = 0x49;    /* cf-server baud rate 19200 */ 
#else
    SERIAL1_UBG2 = 0x92;    /* lab board baud rate 9600 */
#endif 

    //set clock mode
    SERIAL1_UCSR = 0xDD;

    //setup the UART (no parity, 8 bits )
    SERIAL1_UMR = 0x13;
    
    //setup the rest of the UART (noecho, 1 stop bit )
    SERIAL1_UMR = 0x07;

    //setup for transmit and receive
    SERIAL1_UCR = 0x05;

    //enable interupts
    mask = SIM_IMR;
    mask &= 0x0003dfff;
    SIM_IMR = mask;

    
    //enable all interupts
    asm( "move.w #0x2000,%sr" );

    rtx_dbug_outs((CHAR *) "Type q on RTX terminal to quit.\n\r" );
    
    //busy Loop
    while( CharIn != 'q' )
    {
        if( !Caught )
        {
            if( CharIn == 'q' ) break;
            CharOut = CharIn;
            Caught = TRUE;
            
            //enable tx interrupts/
            SERIAL1_IMR = 3;

#ifdef _DEBUG_
            // Insert new char to output string
            StringHack[0] = CharOut == 13 ? 'r' : CharOut;
            rtx_dbug_outs( StringHack );
#endif
        }
    }

    //disable all interupts
    asm( "move.w #0x2700,%sr" );

    //reset globals so we can run again
    CharIn = '\0';
    Caught = TRUE;
    return 0;
}
예제 #6
0
파일: main_rtx.c 프로젝트: apandit/RTOS
int main() 
{

    rtx_dbug_outs((CHAR *)"rtx: Entering main()\r\n");

    /* get the third party test proc initialization info */
    __REGISTER_TEST_PROCS_ENTRY__();
	
	rtxEnd = &(_end);
	m_nextPid = 1;
	
	// Setting up trap # 0
    // Load vector table for trap # 0
    asm( "move.l #asm_trap_entry, %d0" );
    asm( "move.l %d0, 0x10000080" );
	
	#ifdef _DEBUG_
	rtx_dbug_outs( (CHAR*)"Start\r\n" );
	WriteHex((int)malloc(0) );
	rtx_dbug_outs( (CHAR*)" Address before PCBS\r\n" );
	#endif
	// Allocate and initialize pcbs and its stacks
	//rtxProcess* pcbs = AllocatePCBs( MAX_NUMPROCS );
	pcbs = AllocatePCBs( MAX_NUMPROCS );
	#ifdef _DEBUG_
	WriteHex((int)malloc(0) );
	rtx_dbug_outs( (CHAR*)" Address after PCBS\r\n" );
	#endif
	// Initialize the process manager
	rtxProcMan = InitProcessManager();
	#ifdef _DEBUG_
	WriteHex((int)malloc(0) );
	rtx_dbug_outs( (CHAR*)" Address after Procman?\r\n" );
	#endif
	// Create the null process
	rtxProcess* nullProc = CreateProcess( pcbs, null_process, AllocateStack(256), 0, NULLPROCPRIORITY );
	nullProc->status = READY;
	rtxProcMan->nullProc = nullProc;
	#ifdef _DEBUG_
	WriteHex((int)malloc(0) );
	rtx_dbug_outs( (CHAR*)" Address after nullproc?\r\n" );
	#endif
	//Create the Processes
	rtxProcess* cp2 = CreateProcess( pcbs, &keyboardCommandDecoder, AllocateStack(2048), KCDPID, MEDIUM );
	rtxProcess* cp1 = CreateProcess( pcbs, &CRTDisplay, AllocateStack(512), CRTPID, MEDIUM);
	rtxProcess* cp3 = CreateProcess( pcbs, &UART_PROCESS, AllocateStack(512), UARTPID, HIGH );
	
	CRT = cp1;
   	KCD = cp2;
	UART = cp3;	
	
	// Creating and enqueueing the test processes
	for( m_nextPid = 1 ; m_nextPid < (NUM_TEST_PROCS + 1); m_nextPid++ ){
		EnqueueProcess( 
			rtxProcMan, 
			CreateProcess( 
				pcbs, 
				g_test_proc[m_nextPid-1].entry, 
				AllocateStack( g_test_proc[m_nextPid-1].sz_stack ),
				g_test_proc[m_nextPid-1].pid,
				g_test_proc[m_nextPid-1].priority
			),
			READYQUEUE
		);
	}
	
	// Set the next pid to be 1 greater than last test proc pid
	//m_nextPid = g_test_proc[m_nextPid-2].pid + 1;
	
	// Initialize some of our own system processes
	
	EnqueueProcess( rtxProcMan, cp2,READYQUEUE);
	EnqueueProcess( rtxProcMan, cp1,READYQUEUE );

	
	
	// Initialize the scheduler
	InitializeScheduler( (ProcessManager*)(rtxProcMan) );
	
	// Time to allocate and initialize free memory
	UINT32 numTotalBlocks = ( (UINT32)0x10200000 - (UINT32)malloc(0)) / sizeof(MemoryBlock);
	
	//numTotalBlocks = 1;
	#ifdef _DEBUG_
	WriteHex((int)malloc(0) );
	rtx_dbug_outs( (CHAR*)" Address At start of freemem\r\n" );
	#endif
	// Allocate free memory and create memory table
	MemoryBlock* memstart = AllocateFreeMemory( sizeof(MemoryBlock), numTotalBlocks );
	#ifdef _DEBUG_
	WriteHex((int)malloc(0) );
	rtx_dbug_outs( (CHAR*)" Address after freemem?\r\n" );
	rtx_dbug_outs( (CHAR*)"Allocated Free Memory\r\n" );
	#endif
	InitMemQueue( &freeMemory );
	InitializeMemory( &freeMemory, memstart, numTotalBlocks );
	#ifdef _DEBUG_	
    rtx_dbug_outs( (CHAR*)"Number of free memory blocks: " );
    WriteNumber( freeMemory.count );	
    WriteLine();

	rtx_dbug_outs( (CHAR*)"Initialized Free Memory\r\n" );
	#endif
	
	UINT32 mask;
	
	//disable all interupts 
	asm( "move.w #0x2700,%sr" );
	
	coldfire_vbr_init();
	
	//store the serial ISR at user vector #64
	asm( "move.l #asm_serial_entry,%d0" );
	asm( "move.l %d0,0x10000100" );

	//reset the entire UART 
	SERIAL1_UCR = 0x10;

	//reset the receiver 
	SERIAL1_UCR = 0x20;
	
	//reset the transmitter 
	SERIAL1_UCR = 0x30;

	//reset the error condition
	SERIAL1_UCR = 0x40;

	//install the interupt
	SERIAL1_ICR = 0x17;
	SERIAL1_IVR = 64;

	//enable interrupts on rx only
	SERIAL1_IMR = 0x02;

	//set the baud rate
	SERIAL1_UBG1 = 0x00;
#ifdef _CFSERVER_           /* add -D_CFSERVER_ for cf-server build */
	SERIAL1_UBG2 = 0x49;    /* cf-server baud rate 19200 */ 
#else
	SERIAL1_UBG2 = 0x92;    /* lab board baud rate 9600 */
#endif 

	//set clock mode
	SERIAL1_UCSR = 0xDD;

	//setup the UART (no parity, 8 bits )
	SERIAL1_UMR = 0x13;
	
	//setup the rest of the UART (noecho, 1 stop bit )
	SERIAL1_UMR = 0x07;

	//setup for transmit and receive
	SERIAL1_UCR = 0x05;

	//enable interupts
	mask = SIM_IMR;
	mask &= 0x0003dfff;
	SIM_IMR = mask;

	//enable all interupts
	asm( "move.w #0x2000,%sr" );
	// end of keyboard interrupts
	
	
	// Start it up
	ScheduleNextProcess( rtxProcMan, NULL );
	
    return 0;
}
예제 #7
0
파일: main_rtx.c 프로젝트: gkcampbe/ECE354
void rtx_init () {
#ifdef _DEBUG_
	rtx_dbug_outs((CHAR *)"x: rtx_init \r\n");
#else
	rtx_dbug_outs((CHAR *)"\r\nInitializing");
#endif

	init_memory();
	init_trap_handler();
	coldfire_vbr_init();
	
	BYTE * memProcStack = memEnd + MEMBLOCKS*sizeof(struct listItem);
#ifdef _DEBUG_
	dprintf("memProcStack = 0x%x \r\n", memProcStack);
#endif

	UINT16 i;


	rtx_memset( &ready_queues[0], NULL, sizeof(ready_queues) );
	rtx_memset( &blocked_mem_queues[0], NULL, sizeof(blocked_mem_queues) );
	rtx_memset( &blocked_msg_procs[0], 0, sizeof(blocked_msg_procs) );
	rtx_memset( &i_proc_queue, 0, sizeof(i_proc_queue) );
	rtx_memset( &char_buffer[0], 0, sizeof(char_buffer) );
	rtx_memset( &cmd_registration[0], 0, sizeof(CMD_SIZE) );

#ifdef _DEBUG_HOTKEYS
	rtx_memset(&send_msg_buffer[0], 0, sizeof(send_msg_buffer));
	rtx_memset(&recv_msg_buffer[0], 0, sizeof(recv_msg_buffer));
	send_msg_buffer_index = recv_msg_buffer_index = 0;
#endif
	cursor_tracker = 0;

#ifndef _DEBUG_
	rtx_dbug_outs((CHAR *)".");
#endif	
	// sys_proc()
	pcbs[0].pid = 0;
	pcbs[0].priority = LOWEST+1;
	pcbs[0].proc_state = RUNNING;
	memProcStack += SZ_STACK/2;
	pcbs[0].orig_sp = (long*)memProcStack;
	pcbs[0].stack_ptr = pcbs[0].orig_sp;
	pcbs[0].recv_queue.msg_head = pcbs[0].recv_queue.msg_tail = NULL;


	// INIT STACK
	(pcbs[0].stack_ptr)--;
	*(pcbs[0].stack_ptr) = (UINT32)sys_proc; // PC
	(pcbs[0].stack_ptr)--;
	*(pcbs[0].stack_ptr) = ADMIN_SR; // ADMIN_SR
#ifdef _DEBUG_
	dprintf("pcb: 0x%x, pid: %d, stack_start_addr: 0x%x, PC: 0x%x \r\n", &pcbs[0], 0, pcbs[0].stack_ptr, sys_proc);
#else
	rtx_dbug_outs((CHAR *)".");
#endif
	for (i = 1; i<=NUM_T_PROCS; i++ ) {
		pcbs[i].pid = g_test_proc[i-1].pid;
		pcbs[i].priority = g_test_proc[i-1].priority;	
		memProcStack += g_test_proc[i-1].sz_stack;
		pcbs[i].orig_sp = (long*)memProcStack;
		pcbs[i].stack_ptr = pcbs[i].orig_sp;
		pcbs[i].proc_state = READY;
		pcbs[i].recv_queue.msg_head = pcbs[i].recv_queue.msg_tail = NULL;

		// INIT STACK
		
		stack_init(&(pcbs[i].stack_ptr), (UINT32)g_test_proc[i-1].entry);
		
#ifdef _DEBUG_
		dprintf("pcb: 0x%x, pid: %d, stack_ptr: 0x%x \r\n", &pcbs[i], pcbs[i].pid, pcbs[i].stack_ptr);
#else
	rtx_dbug_outs((CHAR *)".");
#endif
		proc_queue_push_back(pcbs[i].pid);
	}

	for (i = NUM_T_PROCS+1; i<=NUM_K_PROCS+NUM_T_PROCS; i++ ) {
		// i<KCD are Process A, B, C
		pcbs[i].pid = i;
		if (i == TIMER0 || i == UART1) {
			pcbs[i].proc_state = I_PROC;
			memProcStack += SZ_STACK/2;
		}
		else {
			pcbs[i].proc_state = READY;
			memProcStack += SZ_STACK;
		}
		pcbs[i].orig_sp = (long*)memProcStack;
		pcbs[i].stack_ptr = pcbs[i].orig_sp;
		
		pcbs[i].recv_queue.msg_head = pcbs[i].recv_queue.msg_tail = NULL;

		// INIT STACK

		switch(i)
		{
			case P_A:
				pcbs[i].priority = LOWEST;
				stack_init(&(pcbs[i].stack_ptr), (UINT32)Process_A);
				break;
			case P_B:
				pcbs[i].priority = LOW;
				stack_init(&(pcbs[i].stack_ptr), (UINT32)Process_B);
				break;
			case P_C:
				pcbs[i].priority = MEDIUM;
				stack_init(&(pcbs[i].stack_ptr), (UINT32)Process_C);
				break;
			case KCD:
				pcbs[i].priority = HIGH;
				stack_init(&(pcbs[i].stack_ptr), (UINT32)kcd);
				break;
			case CMD_DECODER:
				pcbs[i].priority = HIGH;
				stack_init(&(pcbs[i].stack_ptr), (UINT32)cmd_decoder);
				break;
			case CRT:
				pcbs[i].priority = HIGH;
				stack_init(&(pcbs[i].stack_ptr), (UINT32)crt);
				break;
			case WALL_CLK_START:
				pcbs[i].priority = HIGH;
				stack_init(&(pcbs[i].stack_ptr), (UINT32)wall_clock_start);
				break;
			case WALL_CLK_STOP:
				pcbs[i].priority = HIGH;
				stack_init(&(pcbs[i].stack_ptr), (UINT32)wall_clock_stop);
				break;
			case SET_PROCESS_PRIOIRTY_PROC:
				pcbs[i].priority = HIGH;
				stack_init(&(pcbs[i].stack_ptr), (UINT32)set_process_priority_proc);
				break;
			case WALL_CLK_DISPLAY:
				pcbs[i].priority = HIGH;
				stack_init(&(pcbs[i].stack_ptr), (UINT32)wall_clock_display);
				break;
			case TIMER0:
				pcbs[i].priority = HIGH;
				stack_init(&(pcbs[i].stack_ptr), (UINT32)i_timer_proc);
				break;
			case UART1:
				pcbs[i].priority = HIGH;
				stack_init(&(pcbs[i].stack_ptr), (UINT32)i_uart_proc);
				break;
		}
#ifdef _DEBUG_	
		dprintf("pcb: 0x%x, pid: %d, stack_ptr: 0x%x \r\n", &pcbs[i], pcbs[i].pid, pcbs[i].stack_ptr);
#else
	rtx_dbug_outs((CHAR *)".");
#endif
		proc_queue_push_back(pcbs[i].pid);
	}
	
	

	current_pcb = &pcbs[0];

	asm("move.l %0, %%a7": :"m"(current_pcb->stack_ptr));
	
#ifndef _DEBUG_

rtx_dbug_outs("\r\n\r\n\r\n");

rtx_dbug_outs("      :::::::::: ::::::::  :::::::::: ::::::::  ::::::::::     ::: \r\n");
rtx_dbug_outs("     :+:       :+:    :+: :+:       :+:    :+: :+:    :+:    :+:   \r\n");
rtx_dbug_outs("    +:+       +:+        +:+              +:+ +:+          +:+ +:+ \r\n");
rtx_dbug_outs("   +#++:++#  +#+        +#++:++#      +#++:  +#++:++#+   +#+  +:+  \r\n");
rtx_dbug_outs("  +#+       +#+        +#+              +#+        +#+ +#+#+#+#+#+ \r\n");
rtx_dbug_outs(" #+#       #+#    #+# #+#       #+#    #+# #+#    #+#       #+#    \r\n");
rtx_dbug_outs("########## ########  ########## ########   ########        ###  \r\n");

rtx_dbug_outs("\r\n\r\n\r\n");

rtx_dbug_outs("RRRRRRRRRRRRRRRRR   TTTTTTTTTTTTTTTTTTTTTTT     OOOOOOOOO        SSSSSSSSSSSSSSS\r\n");
rtx_dbug_outs("R::::::::::::::::R  T:::::::::::::::::::::T   OO:::::::::OO    SS:::::::::::::::S\r\n");
rtx_dbug_outs("R::::::RRRRRR:::::R T:::::::::::::::::::::T OO:::::::::::::OO S:::::SSSSSS::::::S\r\n");
rtx_dbug_outs("RR:::::R     R:::::RT:::::TT:::::::TT:::::TO:::::::OOO:::::::OS:::::S     SSSSSSS\r\n");
rtx_dbug_outs("  R::::R     R:::::RTTTTTT  T:::::T  TTTTTTO::::::O   O::::::OS:::::S     \r\n");
rtx_dbug_outs("  R::::R     R:::::R        T:::::T        O:::::O     O:::::OS:::::S         \r\n");
rtx_dbug_outs("  R::::RRRRRR:::::R         T:::::T        O:::::O     O:::::O S::::SSSS     \r\n");
rtx_dbug_outs("  R:::::::::::::RR          T:::::T        O:::::O     O:::::O  SS::::::SSSSS    \r\n");
rtx_dbug_outs("  R::::RRRRRR:::::R         T:::::T        O:::::O     O:::::O    SSS::::::::SS  \r\n");
rtx_dbug_outs("  R::::R     R:::::R        T:::::T        O:::::O     O:::::O       SSSSSS::::S \r\n");
rtx_dbug_outs("  R::::R     R:::::R        T:::::T        O:::::O     O:::::O            S:::::S\r\n");
rtx_dbug_outs("  R::::R     R:::::R        T:::::T        O::::::O   O::::::O            S:::::S\r\n");
rtx_dbug_outs("RR:::::R     R:::::R      TT:::::::TT      O:::::::OOO:::::::OSSSSSSS     S:::::S\r\n");
rtx_dbug_outs("R::::::R     R:::::R      T:::::::::T       OO:::::::::::::OO S::::::SSSSSS:::::S\r\n");
rtx_dbug_outs("R::::::R     R:::::R      T:::::::::T         OO:::::::::OO   S:::::::::::::::SS \r\n");
rtx_dbug_outs("RRRRRRRR     RRRRRRR      TTTTTTTTTTT           OOOOOOOOO      SSSSSSSSSSSSSSS   \r\n");

rtx_dbug_outs("\r\n+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");
rtx_dbug_outs("+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");
rtx_dbug_outs("+#++++++  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");
rtx_dbug_outs("+#++++++  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");
rtx_dbug_outs("+#++++''''''''''''''''+++++++++++++++++@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++++++++++++++\r\n");
rtx_dbug_outs("+#++++''''''''''''''''+++++++++++++++++@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++++++++++++++\r\n");
rtx_dbug_outs("++'''''''''''''''''''''''''''''''''''@@................................@@++++++++++++\r\n");
rtx_dbug_outs("++'''''''''''''''''''''''''''''''''''@@................................@@++++++++++++\r\n");
rtx_dbug_outs("++'''''''''''''''''''''''''''''''''@@.`....````````````````````````....`.@@++++++++++\r\n");
rtx_dbug_outs("++'''''''''''''''''''''''''''''''''@@......````````````````````````......@@++++++++++\r\n");
rtx_dbug_outs("++''''::::::::::::::::'''''''''''''@@....```````````::````::`````````....@@++++++++++\r\n");
rtx_dbug_outs("+'''''::::::::::::::::'''''''''''''@@....```````````::````::`````````....@@++++++++++\r\n");
rtx_dbug_outs("+;;::::::::::::::::::::::::::::::::@@..````::``````````````````````````..@@++++++++++\r\n");
rtx_dbug_outs("+;;::::::::::::::::::::::::::::::::@@..````::``````````````````````````..@@++++++++++\r\n");
rtx_dbug_outs("+;;::::::::::::::::::::::::::::::::@@..```````````````````@@@@```::````..@@++@@@@++++\r\n");
rtx_dbug_outs("+;;::::::::::::::::::::::::::::::::@@..``````````````````.@@@@`.`,:````..@@++@@@@++++\r\n");
rtx_dbug_outs("+;;:::,,,,,,,,,,,,,,,,:::::::::::::@@..`````````````````@@::::@@```````..@@@@::::@@++\r\n");
rtx_dbug_outs("+:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@..```````````.`````@@::::::@.`````..@@:,::::@@++\r\n");
rtx_dbug_outs("+:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@..```````````::````@@::::::@``````..@@::::::@@++\r\n");
rtx_dbug_outs("+:,,,,,,,,,,,,,,,,,,,,,,@@@@@@@,,,,@@..```````````,,````@@:::::::@@@@@@@@::::::::@@++\r\n");
rtx_dbug_outs("+:,,,,,,,,,,,,,,,,,,,,,,@@@@@@@,,,,@@..`````````````````@@:::::::@@@@@@@@::::::::@@++\r\n");
rtx_dbug_outs("+:,,,,;;;;;;;;;;;;;;;;@@:::,:@@@@@@@@..``````:.`````````@@::::::::::::::,::::::::@@++\r\n");
rtx_dbug_outs("+:,,,,;;;;;;;;;;;;;;;;@@::,::@@@@@@@@..``````:``````````@@:::::::::::::::::::::::@@++\r\n");
rtx_dbug_outs("+';;;;';;;;;;;;;;;;;;;@@@:::,::::@@@@..`````````````::@@:::::::::::::::::::::::::::@+\r\n");
rtx_dbug_outs("+'';;;;;;;;;;;;;;;;;;;@@@::::::::@@@@..`````````````,:@@:::::::::::::::::::::::::::@+\r\n");
rtx_dbug_outs("+'';;;;;;;;;;;;;;;;;;;;;;@@@@@@@@,:@@..``::```````````@@::::::  @,::::,::::  @@::::@+\r\n");
rtx_dbug_outs("+'';;;;;;;;;;;;;;;;;;;;;;@@@@@@@@::@@..``::```````````@@::::::  @:::::,::::  @@::::@+\r\n");
rtx_dbug_outs("+'';;;::::::::::::::::;;;;;;;;;@@@@@@..```````````````@@:,::::@@@::::::@@::@@@@::::@+\r\n");
rtx_dbug_outs("+'';;;::::::::::::::::;;;;;;;;;@@@@@@..```````````````@@::::::@@@::::::@@,:@@@@:::,@+\r\n");
rtx_dbug_outs("+;;::::::::::::::::::::::::::::::::@@..`````````::````@@::....::::,:::,::::::::.,..@+\r\n");
rtx_dbug_outs("+;;::::::::::::::::::::::::::::::::@@..`````````::````@@::....:,:,,:::,::::::::....@+\r\n");
rtx_dbug_outs("+;;::::::::::::::::::::::::::::::::@@....``::`````````@@::....::@:,::@@::::@@::....@+\r\n");
rtx_dbug_outs("+;;::::::::::::::::::::::::::::::::@@....``::`````````@@::....::@::::@@::::@@::....@+\r\n");
rtx_dbug_outs("+;;::::::::::::::::::::::::::::::@@@@......`````````````@@,::::,@@@@@@@@@@@@@::::@@++\r\n");
rtx_dbug_outs("+;:::::::::::::::::::::::::::::;:@@@@......`````````````@@::::,:@@@@@@@@@@@@@,,::@@++\r\n");
rtx_dbug_outs("+;;::::::::::::::::::::::::::::@@@@@@@@...................@@::::::::::::::::::,@@++++\r\n");
rtx_dbug_outs("+;;::::::::::::::::::::::::::;:@@@@@@@@...................@@:,:::::::::::::::::@@++++\r\n");
rtx_dbug_outs("+;;::::::::::::::::::::::::::@@::::::@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++++++\r\n");
rtx_dbug_outs("+;;:::;::::::::::::::::::::::@@:::::,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#+++++++++++++\r\n");
rtx_dbug_outs("+;;:::++++++++++++++++:::::::@@::::@@  @@::,:@+   ++++++++@@,::,@@+@@::::@@++++++++++\r\n");
rtx_dbug_outs("+++++++++++++++++++++++++++++@@::::@@++@@::::@++++++++++++@@::::@@+@@::::@@++++++++++\r\n");
rtx_dbug_outs("+#+++++++++++++++++++++++++++@@@@@@++++++@@@@@++++++++++++++@@@@@@+++@@@@@@++++++++++\r\n");
rtx_dbug_outs("+#+++++++++++++++++++++++++++#+++++++++++++  ++++++++++++++++++++#+++#+++++++++++++++\r\n");
rtx_dbug_outs("+#+++++++++++++++++++++++++++++++++++++++++  ++++++++++++++++++++++++++++++++++++++++\r\n");
rtx_dbug_outs("+#+++++++++++++++++++++++++++++++++++++++++  ++++++++++++++++++++++++++++++++++++++++\r\n");
rtx_dbug_outs("+#+++++++++++++++++++++++++++++++++++++++++  ++++++++++++++++++++++++++++++++++++++++\r\n");

	rtx_dbug_outs("\r\nNyan Nyan!\r\n");
	rtx_dbug_outs("\r\nG01's FELOX (Forever Emo Loser's Operating System) is about to start!\r\n\r\n");
	SINT8 animate_count = 0;
	UINT32 delay = 50000;
	UINT8 move_count = 12;
	UINT32 tmp_animate_count;
	while(animate_count++<move_count)
	{
		tmp_animate_count = animate_count;
		while(tmp_animate_count-->0) rtx_dbug_outs(" ");
		rtx_dbug_outs("This project is making me FOREVER ALONE!\r");
		tmp_animate_count = 0;
		while (tmp_animate_count++<delay);
	}
	while(animate_count-->0)
	{
		tmp_animate_count = animate_count;
		UINT16 tmp_animate_count2 = move_count-tmp_animate_count;
		while(tmp_animate_count-->0) rtx_dbug_outs(" ");
		rtx_dbug_outs("This project is making me FOREVER ALONE!");
		while(tmp_animate_count2-->0) rtx_dbug_outs(" ");
		rtx_dbug_outs("\r");
		tmp_animate_count = 0;
		while (tmp_animate_count++<delay);
	}
	while (animate_count++<3)
	{
		rtx_dbug_outs("This project is making me FOREVER ALONE! (o.O)\r");
		tmp_animate_count = 0;
		while (tmp_animate_count++<delay);
		rtx_dbug_outs("This project is making me FOREVER ALONE! (O.o)\r");
		tmp_animate_count = 0;
		while (tmp_animate_count++<delay);
		rtx_dbug_outs("This project is making me FOREVER ALONE! (T_T)\r");
		tmp_animate_count = 0;
		while (tmp_animate_count++<delay);
	}
	rtx_dbug_outs("This project is making me FOREVER ALONE! (@_@)\r\n\r\n");
	tmp_animate_count = 0;
	while (tmp_animate_count++<delay);
	                                                                     
rtx_dbug_outs("                             :##@@@@@           \r\n");                         
rtx_dbug_outs("                          '@@@,@,   @@                 \r\n");                  
rtx_dbug_outs("                       #@@@;         @@#                      \r\n");           
rtx_dbug_outs("                   ,+@@@              `#+                            \r\n");    
rtx_dbug_outs("                 `#@@                  `@.                               \r\n");
rtx_dbug_outs("               .@@+            @        '@                               \r\n");
rtx_dbug_outs("             `#@                       ` @,                              \r\n");
rtx_dbug_outs("             #@       `````' `         `@@@                              \r\n");
rtx_dbug_outs("            @@      '      ` # .         `@                              \r\n");
rtx_dbug_outs("           @# `      '+#,.,@ :`   ..   `  '@`                            \r\n");
rtx_dbug_outs("          @#        `     +',              @@                            \r\n");
rtx_dbug_outs("         ,@   #        `         ,..@@@`.   @'                           \r\n");
rtx_dbug_outs("        ,@     @  #` '++    '     +@`'@.+    @                           \r\n");
rtx_dbug_outs("        ;#     @  `  ## +    '    +#+;@`     @@@,,    `                  \r\n");
rtx_dbug_outs("        @      ``   @#@##    :     '@;;+    .;`;#@@@@@`                  \r\n");
rtx_dbug_outs("       ;@           @   @    .,     @,,;            `@@@'                \r\n");
rtx_dbug_outs("       @'        #''@@,@@          ;....:,,,:``  `'    `#@               \r\n");
rtx_dbug_outs("       @        + `+#@::@`#  ;  ,@ `         ,,`  +@+    :@              \r\n");
rtx_dbug_outs("      ,@           `'@;;,  `@   .' ++++'     `  ,@@` ,    ;@             \r\n");
rtx_dbug_outs("      ,@           ;: '.:.  :,# #@           :+@@@'  `     :@            \r\n");
rtx_dbug_outs("      .@    .       `:,'+ `@;@#  `         # `@@@@          '@:          \r\n");
rtx_dbug_outs("      @#  '       ,   `@  #     #      ````+#@@+; :           @@         \r\n");
rtx_dbug_outs("      @.           '';, '         ;`  .: ''@, '@ `   `        `@:        \r\n");
rtx_dbug_outs("      @.             ' '         @  ,@ '.@## @#` '   #         +#        \r\n");
rtx_dbug_outs("      @.            `:   +   .      ++@@@.#.@@ ```   #          @+       \r\n");
rtx_dbug_outs("      @             .;@@@@@@@@@@@@@@#',@@@@@'  `  :`            .@       \r\n");
rtx_dbug_outs("      @             :,.@@@@@@@#@@@;@@@@#.;     ,                 @'`     \r\n");
rtx_dbug_outs("     '@;         '  `,.         @ @+: '   `   ;` +                @      \r\n");
rtx_dbug_outs("     ''          :   ; .               ``   '   ` @       `       ##     \r\n");
rtx_dbug_outs("     '+ @        ,  ``` .' `;`            ;,   '                   @.    \r\n");
rtx_dbug_outs("     '+`,#`       ``  :      ``+.  +    #  ,   .          .        '@    \r\n");
rtx_dbug_outs("     @'   @`          ``          :+++;       `        ` .          @    \r\n");
rtx_dbug_outs("     @   ,`  .        .  +                    `                     '+   \r\n");
rtx_dbug_outs("     @    `           ` `  + `                :         ,           ;#   \r\n");
rtx_dbug_outs("    .@                 `     +                :        .           `'+   \r\n");
rtx_dbug_outs("    `@                 `                               ``         ``'+   \r\n");
rtx_dbug_outs("    @;       ,         ,                              :             '+   \r\n");
rtx_dbug_outs("    @  .               ,                  `;          :             '+   \r\n");
rtx_dbug_outs("   :@`   :    `                                                     '+   \r\n");
rtx_dbug_outs("   '+   :             .                              ,              @'   \r\n");
rtx_dbug_outs("   @. .               ``                                            @    \r\n");
rtx_dbug_outs("   @  `   .                                         .              @, `  \r\n");
rtx_dbug_outs("   @`        `+         '                        ,  '              @     \r\n");
rtx_dbug_outs("   @    '      `                                                  +@     \r\n");
rtx_dbug_outs("   @#  .       '         `                        `               @      \r\n");
rtx_dbug_outs("    @,        `+          '       ` `                          ``#@      \r\n");
rtx_dbug_outs("     @+       ,+           .       ;;,                          ,@       \r\n");
rtx_dbug_outs("      @`                   `          `                         @@       \r\n");
rtx_dbug_outs("      .@.                   ;                                  .#        \r\n");
rtx_dbug_outs("       `@`                   :                                 @'        \r\n");
rtx_dbug_outs("        `@'            `                                      @@         \r\n");
rtx_dbug_outs("          @# `+``                                            ;@          \r\n");
rtx_dbug_outs("       `   @+  ; #                                           @.          \r\n");
rtx_dbug_outs("            @+  ' '                        +                @#           \r\n");
rtx_dbug_outs("            .@`  # `'                      +               #@            \r\n");
rtx_dbug_outs("             `@.     +                     '              .@             \r\n");
rtx_dbug_outs("              `@`   '                      +              @;             \r\n");
rtx_dbug_outs("               .@`   ;                                  `.@              \r\n");
rtx_dbug_outs("                `@`    +                  +              @,              \r\n");
rtx_dbug_outs("                 '@@+++'                            :`  @@               \r\n");
rtx_dbug_outs("                   @@    `,              :         '  '@@                \r\n");
rtx_dbug_outs("                    :##       ,.           `    ++' `@@                  \r\n");
rtx_dbug_outs("                      +@@@`      ;,,,,:         `  ,@#                   \r\n");
rtx_dbug_outs("                        .@@@#              ` ++#@@@@;                    \r\n");
rtx_dbug_outs("                           '@@@@@@@@@@@@@@@@@';;:                        \r\n\r\n");
                           


#endif	
	
	prepare_serial();
	prepare_timer();
	
	asm("rte");

}