Changeset 47a350f in mainline for uspace/app/init/init.c
- Timestamp:
- 2009-12-16T01:49:16Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- df747bd8
- Parents:
- 4491338
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
r4491338 r47a350f 50 50 #include "init.h" 51 51 52 #define DEVFS_MOUNT_POINT "/dev" 53 54 #define SRV_CONSOLE "/srv/console" 55 #define APP_GETVC "/app/getvc" 56 52 57 static void info_print(void) 53 58 { … … 98 103 99 104 snprintf(null, MAX_DEVICE_NAME, "null/%d", null_id); 100 int rc = mount("devfs", "/dev", null, "", IPC_FLAG_BLOCKING);105 int rc = mount("devfs", DEVFS_MOUNT_POINT, null, "", IPC_FLAG_BLOCKING); 101 106 102 107 switch (rc) { … … 176 181 } 177 182 183 static void console(char *dev) 184 { 185 char *argv[3]; 186 char hid_in[MAX_DEVICE_NAME]; 187 int rc; 188 189 snprintf(hid_in, MAX_DEVICE_NAME, "%s/%s", DEVFS_MOUNT_POINT, dev); 190 191 printf(NAME ": Spawning %s with %s\n", SRV_CONSOLE, hid_in); 192 193 /* Wait for the input device to be ready */ 194 dev_handle_t handle; 195 rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING); 196 197 if (rc == EOK) { 198 argv[0] = SRV_CONSOLE; 199 argv[1] = hid_in; 200 argv[2] = NULL; 201 202 if (!task_spawn(SRV_CONSOLE, argv)) 203 printf(NAME ": Error spawning %s with %s\n", SRV_CONSOLE, hid_in); 204 } else 205 printf(NAME ": Error waiting on %s\n", hid_in); 206 } 207 178 208 static void getvc(char *dev, char *app) 179 209 { … … 182 212 int rc; 183 213 184 snprintf(vc, MAX_DEVICE_NAME, "/dev/%s", dev); 185 186 printf(NAME ": Spawning getvc on %s\n", vc); 187 214 snprintf(vc, MAX_DEVICE_NAME, "%s/%s", DEVFS_MOUNT_POINT, dev); 215 216 printf(NAME ": Spawning %s on %s\n", APP_GETVC, vc); 217 218 /* Wait for the terminal device to be ready */ 188 219 dev_handle_t handle; 189 220 rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING); 190 221 191 222 if (rc == EOK) { 192 argv[0] = "/app/getvc";223 argv[0] = APP_GETVC; 193 224 argv[1] = vc; 194 225 argv[2] = app; 195 226 argv[3] = NULL; 196 227 197 if (!task_spawn( "/app/getvc", argv))198 printf(NAME ": Error spawning getvc on %s\n", vc);199 } else {228 if (!task_spawn(APP_GETVC, argv)) 229 printf(NAME ": Error spawning %s on %s\n", APP_GETVC, vc); 230 } else 200 231 printf(NAME ": Error waiting on %s\n", vc); 201 }202 232 } 203 233 … … 234 264 spawn("/srv/fb"); 235 265 spawn("/srv/kbd"); 236 spawn("/srv/console"); 266 console("hid_in/kbd"); 267 237 268 spawn("/srv/clip"); 238 269 spawn("/srv/fhc");
Note:
See TracChangeset
for help on using the changeset viewer.