Exemplo n.º 1
0
/* initialisation of the library */
void
init(){
    openlog ("libnosync", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
    inituser();
    initprocess();
    syslog (LOG_NOTICE, "loaded by program %s, user %s", process, user);
    initsymbols();
    readconfig();
}
Exemplo n.º 2
0
void runsys()
{
    word apt, i;
    procaddr father;

    for (i = 0;  i < MAXPROCESS;  i++ ) /* initialize process descriptors */
    {
        process[ i ].used = FALSE;     /* not used */
        process[ i ].mark = -1;               /* initial mark for processes */
        process[ i ].M = NULL;         /* memory not allocated */
        process[ i ].hash = NULL;
    }
    process[ 0 ].M = M;                /* always contains code */
    dispoff = VIRTSC-(lastprot+1);      /* DISPLAY offset in process object */
    disp2off = dispoff-(lastprot+1);    /* indirect DISPLAY offset */
    ready = qinit();         /* initialize Round-Robin queue */
    ranset();              /* init pseudo-random no. generator */

#if OS2
    {
        SEL gsel, lsel;
        DosGetInfoSeg(&gsel, &lsel);
        ginf = MAKEPGINFOSEG(gsel);
    }
#endif

    if (!remote)                     /* create main process */
    {
        father.node = 0;     /* dummy DL for generated process */
        father.pix  = 0;
        father.mark = 0;
        thispix = 0;                       /* current process index */
        thisp = &process[ thispix ];       /* current process descr pointer */
        initprocess((word) 0, (word) MAINBLOCK, &father);
        mainprog = thisp->prochead;        /* am of main */
        c1 = thisp->c1;            /* pointers to current object */
        c2 = thisp->c2;
        ic = thisp->ic;         /* instruction counter */
        param = thisp->param;           /* parameter vector */
        apt = mainprog+M[ mainprog ];      /* LWA+1 of main */
        display = apt+dispoff;         /* DISPLAY in main */
        display2 = apt+disp2off;   /* indirect DISPLAY in main */
        mnoff = 2;                /* offset of variable mainprog */
        storevirt(thisp->procref, mainprog+mnoff);  /* init variable main */
        M[ apt+STATSL ]++;         /* flag main included in SL chain */
        thisp->status = STOPPED;
        activate(thispix);         /* activate main process */
    }
    else  /* remote */
    {
        thispix = 1;                  /* a dirty trick: set junk current */
        thisp = &process[ thispix ];       /* process for first transfer() */
    }                     /* (must save 'context' somewhere) */
#if DLINK
    net_attention();
#endif
}
Exemplo n.º 3
0
extern "C" int
main(int argc, char *argv[])
{
    /* Pass argv[0] to the Python interpreter */
    Py_SetProgramName(argv[0]);

    /* Initialize the Python interpreter.  Required. */
    Py_Initialize();

    /* Add a static module */
    initprocess();

    return 0;
}
Exemplo n.º 4
0
int main (void) {
	initprocess();
	return 0;
}