Changeset 0b63dc2 in mainline for uspace/app/init/init.c


Ignore:
Timestamp:
2019-12-07T20:26:28Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
df1a019
Parents:
71cbe5c
Message:

Switch compositor → display server

Convert KFB from visualizer to display device interface. Add ability
of display device implementor to provide client with arg2, arg3 needed
to connect to GC.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/init/init.c

    r71cbe5c r0b63dc2  
    3434 */
    3535
     36#include <fibril.h>
    3637#include <stdio.h>
    3738#include <stdarg.h>
     
    4748#include <config.h>
    4849#include <io/logctl.h>
     50#include <vfs/vfs.h>
    4951#include <vol.h>
    5052#include "untar.h"
     
    6365#define APP_GETTERM  "/app/getterm"
    6466
    65 #define SRV_COMPOSITOR  "/srv/hid/compositor"
     67#define SRV_DISPLAY  "/srv/hid/display"
    6668
    6769#define HID_INPUT              "hid/input"
     
    254256}
    255257
    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);
     258static errno_t display_server(void)
     259{
     260        return srv_start(SRV_DISPLAY);
     261}
     262
     263static int gui_start(const char *app)
     264{
     265        printf("%s: Spawning %s\n", NAME, app);
    276266
    277267        task_id_t id;
    278268        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));
    283273                return -1;
    284274        }
     
    458448
    459449        if (!config_key_exists("console")) {
    460                 rc = compositor(HID_INPUT, HID_COMPOSITOR_SERVER);
     450                rc = display_server();
    461451                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");
    465454                }
    466455        }
Note: See TracChangeset for help on using the changeset viewer.