diff -urN dosemu-0.66.5/ChangeLog dosemu-0.66.6/ChangeLog --- dosemu-0.66.5/ChangeLog Fri May 30 20:08:20 1997 +++ dosemu-0.66.6/ChangeLog Sun Jun 15 16:27:06 1997 @@ -1,3 +1,40 @@ +97/06/11 ver. 0.66.6 released + From Steffen + - fix for mitshm autodetect (src/env/video/X.c) + From Michael Guennewig + - fixing invalid disk-geometry-information for drives tracks > 256 + - fixing invalid hdimage's for images with more than 65535 sectors or + (>=32MB) in mkfatimage16.c + From Michael Harnois + - some more work to make DOSEMU compile under glibc + From Eric + - fix for the (infamous) have-to-type-ESC-twice bug in the new kbd, + as it turned out, we forgot switch stdin into O_NONBLOCK mode. + (many kudos to Eric;-) + From Hans + - make target 'bindist', so I'll never forget the right params for + mkbindist (especially /usr/doc/dosemu ;-) + - further enhancements to mkfatimage16.c (in addition to Michael's) + It turned out, that the hdimage was too inflexible for bigger + sizes and made a lot of trouble. + - new option -k: give size of hdimage in Kbytes. This adapts + the geometrie automatically to what is needed for the size. + ( heads, sectors_per_track are adjusted ) + - new option -f: give the filename of the hdimage instead of + writing all to stdout. + - new option -p: when option -f also is given, pad the hdimage + with zero up to the exact filesize. This is required for + mtools-3.6 and when mounting the hdimage via /dev/lo. + The actual disk usage will be lower, because padding is realized + by makeing a big hole at the end. + - updated the man page + - fix for IPX (gnats bug report files/46 from kees@schoen.nl) + setsockopt(sock, SOL_SOCKET, IPX_TYPE, ...) wrongly using + SOL_SOCKET instead of SOL_IPX in src/dosext/net/net/ipx.c + - fixed mkdexe so it can cope with DOSAPP not beeing an absolute path + - fixed INT15-AH=4F not spawning a hooked TSR (src/base/bios/bios.S, + src/include/macros86.h). + This bug was reported by Ulrich Weigand 97/05/30 ver. 0.66.5 released From Michael an Reinhard Karcher - fix for wrongly placed leave_priv_setting() in ipxglt.c diff -urN dosemu-0.66.5/Makefile.in dosemu-0.66.6/Makefile.in --- dosemu-0.66.5/Makefile.in Sat May 10 20:21:40 1997 +++ dosemu-0.66.6/Makefile.in Wed Jun 11 22:19:10 1997 @@ -6,6 +6,8 @@ export do_DEBUG=no @SET_MAKE@ +PACKETNAME=@PACKETNAME@ +REALTOPDIR=@REALTOPDIR@ default install clean realclean echo help depend: @$(MAKE) -C src $@ @@ -28,6 +30,11 @@ mididclean: @$(MAKE) -C src/arch/linux/dosext/sound/midid cleanall +bindist: + rm -rf /tmp/$(PACKETNAME)-bin + ./src/tools/mkbindist -m -s -t /tmp/$(PACKETNAME)-bin -d usr/doc/dosemu -- --host=i386-unknown-linux + (cd /tmp/$(PACKETNAME)-bin; tar -cf- . | gzip -9 > /tmp/$(PACKETNAME)-bin.tgz) + pristine: docsclean mididclean @$(MAKE) -C src $@ rm -f config.cache config.status config.log src/include/config.h @@ -41,4 +48,5 @@ rm -f core `find . -name '*[\.]rej'` rm -f core gen*.log `find . -size 0` (cd setup/demudialog; make clean) + rm -rf ./bindist rm -f Makefile diff -urN dosemu-0.66.5/configure dosemu-0.66.6/configure --- dosemu-0.66.5/configure Fri May 30 20:34:55 1997 +++ dosemu-0.66.6/configure Wed Jun 11 22:01:02 1997 @@ -3258,10 +3258,12 @@ REALTOPDIR=`nolinks=1; pwd` VERSION="0" SUBLEVEL="66" -PATCHLEVEL="5.0" +PATCHLEVEL="6.0" THISVERSION="$VERSION.$SUBLEVEL.$PATCHLEVEL" EMUVER="VERSION.$SUBLEVEL" RELEASE_DATE=`head -n1 $REALTOPDIR/ChangeLog | cut '-d ' -f1` +PACKETNAME="dosemu-$VERSION.$SUBLEVEL.${PATCHLEVEL%.0}" + cat >> confdefs.h < $APP_HDIMAGE - -# padding with zero, because mtools currently can't expand the disk -PADDINGSIZE="$(( ($MINTRACKS * $CYLINDERSIZE ) - `fsize $APP_HDIMAGE` ))" -dd if=/dev/zero bs=1024 count=$PADDINGSIZE 2>/dev/null |cat >> $APP_HDIMAGE +$MKFAT -b ${DOSPART}/$BOOTSEC -k $MINSIZE $PADDING_OPT -f $APP_HDIMAGE \ + ${DOSPART}/${IOSYS} ${DOSPART}/${MSDOS} ${_COMCOM} $EXITEMU # now we copy the whole application tree onto it, # we use a modified version of mtools 'xcopy' script for that diff -urN dosemu-0.66.5/doc/announce dosemu-0.66.6/doc/announce --- dosemu-0.66.5/doc/announce Fri May 30 22:32:20 1997 +++ dosemu-0.66.6/doc/announce Sun Jun 15 16:29:01 1997 @@ -1,7 +1,7 @@ ANNOUNCEMENT ~~~~~~~~~~~~ -The DOSEMU team is proud to announce DOSEMU 0.66.5, the PC Emulator for +The DOSEMU team is proud to announce DOSEMU 0.66.6, the PC Emulator for x86 based *nix. Please remember to consider this as ALPHA software. @@ -78,8 +78,8 @@ tsx-11.mit.edu:/pub/linux/ALPHA/dosemu/... ftp.suse.com:/pub/dosemu/... - .../dosemu-0.66.5-bin.tgz - .../dosemu-0.66.5.tgz + .../dosemu-0.66.6-bin.tgz + .../dosemu-0.66.6.tgz The binary distribution is statically linked against libc-5.4.23 and libX* from XFree-3.3. It should run on all current Linux distributions. diff -urN dosemu-0.66.5/doc/dosemu.lsm dosemu-0.66.6/doc/dosemu.lsm --- dosemu-0.66.5/doc/dosemu.lsm Mon May 19 03:27:00 1997 +++ dosemu-0.66.6/doc/dosemu.lsm Sun Jun 15 16:31:05 1997 @@ -1,7 +1,7 @@ Begin3 Title: DOSEMU PC Emulator -Version: 0.66.5 +Version: 0.66.6 Description: This is a DOS emulation package with support for console, terminal and X-windows. Includes DPMI emulation to run some @@ -15,9 +15,9 @@ Maintained-by: linux-msdos@vger.rutgers.edu (The DOSEMU team) -Primary-site: tsx-11.mit.edu /pub/linux/ALPHA/dosemu/dosemu-0.66.5.tgz +Primary-site: tsx-11.mit.edu /pub/linux/ALPHA/dosemu/dosemu-0.66.6.tgz -Alternate-site: ftp.suse.com /pub/dosemu/dosemu-0.66.5.tgz +Alternate-site: ftp.suse.com /pub/dosemu/dosemu-0.66.6.tgz Platform: Linux 2.0.28+ IPC required, IPX optional. ELF. diff -urN dosemu-0.66.5/man/dos.1 dosemu-0.66.6/man/dos.1 --- dosemu-0.66.5/man/dos.1 Tue May 13 00:02:28 1997 +++ dosemu-0.66.6/man/dos.1 Sun Jun 15 16:32:21 1997 @@ -1,5 +1,5 @@ .\" -*- nroff -*- (This is for Emacs) -.TH DOS 1 "May 12, 1997" "Version ALPHA 0.66.5" "MS-DOS Emulation" +.TH DOS 1 "June 15, 1997" "Version ALPHA 0.66.6" "MS-DOS Emulation" .SH NAME dos, xdos, dosexec, dosdebug \- run MS-DOS and MS-DOS programs under Linux .SH SYNOPSIS diff -urN dosemu-0.66.5/man/mkfatimage16.1 dosemu-0.66.6/man/mkfatimage16.1 --- dosemu-0.66.5/man/mkfatimage16.1 Sat May 17 20:20:26 1997 +++ dosemu-0.66.6/man/mkfatimage16.1 Sat Jun 14 22:48:51 1997 @@ -1,5 +1,5 @@ .\" -*- nroff -*- (This is for Emacs) -.TH MKFATIMAGE16 1 "May 17, 1997" "Version ALPHA 0.66.5" "Make HDIMAGE for DOSEMU" +.TH MKFATIMAGE16 1 "June 14, 1997" "Version ALPHA 0.66.6" "Make HDIMAGE for DOSEMU" .SH NAME mkfatimage16 \- generate a virtual drive image suitable for DOSEMU .SH SYNOPSIS @@ -7,30 +7,51 @@ [ .B \-b bsectfile ] -[ +[{ .B \-t tracks -] +| +.B \-k Kbytes +}] [ .B \-l volume-label ] [ +.B \-f outfile +] +[ +.B \-p +] +[ .B file... ] .SH DESCRIPTION -.B mkfatimage +.B mkfatimage16 creates a hdimage file for .BR DOSEMU that is pre-loaded with the files specified on the command line. -The output is written to +The output is either written to .I stdout -, hence do not forget to append " > hdimagefile", else you will see garbage -on the screen. -This file then can be used as a virtual drive, when defined in +( hence do not forget to append " > hdimagefile", else you will see garbage +on the screen ) or to the file specified by the +.B \-f +option. For the later you may also use option +.B \-p +in order to force padding up to the given size. This padding will result +in socalled holes on an ext2-FS, hence the actual diskusage will not be +greater. +The file created by mkfatimage16 then can be used as a virtual drive, when defined in .I /etc/dosemu.conf. -The number of heads is always 4 and you have 17 sectors per head. -To vary the size, you may use the +As long as +.B \-k +is not given, the number of heads is always 4 and you have 17 sectors per head +else it is adjusted accordingly. +To vary the size, you may either use the .B \-t -option. All files given behind the options will be copied onto the +option or specify the total amount of Kbytes via +.B \-k +option. + +All files given behind the options will be copied onto the hdimage. In addition a .BR DOSEMU suitable masterboot record (MBR) is established and via option @@ -58,12 +79,37 @@ .I \-t num Make the virtual disk have .I num -tracks. This is the only way to define the size of the disk. +tracks. This is the one way to define the size of the disk. +.TP +.I \-k Kbytes +Make the virtual disk be +.I Kbytes +in size. Using +.I \-t +and +.I \-k +are mutual exclusive. .TP .I \-l label insert .I label as volume label for the disk. +.TP +.I \-f outfile +The hdimage is written to +.I outfile +instead of +.I stdout +.TP +.I \-p +Pad the hdimage with zero up to the total size given by +.I \-t +or +.I \-k +( only in conjunction with +.I \-f +). + .SH AUTHOR diff -urN dosemu-0.66.5/src/arch/linux/async/signal.c dosemu-0.66.6/src/arch/linux/async/signal.c --- dosemu-0.66.5/src/arch/linux/async/signal.c Fri Apr 11 16:59:03 1997 +++ dosemu-0.66.6/src/arch/linux/async/signal.c Sun Jun 15 00:57:27 1997 @@ -5,7 +5,7 @@ #include #include #include - +#include #ifdef __linux__ #include #endif diff -urN dosemu-0.66.5/src/base/bios/bios.S dosemu-0.66.6/src/base/bios/bios.S --- dosemu-0.66.5/src/base/bios/bios.S Mon May 5 22:49:53 1997 +++ dosemu-0.66.6/src/base/bios/bios.S Sun Jun 15 15:45:52 1997 @@ -876,7 +876,19 @@ #endif mov ah,#0x4f stc +#if 1 + /* int 15 func 4f as per bios spec. + * We need however a _simulated_ INT else a DOS-space + * hooked INT15 would not be called, + * because _we_ intercept it in src/base/async/int.c + * As we currently don't do anything important with INT15-AH=4f, + * this doesn't make problems. + * -- Hans, June 15 1997 + */ + SIM_INT(15,n_kbd_int15_return) +#else int #0x15 +#endif /* ignore the returned keycode, only skip the pre-translated bios keycode if CF=0. @@ -962,10 +974,23 @@ mov bx,#LASTSCAN_OFF mov ax,[bx] /* "read" keyboard controller */ + mov ah,#0x4f /* prepare for int 15 func 4f */ clc cmc +#if 1 + /* int 15 func 4f as per bios spec. + * We need however a _simulated_ INT else a DOS-space + * hooked INT15 would not be called, + * because _we_ intercept it in src/base/async/int.c. + * As we currently don't do anything important with INT15-AH=4f, + * this doesn't make problems. + * -- Hans, June 15 1997 + */ + SIM_INT(15,kbd_int15_return) +#else int 0x15 /* int 15 func 4f per bios spec */ +#endif mov ah,al /* move char to ah */ mov al,#6 /* dosemu helper func 6 */ diff -urN dosemu-0.66.5/src/base/dev/misc/timers.c dosemu-0.66.6/src/base/dev/misc/timers.c --- dosemu-0.66.5/src/base/dev/misc/timers.c Fri Apr 18 00:30:55 1997 +++ dosemu-0.66.6/src/base/dev/misc/timers.c Sun Jun 15 00:57:27 1997 @@ -25,8 +25,13 @@ * */ +#include #include +#if __GLIBC__ > 1 +#include +#else #include +#endif #include "config.h" #include "emu.h" #include "port.h" diff -urN dosemu-0.66.5/src/base/init/init.c dosemu-0.66.6/src/base/init/init.c --- dosemu-0.66.5/src/base/init/init.c Fri May 2 23:20:49 1997 +++ dosemu-0.66.6/src/base/init/init.c Sun Jun 15 00:57:27 1997 @@ -1,3 +1,4 @@ +#include #include #include #include @@ -12,9 +13,15 @@ #include #ifdef __linux__ +#if __GLIBC__ > 1 +#include +#define new_utsname utsname +#else #include #include -#endif +#endif /* __GLIBC__ */ +#endif /* __linux__ */ + #ifdef __NetBSD__ #include #define new_utsname utsname diff -urN dosemu-0.66.5/src/base/keyboard/keyboard-client.c dosemu-0.66.6/src/base/keyboard/keyboard-client.c --- dosemu-0.66.5/src/base/keyboard/keyboard-client.c Thu Mar 27 23:26:23 1997 +++ dosemu-0.66.6/src/base/keyboard/keyboard-client.c Sun Jun 15 00:57:27 1997 @@ -15,7 +15,7 @@ * * */ - +#include #include #include #include @@ -28,9 +28,12 @@ #define EDEADLOCK EDEADLK #endif #ifdef __linux__ +#if __GLIBC__ > 1 +#include +#include +#else #include #include -#ifndef __GLIBC__ #include #endif #endif diff -urN dosemu-0.66.5/src/base/keyboard/keyboard-server.c dosemu-0.66.6/src/base/keyboard/keyboard-server.c --- dosemu-0.66.5/src/base/keyboard/keyboard-server.c Fri Mar 14 22:58:25 1997 +++ dosemu-0.66.6/src/base/keyboard/keyboard-server.c Sun Jun 15 00:57:27 1997 @@ -14,18 +14,22 @@ * * */ - +#include #include #include #include #include -#ifdef __linux__ +#ifdef __linux__ +#if __GLIBC__ > 1 +#include +#include +#else #include #include -#if ! (__GLIBC__ > 1) #include #endif #endif + #include #include #ifdef __NetBSD__ diff -urN dosemu-0.66.5/src/base/keyboard/n_keyb_slang.c dosemu-0.66.6/src/base/keyboard/n_keyb_slang.c --- dosemu-0.66.5/src/base/keyboard/n_keyb_slang.c Wed Feb 19 01:44:09 1997 +++ dosemu-0.66.6/src/base/keyboard/n_keyb_slang.c Sun Jun 15 16:00:55 1997 @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -16,6 +17,7 @@ static Bit8u kbbuf[KBBUF_SIZE]; static Bit8u *kbp; +static int save_kbd_flags = -1; /* saved flags for STDIN before our fcntl */ static struct termios save_termios; static Bit8u erasekey; @@ -629,17 +631,6 @@ Keystr_Len = 0; KeyNot_Ready = 0; key = SLang_do_key(The_Normal_KeyMap, getkey_callback); -#if 0 /* LERMEN - * NOTE: The 'must-type-ESC-twice-thing' seems to happen here, - * After pressing the first ESC, SLang_do_key() doesn't return - * until the second key is pressed. - * This obviously has to do with the 'dead keys for accents' - * in the new keyboard code. - * ( don't know Slang enough to further trace this down ) - * -- Hans 970217 - */ - k_printf("KBD: back from SLang_do_key %d\n", KeyNot_Ready); -#endif SLang_Error = 0; if (KeyNot_Ready) { @@ -824,6 +815,8 @@ /* XXX - x2dos doesn't make sense with SLANG, does it? */ kbd_fd = STDIN_FILENO; + save_kbd_flags = fcntl(kbd_fd, F_GETFL); + fcntl(kbd_fd, F_SETFL, O_RDONLY | O_NONBLOCK); if (tcgetattr(kbd_fd, &save_termios) < 0) { error("ERROR: slang_keyb_init(): Couldn't tcgetattr(kbd_fd,...) !\n"); @@ -868,6 +861,9 @@ void slang_keyb_close(void) { if (tcsetattr(kbd_fd, TCSAFLUSH, &save_termios) == -1) { error("ERROR: slang_keyb_close(): failed to restore keyboard termios settings!\n"); + } + if (save_kbd_flags != -1) { + fcntl(kbd_fd, F_SETFL, save_kbd_flags); } } diff -urN dosemu-0.66.5/src/base/misc/disks.c dosemu-0.66.6/src/base/misc/disks.c --- dosemu-0.66.5/src/base/misc/disks.c Sun May 18 17:44:54 1997 +++ dosemu-0.66.6/src/base/misc/disks.c Wed Jun 11 22:53:50 1997 @@ -1153,7 +1153,7 @@ HI(cx) = (dp->tracks - 1) & 0xff; LO(dx) = (disk < 0x80) ? FDISKS : HDISKS; - LO(cx) = dp->sectors | ((dp->tracks & 0x300) >> 2); + LO(cx) = dp->sectors | (((dp->tracks -1) & 0x300) >> 2); LO(ax) = 0; HI(ax) = DERR_NOERR; REG(eflags) &= ~CF; /* no error */ diff -urN dosemu-0.66.5/src/base/misc/dosio.c dosemu-0.66.6/src/base/misc/dosio.c --- dosemu-0.66.5/src/base/misc/dosio.c Sat Apr 5 23:57:21 1997 +++ dosemu-0.66.6/src/base/misc/dosio.c Sun Jun 15 00:57:27 1997 @@ -11,7 +11,7 @@ gettimeofday(&tv,NULL);\ fprintf(stderr,"%c %06d:%06d\n",x,(int)tv.tv_sec,(int)tv.tv_usec);\ } - +#include #include #include #include @@ -20,8 +20,12 @@ #include #include #ifndef __NetBSD__ +#if __GLIBC__ > 1 +#include +#else #include #endif +#endif #include #include #include @@ -32,6 +36,10 @@ #include #include /* for mouse.h */ #ifdef __NetBSD__ +#include +#endif +#if __GLIBC__ > 1 +#include #include #else #define MAP_ANON MAP_ANONYMOUS diff -urN dosemu-0.66.5/src/base/misc/ioctl.c dosemu-0.66.6/src/base/misc/ioctl.c --- dosemu-0.66.5/src/base/misc/ioctl.c Fri Feb 14 22:51:28 1997 +++ dosemu-0.66.6/src/base/misc/ioctl.c Sun Jun 15 00:57:27 1997 @@ -2,7 +2,7 @@ #define EDEADLOCK EDEADLK #endif - +#include #include #include #include @@ -28,7 +28,12 @@ #include "netbsd_vm86.h" #endif #ifdef __linux__ +#include +#if __GLIBC__ > 1 +#include +#else #include +#endif #include #include #include diff -urN dosemu-0.66.5/src/base/serial/ser_init.c dosemu-0.66.6/src/base/serial/ser_init.c --- dosemu-0.66.5/src/base/serial/ser_init.c Sun May 25 22:45:44 1997 +++ dosemu-0.66.6/src/base/serial/ser_init.c Sun Jun 15 00:57:27 1997 @@ -24,7 +24,7 @@ * * DANG_END_MODULE */ - +#include #include #include #include @@ -37,7 +37,11 @@ #include #include #ifdef __linux__ +#ifndef __GLIBC__ #include +#else +#include +#endif #endif #include #ifdef __NetBSD__ diff -urN dosemu-0.66.5/src/dosext/dpmi/dpmi.c dosemu-0.66.6/src/dosext/dpmi/dpmi.c --- dosemu-0.66.5/src/dosext/dpmi/dpmi.c Mon May 12 22:05:43 1997 +++ dosemu-0.66.6/src/dosext/dpmi/dpmi.c Sun Jun 15 00:57:27 1997 @@ -17,6 +17,7 @@ #define DIRECT_DPMI_CONTEXT_SWITCH #endif +#include #include "config.h" #include "kversion.h" #include @@ -28,8 +29,12 @@ #include "vm86plus.h" #ifdef __linux__ +#ifndef __GLIBC__ #include #include +#else +#include +#endif #if KERNEL_VERSION < 2001000 #include #else diff -urN dosemu-0.66.5/src/dosext/net/net/ipx.c dosemu-0.66.6/src/dosext/net/net/ipx.c --- dosemu-0.66.5/src/dosext/net/net/ipx.c Fri May 2 23:20:50 1997 +++ dosemu-0.66.6/src/dosext/net/net/ipx.c Sun Jun 15 00:33:16 1997 @@ -456,7 +456,17 @@ } /* allow setting the type field in the IPX header */ opt = 1; +#if 0 /* this seems to be wrong: IPX_TYPE can only be set on level SOL_IPX */ if (setsockopt(sock, SOL_SOCKET, IPX_TYPE, &opt, sizeof(opt)) == -1) { +#else + /* the socket _is_ an IPX socket, hence it first passes ipx_setsockopt() + * in file linux/net/ipx/af_ipx.c. This one handles SOL_IPX itself and + * passes SOL_SOCKET-levels down to sock_setsockopt(). + * Hence I guess the below is correct (can somebody please verify this?) + * -- Hans, June 14 1997 + */ + if (setsockopt(sock, SOL_IPX, IPX_TYPE, &opt, sizeof(opt)) == -1) { +#endif leave_priv_setting(); /* I can't think of anything else to return */ n_printf("IPX: could not set socket option for type.\n"); diff -urN dosemu-0.66.5/src/dosext/net/net/ipxglt.c dosemu-0.66.6/src/dosext/net/net/ipxglt.c --- dosemu-0.66.5/src/dosext/net/net/ipxglt.c Thu May 29 23:14:38 1997 +++ dosemu-0.66.6/src/dosext/net/net/ipxglt.c Sun Jun 15 00:57:27 1997 @@ -8,7 +8,7 @@ #include "ipx.h" #ifdef IPX - +#include #include #include #include diff -urN dosemu-0.66.5/src/dosext/net/net/libpacket.c dosemu-0.66.6/src/dosext/net/net/libpacket.c --- dosemu-0.66.5/src/dosext/net/net/libpacket.c Thu Feb 27 23:07:11 1997 +++ dosemu-0.66.6/src/dosext/net/net/libpacket.c Sun Jun 15 00:57:27 1997 @@ -9,6 +9,7 @@ */ #include "kversion.h" +#include #include #include #include diff -urN dosemu-0.66.5/src/dosext/net/net/libpacket.c.multi dosemu-0.66.6/src/dosext/net/net/libpacket.c.multi --- dosemu-0.66.5/src/dosext/net/net/libpacket.c.multi Fri May 2 22:45:38 1997 +++ dosemu-0.66.6/src/dosext/net/net/libpacket.c.multi Mon Jun 16 00:13:19 1997 @@ -8,19 +8,30 @@ * (c) 1994 Alan Cox iiitac@pyr.swan.ac.uk GW4PTS@GB7SWN */ #include - +#include #include "kversion.h" #include #include #include #include +#include #include #include #include -#include -#include +#if __GLIBC__ > 1 + #include + #include +#else + #include + #include +#endif #include -#include +#if __GLIBC__ > 1 + #include + #include +#else + #include +#endif #include "emu.h" #include "libpacket.h" diff -urN dosemu-0.66.5/src/dosext/net/net/libpacket.c.single dosemu-0.66.6/src/dosext/net/net/libpacket.c.single --- dosemu-0.66.5/src/dosext/net/net/libpacket.c.single Thu Sep 26 13:10:58 1996 +++ dosemu-0.66.6/src/dosext/net/net/libpacket.c.single Mon Jun 16 00:15:32 1997 @@ -9,14 +9,21 @@ */ #include "kversion.h" +#include #include #include #include #include +#include #include #include -#include -#include +#if __GLIBC__ > 1 + #include + #include +#else + #include + #include +#endif #include #include "libpacket.h" diff -urN dosemu-0.66.5/src/dosext/net/net/pktnew.c dosemu-0.66.6/src/dosext/net/net/pktnew.c --- dosemu-0.66.5/src/dosext/net/net/pktnew.c Thu Mar 27 23:26:23 1997 +++ dosemu-0.66.6/src/dosext/net/net/pktnew.c Sun Jun 15 00:57:27 1997 @@ -16,6 +16,7 @@ * doing, though... */ +#include #include #include "pktdrvr.h" #include "emu.h" @@ -25,7 +26,11 @@ #include #include #include +#ifndef __GLIBC__ #include +#else +#include +#endif /* flag to activate use of pic by packet driver */ #if 0 #define PICPKT 1 diff -urN dosemu-0.66.5/src/dosext/net/net/pktnew.c.multi dosemu-0.66.6/src/dosext/net/net/pktnew.c.multi --- dosemu-0.66.5/src/dosext/net/net/pktnew.c.multi Thu Mar 27 19:47:45 1997 +++ dosemu-0.66.6/src/dosext/net/net/pktnew.c.multi Sun Jun 15 00:57:27 1997 @@ -15,7 +15,7 @@ * over this packet driver, unless you understand what you are * doing, though... */ - +#include #include "emu.h" #include "pktdrvr.h" #include "emu.h" @@ -25,7 +25,11 @@ #include #include #include +#if __GLIBC__ > 1 +#include +#else #include +#endif /* flag to activate use of pic by packet driver */ #if 0 #define PICPKT 1 diff -urN dosemu-0.66.5/src/dosext/net/net/pktnew.c.single dosemu-0.66.6/src/dosext/net/net/pktnew.c.single --- dosemu-0.66.5/src/dosext/net/net/pktnew.c.single Thu Sep 26 13:10:58 1996 +++ dosemu-0.66.6/src/dosext/net/net/pktnew.c.single Sun Jun 15 00:57:27 1997 @@ -15,7 +15,7 @@ * over this packet driver, unless you understand what you are * doing, though... */ - +#include #include "pktdrvr.h" #include "emu.h" #include "dosio.h" @@ -24,7 +24,11 @@ #include #include #include +#if __GLIBC__ > 1 +#include +#else #include +#endif /* flag to activate use of pic by packet driver */ #if 0 #define PICPKT 1 diff -urN dosemu-0.66.5/src/emu-i386/do_vm86.c dosemu-0.66.6/src/emu-i386/do_vm86.c --- dosemu-0.66.5/src/emu-i386/do_vm86.c Fri Mar 14 22:44:09 1997 +++ dosemu-0.66.6/src/emu-i386/do_vm86.c Sun Jun 15 00:57:27 1997 @@ -6,7 +6,7 @@ /* Define if we want graphics in X (of course we want :-) (root@zaphod) */ /* WARNING: This may not work in BSD, because it was written for Linux! */ - +#include #include #include #include @@ -39,7 +39,11 @@ #include "netbsd_vm86.h" #endif #ifdef __linux__ +#if __GLIBC__ > 1 +#include +#else #include +#endif #include #include #include diff -urN dosemu-0.66.5/src/emu.c dosemu-0.66.6/src/emu.c --- dosemu-0.66.5/src/emu.c Fri May 30 00:32:42 1997 +++ dosemu-0.66.6/src/emu.c Sun Jun 15 00:57:27 1997 @@ -52,6 +52,7 @@ __asm__("___START___: jmp _emulate\n"); #endif +#include #include #include #include @@ -79,10 +80,15 @@ #include "netbsd_vm86.h" #endif #ifdef __linux__ +#if __GLIBC__ > 1 +#include +#include +#else #include +#include +#endif #include #include -#include #include #include #endif diff -urN dosemu-0.66.5/src/env/video/X.c dosemu-0.66.6/src/env/video/X.c --- dosemu-0.66.5/src/env/video/X.c Fri Mar 14 22:44:09 1997 +++ dosemu-0.66.6/src/env/video/X.c Wed Jun 11 21:19:10 1997 @@ -79,6 +79,11 @@ * 1997/03/03: Added code to turn off MIT-SHM for network connections. * -- sw (Steffen.Winterfeldt@itp.uni-leipzig.de) * + * 1997/06/06: Fixed the code that was supposed to turn off MIT-SHM for + * network connections. Thanks to Leonid V. Kalmankin + * for finding the bug and testing the fix. + * -- sw (Steffen.Winterfeldt@itp.uni-leipzig.de) + * * DANG_END_CHANGELOG */ @@ -189,6 +194,7 @@ #ifdef HAVE_MITSHM /* keep this global -- sw */ int (*OldXErrorHandler)(Display *, XErrorEvent *) = NULL; +int shm_error_base = 0; int shm_failed = 0; #endif @@ -884,7 +890,7 @@ #ifdef HAVE_MITSHM int NewXErrorHandler(Display *dsp, XErrorEvent *xev) { - if(xev->request_code == 129) { + if(xev->request_code == shm_error_base + 1) { X_printf("X::NewXErrorHandler: error using shared memory\n"); shm_failed++; } @@ -893,6 +899,32 @@ } return 0; } + +void X_shm_init() +{ + int major_opcode, event_base, major_version, minor_version; + Bool shared_pixmaps; + + shm_failed = 1; + + if(!config.X_mitshm) return; + + if(!XQueryExtension(display, "MIT-SHM", &major_opcode, &event_base, &shm_error_base)) { + X_printf("X: server does not support MIT-SHM\n"); + return; + } + + X_printf("X: MIT-SHM ErrorBase: %d\n", shm_error_base); + + if(!XShmQueryVersion(display, &major_version, &minor_version, &shared_pixmaps)) { + X_printf("X: XShmQueryVersion() failed\n"); + return; + } + + X_printf("X: using MIT-SHM\n"); + + shm_failed = 0; +} #endif @@ -932,6 +964,11 @@ screen=DefaultScreen(display); rootwindow=RootWindow(display,screen); + +#ifdef HAVE_MITSHM + X_shm_init(); +#endif + get_vga_colors(); get_vga256_colors(); diff -urN dosemu-0.66.5/src/env/video/vc.c dosemu-0.66.6/src/env/video/vc.c --- dosemu-0.66.5/src/env/video/vc.c Fri May 2 23:20:50 1997 +++ dosemu-0.66.6/src/env/video/vc.c Sun Jun 15 00:57:27 1997 @@ -19,7 +19,7 @@ * */ - +#include #include #include #include @@ -34,17 +34,26 @@ #include #endif #ifdef __linux__ +#ifndef __GLIBC__ #define MAP_ANON MAP_ANONYMOUS extern caddr_t mmap __P ((caddr_t __addr, size_t __len, int __prot, int __flags, int __fd, off_t __off)); extern int munmap __P ((caddr_t __addr, size_t __len)); #include +#else +#include +#endif #endif #include #include #ifdef __linux__ +#if __GLIBC__ > 1 +#include +#include +#else #include #include +#endif #endif #ifdef __NetBSD__ #include diff -urN dosemu-0.66.5/src/env/video/vesa.c dosemu-0.66.6/src/env/video/vesa.c --- dosemu-0.66.5/src/env/video/vesa.c Mon May 20 10:23:46 1996 +++ dosemu-0.66.6/src/env/video/vesa.c Sun Jun 15 00:57:27 1997 @@ -60,7 +60,10 @@ /* **************** Include files **************** */ - +#include +#if __GLIBC__ > 1 +#include +#endif #include #include "cpu.h" /* root@sjoerd: for context structure */ diff -urN dosemu-0.66.5/src/env/video/vgaemu.c dosemu-0.66.6/src/env/video/vgaemu.c --- dosemu-0.66.5/src/env/video/vgaemu.c Sun Apr 6 00:45:28 1997 +++ dosemu-0.66.6/src/env/video/vgaemu.c Sun Jun 15 00:57:27 1997 @@ -87,6 +87,10 @@ /* **************** include files **************** */ +#include +#if __GLIBC__ > 1 +#include +#endif #include /* root@sjoerd*/ #include #include diff -urN dosemu-0.66.5/src/include/emu.h dosemu-0.66.6/src/include/emu.h --- dosemu-0.66.5/src/include/emu.h Sun May 25 22:34:10 1997 +++ dosemu-0.66.6/src/include/emu.h Sun Jun 15 00:57:27 1997 @@ -6,8 +6,12 @@ #ifndef EMU_H #define EMU_H +#include #include #include +#if __GLIBC__ > 1 +#include +#endif #include "config.h" #include "types.h" #include "extern.h" diff -urN dosemu-0.66.5/src/include/iodev.h dosemu-0.66.6/src/include/iodev.h --- dosemu-0.66.5/src/include/iodev.h Fri Mar 14 23:10:26 1997 +++ dosemu-0.66.6/src/include/iodev.h Sun Jun 15 00:57:27 1997 @@ -1,6 +1,7 @@ #ifndef _EMU_IODEV_H #define _EMU_IODEV_H +#include #if __GLIBC__ > 1 #include #else diff -urN dosemu-0.66.5/src/include/linux/vm86.h dosemu-0.66.6/src/include/linux/vm86.h --- dosemu-0.66.5/src/include/linux/vm86.h Tue Jan 21 00:12:08 1997 +++ dosemu-0.66.6/src/include/linux/vm86.h Sun Jun 15 00:57:27 1997 @@ -5,4 +5,8 @@ * will be existing _and_ have ZERO size ! * In this case DELETE . */ +#include +#if __GLIBC__ > 1 +#include +#else #include diff -urN dosemu-0.66.5/src/include/macros86.h dosemu-0.66.6/src/include/macros86.h --- dosemu-0.66.5/src/include/macros86.h Sat Nov 4 18:46:47 1995 +++ dosemu-0.66.6/src/include/macros86.h Sun Jun 15 15:18:04 1997 @@ -1,6 +1,18 @@ #ifndef __MACROS86_H_ #define __MACROS86_H_ +#define SIM_INT(n,rtnlabel) \ + push ds !!!\ + push #0 !!!\ + pop ds !!!\ + pushf !!!\ + push cs !!!\ + push #rtnlabel !!!\ + push word ptr [(4*n)+2] !!!\ + push word ptr [(4*n)] !!!\ + retf !!!\ + rtnlabel: pop ds + #define FILL_BYTE(x,v) .REPT x db v!!!.ENDR #define FILL_DWORD(x,v) .REPT x dd v!!!.ENDR #define FILL_WORD(x,v) .REPT x dw v!!!.ENDR diff -urN dosemu-0.66.5/src/tools/mkbindist dosemu-0.66.6/src/tools/mkbindist --- dosemu-0.66.5/src/tools/mkbindist Fri May 30 21:02:25 1997 +++ dosemu-0.66.6/src/tools/mkbindist Sat Jun 14 23:18:15 1997 @@ -146,9 +146,9 @@ cat > doinstall.sh <hdimage.test ) +( cd /var/lib/dosemu; mkfatimage16 -b dosC/boot.bin -p -f hdimage.test \ + -l DOSEMU dosC/ipl.sys dosC/kernel.exe dosC/command.com \ + commands/* ) EOF popd >/dev/null diff -urN dosemu-0.66.5/src/tools/periph/mkfatimage16.c dosemu-0.66.6/src/tools/periph/mkfatimage16.c --- dosemu-0.66.5/src/tools/periph/mkfatimage16.c Fri May 30 01:44:42 1997 +++ dosemu-0.66.6/src/tools/periph/mkfatimage16.c Sun Jun 15 00:57:27 1997 @@ -19,24 +19,30 @@ * - There's no real boot sector code, just "dosemu exit" call. * */ - +#include #include #include #include +#include #include #include #include #include - +#if __GLIBC__ > 1 +#include +#endif /* These can be changed -- at least in theory. In practise, it doesn't * seem to work very well (I don't know why). */ #define SECTORS_PER_TRACK 17 #define HEADS 4 +long sectors_per_track = SECTORS_PER_TRACK; +long heads = HEADS; long tracks = 36; long clusters; long sectors_per_fat; +long total_file_size = 0; long p_starting_head = 1; long p_starting_track = 0; long p_starting_sector = 1; @@ -44,6 +50,7 @@ long p_ending_head = HEADS-1; long p_ending_track; long p_ending_sector = SECTORS_PER_TRACK; + /* Track 0, head 0 is reserved. */ /* Minus 1 for head 0, track 0 (partition table plus empty space). */ long p_sectors; @@ -61,11 +68,13 @@ #define P_TYPE_12BIT 0x01 /* File system: 16-bit FAT */ #define P_TYPE_16BIT 0x04 +/* File system: 16-bit FAT and sectors > 65535 */ +#define P_TYPE_32MB 0x06 #define BYTES_PER_SECTOR 512 #define MEDIA_DESCRIPTOR 0xf8 #define FAT_COPIES 2 #define RESERVED_SECTORS 1 -#define HIDDEN_SECTORS SECTORS_PER_TRACK +#define HIDDEN_SECTORS sectors_per_track #define SECTORS_PER_ROOT_DIRECTORY ((ROOT_DIRECTORY_ENTRIES*32)/BYTES_PER_SECTOR) @@ -79,6 +88,7 @@ int size_in_clusters; }; +static FILE *outfile = stdout; static char *bootsect_file=0; static struct input_file input_files[ROOT_DIRECTORY_ENTRIES]; static int input_file_count = 0; @@ -109,7 +119,23 @@ /* Write the sector buffer to disc. */ static void write_buffer(void) { - fwrite(buffer, 1, BYTES_PER_SECTOR, stdout); + fwrite(buffer, 1, BYTES_PER_SECTOR, outfile); +} + +static void close_exit(int errcode) +{ + if (outfile != stdout) { + if (total_file_size) { + /* we need padding, + * but doing it this way it will make holes on an ext2-fs, + * hence the _actual_ disk usage will not be greater. + */ + fseek(outfile, total_file_size-1, SEEK_SET); + fwrite("",1,1,outfile); + } + fclose(outfile); + } + exit(errcode); } /* Set a FAT entry 'n' to value 'data'. */ @@ -126,12 +152,12 @@ fat[(n/2)*3] = value & 0xff; fat[(n/2)*3+1] = (fat[n/2*3+1] & ~0x0f) | ((value >> 8) & 0x0f); } - } else if (p_type == P_TYPE_16BIT) { + } else if ((p_type == P_TYPE_16BIT) || (p_type == P_TYPE_32MB)) { fat[2*n] = value & 0xff; fat[2*n+1] = value >> 8; } else { fprintf(stderr, "Error: FAT type %ld unknown\n", p_type); - exit(1); + close_exit(1); } } @@ -221,21 +247,25 @@ static void usage(void) { - fprintf(stderr, "Usage: mkfatimage [-b bsectfile] [-t tracks] [-l volume-label] [file...]\n"); + fprintf(stderr, + "Usage:\n" + " mkfatimage [-b bsectfile] [{-t tracks | -k Kbytes}]\n" + " [-l volume-label] [-f outfile] [-p ] [file...]\n"); + close_exit(1); } int main(int argc, char *argv[]) { int n, m; + int kbytes = -1; /* Parse command line. */ if ((argc <= 1) && isatty(STDOUT_FILENO)) { usage(); - exit(1); } - while ((n = getopt(argc, argv, "b:l:t:")) != EOF) + while ((n = getopt(argc, argv, "b:l:t:k:f:p")) != EOF) { switch (n) { @@ -250,21 +280,75 @@ volume_label[11] = '\0'; break; case 't': + if (kbytes >= 0) usage(); + kbytes =0; tracks = atoi(optarg); if (tracks <= 0) { fprintf(stderr, "Error: %ld tracks specified - must be positive \n", tracks); - exit(1); + close_exit(1); + } + if (tracks > 1024) { + fprintf(stderr, "Error: %ld tracks specified - must <= 1024 \n", tracks); + close_exit(1); } break; - + case 'k': + if (kbytes != -1) usage(); + kbytes = strtol(optarg, 0,0) *2; /* needed total number of sectors */ + if (kbytes < (SECTORS_PER_TRACK * HEADS *2)) { + fprintf(stderr, "Error: %d Kbyte specified, must be a reasonable size\n", kbytes); + close_exit(1); + } + tracks = (kbytes + (sectors_per_track * heads) -1) / (sectors_per_track * heads); + if (tracks > 1024) { + heads *= 2; + tracks /= 2; + if (tracks > 1024) { + sectors_per_track = 63; + heads = 15; + tracks = (kbytes + (sectors_per_track * heads) -1) / (sectors_per_track * heads); + if (tracks > 1024) { + fprintf(stderr, "Error: %d Kbyte specified, to big\n", kbytes); + close_exit(1); + } + } + } + p_ending_head = heads-1; + p_starting_absolute_sector = sectors_per_track; + p_ending_sector = sectors_per_track; + break; + case 'f': + if ((outfile=fopen(optarg, "w")) == 0) { + fprintf(stderr, "Error: cannot open file %s: %s\n", optarg, sys_errlist[errno]); + exit(1); + } + break; + case 'p': + total_file_size = 1; /* padding to exact file size */ + break; default: usage(); - exit(1); + close_exit(1); } } - p_sectors = ((HEADS*tracks-1)*SECTORS_PER_TRACK); - p_type = ((p_sectors <= 8*0xff7) ? P_TYPE_12BIT : P_TYPE_16BIT); - sectors_per_cluster = (p_type == P_TYPE_12BIT) ? 8 : 4; + if (total_file_size) total_file_size = heads*tracks*sectors_per_track*512; + p_sectors = ((heads*tracks-1)*sectors_per_track); +/* p_type = ((p_sectors <= 8*0xff7) ? P_TYPE_12BIT : P_TYPE_16BIT); */ + if (p_sectors <= 8 * 0xff7) { + sectors_per_cluster = 8; + p_type = P_TYPE_12BIT; + } else if (p_sectors <= 65535) { + sectors_per_cluster = 4; + p_type = P_TYPE_16BIT; + } else { + /* sectors_per_cluster must be a power of 2 */ + p_type = P_TYPE_32MB; + sectors_per_cluster = 1; + while ((p_sectors / (1 << sectors_per_cluster)) > 65535) + sectors_per_cluster++; + sectors_per_cluster = 1 << sectors_per_cluster; + } +/* sectors_per_cluster = (p_type == P_TYPE_12BIT) ? 8 : 4; */ clusters = p_sectors/sectors_per_cluster; sectors_per_fat = ((p_type==P_TYPE_12BIT) ? ((3*clusters+1023)/1024) : @@ -274,7 +358,7 @@ if (!(fat = malloc(sectors_per_fat*BYTES_PER_SECTOR))) { fprintf(stderr, "Memory error: Cannot allocate fat of %ld sectors\n", sectors_per_fat); - exit(1); + close_exit(1); } while (optind < argc) @@ -283,11 +367,11 @@ /* Write dosemu image header. */ clear_buffer(); memmove(&buffer[0], "DOSEMU", 7); - put_dword(&buffer[7], HEADS); - put_dword(&buffer[11], SECTORS_PER_TRACK); + put_dword(&buffer[7], heads); + put_dword(&buffer[11], sectors_per_track); put_dword(&buffer[15], tracks); put_dword(&buffer[19], 128); - fwrite(buffer, 1, 128, stdout); + fwrite(buffer, 1, 128, outfile); /* Write our master boot record */ clear_buffer(); @@ -353,8 +437,8 @@ else put_word(&buffer[19], 0); buffer[21] = MEDIA_DESCRIPTOR; put_word(&buffer[22], sectors_per_fat); - put_word(&buffer[24], SECTORS_PER_TRACK); - put_word(&buffer[26], HEADS); + put_word(&buffer[24], sectors_per_track); + put_word(&buffer[26], heads); put_word(&buffer[28], HIDDEN_SECTORS); if (p_sectors < 65536L) put_dword(&buffer[32], 0); @@ -367,8 +451,9 @@ memmove(&buffer[43], volume_label, strlen(volume_label)); switch(p_type) { case P_TYPE_12BIT: memmove(&buffer[54], "FAT12 ", 8); break; + case P_TYPE_32MB : case P_TYPE_16BIT: memmove(&buffer[54], "FAT16 ", 8); break; - default: fprintf(stderr, "Unknown FAT type %ld\n",p_type); exit(1); + default: fprintf(stderr, "Unknown FAT type %ld\n",p_type); close_exit(1); } put_word(&buffer[510], 0xaa55); write_buffer(); @@ -384,7 +469,7 @@ put_fat(m, 0xffff); } for (n = 1; (n <= FAT_COPIES); n++) - fwrite(fat, 1, sectors_per_fat*BYTES_PER_SECTOR, stdout); + fwrite(fat, 1, sectors_per_fat*BYTES_PER_SECTOR, outfile); free(fat); /* Write root directory. */ @@ -403,7 +488,7 @@ put_root_directory(m, &input_files[n]); m++; } - fwrite(root_directory, 1, SECTORS_PER_ROOT_DIRECTORY*BYTES_PER_SECTOR, stdout); + fwrite(root_directory, 1, SECTORS_PER_ROOT_DIRECTORY*BYTES_PER_SECTOR, outfile); /* Write data area. */ for (n = 0; (n < input_file_count); n++) @@ -422,5 +507,6 @@ } fclose(f); } + close_exit(0); return(0); }