Changeset eb522e8 in mainline for uspace/app/init/init.c


Ignore:
Timestamp:
2011-06-01T08:43:42Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8d6c1f1
Parents:
9e2e715 (diff), e51a514 (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:

Huuuuuge merge from development - all the work actually :)

File:
1 edited

Legend:

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

    r9e2e715 reb522e8  
    3737#include <stdio.h>
    3838#include <unistd.h>
    39 #include <ipc/ipc.h>
    4039#include <vfs/vfs.h>
    4140#include <bool.h>
     
    5756#define DEVFS_MOUNT_POINT  "/dev"
    5857
    59 #define SCRATCH_FS_TYPE      "tmpfs"
    60 #define SCRATCH_MOUNT_POINT  "/scratch"
     58#define TMPFS_FS_TYPE      "tmpfs"
     59#define TMPFS_MOUNT_POINT  "/tmp"
    6160
    6261#define DATA_FS_TYPE      "fat"
    63 #define DATA_DEVICE       "bd/disk0"
     62#define DATA_DEVICE       "bd/ata1disk0"
    6463#define DATA_MOUNT_POINT  "/data"
    6564
     
    185184       
    186185        /* Wait for the input device to be ready */
    187         dev_handle_t handle;
     186        devmap_handle_t handle;
    188187        rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING);
    189188        if (rc != EOK) {
     
    200199}
    201200
    202 static void getterm(const char *dev, const char *app)
     201static void getterm(const char *dev, const char *app, bool wmsg)
    203202{
    204203        char term[DEVMAP_NAME_MAXLEN];
     
    210209       
    211210        /* Wait for the terminal device to be ready */
    212         dev_handle_t handle;
     211        devmap_handle_t handle;
    213212        rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING);
    214213        if (rc != EOK) {
     
    218217        }
    219218       
    220         rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, term, app, NULL);
    221         if (rc != EOK) {
    222                 printf("%s: Error spawning %s %s %s (%s)\n", NAME,
    223                     APP_GETTERM, term, app, str_error(rc));
    224         }
    225 }
    226 
    227 static bool mount_scratch(void)
    228 {
    229         int rc = mount(SCRATCH_FS_TYPE, SCRATCH_MOUNT_POINT, "", "", 0);
    230         return mount_report("Scratch filesystem", SCRATCH_MOUNT_POINT,
    231             SCRATCH_FS_TYPE, NULL, rc);
     219        if (wmsg) {
     220                rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, "-w", term,
     221                    app, NULL);
     222                if (rc != EOK) {
     223                        printf("%s: Error spawning %s -w %s %s (%s)\n", NAME,
     224                            APP_GETTERM, term, app, str_error(rc));
     225                }
     226        } else {
     227                rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, term, app,
     228                    NULL);
     229                if (rc != EOK) {
     230                        printf("%s: Error spawning %s %s %s (%s)\n", NAME,
     231                            APP_GETTERM, term, app, str_error(rc));
     232                }
     233        }
     234}
     235
     236static bool mount_tmpfs(void)
     237{
     238        int rc = mount(TMPFS_FS_TYPE, TMPFS_MOUNT_POINT, "", "", 0);
     239        return mount_report("Temporary filesystem", TMPFS_MOUNT_POINT,
     240            TMPFS_FS_TYPE, NULL, rc);
    232241}
    233242
     
    261270        }
    262271       
    263         mount_scratch();
    264        
     272        mount_tmpfs();
     273       
     274        spawn("/srv/apic");
     275        spawn("/srv/i8259");
    265276        spawn("/srv/fhc");
    266277        spawn("/srv/obio");
     
    295306#endif
    296307       
    297         getterm("term/vc0", "/app/bdsh");
    298         getterm("term/vc1", "/app/bdsh");
    299         getterm("term/vc2", "/app/bdsh");
    300         getterm("term/vc3", "/app/bdsh");
    301         getterm("term/vc4", "/app/bdsh");
    302         getterm("term/vc5", "/app/bdsh");
    303         getterm("term/vc6", "/app/klog");
    304        
     308        getterm("term/vc0", "/app/bdsh", true);
     309        getterm("term/vc1", "/app/bdsh", false);
     310        getterm("term/vc2", "/app/bdsh", false);
     311        getterm("term/vc3", "/app/bdsh", false);
     312        getterm("term/vc4", "/app/bdsh", false);
     313        getterm("term/vc5", "/app/bdsh", false);
     314        getterm("term/vc6", "/app/klog", false);
     315
     316#ifdef CONFIG_START_DEVMAN
     317
     318#ifdef CONFIG_DEVMAN_EARLY_LAUNCH
     319        spawn("/srv/devman");
     320#else
     321        getterm("term/vc7", "/srv/devman", false);
     322#endif
     323
     324#endif
     325
    305326        return 0;
    306327}
Note: See TracChangeset for help on using the changeset viewer.