Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 47a350f in mainline for uspace/app/init/init.c


Ignore:
Timestamp:
2009-12-16T01:49:16Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
df747bd8
Parents:
4491338
Message:

keyboard is not a single possible human input device, thus don't register the kbd driver as a singleton service to the Naming service, but to the Device mapper

File:
1 edited

Legend:

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

    r4491338 r47a350f  
    5050#include "init.h"
    5151
     52#define DEVFS_MOUNT_POINT  "/dev"
     53
     54#define SRV_CONSOLE  "/srv/console"
     55#define APP_GETVC    "/app/getvc"
     56
    5257static void info_print(void)
    5358{
     
    98103       
    99104        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);
    101106       
    102107        switch (rc) {
     
    176181}
    177182
     183static 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
    178208static void getvc(char *dev, char *app)
    179209{
     
    182212        int rc;
    183213       
    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 */
    188219        dev_handle_t handle;
    189220        rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING);
    190221       
    191222        if (rc == EOK) {
    192                 argv[0] = "/app/getvc";
     223                argv[0] = APP_GETVC;
    193224                argv[1] = vc;
    194225                argv[2] = app;
    195226                argv[3] = NULL;
    196227               
    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
    200231                printf(NAME ": Error waiting on %s\n", vc);
    201         }
    202232}
    203233
     
    234264        spawn("/srv/fb");
    235265        spawn("/srv/kbd");
    236         spawn("/srv/console");
     266        console("hid_in/kbd");
     267       
    237268        spawn("/srv/clip");
    238269        spawn("/srv/fhc");
Note: See TracChangeset for help on using the changeset viewer.