Ejemplo n.º 1
0
/*
 * Kernel C code entry point.
 * Initializes kernel subsystems, mounts filesystems,
 * and spawns init process.
 */
void Main(struct Boot_Info* bootInfo)
{
    Init_BSS();
    Init_Screen();
    Init_Mem(bootInfo);
    Init_CRC32();
    Init_TSS();
    Init_Interrupts();
    Init_Scheduler();
    Init_Traps();
    Init_Timer();
    Init_Keyboard();
    Init_DMA();
    Init_Floppy();
    Init_IDE();
    Init_PFAT();

    Mount_Root_Filesystem();

    Set_Current_Attr(ATTRIB(BLACK, GREEN|BRIGHT));
    Print("Welcome to GeekOS!\n");
    Set_Current_Attr(ATTRIB(BLACK, GRAY));




    Spawn_Init_Process();

    /* Now this thread is done. */
    Exit(0);
}
Ejemplo n.º 2
0
void main(void)
{
	Init_Ports();                             // Initialize Ports
	Init_Clocks();                            // Initialize Clock System 
	Init_Conditions();
	Init_Interrupts();
	  
	TimeMsec = RESET_TIME;
	Init_Timers(); 				// Initialize Timers
	Init_LCD();				// Initialize LCD    
        
        
	//          "0123456789abcdef"
	display_1 = "   Homework 9   ";
	display_2 = "                ";
	Display_Process();
	
/* ---------- Begining of the "While" Operating System ------------- */
	while(ALWAYS) 										// Can the Operating system run
	{                            
                ADC_Process();
                Control_Process();
                Menu_Process();
                
          
                if(TimeMsec % EVERY_50 == RESET_TIME)
                {
                        Display_Process();
                }	
	}
}
Ejemplo n.º 3
0
/*
 * Kernel C code entry point.
 * Initializes kernel subsystems, mounts filesystems,
 * and spawns init process.
 */
void Main(struct Boot_Info* bootInfo)
{
    Init_BSS();
    Init_Screen();
    Init_Mem(bootInfo);
    Init_CRC32();
    Init_TSS();
    Init_Interrupts();
    Init_Scheduler();
    Init_Traps();
    Init_Timer();
    Init_Keyboard();


    Set_Current_Attr(ATTRIB(BLACK, GREEN|BRIGHT));
    Print("Welcome to GeekOS!\n");
    Set_Current_Attr(ATTRIB(BLACK, GRAY));
	


/*    TODO("Start a kernel thread to echo pressed keys and print counts");*/
	Start_Kernel_Thread(&funct_eigen, 0, PRIORITY_NORMAL, false);


    /* Now this thread is done. */
    Exit(0);
}
Ejemplo n.º 4
0
void Main(struct Boot_Info *bootInfo) {
    Init_BSS();
    Init_Screen();
    Init_Mem(bootInfo);
    Init_CRC32();
    Init_TSS();

    lockKernel();
    Init_Interrupts(0);
    Init_SMP();
    TODO_P(PROJECT_VIRTUAL_MEMORY_A,
           "initialize virtual memory page tables.");
    Init_Scheduler(0, (void *)KERN_STACK);
    Init_Traps();
    Init_Local_APIC(0);
    Init_Timer();

    Init_Keyboard();
    Init_DMA();
    /* Init_Floppy(); *//* floppy initialization hangs on virtualbox */
    Init_IDE();
    Init_PFAT();
    Init_GFS2();
    Init_GOSFS();
    Init_CFS();
    Init_Alarm();

    Release_SMP();

    /* Initialize Networking */
    Init_Network_Devices();
    Init_ARP_Protocol();
    Init_IP();
    Init_Routing();
    Init_Sockets();
    Init_RIP();
    /* End networking subsystem init */

    /* Initialize Sound */
    Init_Sound_Devices();
    /* End sound init */

    Mount_Root_Filesystem();

    TODO_P(PROJECT_VIRTUAL_MEMORY_A, "initialize page file.");

    Set_Current_Attr(ATTRIB(BLACK, GREEN | BRIGHT));
    Print("Welcome to GeekOS!\n");
    Set_Current_Attr(ATTRIB(BLACK, GRAY));

    TODO_P(PROJECT_SOUND, "play startup sound");

    Spawn_Init_Process();

    /* it's time to shutdown the system */
    Hardware_Shutdown();

    /* we should not get here */
}
Ejemplo n.º 5
0
//--------------------------------------------------------------------------//
// Function:	main														//
//--------------------------------------------------------------------------//
void main(void)
{
	Init_Flags();
	Init_Timers();
	Init_Interrupts();

	while(1);
}
Ejemplo n.º 6
0
//--------------------------------------------------------------------------//
// Function:	main														//
//--------------------------------------------------------------------------//
int main(void)
{
	Init_Flags();
	Init_Timers();
	Init_Interrupts();

	while(1);
	return 0;
}
Ejemplo n.º 7
0
//--------------------------------------------------------------------------//
// Function:	main														//
//																			//
// Description:	After calling a few initalization routines, main() just 	//
//				waits in a loop forever.  The code to process the incoming  //
//				data can be placed in the function Process_Data() in the 	//
//				file "Process_Data.c".										//
//--------------------------------------------------------------------------//
void main(void)
{
	Init_Flags();
	Audio_Reset();
	Init_Sport0();
	Init_DMA();
	Init_Interrupts();
	Enable_DMA_Sport0();

	while(1);
}
Ejemplo n.º 8
0
int Init (void) 
{	
	Init_Oscillator();
	Init_I2C();
	Init_Interrupts();
	Init_USART();
	
	TRISB = 0x00;
	//LATB = 0x01; // Turn on a little status LED;
	return 1;
}
Ejemplo n.º 9
0
//--------------------------------------------------------------------------//
// Function:	main														//
//--------------------------------------------------------------------------//
void main(void)
{
	int c;
	
  //inicjalizacje
	Init_Interrupts();
	LED_Init();
  UART_initialize(115200);
	
  //jakiœ tam komunikat powitalny
	UART_putc('H');
	UART_putc('e');
	UART_putc('l');
	UART_putc('l');
	UART_putc('o');
	
	for (;;)
	{
    //odbieramy znak i odbijamy go na terminal
		c = UART_getc();
		UART_putc(c);
		
    //w zale¿noœci od tego co przysz³o, prze³¹czamy stan jednej z diod
    switch (c)
		{
			case '1':
				*pPORTFIO_TOGGLE = 0x0040;
				break;
			case '2':
				*pPORTFIO_TOGGLE = 0x0080;
				break;
			case '3':
				*pPORTFIO_TOGGLE = 0x0100;
				break;
			case '4':
				*pPORTFIO_TOGGLE = 0x0200;
				break;
			case '5':
				*pPORTFIO_TOGGLE = 0x0400;
				break;
			case '6':
				*pPORTFIO_TOGGLE = 0x0800;
				break;
		}
	}
}
Ejemplo n.º 10
0
/*
 * Kernel C code entry point.
 * Initializes kernel subsystems, mounts filesystems,
 * and spawns init process.
 */
void Main(struct Boot_Info *bootInfo) {



    Init_BSS();
    Init_Screen();
    Init_Mem(bootInfo);
    Init_CRC32();
    Init_TSS();
    Init_Interrupts();
    Init_Scheduler();
    Init_Traps();
    Init_Timer();
    Init_Keyboard();
    Init_DMA();
    Init_Floppy();
    Init_IDE();
    Init_PFAT();
    Init_GFS2();
    Init_GOSFS();
    Init_Alarm();

    /* Initialize Networking */
    Init_Network_Devices();
    Init_ARP_Protocol();
    Init_IP();
    Init_Routing();
    Init_Sockets();
    Init_RIP();
    /* End networking subsystem init */

    Mount_Root_Filesystem();

    Set_Current_Attr(ATTRIB(BLACK, GREEN | BRIGHT));
    Print("Welcome to GeekOS!\n");
    Set_Current_Attr(ATTRIB(BLACK, GRAY));

    Spawn_Init_Process();

    /* Now this thread is done. */
    Exit(0);
}
Ejemplo n.º 11
0
/*
 * Kernel C code entry point.
 * Initializes kernel subsystems, mounts filesystems,
 * and spawns init process.
 */
void Main(struct Boot_Info* bootInfo)
{
    Init_BSS();
    Init_Screen();
    Init_Mem(bootInfo);
    Init_CRC32();
    Init_TSS();
    Init_Interrupts();
    Init_Scheduler();
    Init_Traps();
    Init_Timer();
    Init_Keyboard();

    Set_Current_Attr(ATTRIB(BLACK, GREEN|BRIGHT));
    Print("Welcome to GeekOS!\n");
    Set_Current_Attr(ATTRIB(BLACK, GRAY));
    Start_Kernel_Thread(Print_Key_Pressed, 0, PRIORITY_NORMAL, false);

    /* Now this thread is done. */
    Exit(0);
}
Ejemplo n.º 12
0
void main(void)
{
	Init_Ports();                             // Initialize Ports
	Init_Clocks();                            // Initialize Clock System 
	Init_Conditions();
	Init_Interrupts();
       
	//PJOUT |= LED1;                          // Turn LED 1 on to indicate boot
	  
	TimeMsec = RESET_TIME;
	Init_Timers(); 				// Initialize Timers
	Init_LCD();				// Initialize LCD
	//Init_LEDs();                            // Initialize LEDs       
        
        
        
	//          "0123456789abcdef"
	display_1 = "   PROJECT  5   ";
	display_2 = "                ";
	Display_Process();
	
	P1OUT |= IR_LED;
	waitMsec(10);
	
/* ---------- Begining of the "While" Operating System ------------- */
	while(ALWAYS) 										// Can the Operating system run
	{                            
		if(TimeMsec % EVERY_50 == RESET_TIME)
			Display_Process();					//Refreshes screen every 50 'ticks'
                
		if(TimeMsec % EVERY_2 == RESET_TIME)
		{
			Switches_Process();                 // Poll for switch state change every other 'tick'
			ADC_Process();
		}
		
		Motors_Process();
		Control_Process();
	}
}
Ejemplo n.º 13
0
void Main(struct Boot_Info *bootInfo) {
    Init_BSS();
    Init_Screen();
    Init_Mem(bootInfo);
    Init_CRC32();
    TODO_P(PROJECT_PERCPU, "Initialize PERCPU");
    Init_TSS();

    /* by modifying begin_int_atomic to autolock if not locked when interrupts are disabled, 
       this lockKernel() became duplicative */
    /* lockKernel(); */
    Init_Interrupts(0);
    Print("Init_SMP\n");
    Init_SMP();
    Print("/Init_SMP\n");
    TODO_P(PROJECT_VIRTUAL_MEMORY_A,
           "initialize virtual memory page tables.");
    Init_Scheduler(0, (void *)KERN_STACK);
    Init_Traps();
    Init_Local_APIC(0);
    Init_Timer();

    Init_Keyboard();
    Init_DMA();
    /* Init_Floppy(); *//* floppy initialization hangs on virtualbox */
    Init_IDE();
    Init_PFAT();
    if(Init_GFS2)
        Init_GFS2();
    if(Init_GFS3)
        Init_GFS3();
    Init_GOSFS();
    Init_CFS();
    Init_Alarm();
    Init_Serial();

    Print("the global lock is %sheld.\n",
          Kernel_Is_Locked()? "" : "not ");

    Release_SMP();

    /* Initialize Networking */
    /* 
       Init_Network_Devices();
       Init_ARP_Protocol();
       Init_IP();
       Init_Routing();
       Init_Sockets();
       Init_RIP();
     */
    /* End networking subsystem init */

    /* Initialize Sound */
    Init_Sound_Devices();
    /* End sound init */

    Mount_Root_Filesystem();

    TODO_P(PROJECT_VIRTUAL_MEMORY_A, "initialize page file.");

    Set_Current_Attr(ATTRIB(BLACK, GREEN | BRIGHT));
    Print("Welcome to GeekOS!\n");
    Set_Current_Attr(ATTRIB(BLACK, GRAY));

    TODO_P(PROJECT_SOUND, "play startup sound");

    TODO_P(PROJECT_SERIAL,
           "Initialize the serial console and start the shell.");

    Spawn_Init_Process();

    /* it's time to shutdown the system because Init exited. */
    Hardware_Shutdown();

    /* we should not get here */
}