Changes in uspace/app/init/init.c [75fe97b:ca05e9b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
r75fe97b rca05e9b 59 59 #define TMPFS_FS_TYPE "tmpfs" 60 60 #define TMPFS_MOUNT_POINT "/tmp" 61 62 #define DATA_FS_TYPE "fat" 63 #define DATA_DEVICE "bd/ata1disk0" 64 #define DATA_MOUNT_POINT "/data" 61 65 62 66 #define SRV_CONSOLE "/srv/console" … … 172 176 va_start(ap, path); 173 177 task_id_t id; 174 task_wait_t wait; 175 int rc = task_spawn(&id, &wait, path, cnt, ap); 178 int rc = task_spawn(&id, path, cnt, ap); 176 179 va_end(ap); 177 180 … … 190 193 task_exit_t texit; 191 194 int retval; 192 rc = task_wait( &wait, &texit, &retval);195 rc = task_wait(id, &texit, &retval); 193 196 if (rc != EOK) { 194 197 printf("%s: Error waiting for %s (%s)\n", NAME, path, … … 254 257 255 258 task_id_t id; 256 task_wait_t wait; 257 int rc = task_spawnl(&id, &wait, app, app, winreg, NULL); 259 int rc = task_spawnl(&id, app, app, winreg, NULL); 258 260 if (rc != EOK) { 259 261 printf("%s: Error spawning %s %s (%s)\n", NAME, app, … … 264 266 task_exit_t texit; 265 267 int retval; 266 rc = task_wait( &wait, &texit, &retval);268 rc = task_wait(id, &texit, &retval); 267 269 if ((rc != EOK) || (texit != TASK_EXIT_NORMAL)) { 268 270 printf("%s: Error retrieving retval from %s (%s)\n", NAME, … … 274 276 } 275 277 276 static void getterm(const char *svc, const char *app, bool msg) 277 { 278 if (msg) { 279 printf("%s: Spawning %s %s %s --msg --wait -- %s\n", NAME, 280 APP_GETTERM, svc, LOCFS_MOUNT_POINT, app); 281 282 int rc = task_spawnl(NULL, NULL, APP_GETTERM, APP_GETTERM, svc, 283 LOCFS_MOUNT_POINT, "--msg", "--wait", "--", app, NULL); 284 if (rc != EOK) 285 printf("%s: Error spawning %s %s %s --msg --wait -- %s\n", 286 NAME, APP_GETTERM, svc, LOCFS_MOUNT_POINT, app); 278 static void getterm(const char *svc, const char *app, bool wmsg) 279 { 280 char term[LOC_NAME_MAXLEN]; 281 snprintf(term, LOC_NAME_MAXLEN, "%s/%s", LOCFS_MOUNT_POINT, svc); 282 283 printf("%s: Spawning %s %s %s\n", NAME, APP_GETTERM, term, app); 284 285 /* Wait for the terminal service to be ready */ 286 service_id_t service_id; 287 int rc = loc_service_get_id(svc, &service_id, IPC_FLAG_BLOCKING); 288 if (rc != EOK) { 289 printf("%s: Error waiting on %s (%s)\n", NAME, term, 290 str_error(rc)); 291 return; 292 } 293 294 if (wmsg) { 295 rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, "-w", term, 296 app, NULL); 297 if (rc != EOK) { 298 printf("%s: Error spawning %s -w %s %s (%s)\n", NAME, 299 APP_GETTERM, term, app, str_error(rc)); 300 } 287 301 } else { 288 printf("%s: Spawning %s %s %s --wait -- %s\n", NAME, 289 APP_GETTERM, svc, LOCFS_MOUNT_POINT, app); 290 291 int rc = task_spawnl(NULL, NULL, APP_GETTERM, APP_GETTERM, svc, 292 LOCFS_MOUNT_POINT, "--wait", "--", app, NULL); 293 if (rc != EOK) 294 printf("%s: Error spawning %s %s %s --wait -- %s\n", 295 NAME, APP_GETTERM, svc, LOCFS_MOUNT_POINT, app); 302 rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, term, app, 303 NULL); 304 if (rc != EOK) { 305 printf("%s: Error spawning %s %s %s (%s)\n", NAME, 306 APP_GETTERM, term, app, str_error(rc)); 307 } 296 308 } 297 309 } … … 304 316 } 305 317 318 static bool mount_data(void) 319 { 320 int rc = mount(DATA_FS_TYPE, DATA_MOUNT_POINT, DATA_DEVICE, "wtcache", 0, 0); 321 return mount_report("Data filesystem", DATA_MOUNT_POINT, DATA_FS_TYPE, 322 DATA_DEVICE, rc); 323 } 324 306 325 int main(int argc, char *argv[]) 307 326 { … … 331 350 srv_start("/srv/apic"); 332 351 srv_start("/srv/i8259"); 333 srv_start("/srv/icp-ic");334 352 srv_start("/srv/obio"); 335 353 srv_start("/srv/cuda_adb"); … … 349 367 srv_start("/srv/remcons"); 350 368 369 /* 370 * Start these synchronously so that mount_data() can be 371 * non-blocking. 372 */ 373 #ifdef CONFIG_START_BD 374 srv_start("/srv/ata_bd"); 375 #endif 376 377 #ifdef CONFIG_MOUNT_DATA 378 /* Make sure fat is running. */ 379 if (str_cmp(STRING(RDFMT), "fat") != 0) 380 srv_start("/srv/fat"); 381 382 mount_data(); 383 #else 384 (void) mount_data; 385 #endif 386 351 387 srv_start("/srv/input", HID_INPUT); 352 388 srv_start("/srv/output", HID_OUTPUT); … … 357 393 gui_start("/app/vlaunch", HID_COMPOSITOR_SERVER); 358 394 gui_start("/app/vterm", HID_COMPOSITOR_SERVER); 359 } 360 361 rc = console(HID_INPUT, HID_OUTPUT); 362 if (rc == EOK) { 363 getterm("term/vc0", "/app/bdsh", true); 364 getterm("term/vc1", "/app/bdsh", false); 365 getterm("term/vc2", "/app/bdsh", false); 366 getterm("term/vc3", "/app/bdsh", false); 367 getterm("term/vc4", "/app/bdsh", false); 368 getterm("term/vc5", "/app/bdsh", false); 395 } else { 396 rc = console(HID_INPUT, HID_OUTPUT); 397 if (rc == EOK) { 398 getterm("term/vc0", "/app/bdsh", true); 399 getterm("term/vc1", "/app/bdsh", false); 400 getterm("term/vc2", "/app/bdsh", false); 401 getterm("term/vc3", "/app/bdsh", false); 402 getterm("term/vc4", "/app/bdsh", false); 403 getterm("term/vc5", "/app/bdsh", false); 404 getterm("term/vc6", "/app/klog", false); 405 } 369 406 } 370 407
Note:
See TracChangeset
for help on using the changeset viewer.