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

Changeset 827d73f in mainline for uspace/app/init/init.c


Ignore:
Timestamp:
2010-02-12T14:09:22Z (12 years ago)
Author:
Lukas Mejdrech <lukasmejdrech@…>
Branches:
lfn, master
Children:
a70bda4
Parents:
918e9910 (diff), e70edd1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged the actual head

File:
1 edited

Legend:

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

    r918e9910 r827d73f  
    9494static bool mount_devfs(void)
    9595{
    96         char null[MAX_DEVICE_NAME];
    97         int null_id = devmap_null_create();
    98        
    99         if (null_id == -1) {
    100                 printf(NAME ": Unable to create null device\n");
    101                 return false;
    102         }
    103        
    104         snprintf(null, MAX_DEVICE_NAME, "null/%d", null_id);
    105         int rc = mount("devfs", DEVFS_MOUNT_POINT, null, "", IPC_FLAG_BLOCKING);
     96        int rc = mount("devfs", DEVFS_MOUNT_POINT, "", "", IPC_FLAG_BLOCKING);
    10697       
    10798        switch (rc) {
     
    111102        case EBUSY:
    112103                printf(NAME ": Device filesystem already mounted\n");
    113                 devmap_null_destroy(null_id);
    114104                return false;
    115105        case ELIMIT:
    116106                printf(NAME ": Unable to mount device filesystem\n");
    117                 devmap_null_destroy(null_id);
    118107                return false;
    119108        case ENOENT:
    120109                printf(NAME ": Unknown filesystem type (devfs)\n");
    121                 devmap_null_destroy(null_id);
    122110                return false;
    123111        default:
    124112                printf(NAME ": Error mounting device filesystem (%d)\n", rc);
    125                 devmap_null_destroy(null_id);
    126113                return false;
    127114        }
     
    184171{
    185172        char *argv[3];
    186         char hid_in[MAX_DEVICE_NAME];
     173        char hid_in[DEVMAP_NAME_MAXLEN];
    187174        int rc;
    188175       
    189         snprintf(hid_in, MAX_DEVICE_NAME, "%s/%s", DEVFS_MOUNT_POINT, dev);
     176        snprintf(hid_in, DEVMAP_NAME_MAXLEN, "%s/%s", DEVFS_MOUNT_POINT, dev);
    190177       
    191178        printf(NAME ": Spawning %s with %s\n", SRV_CONSOLE, hid_in);
     
    209196{
    210197        char *argv[4];
    211         char term[MAX_DEVICE_NAME];
     198        char term[DEVMAP_NAME_MAXLEN];
    212199        int rc;
    213200       
    214         snprintf(term, MAX_DEVICE_NAME, "%s/%s", DEVFS_MOUNT_POINT, dev);
     201        snprintf(term, DEVMAP_NAME_MAXLEN, "%s/%s", DEVFS_MOUNT_POINT, dev);
    215202       
    216203        printf(NAME ": Spawning %s with %s %s\n", APP_GETTERM, term, app);
     
    233220}
    234221
     222static void mount_scratch(void)
     223{
     224        int rc;
     225
     226        printf("Trying to mount null/0 on /scratch... ");
     227        fflush(stdout);
     228
     229        rc = mount("tmpfs", "/scratch", "null/0", "", 0);
     230        if (rc == EOK)
     231                printf("OK\n");
     232        else
     233                printf("Failed\n");
     234}
     235
    235236static void mount_data(void)
    236237{
     
    255256                return -1;
    256257        }
     258
     259        /* Make sure tmpfs is running. */
     260        if (str_cmp(STRING(RDFMT), "tmpfs") != 0) {
     261                spawn("/srv/tmpfs");
     262        }
    257263       
    258264        spawn("/srv/devfs");
     265        spawn("/srv/taskmon");
    259266       
    260267        if (!mount_devfs()) {
     
    262269                return -2;
    263270        }
     271
     272        mount_scratch();
    264273       
    265274        spawn("/srv/fhc");
    266275        spawn("/srv/obio");
     276        srv_start("/srv/cuda_adb");
    267277        srv_start("/srv/i8042");
    268         srv_start("/srv/c_mouse");
     278        srv_start("/srv/adb_ms");
     279        srv_start("/srv/char_ms");
    269280
    270281        spawn("/srv/fb");
     
    298309        getterm("term/vc5", "/app/bdsh");
    299310        getterm("term/vc6", "/app/klog");
    300        
     311
    301312        return 0;
    302313}
Note: See TracChangeset for help on using the changeset viewer.