Changeset 36b8100a in mainline for uspace/app/init/init.c


Ignore:
Timestamp:
2009-06-03T19:29:18Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
73878c1
Parents:
595edf5
Message:

init rewrite: remove banner, start getvc to acquire first seven virtual terminals

File:
1 edited

Legend:

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

    r595edf5 r36b8100a  
    4545#include <malloc.h>
    4646#include <macros.h>
    47 #include <console.h>
    4847#include <string.h>
     48#include <devmap.h>
    4949#include "init.h"
    50 #include "version.h"
    5150
    52 static bool mount_fs(const char *fstype)
     51static void info_print(void)
     52{
     53        printf(NAME ": HelenOS init\n");
     54}
     55
     56static bool mount_root(const char *fstype)
    5357{
    5458        int rc = -1;
     
    119123}
    120124
     125static void getvc(char *dev, char *app)
     126{
     127        char *argv[4];
     128        char vc[MAX_DEVICE_NAME];
     129       
     130        snprintf(vc, MAX_DEVICE_NAME, "/dev/%s", dev);
     131       
     132        printf(NAME ": Spawning getvc on %s\n", vc);
     133       
     134        dev_handle_t handle;
     135        devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING);
     136       
     137        if (handle >= 0) {
     138                argv[0] = "/app/getvc";
     139                argv[1] = vc;
     140                argv[2] = app;
     141                argv[3] = NULL;
     142               
     143                if (!task_spawn("/app/getvc", argv))
     144                        printf(NAME ": Error spawning getvc on %s\n", vc);
     145        } else
     146                printf(NAME ": Error waiting on %s\n", vc);
     147}
     148
    121149int main(int argc, char *argv[])
    122150{
    123151        info_print();
    124152       
    125         if (!mount_fs(STRING(RDFMT))) {
     153        if (!mount_root(STRING(RDFMT))) {
    126154                printf(NAME ": Exiting\n");
    127155                return -1;
     
    141169        spawn("/srv/obio");
    142170       
    143         console_wait();
    144         version_print();
    145        
    146         spawn("/app/klog");
    147         spawn("/app/bdsh");
     171        getvc("vc0", "/app/bdsh");
     172        getvc("vc1", "/app/bdsh");
     173        getvc("vc2", "/app/bdsh");
     174        getvc("vc3", "/app/bdsh");
     175        getvc("vc4", "/app/bdsh");
     176        getvc("vc5", "/app/bdsh");
     177        getvc("vc6", "/app/klog");
    148178       
    149179        return 0;
Note: See TracChangeset for help on using the changeset viewer.