Rev 4417 | Rev 4549 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4417 | Rev 4485 | ||
---|---|---|---|
Line 42... | Line 42... | ||
42 | #include <errno.h> |
42 | #include <errno.h> |
43 | #include <fcntl.h> |
43 | #include <fcntl.h> |
44 | #include <task.h> |
44 | #include <task.h> |
45 | #include <malloc.h> |
45 | #include <malloc.h> |
46 | #include <macros.h> |
46 | #include <macros.h> |
47 | #include <console.h> |
- | |
48 | #include <string.h> |
47 | #include <string.h> |
- | 48 | #include <devmap.h> |
|
49 | #include "init.h" |
49 | #include "init.h" |
50 | #include "version.h" |
- | |
51 | 50 | ||
- | 51 | static void info_print(void) |
|
- | 52 | { |
|
- | 53 | printf(NAME ": HelenOS init\n"); |
|
- | 54 | } |
|
- | 55 | ||
52 | static bool mount_fs(const char *fstype) |
56 | static bool mount_root(const char *fstype) |
53 | { |
57 | { |
54 | int rc = -1; |
58 | int rc = -1; |
55 | char *opts = ""; |
59 | char *opts = ""; |
56 | 60 | ||
57 | if (str_cmp(fstype, "tmpfs") == 0) |
61 | if (str_cmp(fstype, "tmpfs") == 0) |
Line 116... | Line 120... | ||
116 | 120 | ||
117 | if (!task_spawn(fname, argv)) |
121 | if (!task_spawn(fname, argv)) |
118 | printf(NAME ": Error spawning %s\n", fname); |
122 | printf(NAME ": Error spawning %s\n", fname); |
119 | } |
123 | } |
120 | 124 | ||
- | 125 | static void getvc(char *dev, char *app) |
|
- | 126 | { |
|
- | 127 | char *argv[4]; |
|
- | 128 | char vc[MAX_DEVICE_NAME]; |
|
- | 129 | ||
- | 130 | snprintf(vc, MAX_DEVICE_NAME, "/dev/%s", dev); |
|
- | 131 | ||
- | 132 | printf(NAME ": Spawning getvc on %s\n", vc); |
|
- | 133 | ||
- | 134 | dev_handle_t handle; |
|
- | 135 | devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING); |
|
- | 136 | ||
- | 137 | if (handle >= 0) { |
|
- | 138 | argv[0] = "/app/getvc"; |
|
- | 139 | argv[1] = vc; |
|
- | 140 | argv[2] = app; |
|
- | 141 | argv[3] = NULL; |
|
- | 142 | ||
- | 143 | if (!task_spawn("/app/getvc", argv)) |
|
- | 144 | printf(NAME ": Error spawning getvc on %s\n", vc); |
|
- | 145 | } else |
|
- | 146 | printf(NAME ": Error waiting on %s\n", vc); |
|
- | 147 | } |
|
- | 148 | ||
121 | int main(int argc, char *argv[]) |
149 | int main(int argc, char *argv[]) |
122 | { |
150 | { |
123 | info_print(); |
151 | info_print(); |
124 | 152 | ||
125 | if (!mount_fs(STRING(RDFMT))) { |
153 | if (!mount_root(STRING(RDFMT))) { |
126 | printf(NAME ": Exiting\n"); |
154 | printf(NAME ": Exiting\n"); |
127 | return -1; |
155 | return -1; |
128 | } |
156 | } |
129 | 157 | ||
130 | spawn("/srv/devfs"); |
158 | spawn("/srv/devfs"); |
Line 138... | Line 166... | ||
138 | spawn("/srv/kbd"); |
166 | spawn("/srv/kbd"); |
139 | spawn("/srv/console"); |
167 | spawn("/srv/console"); |
140 | spawn("/srv/fhc"); |
168 | spawn("/srv/fhc"); |
141 | spawn("/srv/obio"); |
169 | spawn("/srv/obio"); |
142 | 170 | ||
143 | console_wait(); |
171 | getvc("vc0", "/app/bdsh"); |
144 | version_print(); |
172 | getvc("vc1", "/app/bdsh"); |
145 | - | ||
- | 173 | getvc("vc2", "/app/bdsh"); |
|
- | 174 | getvc("vc3", "/app/bdsh"); |
|
146 | spawn("/app/klog"); |
175 | getvc("vc4", "/app/bdsh"); |
147 | spawn("/app/bdsh"); |
176 | getvc("vc5", "/app/bdsh"); |
- | 177 | getvc("vc6", "/app/klog"); |
|
148 | 178 | ||
149 | return 0; |
179 | return 0; |
150 | } |
180 | } |
151 | 181 | ||
152 | /** @} |
182 | /** @} |