Changeset 550 for Whitix/branches/hybrid/user
- Timestamp:
- 05/24/08 09:59:22 (6 months ago)
- Files:
-
- 1 modified
-
Whitix/branches/hybrid/user/system/startup.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/hybrid/user/system/startup.c
r459 r550 1 1 #include <stdio.h> 2 3 /* TODO: Make more configurable. Create a thread for each directory. */ 2 4 3 5 #define PATH_MAX 2048 … … 6 8 { 7 9 char* args[]={name, NULL}; 8 int fds[]={0, 1, 2};9 10 10 return SysCreateProcess("moduleadd", fds, args);11 return SysCreateProcess("moduleadd", NULL, args); 11 12 } 12 13 14 /* TODO: Finish. */ 13 15 int ModuleLoadDirectory(char* dirName) 14 16 { … … 27 29 } 28 30 31 int networkFinished=0; 32 33 void NetworkInit(void* args) 34 { 35 int pid; 36 37 pid=ModuleLoad("Core/net"); 38 39 SysWaitForProcessFinish(pid, NULL); 40 41 ModuleLoad("Core/local"); 42 ModuleLoad("Core/inet"); 43 44 pid=ModuleLoad("Core/pci"); 45 46 SysWaitForProcessFinish(pid, NULL); 47 48 ModuleLoad("Network/ne2k_pci"); 49 50 networkFinished=1; 51 } 52 53 int storageFinished=0; 54 55 void StorageInit(void* args) 56 { 57 ModuleLoad("Storage/ramdisk"); 58 ModuleLoad("Storage/floppy"); 59 60 storageFinished=1; 61 } 62 63 int inputFinished=0; 64 65 void InputInit() 66 { 67 int pid; 68 69 pid=ModuleLoad("Input/Ps2"); 70 71 SysWaitForProcessFinish(pid, NULL); 72 73 ModuleLoad("Input/keyboard"); 74 ModuleLoad("Input/Ps2Mouse"); 75 76 inputFinished=1; 77 } 78 29 79 int main(int argc, char* argv[]) 30 80 { 81 int pid; 82 31 83 /* Load modules */ 32 84 SysChangeDir("/System/Modules/"); 33 // ModuleLoad("Core/pci"); 34 ModuleLoad("Input/Ps2"); 35 ModuleLoad("Input/keyboard"); 36 // ModuleLoad("Network/ne2k-pci"); 85 86 SysCreateThread(NetworkInit, 0, NULL); 87 SysCreateThread(InputInit, 0 , NULL); 88 SysCreateThread(StorageInit, 0, NULL); 89 90 while (!inputFinished || !networkFinished || !storageFinished) 91 SysYield(); 37 92 38 93 SysChangeDir("/"); 39 94 40 int fds[]={0, 1, 2}; 41 char* args[]={""}; 95 char* args[]={NULL}; 42 96 43 SysCreateProcess("/Applications/Burn", fds, args); 97 pid=SysCreateProcess("/Applications/Burn", NULL, args); 98 99 SysWaitForProcessFinish(pid, NULL); 100 44 101 return 0; 45 102 }