Show
Ignore:
Timestamp:
05/02/08 11:36:05 (7 months ago)
Author:
mwhitworth
Message:

Rework startup function to call startup program.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/hybrid/kernel/main.c

    r194 r393  
    8888static void Start(void* args) 
    8989{ 
    90         char buf[100]; 
    9190        int i; 
    9291        struct StorageDevice* rootDev=NULL; 
     
    130129        printf("Mounted the filesystems. Starting the shell\n"); 
    131130 
    132         for (i=0; i<MAX_CONSOLES; i++) 
     131        if (DoOpenFile(&current->files[0], DEVICES_PATH "/Consoles/Console0",FILE_READ | FILE_FORCE_OPEN,0)) 
    133132        { 
    134                 sprintf(buf,"%s/Consoles/Console%d",DEVICES_PATH,i); 
    135                 if (DoOpenFile(&current->files[0],buf,FILE_READ | FILE_FORCE_OPEN,0)) 
    136                 { 
    137                         printf("Failed to open %s. Halting\n",buf); 
    138                         cli(); hlt(); 
    139                 } 
     133                printf("Failed to open the first console. Halting\n"); 
     134                cli(); hlt(); 
     135        } 
    140136 
    141                 strcat(buf,"\n\n"); 
    142                 DoWriteFile(&current->files[0],(BYTE*)(buf+strlen(DEVICES_PATH)),strlen(buf)-strlen(DEVICES_PATH)); 
    143                 extern int Exec(char* pathName,int* fds,char** argv); 
    144                 if (Exec("/Applications/burn",fds,NULL) < 0) 
    145                 { 
    146                         printf("Could not open the shell. Halting\n"); 
    147                         cli(); hlt(); 
    148                 } 
     137        extern int Exec(char* pathName,int* fds,char** argv); 
     138        if (Exec("/System/Startup/startup", fds, NULL) < 0) 
     139        { 
     140                printf("Could not launch the startup program. Halting\n"); 
     141                cli(); hlt(); 
    149142        } 
    150143