From owner-freebsd-emulation Sun Sep 8 03:24:57 1996 Return-Path: owner-emulation Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id DAA01180 for emulation-outgoing; Sun, 8 Sep 1996 03:24:57 -0700 (PDT) Received: from who.cdrom.com (who.cdrom.com [204.216.27.3]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id DAA01175 for ; Sun, 8 Sep 1996 03:24:56 -0700 (PDT) Received: from mail.crl.com (mail.crl.com [165.113.1.22]) by who.cdrom.com (8.7.5/8.6.11) with SMTP id DAA00303 for ; Sun, 8 Sep 1996 03:24:55 -0700 (PDT) Received: from ref.tfs.com ([206.245.251.1]) by mail.crl.com with SMTP id AA05693 (5.65c/IDA-1.5 for ); Sun, 8 Sep 1996 00:47:41 -0700 Received: from fermat.pdmi.ras.ru (root@fermat.pdmi.ras.ru [194.88.2.34]) by ref.tfs.com (8.7.5/8.7.3) with SMTP id AAA28500 for ; Sun, 8 Sep 1996 00:43:00 -0700 (PDT) Received: from gauss.pdmi.ras.ru (gauss.pdmi.ras.ru [194.88.2.33]) by fermat.pdmi.ras.ru (8.6.12/8.6.9) with ESMTP id LAA01851 for ; Sun, 8 Sep 1996 11:47:00 +0400 Received: (from pialkin@localhost) by gauss.pdmi.ras.ru (8.6.12/8.6.12) id LAA26282 for emulation@freebsd.org; Sun, 8 Sep 1996 11:36:17 +0400 From: Alexey Pialkin Message-Id: <199609080736.LAA26282@gauss.pdmi.ras.ru> Subject: Small patch for Non X yusers To: emulation@freebsd.org Date: Sun, 8 Sep 1996 11:36:16 +0400 (????) X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi ! This is a small patch for compiling doscmd without X support. (this patch doesn't able to support BIOS calls for fullscreen drawing) diff -cr old/Makefile doscmd/Makefile *** old/Makefile Sun Sep 1 04:35:45 1996 --- doscmd/Makefile Sun Sep 8 10:46:03 1996 *************** *** 15,23 **** ################################################################################ # For FreeBSD ! CFLAGS+=-I/usr/X11R6/include -DDISASSEMBLER -g LDFLAGS+=-L/usr/X11R6/lib ! LDADD+= -lX11 -lgcc -lc -lgcc DPADD+=/usr/X11R6/lib/libX11.a ${LIBC} ################################################################################ --- 15,25 ---- ################################################################################ # For FreeBSD ! # NO_X - compile without X support ! CFLAGS+=-I/usr/X11R6/include -DDISASSEMBLER -g -DNO_X LDFLAGS+=-L/usr/X11R6/lib ! #without X11 ! LDADD+= -lgcc -lc -lgcc DPADD+=/usr/X11R6/lib/libX11.a ${LIBC} ################################################################################ Binary files old/doscmd and doscmd/doscmd differ diff -cr old/doscmd.c doscmd/doscmd.c *** old/doscmd.c Sun Sep 1 04:44:01 1996 --- doscmd/doscmd.c Sun Sep 8 10:47:56 1996 *************** *** 137,144 **** debug_set(0); /* debug any D_TRAPS without intnum */ while ((c = getopt (argc, argv, "234Oc:IEMPRLAU:S:HDtzvVxXfbri:o:d:")) != -1) { ! switch (c) { case 'd': if (fp = fopen(optarg, "w")) { debugf = fp; --- 137,148 ---- debug_set(0); /* debug any D_TRAPS without intnum */ + #ifndef NO_X while ((c = getopt (argc, argv, "234Oc:IEMPRLAU:S:HDtzvVxXfbri:o:d:")) != -1) { ! #else ! while ((c = getopt (argc, argv, "234Oc:IEMPRLAU:S:HDtzvVXfbri:o:d:")) != -1) { ! #endif ! switch (c) { case 'd': if (fp = fopen(optarg, "w")) { debugf = fp; Binary files old/doscmd.kernel and doscmd/doscmd.kernel differ Binary files old/doscmd.o and doscmd/doscmd.o differ diff -cr old/tty.c doscmd/tty.c *** old/tty.c Sun Sep 1 04:35:46 1996 --- doscmd/tty.c Sun Sep 8 10:51:55 1996 *************** *** 30,38 **** * BSDI tty.c,v 2.4 1996/04/08 22:03:27 prb Exp */ ! #include ! #include ! #include #include #include #include --- 30,41 ---- * BSDI tty.c,v 2.4 1996/04/08 22:03:27 prb Exp */ ! #ifndef NO_X ! #include ! #include ! #include ! #endif ! #include #include #include *************** *** 68,76 **** static u_short break_code = 0x00; static u_short scan_code = 0x00; ! static Display *dpy = 0; ! static Window win; ! static XFontStruct *font; static unsigned long black; static unsigned long white; static unsigned long pixels[16]; --- 71,82 ---- static u_short break_code = 0x00; static u_short scan_code = 0x00; ! #ifndef NO_X ! static Display *dpy = 0; ! static Window win; ! static XFontStruct *font; ! #endif ! static unsigned long black; static unsigned long white; static unsigned long pixels[16]; *************** *** 94,101 **** }; static int FW, FH, FD; ! static GC gc; ! static GC cgc; static int xfd; int kbd_fd = -1; int kbd_read = 0; --- 100,109 ---- }; static int FW, FH, FD; ! #ifndef NO_X ! static GC gc; ! static GC cgc; ! #endif static int xfd; int kbd_fd = -1; int kbd_read = 0; *************** *** 136,142 **** #define video_pate BISODATA[0x62] ! #define IBMFONT "ibmpc" char *xfont = 0; --- 144,150 ---- #define video_pate BISODATA[0x62] ! #define IBMFONT "fixed" char *xfont = 0; *************** *** 352,359 **** --- 360,369 ---- video_setborder(int color) { _BlockIO(); + #ifndef NO_X XSetWindowBackground(dpy, win, pixels[color & 0xf]); _UnblockIO(); + #endif } void video_blink(int mode) *************** *** 365,370 **** --- 375,381 ---- setgc(u_short attr) { + #ifndef NO_X XGCValues v; if (blink && !show && (attr & 0x8000)) v.foreground = pixels[(attr >> 12) & 0x07]; *************** *** 379,389 **** --- 390,402 ---- } #endif XChangeGC(dpy, gc, GCForeground|GCBackground, &v); + #endif } void video_update(struct sigcontext *sc) { + #ifndef NO_X static int or = -1; static int oc = -1; *************** *** 516,521 **** --- 529,535 ---- BIOSDATA[0x70]++; /* BIOSDATA[0x70] # times past mn */ } } + #endif } static u_short Ascii2Scan[] = { *************** *** 732,739 **** --- 746,755 ---- } KbdWrite(ScanCodes[28].base); } else if (!strcasecmp(av[0], "bell")) { + #ifndef NO_X XBell(dpy, 0); XFlush(dpy); + #endif } else { fprintf(stderr, "%s: unknown command\n", av[0]); } *************** *** 958,963 **** --- 974,980 ---- { int int09 = 0; + #ifndef NO_X for (;;) { int x; fd_set fdset; *************** *** 988,994 **** --- 1005,1013 ---- perror("select"); return; case 0: + #ifndef NO_X XFlush(dpy); + #endif if (int09) hardint(0x09); return; *************** *** 1002,1007 **** --- 1021,1027 ---- break; } } + #endif } void *************** *** 1098,1103 **** --- 1118,1124 ---- #endif } + #ifndef NO_X int video_event(XEvent *ev) { *************** *** 1457,1462 **** --- 1478,1484 ---- } return(0); } + #endif #define R03D4 BIOSDATA[0x65] static u_char R03BA = 0; *************** *** 1578,1584 **** --- 1600,1608 ---- switch (c) { case 0x07: if (xmode) { + #ifndef NO_X XBell(dpy, 0); + #endif } else write(1, "\007", 1); break; *************** *** 1873,1879 **** --- 1897,1905 ---- int klen = K_BUFEND - K_BUFSTART; int kf = (K_FREE + 1) % klen; if (kf == K_NEXT) { + #ifndef NO_X XBell(dpy, 0); + #endif return; } K_BUFSTART[K_FREE] = code; *************** *** 1907,1915 **** --- 1933,1943 ---- video_init() { u_long vec; + #ifndef NO_X XSizeHints sh; XGCValues gcv; XColor ccd, rgb; + #endif unsigned long mask; int level; int i, j; *************** *** 1954,1959 **** --- 1982,1989 ---- if (!xmode) return; + #ifndef NO_X + if (!(lines = (TextLine *)malloc(sizeof(TextLine) * height))) { fprintf(stderr, "Could not allocate data structure for text lines\n"); quit(1); *************** *** 2085,2090 **** --- 2115,2121 ---- XFlush(dpy); _UnblockIO(); + #endif } void Alexey Pialkin