Changes in uspace/app/init/init.c [15f3c3f:1bfae13] in mainline


Ignore:
File:
1 edited

Legend:

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

    r15f3c3f r1bfae13  
    4646#include <macros.h>
    4747#include <str.h>
    48 #include <loc.h>
     48#include <devmap.h>
    4949#include <str_error.h>
    5050#include "init.h"
     
    5353#define ROOT_MOUNT_POINT  "/"
    5454
    55 #define LOCFS_FS_TYPE      "locfs"
    56 #define LOCFS_MOUNT_POINT  "/loc"
     55#define DEVFS_FS_TYPE      "devfs"
     56#define DEVFS_MOUNT_POINT  "/dev"
    5757
    5858#define TMPFS_FS_TYPE      "tmpfs"
     
    113113}
    114114
    115 static bool mount_locfs(void)
    116 {
    117         int rc = mount(LOCFS_FS_TYPE, LOCFS_MOUNT_POINT, "", "",
     115static bool mount_devfs(void)
     116{
     117        int rc = mount(DEVFS_FS_TYPE, DEVFS_MOUNT_POINT, "", "",
    118118            IPC_FLAG_BLOCKING);
    119         return mount_report("Location service filesystem", LOCFS_MOUNT_POINT,
    120             LOCFS_FS_TYPE, NULL, rc);
     119        return mount_report("Device filesystem", DEVFS_MOUNT_POINT, DEVFS_FS_TYPE,
     120            NULL, rc);
    121121}
    122122
     
    174174}
    175175
    176 static void console(const char *svc)
    177 {
    178         printf("%s: Spawning %s %s\n", NAME, SRV_CONSOLE, svc);
    179        
    180         /* Wait for the input service to be ready */
    181         service_id_t service_id;
    182         int rc = loc_service_get_id(svc, &service_id, IPC_FLAG_BLOCKING);
    183         if (rc != EOK) {
    184                 printf("%s: Error waiting on %s (%s)\n", NAME, svc,
    185                     str_error(rc));
    186                 return;
    187         }
    188        
    189         rc = task_spawnl(NULL, SRV_CONSOLE, SRV_CONSOLE, svc, NULL);
     176static void console(const char *dev)
     177{
     178        printf("%s: Spawning %s %s\n", NAME, SRV_CONSOLE, dev);
     179       
     180        /* Wait for the input device to be ready */
     181        devmap_handle_t handle;
     182        int rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING);
     183        if (rc != EOK) {
     184                printf("%s: Error waiting on %s (%s)\n", NAME, dev,
     185                    str_error(rc));
     186                return;
     187        }
     188       
     189        rc = task_spawnl(NULL, SRV_CONSOLE, SRV_CONSOLE, dev, NULL);
    190190        if (rc != EOK) {
    191191                printf("%s: Error spawning %s %s (%s)\n", NAME, SRV_CONSOLE,
    192                     svc, str_error(rc));
    193         }
    194 }
    195 
    196 static void getterm(const char *svc, const char *app, bool wmsg)
    197 {
    198         char term[LOC_NAME_MAXLEN];
     192                    dev, str_error(rc));
     193        }
     194}
     195
     196static void getterm(const char *dev, const char *app, bool wmsg)
     197{
     198        char term[DEVMAP_NAME_MAXLEN];
    199199        int rc;
    200200       
    201         snprintf(term, LOC_NAME_MAXLEN, "%s/%s", LOCFS_MOUNT_POINT, svc);
     201        snprintf(term, DEVMAP_NAME_MAXLEN, "%s/%s", DEVFS_MOUNT_POINT, dev);
    202202       
    203203        printf("%s: Spawning %s %s %s\n", NAME, APP_GETTERM, term, app);
    204204       
    205         /* Wait for the terminal service to be ready */
    206         service_id_t service_id;
    207         rc = loc_service_get_id(svc, &service_id, IPC_FLAG_BLOCKING);
     205        /* Wait for the terminal device to be ready */
     206        devmap_handle_t handle;
     207        rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING);
    208208        if (rc != EOK) {
    209209                printf("%s: Error waiting on %s (%s)\n", NAME, term,
     
    257257        }
    258258       
    259         spawn("/srv/locfs");
     259        spawn("/srv/devfs");
    260260        spawn("/srv/taskmon");
    261261       
    262         if (!mount_locfs()) {
     262        if (!mount_devfs()) {
    263263                printf("%s: Exiting\n", NAME);
    264264                return -2;
     
    270270        spawn("/srv/apic");
    271271        spawn("/srv/i8259");
    272         spawn("/srv/fhc");
    273272        spawn("/srv/obio");
    274273        srv_start("/srv/cuda_adb");
     
    295294       
    296295#ifdef CONFIG_MOUNT_DATA
     296        /* Make sure fat is running. */
     297        if (str_cmp(STRING(RDFMT), "fat") != 0) {
     298                srv_start("/srv/fat");
     299        }
    297300        mount_data();
    298301#else
Note: See TracChangeset for help on using the changeset viewer.