Changeset 8e7c9fe in mainline for uspace/app/init/init.c
- Timestamp:
- 2014-09-12T03:45:25Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c53b58e
- Parents:
- 3eb0c85 (diff), 105d8d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
r3eb0c85 r8e7c9fe 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"65 61 66 62 #define SRV_CONSOLE "/srv/console" … … 176 172 va_start(ap, path); 177 173 task_id_t id; 178 int rc = task_spawn(&id, path, cnt, ap); 174 task_wait_t wait; 175 int rc = task_spawn(&id, &wait, path, cnt, ap); 179 176 va_end(ap); 180 177 … … 193 190 task_exit_t texit; 194 191 int retval; 195 rc = task_wait( id, &texit, &retval);192 rc = task_wait(&wait, &texit, &retval); 196 193 if (rc != EOK) { 197 194 printf("%s: Error waiting for %s (%s)\n", NAME, path, … … 257 254 258 255 task_id_t id; 259 int rc = task_spawnl(&id, app, app, winreg, NULL); 256 task_wait_t wait; 257 int rc = task_spawnl(&id, &wait, app, app, winreg, NULL); 260 258 if (rc != EOK) { 261 259 printf("%s: Error spawning %s %s (%s)\n", NAME, app, … … 266 264 task_exit_t texit; 267 265 int retval; 268 rc = task_wait( id, &texit, &retval);266 rc = task_wait(&wait, &texit, &retval); 269 267 if ((rc != EOK) || (texit != TASK_EXIT_NORMAL)) { 270 268 printf("%s: Error retrieving retval from %s (%s)\n", NAME, … … 276 274 } 277 275 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 } 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); 301 287 } else { 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 } 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); 308 296 } 309 297 } … … 316 304 } 317 305 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 325 306 int main(int argc, char *argv[]) 326 307 { … … 350 331 srv_start("/srv/apic"); 351 332 srv_start("/srv/i8259"); 333 srv_start("/srv/icp-ic"); 352 334 srv_start("/srv/obio"); 353 335 srv_start("/srv/cuda_adb"); … … 367 349 srv_start("/srv/remcons"); 368 350 369 /*370 * Start these synchronously so that mount_data() can be371 * non-blocking.372 */373 #ifdef CONFIG_START_BD374 srv_start("/srv/ata_bd");375 #endif376 377 #ifdef CONFIG_MOUNT_DATA378 /* Make sure fat is running. */379 if (str_cmp(STRING(RDFMT), "fat") != 0)380 srv_start("/srv/fat");381 382 mount_data();383 #else384 (void) mount_data;385 #endif386 387 351 srv_start("/srv/input", HID_INPUT); 388 352 srv_start("/srv/output", HID_OUTPUT); … … 393 357 gui_start("/app/vlaunch", HID_COMPOSITOR_SERVER); 394 358 gui_start("/app/vterm", HID_COMPOSITOR_SERVER); 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 } 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); 406 369 } 407 370
Note:
See TracChangeset
for help on using the changeset viewer.