Changeset 0b63dc2 in mainline for uspace/app/init/init.c
- Timestamp:
- 2019-12-07T20:26:28Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- df1a019
- Parents:
- 71cbe5c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
r71cbe5c r0b63dc2 34 34 */ 35 35 36 #include <fibril.h> 36 37 #include <stdio.h> 37 38 #include <stdarg.h> … … 47 48 #include <config.h> 48 49 #include <io/logctl.h> 50 #include <vfs/vfs.h> 49 51 #include <vol.h> 50 52 #include "untar.h" … … 63 65 #define APP_GETTERM "/app/getterm" 64 66 65 #define SRV_ COMPOSITOR "/srv/hid/compositor"67 #define SRV_DISPLAY "/srv/hid/display" 66 68 67 69 #define HID_INPUT "hid/input" … … 254 256 } 255 257 256 static errno_t compositor(const char *isvc, const char *name) 257 { 258 /* Wait for the input service to be ready */ 259 service_id_t service_id; 260 errno_t rc = loc_service_get_id(isvc, &service_id, IPC_FLAG_BLOCKING); 261 if (rc != EOK) { 262 printf("%s: Error waiting on %s (%s)\n", NAME, isvc, 263 str_error(rc)); 264 return rc; 265 } 266 267 return srv_start(SRV_COMPOSITOR, isvc, name); 268 } 269 270 static int gui_start(const char *app, const char *srv_name) 271 { 272 char winreg[50]; 273 snprintf(winreg, sizeof(winreg), "%s%s%s", "comp", srv_name, "/winreg"); 274 275 printf("%s: Spawning %s %s\n", NAME, app, winreg); 258 static errno_t display_server(void) 259 { 260 return srv_start(SRV_DISPLAY); 261 } 262 263 static int gui_start(const char *app) 264 { 265 printf("%s: Spawning %s\n", NAME, app); 276 266 277 267 task_id_t id; 278 268 task_wait_t wait; 279 errno_t rc = task_spawnl(&id, &wait, app, app, winreg,NULL);280 if (rc != EOK) { 281 printf("%s: Error spawning %s %s(%s)\n", NAME, app,282 winreg,str_error(rc));269 errno_t rc = task_spawnl(&id, &wait, app, app, NULL); 270 if (rc != EOK) { 271 printf("%s: Error spawning %s (%s)\n", NAME, app, 272 str_error(rc)); 283 273 return -1; 284 274 } … … 458 448 459 449 if (!config_key_exists("console")) { 460 rc = compositor(HID_INPUT, HID_COMPOSITOR_SERVER);450 rc = display_server(); 461 451 if (rc == EOK) { 462 gui_start("/app/barber", HID_COMPOSITOR_SERVER); 463 gui_start("/app/vlaunch", HID_COMPOSITOR_SERVER); 464 gui_start("/app/vterm", HID_COMPOSITOR_SERVER); 452 fibril_sleep(1); 453 gui_start("/app/gfxdemo"); 465 454 } 466 455 }
Note:
See TracChangeset
for help on using the changeset viewer.