#include <stdlib.h>
#include "os.h"
#include "opaque.h"
#include "dbm.h"
#include <stdio.h>
#include "Xos.h"
#include "msdos.h"
#include <sys/stat.h>

char * _near X11env = 0;

#ifdef zero_debug
jmpZero(arg)
{
	printf("HELP!!! jmpZero called by %x:%x my cs:%x\n",
		((u_short *)&arg)[-1], ((u_short *)&arg)[-2],
		(u_short)((u_long)jmpZero >> 16));
	GiveUp();
}
#endif

void
OsInit()
{
    static Bool been_here = FALSE;
    unsigned char far *s;
    char *path;
    char fname[256];
    struct stat statb;

#ifdef zero_debug
    s = 0L;
    *s++ = 0xEA;
    *(unsigned long *)s = (unsigned long)jmpZero;
#endif

    if (!X11env)
	X11env = getenv("X11");

    if (!been_here) {
	srand(s_clicks());
	start_network();
#ifdef EMS
	ems_init();
#endif

	been_here = TRUE;
    }

    OsInitColors();
}
