From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Aug 31 14:54:28 2011 Return-Path: Delivered-To: freebsd-ports-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80BCC106566C; Wed, 31 Aug 2011 14:54:28 +0000 (UTC) (envelope-from shurd@sasktel.net) Received: from mail119c7.megamailservers.com (mail119c7.megamailservers.com [69.49.98.219]) by mx1.freebsd.org (Postfix) with ESMTP id 219168FC13; Wed, 31 Aug 2011 14:54:27 +0000 (UTC) X-Authenticated-User: hurds.sasktel.net Received: from stephen.hurd.local ([12.69.216.86]) (authenticated bits=0) by mail119c7.megamailservers.com (8.13.6/8.13.1) with ESMTP id p7VEa3kL025595; Wed, 31 Aug 2011 10:36:05 -0400 Message-ID: <4E5E46CF.9010705@sasktel.net> Date: Wed, 31 Aug 2011 07:35:59 -0700 From: Stephen Hurd User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.19) Gecko/20110717 SeaMonkey/2.0.14 MIME-Version: 1.0 To: stefan@FreeBSD.org References: <201108311307.p7VD7uxW046422@freefall.freebsd.org> In-Reply-To: <201108311307.p7VD7uxW046422@freefall.freebsd.org> Content-Type: multipart/mixed; boundary="------------020307060208060909030708" X-CSC: 0 X-CHA: v=1.1 cv=LtDPo6UbR1/nDziwW99iV6QoqH1gasj+teXTHBsHTG0= c=1 sm=1 a=d11FXTDrlS8A:10 a=URh7Lh0WRXYA:10 a=YxfxW3ofkq8A:10 a=tA04l6VDvRo5w/gp41rdEQ==:17 a=6I5d2MoRAAAA:8 a=lfW_0-nXJNk9XPOLXoQA:9 a=wPNLvfGTeEIA:10 a=SV7veod9ZcQA:10 a=17o3Abt5CDm_tFpGOyMA:9 a=NiX247bfVQpJSyARdf8A:7 a=tA04l6VDvRo5w/gp41rdEQ==:117 Cc: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/160217: [Maintainer Update] emulators/doscmd update X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 14:54:28 -0000 This is a multi-part message in MIME format. --------------020307060208060909030708 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit stefan@FreeBSD.org wrote: > Please note that updates to existing ports should be sent in unified diff format > (as produced by 'diff -u'), not as shar files, so changes to the port can be > seen in the problem report. Could you send a followup with your update in > unified diff format? > Attached. How should new and deleted files be sent for existing ports? --------------020307060208060909030708 Content-Type: text/plain; name="doscmd.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="doscmd.patch" diff -u /usr/ports/emulators/doscmd/work/doscmd-20040330/doscmd.c doscmd.bbs/doscmd.c --- /usr/ports/emulators/doscmd/work/doscmd-20040330/doscmd.c Mon Mar 29 16:00:00 2004 +++ doscmd.bbs/doscmd.c Mon Sep 23 21:42:31 2002 @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: projects/doscmd/doscmd.c,v 1.25 2002/03/07 12:52:26 obrien Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/doscmd/doscmd.c,v 1.13.2.6 2002/04/25 11:04:51 tg Exp $"); #include #include @@ -53,6 +53,7 @@ #include #include #include +#include #include "doscmd.h" #include "cwd.h" @@ -67,6 +68,7 @@ int booting = 0; int raw_kbd = 0; int timer_disable = 0; +int doormode = 0; struct timeval boot_time; unsigned long *ivec = (unsigned long *)0; @@ -510,8 +512,9 @@ int i,c,p; FILE *fp; char *col; + struct termios tio_raw; - while ((c = getopt(argc, argv, "234AbCc:Dd:EGHIi:kLMOo:Pp:RrS:TtU:vVxXYz")) != -1) { + while ((c = getopt(argc, argv, "234ABbCc:Dd:EGHIi:kLMOo:Pp:RrS:TtU:vVxXYz")) != -1) { switch (c) { case '2': debug_flags |= D_TRAPS2; @@ -527,6 +530,12 @@ for (c = 0; c < 256; ++c) debug_set(c); break; + case 'B': /* "BBS" mode */ + doormode = 1; + tcgetattr(fileno(stdin),&tio_raw); + cfmakeraw(&tio_raw); + tcsetattr(fileno(stdin),TCSANOW,&tio_raw); + break; case 'b': booting = 1; break; @@ -823,7 +832,7 @@ done(regcontext_t *REGS, int val) { if (curpsp < 2) { - if (xmode) { + if (xmode && !doormode) { const char *m; tty_move(24, 0); diff -u /usr/ports/emulators/doscmd/work/doscmd-20040330/doscmd.h doscmd.bbs/doscmd.h --- /usr/ports/emulators/doscmd/work/doscmd-20040330/doscmd.h Mon Mar 29 16:00:00 2004 +++ doscmd.bbs/doscmd.h Mon Sep 23 21:42:31 2002 @@ -29,7 +29,7 @@ * * BSDI doscmd.h,v 2.3 1996/04/08 19:32:32 bostic Exp * - * $FreeBSD: projects/doscmd/doscmd.h,v 1.14 2002/02/17 17:18:04 deischen Exp $ + * $FreeBSD: src/usr.bin/doscmd/doscmd.h,v 1.7.2.1 2002/04/25 11:04:51 tg Exp $ */ @@ -178,6 +178,7 @@ extern int booting; extern int raw_kbd; extern int timer_disable; +extern int doormode; extern char cmdname[]; extern struct timeval boot_time; extern unsigned long *ivec; diff -u /usr/ports/emulators/doscmd/work/doscmd-20040330/int14.c doscmd.bbs/int14.c --- /usr/ports/emulators/doscmd/work/doscmd-20040330/int14.c Mon Mar 29 16:00:00 2004 +++ doscmd.bbs/int14.c Mon Sep 23 21:42:31 2002 @@ -34,10 +34,11 @@ */ #include -__FBSDID("$FreeBSD: projects/doscmd/int14.c,v 1.9 2002/03/30 13:51:40 dwmalone Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/doscmd/int14.c,v 1.2.2.1 2002/04/25 11:04:51 tg Exp $"); #include #include +#include #include #include #include @@ -113,7 +114,13 @@ input(struct com_data_struct *cdsp, int force_read) { int nbytes; + fd_set rfds; + struct timeval timeout={0,0}; + if(doormode) { + cdsp->fd = STDIN_FILENO; + } + if (cdsp->ids < N_BYTES && (force_read || !has_enough_data(cdsp))) { nbytes = read(cdsp->fd, &cdsp->inbuf[cdsp->ids], N_BYTES - cdsp->ids); @@ -130,6 +137,10 @@ { int nbytes; + if(doormode) { + cdsp->fd = STDOUT_FILENO; + } + if (cdsp->ods > 0) { nbytes = write(cdsp->fd, &cdsp->outbuf[0], cdsp->ods); debug(D_PORT, "write of fd %d on '%s' returned %d (%s)\n", @@ -206,13 +217,26 @@ get_status(struct com_data_struct *cdsp) { unsigned char s = (LS_X_DATA_E | LS_X_HOLD_E); - if (cdsp->ids > 0) - s |= LS_RCV_DATA_RD; - if (cdsp->ods > 0) { - s &= ~LS_X_DATA_E; - if (cdsp->ods >= N_BYTES) - s &= ~LS_X_HOLD_E; - } + fd_set rfds; + struct timeval timeout={0,0}; + + if (doormode) { + FD_ZERO(&rfds); + FD_SET(STDIN_FILENO,&rfds); + if(select(STDIN_FILENO+1,&rfds,NULL,NULL,&timeout)!=0) { + s |= LS_RCV_DATA_RD; + debug(D_PORT,"READ away!"); + } + } + else { + if (cdsp->ids > 0) + s |= LS_RCV_DATA_RD; + if (cdsp->ods > 0) { + s &= ~LS_X_DATA_E; + if (cdsp->ods >= N_BYTES) + s &= ~LS_X_HOLD_E; + } + } debug(D_PORT, "get_status: %x\n", (unsigned)s); return s; } @@ -238,7 +262,7 @@ } static void -com_async(int fd __unused, int cond, void *arg, regcontext_t *REGS __unused) +com_async(int fd, int cond, void *arg, regcontext_t *REGS) { struct com_data_struct *cdsp = (struct com_data_struct*) arg; @@ -257,7 +281,7 @@ struct com_data_struct *cdsp; int i; - debug(D_PORT, "int14: dl = 0x%02X, al = 0x%02X.\n", R_DL, R_AL); + debug(D_PORT, "int14: dl = 0x%02X, ah= 0x%02X, al = 0x%02X.\n", R_DL, R_AH, R_AL); if (R_DL >= N_COMS_MAX) { if (vflag) dump_regs(REGS); @@ -267,9 +291,17 @@ switch (R_AH) { case 0x00: /* Initialize Serial Port */ - com_set_line(cdsp, R_DL + 1, R_AL); - R_AH = get_status(cdsp); - R_AL = 0; + if (doormode) { + R_AH=0x19; + R_AL=0x54; + R_BL=0x10; + R_BH=5; + } + else { + com_set_line(cdsp, R_DL + 1, R_AL); + R_AH = get_status(cdsp); + R_AL = 0; + } break; case 0x01: /* Write Character */ @@ -295,8 +327,9 @@ break; case 0x03: /* Status Request */ + cdsp->fd=STDIN_FILENO; R_AH = get_status(cdsp); - R_AL = 0; + R_AL = 128; break; case 0x04: /* Extended Initialization */ @@ -318,6 +351,19 @@ break; } break; + case 0x08: /* Flush output buffer */ + flush_out(cdsp); + break; + case 0x09: /* Purge output buffer */ + if (doormode) { + fpurge(stdout); + } + break; + case 0x0a: /* Flush output buffer */ + if (doormode) { + fpurge(stdin); + } + break; default: unknown_int2(0x14, R_AH, REGS); break; @@ -353,7 +399,7 @@ port, cdsp->path); return; } - + cdsp->ids = cdsp->ods = cdsp->emptyint = 0; cdsp->int_enable = 0; cdsp->fifo_ctrl = 0; @@ -384,7 +430,7 @@ } else { cdsp->tty.c_cflag &= ~CSTOPB; cdsp->line_ctrl &= ~LC_STOP_B; - } + } switch (param & PARITY_EVEN) { case PARITY_ODD: cdsp->tty.c_cflag |= (PARENB | PARODD); @@ -448,7 +494,7 @@ ret_val = cfsetospeed(&cdsp->tty, speed); debug(D_PORT, "com_set_line: cfsetospeed returned 0x%X.\n", ret_val); errno = 0; - ret_val = tcsetattr(cdsp->fd, 0, &cdsp->tty); + ret_val = tcsetattr(cdsp->fd, 0, &cdsp->tty); /* Causes an xterm to close */ debug(D_PORT, "com_set_line: tcsetattr returned 0x%X (%s).\n", ret_val, ret_val == -1 ? strerror(errno) : ""); errno = 0; diff -u /usr/ports/emulators/doscmd/work/doscmd-20040330/tty.c doscmd.bbs/tty.c --- /usr/ports/emulators/doscmd/work/doscmd-20040330/tty.c Mon Mar 29 16:00:00 2004 +++ doscmd.bbs/tty.c Mon Sep 23 21:42:32 2002 @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: projects/doscmd/tty.c,v 1.25 2002/04/12 21:18:05 charnier Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/doscmd/tty.c,v 1.8.2.2 2002/04/25 11:04:51 tg Exp $"); #include #include @@ -124,22 +124,21 @@ #define row (CursRow0) #define col (CursCol0) +#define BIOSrow (BIOS_CursRow0) +#define BIOScol (BIOS_CursCol0) + /* Local functions */ static void _kbd_event(int, int, void *, regcontext_t *); static void Failure(void *); static void SetVREGCur(void); -#ifndef NO_X static void debug_event(int, int, void *, regcontext_t *); -#endif static unsigned char inb_port60(int); static int inrange(int, int, int); -#ifndef NO_X static void kbd_event(int, int, void *, regcontext_t *); static u_short read_raw_kbd(int, u_short *); static void setgc(u_short); static void video_async_event(int, int, void *, regcontext_t *); -#endif #ifndef NO_X static void dac2rgb(XColor *, int); @@ -197,8 +196,8 @@ #define K4_SLOCK_LED 0x01 #define K4_NLOCK_LED 0x02 #define K4_CLOCK_LED 0x04 -#define K4_ACK 0x10 /* ACK received from keyboard */ -#define K4_RESEND 0x20 /* RESEND received from keyboard */ +#define K4_ACK 0x10 /* ACK recieved from keyboard */ +#define K4_RESEND 0x20 /* RESEND recieved from keyboard */ #define K4_LED 0x40 /* LED update in progress */ #define K4_ERROR 0x80 @@ -329,7 +328,7 @@ } void -video_setborder(int color __unused) +video_setborder(int color) { #ifndef NO_X XSetWindowBackground(dpy, win, pixels[color & 0xf]); @@ -341,10 +340,10 @@ blink = mode; } -#ifndef NO_X static void setgc(u_short attr) { +#ifndef NO_X XGCValues v; if (blink && !show && (attr & 0x8000)) v.foreground = pixels[(attr >> 12) & 0x07]; @@ -353,8 +352,8 @@ v.background = pixels[(attr >> 12) & (blink ? 0x07 : 0x0f)]; XChangeGC(dpy, gc, GCForeground|GCBackground, &v); -} #endif +} void video_update(regcontext_t *REGS __unused) @@ -535,6 +534,7 @@ return; } +#endif static u_short Ascii2Scan[] = { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, @@ -554,7 +554,6 @@ 0x0019, 0x0010, 0x0013, 0x001f, 0x0014, 0x0016, 0x002f, 0x0011, 0x002d, 0x0015, 0x002c, 0x011a, 0x012b, 0x011b, 0x0129, 0xffff, }; -#endif struct { u_short base; @@ -653,9 +652,8 @@ { 0x8600, 0x5888, 0x8a00, 0x8c00 }, /* key 88 - F12 */ }; -#ifndef NO_X void -debug_event(int fd __unused, int cond, void *arg __unused, regcontext_t *REGS) +debug_event(int fd, int cond, void *arg, regcontext_t *REGS) { static char ibuf[1024]; static int icnt = 0; @@ -667,8 +665,8 @@ if (!(cond & AS_RD)) return; - - r = read(STDIN_FILENO, ibuf + icnt, sizeof(ibuf) - icnt); + if(!doormode) + r = read(STDIN_FILENO, ibuf + icnt, sizeof(ibuf) - icnt); if (r <= 0) return; @@ -773,7 +771,6 @@ ibuf[icnt] = 0; } } -#endif unsigned char inb_port60(int port __unused) @@ -784,9 +781,8 @@ return(r); } -#ifndef NO_X void -kbd_event(int fd, int cond, void *arg __unused, regcontext_t *REGS __unused) +kbd_event(int fd, int cond, void *arg, regcontext_t *REGS) { if (!(cond & AS_RD)) return; @@ -797,7 +793,6 @@ if ((break_code = read_raw_kbd(fd, &scan_code)) != 0xffff) hardint(0x01); } -#endif void int09(REGISTERS __unused) @@ -815,7 +810,6 @@ send_eoi(); } -#ifndef NO_X u_short read_raw_kbd(int fd, u_short *code) { @@ -987,12 +981,11 @@ return(0xffff); } } -#endif -#ifndef NO_X void -video_async_event(int fd, int cond, void *arg __unused, regcontext_t *REGS __unused) +video_async_event(int fd, int cond, void *arg, regcontext_t *REGS) { +#ifndef NO_X int int9 = 0; if (!(cond & AS_RD)) @@ -1042,8 +1035,8 @@ break; } } -} #endif +} #ifndef NO_X static int @@ -1427,7 +1420,9 @@ tty_move(int r, int c) { row = r; + BIOSrow=r; col = c; + BIOScol=c; SetVREGCur(); } @@ -1449,10 +1444,13 @@ { int i; - if (row > (height - 1)) + if (row > (height - 1)) { row = 0; + BIOSrow=0; + } else if (++row >= height) { row = height - 1; + BIOSrow = height = 1; if (scroll) { memcpy(vmem, &vmem[width], 2 * width * (height - 1)); for (i = 0; i < width; ++i) @@ -1494,16 +1492,21 @@ vmem[row * width + col] &= 0xff00; break; case '\t': - if (row > (height - 1)) + if (row > (height - 1)) { row = 0; + BIOSrow = 0; + } col = (col + 8) & ~0x07; + BIOScol = col; if (col > width) { col = 0; + BIOScol = 0; tty_index(1); } break; case '\r': col = 0; + BIOScol = 0; break; case '\n': tty_index(1); @@ -1511,10 +1514,13 @@ default: if (col >= width) { col = 0; + BIOScol = 0; tty_index(1); } - if (row > (height - 1)) + if (row > (height - 1)) { row = 0; + BIOSrow = 0; + } if (attr >= 0) vmem[row * width + col] = attr & 0xff00; else @@ -1543,10 +1549,13 @@ while (n--) { if (col >= width) { col = 0; + BIOScol = 0; tty_index(0); } - if (row > (height - 1)) + if (row > (height - 1)) { row = 0; + BIOSrow = 0; + } if (attr >= 0) vmem[row * width + col] = attr & 0xff00; else @@ -1554,7 +1563,9 @@ vmem[row * width + col++] |= c; } row = srow; + BIOSrow = srow; col = scol; + BIOScol = scol; SetVREGCur(); } @@ -1574,15 +1585,20 @@ while (n--) { if (col >= wd) { col = 0; + BIOScol = 0; /* tty_index(0); *//* scroll up if last line is filled */ } - if (row > (ht - 1)) + if (row > (ht - 1)) { row = 0; + BIOSrow = 0; + } putchar_graphics(row * wd * CharHeight + col, c, attr); col++; } row = srow; + BIOSrow = 0; col = scol; + BIOScol = scol; SetVREGCur(); return; @@ -1641,6 +1657,8 @@ { int r; + if(doormode) + return(0); if ((r = nextchar) != 0) { nextchar = 0; return(r & 0xff); @@ -1648,7 +1666,7 @@ if ((flag & TTYF_REDIRECT) && redirect0) { char c; - if (read(STDIN_FILENO, &c, 1) != 1) + if (! doormode && read(STDIN_FILENO, &c, 1) != 1) return(-1); if (c == '\n') c = '\r'; @@ -2041,7 +2059,8 @@ font = XLoadQueryFont(dpy, FONTVGA); if (font == NULL) - err(1, "Could not open font ``%s''\n", xfont); +// err(1, "Could not open font ``%s''\n", xfont); + font = XLoadQueryFont(dpy, "fixed"); gcv.font = font->fid; XChangeGC(dpy, gc, GCFont, &gcv); --------------020307060208060909030708--