Changeset c98e6ee in mainline for uspace/app/init/init.c
- Timestamp:
- 2008-07-08T16:05:45Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f93f168
- Parents:
- b7f9087
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
rb7f9087 rc98e6ee 46 46 #include "version.h" 47 47 48 #define BUF_SIZE 15000049 50 static char *buf;51 52 48 static void console_wait(void) 53 49 { … … 83 79 static void spawn(char *fname) 84 80 { 81 char *argv[2]; 82 85 83 printf(NAME ": Spawning %s\n", fname); 86 87 int fd = open(fname, O_RDONLY); 88 if (fd >= 0) { 89 90 ssize_t rd; 91 size_t len = 0; 92 93 // FIXME: cannot do long reads yet 94 do { 95 rd = read(fd, buf + len, 1024); 96 if (rd > 0) 97 len += rd; 98 99 } while (rd > 0); 100 101 if (len > 0) { 102 task_spawn(buf, len); 103 sleep(1); // FIXME 104 } 105 106 close(fd); 84 85 argv[0] = fname; 86 argv[1] = NULL; 87 88 if (task_spawn(fname, argv) != 0) { 89 /* Success */ 90 sleep(1); 107 91 } 108 92 } … … 118 102 } 119 103 120 buf = malloc(BUF_SIZE);121 122 104 // FIXME: spawn("/sbin/pci"); 123 105 spawn("/sbin/fb"); … … 130 112 spawn("/sbin/fat"); 131 113 spawn("/sbin/tetris"); 114 spawn("/sbin/cli"); 132 115 // FIXME: spawn("/sbin/tester"); 133 116 spawn("/sbin/klog"); 134 117 135 free(buf);136 118 return 0; 137 119 }
Note:
See TracChangeset
for help on using the changeset viewer.