Changes in uspace/app/init/init.c [c26eb39:cc1f8d4] in mainline


Ignore:
File:
1 edited

Legend:

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

    rc26eb39 rcc1f8d4  
    5050#include "init.h"
    5151
    52 #define DEVFS_MOUNT_POINT  "/dev"
    53 
    54 #define SRV_CONSOLE  "/srv/console"
    55 #define APP_GETTERM  "/app/getterm"
    56 
    5752static void info_print(void)
    5853{
     
    6358{
    6459        char *opts = "";
    65         const char *root_dev = "bd/initrd";
     60        const char *root_dev = "initrd";
    6661       
    6762        if (str_cmp(fstype, "tmpfs") == 0)
     
    10297        }
    10398       
    104         snprintf(null, MAX_DEVICE_NAME, "null/%d", null_id);
    105         int rc = mount("devfs", DEVFS_MOUNT_POINT, null, "", IPC_FLAG_BLOCKING);
     99        snprintf(null, MAX_DEVICE_NAME, "null%d", null_id);
     100        int rc = mount("devfs", "/dev", null, "", IPC_FLAG_BLOCKING);
    106101       
    107102        switch (rc) {
     
    175170        }
    176171
    177         if ((texit != TASK_EXIT_NORMAL) || (retval != 0)) {
     172        if (texit != TASK_EXIT_NORMAL || retval != 0) {
    178173                printf(NAME ": Server %s failed to start (returned %d)\n",
    179174                        fname, retval);
     
    181176}
    182177
    183 static void console(char *dev)
    184 {
    185         char *argv[3];
    186         char hid_in[MAX_DEVICE_NAME];
     178static void getvc(char *dev, char *app)
     179{
     180        char *argv[4];
     181        char vc[MAX_DEVICE_NAME];
    187182        int rc;
    188183       
    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 */
     184        snprintf(vc, MAX_DEVICE_NAME, "/dev/%s", dev);
     185       
     186        printf(NAME ": Spawning getvc on %s\n", vc);
     187       
    194188        dev_handle_t handle;
    195189        rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING);
    196190       
    197191        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 
    208 static void getterm(char *dev, char *app)
    209 {
    210         char *argv[4];
    211         char term[MAX_DEVICE_NAME];
    212         int rc;
    213        
    214         snprintf(term, MAX_DEVICE_NAME, "%s/%s", DEVFS_MOUNT_POINT, dev);
    215        
    216         printf(NAME ": Spawning %s with %s %s\n", APP_GETTERM, term, app);
    217        
    218         /* Wait for the terminal device to be ready */
    219         dev_handle_t handle;
    220         rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING);
    221        
    222         if (rc == EOK) {
    223                 argv[0] = APP_GETTERM;
    224                 argv[1] = term;
     192                argv[0] = "/app/getvc";
     193                argv[1] = vc;
    225194                argv[2] = app;
    226195                argv[3] = NULL;
    227196               
    228                 if (!task_spawn(APP_GETTERM, argv))
    229                         printf(NAME ": Error spawning %s with %s %s\n", APP_GETTERM,
    230                             term, app);
    231         } else
    232                 printf(NAME ": Error waiting on %s\n", term);
     197                if (!task_spawn("/app/getvc", argv))
     198                        printf(NAME ": Error spawning getvc on %s\n", vc);
     199        } else {
     200                printf(NAME ": Error waiting on %s\n", vc);
     201        }
    233202}
    234203
     
    237206        int rc;
    238207
    239         printf("Trying to mount bd/disk0 on /data... ");
     208        printf("Trying to mount disk0 on /data... ");
    240209        fflush(stdout);
    241210
    242         rc = mount("fat", "/data", "bd/disk0", "wtcache", 0);
     211        rc = mount("fat", "/data", "disk0", "wtcache", 0);
    243212        if (rc == EOK)
    244213                printf("OK\n");
     
    265234        spawn("/srv/fb");
    266235        spawn("/srv/kbd");
    267         console("hid_in/kbd");
    268        
    269         spawn("/srv/clip");
     236        spawn("/srv/console");
    270237        spawn("/srv/fhc");
    271238        spawn("/srv/obio");
     
    288255#endif
    289256
    290         getterm("term/vc0", "/app/bdsh");
    291         getterm("term/vc1", "/app/bdsh");
    292         getterm("term/vc2", "/app/bdsh");
    293         getterm("term/vc3", "/app/bdsh");
    294         getterm("term/vc4", "/app/bdsh");
    295         getterm("term/vc5", "/app/bdsh");
    296         getterm("term/vc6", "/app/klog");
     257        getvc("vc0", "/app/bdsh");
     258        getvc("vc1", "/app/bdsh");
     259        getvc("vc2", "/app/bdsh");
     260        getvc("vc3", "/app/bdsh");
     261        getvc("vc4", "/app/bdsh");
     262        getvc("vc5", "/app/bdsh");
     263        getvc("vc6", "/app/klog");
    297264       
    298265        return 0;
Note: See TracChangeset for help on using the changeset viewer.