--- dosemu-0.64.0.2.orig/etc/config.dist +++ dosemu-0.64.0.2/etc/config.dist @@ -441,7 +441,7 @@ # "readonly" for read only access. A good idea to set up with. # "bootfile" to specify an image of a boot sector to boot from. # -#disk { image "/var/lib/dosemu/hdimage" } # use diskimage file. +disk { image "/var/lib/dosemu/hdimage" } # use diskimage file. #disk { partition "/dev/hda1" readonly } # 1st partition on 1st IDE. #disk { partition "/dev/hda1" bootfile "/var/lib/bootsect.dos" } # 1st partition on 1st IDE --- dosemu-0.64.0.2.orig/load_module.sh +++ dosemu-0.64.0.2/load_module.sh @@ -48,7 +48,7 @@ ${BINDIR}/rmmod emumodule fi if [ "`lsmod|grep syscallmgr`" = "" ]; then - ${BINDIR}/insmod -z ${MODULESDIR}/syscallmgr.o + ${BINDIR}/insmod -f -z ${MODULESDIR}/syscallmgr.o fi -${BINDIR}/insmod -lz ${MODULESDIR}/emumodule.o +${BINDIR}/insmod -f -lz ${MODULESDIR}/emumodule.o --- dosemu-0.64.0.2.orig/src/dosext/net/net/libpacket.c +++ dosemu-0.64.0.2/src/dosext/net/net/libpacket.c @@ -7,6 +7,7 @@ * * (c) 1994 Alan Cox iiitac@pyr.swan.ac.uk GW4PTS@GB7SWN */ +#include #include "kversion.h" #include @@ -15,12 +16,17 @@ #include #include #include +#include #include #include #include +#include +#include "emu.h" #include "libpacket.h" +#include "dosnet.h" + /* * Obtain a file handle on a raw ethernet type. In actual fact * you can also request the dummy types for AX.25 or 802.3 also @@ -33,23 +39,73 @@ * hell will break loose. */ + +/* Should return an unique ID (< 255) corresponding to this invocation + of DOSEMU not clashing with other DOSEMU's. + We use tty number. If someone invokes dosemu in background, we + are in trouble ... ;-(. +*/ + + +static unsigned short int DosnetID=0xffff; int -OpenNetworkType(unsigned short netid) -{ - int s = socket(AF_INET, SOCK_PACKET, htons(netid)); +GetDosnetID() +{ + struct stat chkbuf; + int major, minor; + + if (DosnetID != 0xffff) return (DosnetID) ; + + fstat(STDOUT_FILENO, &chkbuf); + major = chkbuf.st_rdev >> 8; + minor = chkbuf.st_rdev & 0xff; + + if (major != 4) { + /* Not running on tty/ttyp/ttyS. I really don't know what to do. + For now, let us exit ... */ + pd_printf( "DosNetID: Can't work without a tty/pty/ttyS, assigning an odd one ... "); + minor=241; + } + + DosnetID = (unsigned short int)DOSNET_TYPE_BASE + minor; + pd_printf("Assigned DosnetID=%x\n", DosnetID ); + return(DosnetID); +} + +int +DosnetOpenNetworkType(unsigned short netid) +{ + /* Here, netid is ignored, and instead, we send our own netid. + assigned to this dosnet session. + */ + int s = socket(AF_INET, SOCK_PACKET, htons(GetDosnetID())); if (s == -1) return -1; fcntl(s, F_SETFL, O_NDELAY); return s; } +/* Return a socket opened in broadcast mode ... */ +int +DosnetOpenBroadcastNetworkType() +{ + int s = socket(AF_INET, SOCK_PACKET, htons(DOSNET_BROADCAST_TYPE)); + /* this is special value !*/ + if (s == -1) { + return -1; + pd_printf("DosnetOpenBroadcast.. couldnot open socket.\n"); + } + fcntl(s, F_SETFL, O_NDELAY); + return s; +} + /* * Close a file handle to a raw packet type. */ void -CloseNetworkLink(int sock) +DosnetCloseNetworkLink(int sock) { close(sock); } @@ -65,12 +121,12 @@ */ int -WriteToNetwork(int sock, const char *device, const char *data, int len) +DosnetWriteToNetwork(int sock, const char *device, const char *data, int len) { struct sockaddr sa; sa.sa_family = AF_INET; - strcpy(sa.sa_data, device); + strcpy(sa.sa_data, DOSNET_DEVICE); return (sendto(sock, data, len, 0, &sa, sizeof(sa))); } @@ -88,7 +144,7 @@ */ int -ReadFromNetwork(int sock, char *device, char *data, int len) +DosnetReadFromNetwork(int sock, char *device, char *data, int len) { struct sockaddr sa; int sz = sizeof(sa); @@ -123,25 +179,26 @@ #define NET3 #endif -int -GetDeviceHardwareAddress(char *device, char *addr) -{ - int s = socket(AF_INET, SOCK_DGRAM, 0); - struct ifreq req; - int err; - strcpy(req.ifr_name, device); - err = ioctl(s, SIOCGIFHWADDR, &req); - close(s); /* Thanks Rob. for noticing this */ - if (err == -1) - return err; -#ifdef NET3 - memcpy(addr, req.ifr_hwaddr.sa_data,8); -#else - memcpy(addr, req.ifr_hwaddr, 8); -#endif - return 0; +/* This routine is totally local; doesn't make request to actual device. */ + +char local_eth_addr[6]={0,0,0,0,0,0}; +int +DosnetGetDeviceHardwareAddress(char *device, char *addr) +{ + int i; + memcpy(local_eth_addr,DOSNET_FAKED_ETH_ADDRESS, 6); + (void)GetDosnetID(); + *(unsigned short int *)&(local_eth_addr[2])= DosnetID ; + + memcpy(addr, local_eth_addr, 6); + + pd_printf("Assigned Ethernet Address= " ); + for ( i=0; i< 6 ; i++) pd_printf("%x:", local_eth_addr[i]); + pd_printf( "\n"); + + return 0; } /* @@ -153,7 +210,7 @@ */ int -GetDeviceMTU(char *device) +DosnetGetDeviceMTU(char *device) { int s = socket(AF_INET, SOCK_DGRAM, 0); struct ifreq req; @@ -166,4 +223,14 @@ if (err == -1) return err; return req.ifr_mtu; +} + +void +printbuf(char *mesg, struct ethhdr *buf) +{ int i; + pd_printf( "%s :\n Dest.=", mesg); + for (i=0;i<6;i++) pd_printf("%x:",buf->h_dest[i]); + pd_printf( " Source=") ; + for (i=0;i<6;i++) pd_printf("%x:",buf->h_source[i]); + pd_printf( " Type= %x \n", buf->h_proto) ; } --- dosemu-0.64.0.2.orig/src/dosext/net/net/pktnew.c +++ dosemu-0.64.0.2/src/dosext/net/net/pktnew.c @@ -16,6 +16,7 @@ * doing, though... */ +#include "emu.h" #include "pktdrvr.h" #include "emu.h" #include "dosio.h" @@ -35,14 +36,31 @@ #define min(a,b) ((a) < (b)? (a) : (b)) -extern int OpenNetworkType(u_short); -extern int GetDeviceHardwareAddress(char *, char *); -extern int WriteToNetwork(int, const char *, const char *, int); -extern int ReadFromNetwork(int, char *, char *, int); +#include "dosnet.h" + +extern int DosnetOpenNetworkType(u_short); +extern int DosnetOpenBroadcastNetwork(u_short); +extern int DosnetGetDeviceHardwareAddress(char *, char *); +extern int DosnetWriteToNetwork(int, const char *, const char *, int); +extern int DosnetReadFromNetwork(int, char *, char *, int); + + + +void Open_sockets(void); + +int pkt_fd=-1, pkt_broadcast_fd=-1, max_pkt_fd; /* global data which is put at PKTDRV_SEG:PKTDRV_OFF */ /* (not everything needs to be accessible from DOS space, but it is */ /* often convenient to be able to look at it with DEBUG...) */ +#define MAX_PKT_TYPE_SIZE 10 +struct pkt_type { + int handle, no_of_chars; + char pkt_type[MAX_PKT_TYPE_SIZE]; + int count; /* To sort the array based on counts of packet type. */ +} pkt_type_array[MAX_HANDLE]; +int max_pkt_type_array=0; + struct pkt_globs { @@ -58,8 +76,6 @@ short size; /* current packet's size */ long receiver; /* current receive handler */ int helpvec; /* vector number for helper */ - int nfds; /* number of fd's for select() */ - fd_set sockset; /* set of sockets for select() */ unsigned char helper[72]; /* upcall helper */ struct per_handle @@ -68,15 +84,14 @@ char class; /* class it was access_type'd with */ short packet_type_len; /* length of packet type */ int flags; /* per-packet-type flags */ - int sock; /* fd for the socket */ long receiver; /* receive handler */ char packet_type[16]; /* packet type for this handle */ - } handle[MAX_HANDLE]; + } handle[MAX_HANDLE]; char buf[ETH_FRAME_LEN + 32]; /* packet buffer */ }; -static char devname[] = "eth0"; /* linux device name */ +static char devname[] = DOSNET_DEVICE ; /* linux device name */ static struct pkt_globs *pg = NULL; @@ -111,9 +126,9 @@ /* fill other global data */ strcpy(pg->driver_name,"Linux$"); - GetDeviceHardwareAddress(devname,pg->hw_address); - pg->classes[0] = ETHER_CLASS; - pg->classes[1] = IEEE_CLASS; + DosnetGetDeviceHardwareAddress(devname,pg->hw_address); + pg->classes[0] = ETHER_CLASS; /* == 1. */ + pg->classes[1] = IEEE_CLASS; /* == 11. */ pg->type = 12; /* dummy type (3c503) */ pg->flags = config.pktflags; /* global config flags */ @@ -121,10 +136,16 @@ pg->param.minor_rev = 1; pg->param.length = sizeof(struct pkt_param); pg->param.addr_len = ETH_ALEN; - pg->param.mtu = GetDeviceMTU(devname); + pg->param.mtu = DosnetGetDeviceMTU(devname); pg->param.rcv_bufs = 8 - 1; /* a guess */ pg->param.xmt_bufs = 2 - 1; + Open_sockets(); /* VINOD: Added to receive all packets + from dosnet device. These packets + are of special type and are reconverted + into broadcast packets proper after being + received by dosemu. */ + /* helper routine to transfer received packets and call receiver */ pg->helpvec = vec + 1; /* use this for helper vec */ @@ -184,6 +205,7 @@ { struct per_handle *hdlp; + int hdlp_handle=-1; #if 0 pd_printf("NPKT: AX=%04x BX=%04x CX=%04x DX=%04x FLAGS=%08x\n", @@ -197,10 +219,16 @@ NOCARRY; - /* when BX seems like a valid handle, set the handle info pointer */ + /* when BX seems like a valid handle, set the handle info pointer. + Actually, BX could be zero in some "default cases". For e.g. + if it is zero when getting the driver info, we can't say if it is + the "real" handle or general default value. + */ - if (LWORD(ebx) < MAX_HANDLE) + if ((LWORD(ebx) < MAX_HANDLE)) { hdlp = &pg->handle[LWORD(ebx)]; + hdlp_handle=LWORD(ebx); + } else hdlp = NULL; @@ -209,15 +237,23 @@ switch (HI(ax)) { case F_DRIVER_INFO: + pd_printf("Driver info called ...\n"); REG(eax) = 2; /* basic+extended functions */ REG(ebx) = 1; /* version */ - if (hdlp != NULL && hdlp->in_use) + + /* If hdlp_handle == 0, it is not always a valid handle. + At least in case of CUTCP it sets it to zero for the first + time. + */ + if (hdlp_handle !=0 && hdlp != NULL && hdlp->in_use) REG(ecx) = (hdlp->class << 8) + 1; /* class, number */ else REG(ecx) = (pg->classes[0] << 8) + 1; REG(edx) = pg->type; /* type (dummy) */ REG(ds) = PKTDRV_SEG; /* driver name */ REG(esi) = PKTDRV_OFF + offsetof(struct pkt_globs,driver_name); + pd_printf("Class returned = %d, handle=%d, pg->classes[0]=%d \n", + REG(ecx)>>8, hdlp_handle, pg->classes[0] ); return 1; case F_ACCESS_TYPE: @@ -310,19 +346,7 @@ } } } - - hdlp->sock = OpenNetworkType(type); /* open the socket */ - - if (hdlp->sock < 0) { - hdlp->in_use = 0; /* forget about this handle */ - HI(dx) = E_BAD_TYPE; - break; - } - - FD_SET(hdlp->sock,&pg->sockset); /* keep track of sockets */ - add_to_io_select(hdlp->sock, 1); - if (hdlp->sock >= pg->nfds) - pg->nfds = hdlp->sock + 1; + Insert_Type(free_handle, hdlp->packet_type_len, hdlp->packet_type); REG(eax) = free_handle; /* return the handle */ } @@ -334,19 +358,9 @@ break; } - if (hdlp->in_use) { - int i,n; - - CloseNetworkLink(hdlp->sock); /* close the socket */ - FD_CLR(hdlp->sock,&pg->sockset); /* keep track of sockets */ - remove_from_io_select(hdlp->sock, 1); - n = pg->nfds; - pg->nfds = 0; - - for (i = 0; i < n; i++) - if (FD_ISSET(i,&pg->sockset)) - pg->nfds = i + 1; + Remove_Type(hdlp_handle); + if (hdlp->in_use) { hdlp->in_use = 0; /* no longer in use */ } return 1; @@ -360,6 +374,7 @@ /* find a handle which is in use, and use its socket for the send */ { int handle; + char *p; for (handle = 0; handle < MAX_HANDLE; handle++) { hdlp = &pg->handle[handle]; @@ -386,8 +401,12 @@ p[1] = (char)len; } } + /* Now we have to write to network. We need + to check if it is broadcast, and if so, use the + corresponding socket. */ + p = SEG_ADR((char *),ds,si); - if (WriteToNetwork(hdlp->sock,devname, + if (DosnetWriteToNetwork( pkt_fd, devname, SEG_ADR((char *),ds,si),LWORD(ecx)) >= 0) { /* send was okay, check for a reply to speedup */ @@ -399,8 +418,8 @@ #endif return 1; } else { - warn("NPKT: WriteToNetwork(%d,\"%s\",buffer,%u): error %d\n", - hdlp->sock,devname,LWORD(ecx),errno); + warn("NPKT: DosnetWriteToNetwork(%d,\"%s\",buffer,%u): error %d\n", + pkt_fd,devname,LWORD(ecx),errno); break; } } @@ -479,19 +498,78 @@ /* fell through switch, indicate an error (DH set above) */ CARRY; -#if 0 - pd_printf("ERR: AX=%04x BX=%04x CX=%04x DX=%04x FLAGS=%08x\n", + pd_printf("PD ERR: AX=%04x BX=%04x CX=%04x DX=%04x FLAGS=%08x\n", LWORD(eax),LWORD(ebx),LWORD(ecx),LWORD(edx),REG(eflags)); pd_printf(" SI=%04x DI=%04x BP=%04x SP=%04x CS=%04x DS=%04x ES=%04x SS=%04x\n", LWORD(esi),LWORD(edi),LWORD(ebp),LWORD(esp), LWORD(cs),LWORD(ds),LWORD(es),LWORD(ss)); -#endif return 1; } +/* This handle is inserted to receive packets of type "dosnet broadcast". + These are really speaking broadcast packets meant to be received by + all dosemu's. Their destination addresses are changed by dosemu, and + are changed back to 'ffffff..' when these packets are received by dosemu. +*/ + +void +Open_sockets(void) +{ + pkt_broadcast_fd = DosnetOpenBroadcastNetworkType(); /* open the socket */ + pkt_fd = DosnetOpenNetworkType( (u_short)0 ); + max_pkt_fd = pkt_fd + 1; + if ( max_pkt_fd <= pkt_broadcast_fd ) max_pkt_fd = pkt_broadcast_fd + 1; +} + +/* Find_Handle does type demultiplexing. + Given a packet, it compares the type fields and finds out which + handle should take the given packet. + An array of types is maintained. +*/ +int +Insert_Type(int handle, int no_of_chars, char *pkt_type) +{ + int i,nchars; + if(no_of_chars > MAX_PKT_TYPE_SIZE) return -1; + if (max_pkt_type_array >= MAX_HANDLE) return -1; + + pd_printf("Trying to insert: handle %d, no_of_chars=%d \n ",handle, no_of_chars); + + /* Find if the type or handle is already present ... */ + for( i=0; i 1) && !memcmp(&pkt_type_array[i].pkt_type, pkt_type, nchars)) + ) + return -1; + } + pkt_type_array[max_pkt_type_array].no_of_chars=no_of_chars; + pkt_type_array[max_pkt_type_array].handle=handle; + pkt_type_array[max_pkt_type_array].count=0; + memcpy(&pkt_type_array[max_pkt_type_array].pkt_type, pkt_type, no_of_chars); + for(i=0; infds == 0) /* no active sockets? */ - return 0; - if (pg->size != 0) /* transfer area busy? */ return 1; tv.tv_sec = 0; /* set a (small) timeout */ tv.tv_usec = timeout; - readset = pg->sockset; - if (select(pg->nfds,&readset,NULL,NULL,&tv) <= 0) /* anything ready? */ - return 0; - - for (handle = 0; handle < MAX_HANDLE; handle++) { - hdlp = &pg->handle[handle]; - - if (hdlp->in_use && FD_ISSET(hdlp->sock,&readset)) { - /* somethine is available on this handle's socket */ - /* attempt to read it. that should always succeed... */ + FD_SET(pkt_fd, &readset); + FD_SET(pkt_broadcast_fd, &readset); + add_to_io_select(pkt_broadcast_fd, 1); + add_to_io_select(pkt_fd, 1); - size = ReadFromNetwork(hdlp->sock,device,pg->buf,sizeof(pg->buf)); - - /* check if something has been received */ - /* there was a check for "not multicast" here, but I think */ - /* it should not be there... */ - - if (size >= 0) { - /* verify the source of the packet. when not from eth0, */ - /* discard it for now (multiple network cards are next) */ + if (select(max_pkt_fd,&readset,NULL,NULL,&tv) <= 0) /* anything ready? */ + return 0; - if (strcmp(device,devname)) - continue; + if( FD_ISSET(pkt_fd, &readset) ) + fd = pkt_fd; + else if( FD_ISSET(pkt_broadcast_fd, &readset) ) + fd = pkt_broadcast_fd; + else return 0; + size = DosnetReadFromNetwork(fd,device,pg->buf,sizeof(pg->buf)); + if (size < 0) { + pg->stats.errors_in++; /* select() somehow lied */ + return 0; + } + if (strcmp(device,devname)) return 0; + + pd_printf("========Processing New packet======\n"); + /* if( (handle = Find_Handle(pg->buf))== -1) return 0; */ + /* Code for Find_Handle. */ + { + int i,nchars; + struct ethhdr *eth ; + u_char *p; + + eth=(struct ethhdr *) pg -> buf; + /* find this packet's frame type, and hence position to compare the type. */ + if (ntohs(eth->h_proto) >= 1536) + p = pg->buf + 2 * ETH_ALEN; /* Ethernet-II */ + else + p = pg->buf + 2 * ETH_ALEN + 2; /* All the rest frame types. */ + + pd_printf("Received packet type: %.2x\n", ntohs(eth->h_proto)); + + handle=-1; + for( i=0; ihandle[handle]; + if (hdlp->in_use) { + + printbuf("received packet:", pg->buf); + + /* VINOD: If it is broadcast type, translate it back ... */ + if ( memcmp(pg->buf, DOSNET_BROADCAST_ADDRESS, 4) == 0 ) + { + pd_printf("It is broadcast packet."); + if(memcmp((pg->buf + ETH_ALEN), pg->hw_address, ETH_ALEN) == 0) + { + pd_printf("It was my own packet! Ignored.\n"); + return; /* Ignore our own ethernet broadcast. */ + } + memcpy(pg->buf, "\x0ff\x0ff\x0ff\x0ff\x0ff\x0ff", ETH_ALEN); + printbuf("Translated:", pg->buf); + } + + /* No need to check the type again. Also, for now, NOVELL_HACK + is diabled... */ + if ( 0 ) { /* check if the packet's type matches the specified type */ /* in the ACCESS_TYPE call. the position depends on the */ /* driver class! */ @@ -554,30 +678,51 @@ if (size >= ((p - pg->buf) + hdlp->packet_type_len) && !memcmp(p,hdlp->packet_type,hdlp->packet_type_len)) { - pg->stats.packets_in++; - pg->stats.bytes_in += size; - + } if (hdlp->flags & N_OPTION) { /* Novell hack? */ *--p = (char)ETH_P_IPX; /* overwrite length with type */ *--p = (char)(ETH_P_IPX >> 8); } + } + pg->stats.packets_in++; + pg->stats.bytes_in += size; /* stuff things in global vars and queue a hardware */ /* interrupt which will perform the upcall */ - pg->size = size; - pg->receiver = hdlp->receiver; + pg->size = size; + pg->receiver = hdlp->receiver; #ifdef PICPKT - do_irq(); + do_irq(); #else - run_int(pg->helpvec); + run_int(pg->helpvec); #endif - return 1; - } else - pg->stats.packets_lost++; /* not really lost... */ - } else - pg->stats.errors_in++; /* select() somehow lied */ - } - } - + pd_printf("Called the helpvector ... \n"); + return 1; + } else + pg->stats.packets_lost++; /* not really lost... */ + pd_printf("Handle not in use. Ignored this packet.\n"); return 0; +} + + +int +Find_Handle(u_char *buf) +{ + int i,nchars; + struct ethhdr *eth = (struct ethhdr *) buf; + u_char *p; + /* find this packet's frame type, and hence position to compare the type. */ + if (ntohs(eth->h_proto) >= 1536) + p = buf + 2 * ETH_ALEN; /* Ethernet-II */ + else + p = buf + 2 * ETH_ALEN + 2; /* All the rest frame types. */ + + for( i=0; i= 1001076 -char *system_map_name="/usr/src/linux/System.map"; +char *system_map_name="/System.map"; static void check_system_map_name() { struct stat buf; --- dosemu-0.64.0.2.orig/src/arch/linux/Makefile.main.in +++ dosemu-0.64.0.2/src/arch/linux/Makefile.main.in @@ -17,14 +17,14 @@ USE_MHPDBG=@USE_MHPDBG@ #Change the following line if the right kernel includes reside elsewhere -#LINUX_KERNEL = /usr/src/linux -LINUX_KERNEL = $(shell sh @SRCPATH@/arch/@CONFIG_HOST@/kversion.sh -find -print) +LINUX_KERNEL = /usr/src/linux +#LINUX_KERNEL = $(shell sh @SRCPATH@/arch/@CONFIG_HOST@/kversion.sh -find -print) LINUX_INCLUDE = $(LINUX_KERNEL)/include export LINUX_KERNEL export LINUX_INCLUDE #Change the following line to point to your loadable modules directory -BOOTDIR = /boot/modules +BOOTDIR = /lib/modules PICOBJS = libpic.a export PICOBJS @@ -395,35 +395,35 @@ $(MAKE) install install: - @install -d /var/lib/dosemu - @install -d /var/run + @install -d $(DEST)/var/lib/dosemu + @install -d $(DEST)/var/run @if [ -f ../load_module.sh ]; then chmod 700 ../load_module.sh; fi @if [ -f ../unload_module.sh ]; then chmod 700 ../unload_module.sh; fi @if [ -f ../install-for-modprobe.sh ]; then chmod 700 ../install-for-modprobe.sh; fi @if [ -f /lib/libemu ]; then rm -f /lib/libemu ; fi - @install -c -o root -m 04755 $(BINPATH)/bin/dos /usr/bin + @install -cs -o root -m 04755 $(BINPATH)/bin/dos $(DEST)/usr/bin ifdef USE_MHPDBG - @install -c -o root -m 0755 $(BINPATH)/bin/dosdebug /usr/bin + @install -cs -o root -m 0755 $(BINPATH)/bin/dosdebug $(DEST)/usr/bin endif ifndef ELF - @install -m 0644 $(LIBDOSEMU) /usr/lib/libdosemu-$(THISVERSION) - @(cd /usr/lib; ln -sf libdosemu-$(THISVERSION) libdosemu) + @install -m 0644 $(LIBDOSEMU) $(DEST)/usr/lib/libdosemu-$(THISVERSION) + @(cd $(DEST)/usr/lib; ln -sf libdosemu-$(THISVERSION) libdosemu) endif - @if [ -f /usr/bin/xdosemu ]; then \ - install -m 0700 /usr/bin/xdosemu /tmp; \ - rm -f /usr/bin/xdosemu; \ + @if [ -f $(DEST)/usr/bin/xdosemu ]; then \ + install -s -m 0700 $(DEST)/usr/bin/xdosemu /tmp; \ + rm -f $(DEST)/usr/bin/xdosemu; \ fi ifdef X_SUPPORT @ln -sf dos $(BINPATH)/bin/xdos - @install -m 0755 ../etc/xtermdos /usr/bin - @if [ ! -e /usr/bin/xdos ]; then ln -s dos /usr/bin/xdos; fi + @install -m 0755 ../etc/xtermdos $(DEST)/usr/bin + @if [ ! -e $(DEST)/usr/bin/xdos ]; then ln -s dos $(DEST)/usr/bin/xdos; fi @echo "" - @if [ -w $(X11LIBDIR)/X11/fonts/misc ] && \ - [ -d $(X11LIBDIR)/X11/fonts/misc ] && \ - [ ! -e $(X11LIBDIR)/X11/fonts/misc/vga.pcf ] && \ - [ ! -e $(X11LIBDIR)/X11/fonts/misc/vga.pcf.Z ]; then \ + @if [ -w $(DEST)$(X11LIBDIR)/X11/fonts/misc ] && \ + [ -d $(DEST)$(X11LIBDIR)/X11/fonts/misc ] && \ + [ ! -e $(DEST)$(X11LIBDIR)/X11/fonts/misc/vga.pcf ] && \ + [ ! -e $(DEST)$(X11LIBDIR)/X11/fonts/misc/vga.pcf.Z ]; then \ echo "-> Main DOSEMU files installation done. Installing the Xwindows PC-8 font..."; \ - install -m 0644 ../etc/vga.pcf $(X11LIBDIR)/X11/fonts/misc; \ + install -m 0644 ../etc/vga.pcf $(DEST)$(X11LIBDIR)/X11/fonts/misc; \ cd $(X11LIBDIR)/X11/fonts/misc; \ mkfontdir; \ fi --- dosemu-0.64.0.2.orig/src/tools/periph/Makefile.in +++ dosemu-0.64.0.2/src/tools/periph/Makefile.in @@ -32,8 +32,8 @@ ./mkfatimage -l DOSEMU @REALTOPDIR@/@THISVERSION@/commands/* >$(D)/hdimage.dist install: - install -d /usr/lib/dosemu - install -m 0755 mkhdimage putrom $(SCRIPT) /usr/lib/dosemu + install -d $(DEST)/usr/lib/dosemu + install -m 0755 mkhdimage putrom $(SCRIPT) $(DEST)/usr/lib/dosemu checkin: -ci -l keyboard.c.diff $(SRC) $(SCRIPT) Makefile --- dosemu-0.64.0.2.orig/unload_module.sh +++ dosemu-0.64.0.2/unload_module.sh @@ -9,9 +9,9 @@ ${BINDIR}/rmmod emumodule fi if [ "`lsmod|grep syscallmgr`" != "" ]; then - echo "are you sure to unload syscallmgr ? (y)" - read x - if [ "$x" = "y" ]; then +# echo "are you sure to unload syscallmgr ? (y)" +# read x +# if [ "$x" = "y" ]; then ${BINDIR}/rmmod syscallmgr - fi +# fi fi --- dosemu-0.64.0.2.orig/debian/changelog +++ dosemu-0.64.0.2/debian/changelog @@ -0,0 +1,29 @@ +dosemu (0.64.0.2-3) unstable; urgency=high + + * Support for Virtual Network included (not working right now due to a bug + in dosemu which I hope to have fixed soon. Had to include it since this + version also fixed a big problem). + * Fixed broken rmmod function. dosemu stop did not work. + + -- Christoph Lameter Wed, 3 Oct 1996 09:00:00 +0800 + +dosemu (0.64.0.2-2) unstable; urgency=high + + * Reworked installation scripts etc so that the presence of FreeDOS is + detected. After installation dos can now be started without first + having to copy msdos. + * Lots of other fixes + * insmod -f used to load emumodule etc so that dosemu is version independent. + + -- Christoph Lameter Wed, 2 Oct 1996 09:00:00 +0800 + +dosemu (0.64.0.2-1) unstable; urgency=high + + * Initial Release + + -- Christoph Lameter Wed, 2 Oct 1996 09:00:00 +0800 + +Local variables: +mode: debian-changelog +End: + --- dosemu-0.64.0.2.orig/debian/copyright +++ dosemu-0.64.0.2/debian/copyright @@ -0,0 +1,56 @@ +This is Debian/GNU Linux's prepackaged version of DOSEMU, the Linux +DOS emulator. This is ALPHA software!!! It is being actively +developed by a loosely knit team of hackers (linux-msdos@vger.rutgers.edu). +DOSEMU is a user-level program which uses certain special features of +the Linux kernel and the 80386 processor to run MS-DOS. + +This package was put together by me, Mike Deisher +, from the sources, which I obtained from +tsx-11.mit.edu:/pub/linux/ALPHA/dosemu/dosemu0.60.3.tgz. The changes +were very minimal: adding support for the Debian package maintenance +scheme by adding various debian.* files. + +This package was reconstructed according to the newest standards of the Debian +Project and the newest sources of dosemu by Christoph Lameter + in October 1996. Only minor parts of the old +modifications were kept. + +Copyright (C) 1992 Krishna Balasubramanian +Copyright (C) 1990,1991,1992,1993 Carnegie Mellon University +Copyright (C) 1992,1994 John E. Davis +Copyright (C) 1993 David Dawes +Copyright (C) 1995 Bjorn Ekwall +Copyright (C) 1992 Tommy Frandsen +Copyright (C) 1991 IBM Corporation +Copyright (C) 1995 Hans Lermen +Copyright (C) 1995 Dong Liu +Copyright (C) 1994 Lutz Molgedey +Copyright (C) 1986 Peter Norton +Copyright (C) 1993 Kenneth Osterberg +Copyright (C) 1995 Mark Rejhon +Copyright (C) 1990,1991 Thomas Roell +Copyright (C) 1993 Robert Sanders +Copyright (C) 1994 J. Lawrence Stephan +Copyright (C) 1991,1992 Ian Lance Taylor +Copyright (C) 1991,1992,1994 Linus Torvalds +Copyright (C) 1992,1993,1994 Andrew Tridgell +Copyright (C) 1992 Theodore Ts'o +Copyright (C) 1994 University of Bristol, England + +Modifications for Debain GNU/Linux Copyright (C) 1995 Mike Deisher. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 2. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License with +your Debian GNU/Linux system, in /usr/doc/copyright/GPL, or with the +Debian GNU/Linux hello source package as the file COPYING. If not, +write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, +MA 02139, USA. + --- dosemu-0.64.0.2.orig/debian/control +++ dosemu-0.64.0.2/debian/control @@ -0,0 +1,27 @@ +Source: dosemu +Section: devel +Priority: optional +Maintainer: Christoph Lameter +Standards-Version: 2.1.1.0 + +Package: dosemu +Architecture: i386 +Depends: ${shlibs:Depends} +Suggests: fdos +Description: The Linux DOS Emulator + DOSEMU is a PC Emulator application that allows Linux to run a DOS + operating system in a virtual x86 machine. This allows you to run + many DOS applications. + - Works with the FreeDOS package (fdos) under Debian + . + - Color text and full keyboard emulation (via hotkeys) via terminal. + - Built-in X-Windows support, includes IBM character set font! + - Graphics capability at the console with most compatible video cards. + - Much-improved DPMI support. + - Runs Borland BCC.EXE/TCC.EXE version 3.x command line compilers! + - Runs Borlandc C++ 3.x IDE (with emumodule.o) + - Runs several 32-bit DPMI-compilant video games, including DOS/4GW, + at the Linux console. + - CDROM support. + - NetWare and other network connectivity via builtin IPX and pktdrvr + support. --- dosemu-0.64.0.2.orig/debian/rules +++ dosemu-0.64.0.2/debian/rules @@ -0,0 +1,106 @@ +#!/usr/bin/make -f +# Sample debian.rules file - for GNU Hello (1.3). +# Copyright 1994,1995 by Ian Jackson. +# I hereby give you perpetual unlimited permission to copy, +# modify and relicense this file, provided that you do not remove +# my name from the file itself. (I assert my moral right of +# paternity under the Copyright, Designs and Patents Act 1988.) +# This file may have to be extensively modified + +# There used to be `source' and `diff' targets in this file, and many +# packages also had `changes' and `dist' targets. These functions +# have been taken over by dpkg-source, dpkg-genchanges and +# dpkg-buildpackage in a package-independent way, and so these targets +# are obsolete. + +package=dosemu + +build: + $(checkdir) + ./configure + make + cd doc;make dosemu.info + cd src/dosext/net/v-net;make + touch build + +clean: + $(checkdir) + -rm -f build + -make pristine + -rm `find . -name "*~"` + -rm -rf debian/tmp debian/files* + +binary-indep: checkroot build + $(checkdir) +# There are no architecture-independent files to be uploaded +# generated by this package. If there were any they would be +# made here. + +binary-arch: checkroot build + $(checkdir) + -rm -rf debian/tmp + install -d debian/tmp/DEBIAN debian/tmp/usr/{sbin,bin} debian/tmp/etc \ + debian/tmp/usr/doc/$(package)/examples debian/tmp/usr/X11R6/icons \ + debian/tmp/usr/info debian/tmp/usr/X11R6/lib/X11/fonts/misc \ + debian/tmp/usr/man/man1 debian/tmp/usr/lib/dosemu/{bin,modules} \ + debian/tmp/etc/init.d debian/tmp/etc/dosemu + make install DEST=`pwd`/debian/tmp +# Manpages + install man/*.1 debian/tmp/usr/man/man1 +# Special Scripts +# install debian/dosemuconfig debian/tmp/usr/sbin +# Distribution + cp etc/config.dist debian/tmp/etc/dosemu/dist + cp etc/config.dist debian/tmp/usr/lib/dosemu/dosemu.conf.dist + echo "all" >debian/tmp/etc/dosemu/users + ln -s dosemu/users debian/tmp/etc/dosemu.users + cp etc/hdimage.dist debian/tmp/var/lib/dosemu/hdimage + cp etc/dosemu.xpm debian/tmp/usr/X11R6/icons + cp etc/hddummy debian/tmp/usr/lib/dosemu + install etc/xtermdos debian/tmp/usr/bin + cp doc/dosemu.info debian/tmp/usr/info + install bin/insmod debian/tmp/usr/lib/dosemu/bin + ln -s insmod debian/tmp/usr/lib/dosemu/bin/rmmod + ln -s insmod debian/tmp/usr/lib/dosemu/bin/ksyms + install modules/* debian/tmp/usr/lib/dosemu/modules + install src/dosext/net/v-net/dosnet.o debian/tmp/usr/lib/dosemu/modules + cp load_module.sh unload_module.sh debian/tmp/usr/lib/dosemu + cp etc/hdimage.dist debian/tmp/usr/lib/dosemu +# Documentation + cp ChangeLog QuickStart debian/tmp/usr/doc/$(package) + cp doc/{README*,*.txt,ann*,NOVELL*,Known*,EMUsucc*,DPR} debian/tmp/usr/doc/$(package) + cp src/dosext/net/v-net/dosnet.README debian/tmp/usr/doc/$(package) +# Debian special Documentation + cp debian/copyright debian/tmp/usr/doc/$(package) + cp debian/README.debian debian/tmp/usr/doc/$(package)/. + cp debian/changelog debian/tmp/usr/doc/$(package)/changelog.Debian + chmod a+r debian/tmp/usr/doc/$(package)/* +# Zip things up. + gzip -9v debian/tmp/usr/info/* debian/tmp/usr/doc/$(package)/{*.txt,ChangeLog,DPR} + install debian/{postinst,postrm} debian/tmp/DEBIAN + install -m644 debian/conffiles debian/tmp/DEBIAN + install debian/dosemu debian/tmp/etc/init.d + cp debian/dosemu.conf.fdos debian/tmp/usr/lib/dosemu + cp debian/dosemu.conf.fdos debian/tmp/etc/dosemu/fdos + dpkg-shlibdeps 0.*/bin/dos + dpkg-gencontrol + chown -R root.root debian/tmp + chmod -R g-ws debian/tmp + dpkg --build debian/tmp .. + +define checkdir + test -f debian/rules +endef + +# Below here is fairly generic really + +binary: binary-indep binary-arch + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +checkroot: + $(checkdir) + test root = "`whoami`" + +.PHONY: binary binary-arch binary-indep clean checkroot --- dosemu-0.64.0.2.orig/debian/substvars +++ dosemu-0.64.0.2/debian/substvars @@ -0,0 +1 @@ +shlibs:Depends=elf-x11r6lib, libc5 (>= 5.2.18) --- dosemu-0.64.0.2.orig/debian/README.debian +++ dosemu-0.64.0.2/debian/README.debian @@ -0,0 +1,47 @@ +dosemu for Debian +----------------- + +The dosemu has been preconfigured for you with minimal options. +You can just run xdos or dos to get a dos prompt. + +FreeDOS +------- +Initially dosemu is configured to use FreeDOS which is quite unstable right +now. If you want to go through installing your own version of MS-DOS (as +described in QuickStart) then first change the symlink /etc/dosemu.conf to +point to /etc/dosemu/dist. + +If you are not satisfied with that configuration then copy some config file +to another name and make a symlink to that name. +Please do not change /etc/dosemu/fdos, /etc/dosemu/dist or /etc/dosemu/msdos. +These are standard configurations and will be overwritten by the next upgrade. + +Note: +1. I could not get FreeDOS installed on a hdimage that is why it is right + now on a floppyimage which is referred to as drive A: + I hope this brings your expectations of FreeDOS down to reality. + +2. Consequently your real drive A: is accessible as drive B:. + As soon as FreeDOS becomes stable enough to run on a Harddisk I will + change that. + +TCP/IP Networking from dosemu +----------------------------- +Dosemu includes support for a packetdriver. If you get the wattcp package or +similar then you should be able to use tcp/ip from the dosemu session to +access the world or run obscure applications that still depend on a +packetdriver. +You need to edit /etc/init.d/dosemu if you want to assign different IP +addresses to the Virtual DOSEMU network. + +(A good resource for DOS networking can be found on + http://www.paxnet.com.au/~nigel. +Also read the dosnet.README file) + +NOTE NOTE NOTE +-------------- +Support for TCP/IP Networking from dosemu is not working right now due +to a bug in the dosemu code. The dosemu package will be updated As soon +as a fix is available. + +Christoph Lameter, --- dosemu-0.64.0.2.orig/debian/conffiles +++ dosemu-0.64.0.2/debian/conffiles @@ -0,0 +1,2 @@ +/etc/dosemu/users +/var/lib/dosemu/hdimage --- dosemu-0.64.0.2.orig/debian/postinst +++ dosemu-0.64.0.2/debian/postinst @@ -0,0 +1,52 @@ +#!/bin/sh +# +# post install script for the Debian GNU/Linux dosemu package +# + +# add info file to the info "dir" file + +install-info --quiet --section "General commands" "General commands" \ + /usr/info/dosemu.info.gz + +# Update the X11 fonts + +( cd /usr/X11R6/lib/X11/fonts/misc ; /usr/X11R6/bin/mkfontdir ) + +# Install the automatic loader +update-rc.d dosemu defaults 30 >/dev/null + +echo "Starting dosemu modules ..." +/etc/init.d/dosemu start + +if [ ! -L /etc/dosemu.conf ]; then + echo "/etc/dosemu.conf should be a sym link. Saving your old dosemu.conf" + echo "in /etc/dosemu/old." + mv /etc/dosemu.conf /etc/dosemu/old +fi + +if [ -f /usr/fdos/boot-fdos1440.gz ]; then + echo "Found FreeDOS." + if [ ! -e /var/lib/dosemu/diskimage.fdos ]; then + echo "Generating FreeDOS floppyimage" + zcat /usr/fdos/boot-fdos1440.gz >/var/lib/dosemu/diskimage.fdos + else + echo "FreeDOS floppyimage already in /var/lib/dosemu/diskimage.fdos" + fi + if [ ! -e /var/lib/dosemu/hdimage.fdos ]; then + echo "Preparing a FreeDOS hdimage" + cp /usr/lib/dosemu/hdimage.dist /var/lib/dosemu/hdimage.fdos + else + echo "FreeDOS hdimage already in /var/lib/dosemu/diskimage.fdos" + fi + if [ ! -e /etc/dosemu.conf ]; then + ln -s dosemu/fdos /etc/dosemu.conf + fi +else + echo "FreeDOS not installed. Read /usr/doc/dosemu/QuickStart on how" + echo "to provide dosemu with the necessary MS-DOS binaries." +fi + +# Make sure that dosemu.conf is pointing to something. +if [ ! -e /etc/dosemu.conf ]; then + ln -s dosemu/dist /etc/dosemu.conf +fi --- dosemu-0.64.0.2.orig/debian/dosemu +++ dosemu-0.64.0.2/debian/dosemu @@ -0,0 +1,42 @@ +#! /bin/sh +# /etc/init.d/skeleton: example file to build /etc/init.d/ scripts. +# $Id: skeleton,v 1.3 1996/05/14 17:35:50 miquels Exp $ +# +# This file should be used to construct scripts for /etc/init.d. +# +# Written by Miquel van Smoorenburg . +# Modified for Debian GNU/Linux by Ian Murdock . +# Modified for dosemu by Christoph Lameter + +# dosemu works as a separate IP address on your network. +# Be sure to route something to that IP address - use masquerading if possible +# IP forwarding/Gatewaying must of course be enabled for this to work. +V_NET="192.168.4.0" +V_IP="192.168.4.1" +V_MASK="255.255.255.0" +# Assign IPs beginning at 192.168.4.2 for dosemu sessions + +test -f /usr/bin/dos || exit 0 + +case "$1" in + start) + cd /usr/lib/dosemu + ./load_module.sh + insmod -f modules/dosnet.o + ifconfig dsn0 $V_IP netmask $V_MASK + route add -net $V_NET netmask $V_MASK dev dsn0 + ;; + stop) + cd /usr/lib/dosemu + route del -net $V_NET + ifconfig dsn0 down + rmmod dosnet + ./unload_module.sh + ;; + *) + echo "Usage: /etc/init.d/dosemu {start|stop}" + exit 1 + ;; +esac + +exit 0 --- dosemu-0.64.0.2.orig/debian/postrm +++ dosemu-0.64.0.2/debian/postrm @@ -0,0 +1,9 @@ +#!/bin/sh + +install-info --quiet --remove /usr/info/dosemu.info + +if [ "$1" = "purge" ] +then + update-rc.d dosemu remove 2>/dev/null + rm -f /var/lib/dosemu /etc/dosemu /etc/dosemu.conf +fi --- dosemu-0.64.0.2.orig/debian/dosemu.conf.fdos +++ dosemu-0.64.0.2/debian/dosemu.conf.fdos @@ -0,0 +1,554 @@ +# Linux dosemu 0.63 configuration file. +# Updated to include QuickStart documentation 5/10/94 by Mark Rejhon +# James MacLean, macleajb@ednet.ns.ca, 12/31/93 +# Robert Sanders, gt8134b@prism.gatech.edu, 5/16/93 +# +# NOTICE: +# - Although QuickStart information is included in this file, you +# should refer to the documentation in the "doc" subdirectory of the +# DOSEMU distribution, wherever possible. +# - This configuration file is designed to be used as a base to make +# it easier for you to set up DOSEMU for your specific system. +# - Configuration options between lace brackets { } can be split onto +# multiple lines. +# - Comments start with # or ; in column 1. (beginning of a line) +# - If you have problems installing DOSEMU and think it might be useful +# to mail or post your /etc/dosemu.conf, please consider to do: +# +# grep ^[^#] /etc/dosemu.conf > /tmp/dosemu.conf-stripped +# +# and mail or post /tmp/dosemu.conf-stripped instead. +# This will prove that you actually read the documentation. :-) +# - Send Email to the jmaclean address above if you find any errors. + +#************************* DEBUG ****************************************** +# +# QuickStart: +# This section is of interest mainly to programmers. This is useful if +# you are having problems with DOSEMU and you want to enclose debug info +# when you make bug reports to a member of the DOSEMU development team. +# Simply set desired flags to "on" or "off", then redirect stderr of +# DOSEMU to a file using "dos 2>debug" to record the debug information +# if desired. Skip this section if you're only starting to set up. +# +debug { config off disk off warning off hardware off + port off read off general off IPC off + video off write off xms off ems off + serial off keyb off dpmi off + printer off mouse off sound off + } + + +#************************ MISCELLANEOUS ************************************ +# +# Want startup DOSEMU banner messages? Of course :-) +dosbanner on +# +# timint is necessary for many programs to work. +timint on + + +#************************** KEYBOARD ************************************ +# +# QuickStart: +# With the "layout" keyword, you can specify your country's keyboard +# layout. The following layouts are implemented: +# finnish us dvorak sf +# finnish-latin1 uk sg sf-latin1 +# de dk sg-latin1 es +# de-latin1 dk-latin1 fr es-latin1 +# be no fr-latin1 portuguese +# it sw +# The us-layout is selected by default if the "layout" keyword is omitted. +# +# The keyword "keybint" allows more accurate of keyboard interrupts, +# It is a bit unstable, but makes keyboard work better when set to "on". +# +# The keyword "rawkeyboard" allows for accurate keyboard emulation for +# DOS programs, and is only activated when DOSEMU starts up at the +# console. It only becomes a problem when DOSEMU prematurely exits +# with a "Segmentation Fault" fatal error, because the keyboard would +# have not been reset properly. In that case, you would have to run +# kbd_mode -a remotely, or use the RESET button. In reality, +# this should never happen. But if it does, please do report to the +# dosemu development team, of the problem and detailed circumstances, +# we're trying our best! If you don't need near complete keyboard +# emulation (needed by major software package), set it to "off" +# +keyboard { layout us keybint on rawkeyboard off } +# keyboard { layout de-latin1 keybint on rawkeyboard on } +# +# The HogThreshold value determines how nice Dosemu will be about +# giving other Linux processes a chance to run. Setting the HogThreshold +# value to approximately half of you BogoMips value will slightly +# degrade Dosemu performance, but significantly increase overall +# system idle time. A zero value runs Dosemu at full tilt. +# +HogThreshold 10 + + +#**************************** SERIAL ************************************ +# +# QuickStart: +# You can specify up to 4 simultaneous serial ports here. +# If more than one ports have the same IRQ, only one of those ports +# can be used at the same time. Also, you can specify the com port, +# base address, irq, and device path! The defaults are: +# COM1 default is base 0x03F8, irq 4, and device /dev/cua0 +# COM2 default is base 0x02F8, irq 3, and device /dev/cua1 +# COM3 default is base 0x03E8, irq 4, and device /dev/cua2 +# COM4 default is base 0x02E8, irq 3, and device /dev/cua3 +# If the "com" keyword is omitted, the next unused COM port is assigned. +# Also, remember, these are only how you want the ports to be emulated +# in DOSEMU. That means what is COM3 on IRQ 5 in real DOS, can become +# COM1 on IRQ 4 in DOSEMU! +# +# Also, as an example of defaults, these two lines are functionally equal: +# serial { com 1 mouse } +# serial { com 1 mouse base 0x03F8 irq 4 device /dev/cua0 } +# +# If you want to use a serial mouse with DOSEMU, the "mouse" keyword +# should be specified in only one of the serial lines. (For PS/2 +# mice, it is not necessary, and device path is in mouse line instead) +# +# Uncomment/modify any of the following if you want to support a modem: +# (or any other serial device.) +#serial { com 1 device /dev/modem } +#serial { com 2 device /dev/modem } +#serial { com 3 device /dev/modem } +#serial { com 4 device /dev/modem } +#serial { com 3 base 0x03E8 irq 5 device /dev/cua2 } +# +# If you are going to load a msdos mouse driver for mouse support +# uncomment/modify one of the following +#serial { mouse com 1 device /dev/mouse } +#serial { mouse com 2 device /dev/mouse } +# +# What type is your mouse? Uncomment one of the following. +# Use the 'internaldriver' option to try Dosemu internaldriver. +# Use the 'emulate3buttons' for 3button mice. +#mouse { microsoft } +#mouse { logitech } +#mouse { mmseries } +#mouse { mouseman } +#mouse { hitachi } +#mouse { mousesystems } +#mouse { busmouse } +#mouse { ps2 device /dev/mouse internaldriver emulate3buttons } +#mouse { mousesystems device /dev/mouse internaldriver cleardtr } + +# For tty locking capabilities: +# ttylocks { directory /var/locks namestub LCK.. [binary] } + +#************************* NETWORKING SUPPORT ***************************** +# +# Turn the following option 'on' if you require IPX/SPX emulation. +# Therefore, there is no need to load IPX.COM within the DOS session. +# The following option does not emulate LSL.COM, IPXODI.COM, etc. +# NOTE: MUST HAVE IPX PROTOCOL ENABLED IN KERNEL !! +ipxsupport off +# +# Enable Novell 8137->raw 802.3 translation hack in new packet driver. +#pktdriver novell_hack + + +#************************** TERMINALS ************************************* +# +# This section applies whenever you run DOSEMU remotely or in an xterm. +# Color terminal support is now built into DOSEMU. Skip this section for +# now to use terminal defaults, until you get DOSEMU to work. +# +# QuickStart: +# There is a number of keywords for the terminal { } configuration line. +# "charset" latin, ibm (default latin) +# Select the character set to use with DOSEMU. +# "color" off, on (default on) +# Enable or disable color terminal support. +# "updatefreq" value (default 4) +# A number indicating the frequency of terminal updates of the screen. +# The smaller the number, the more frequent. A value of 20 gives a +# frequency of about one per second, which is very slow. However, more +# CPU time is given to DOS applications when updates are less frequent. +# A value of 4 is recommended in most cases, but if you have a fast +# system or link, you can decrease this to 0. +# "escchar" value (default 30) +# A number that specifies the control character used as a prefix +# character for sending alt, shift, ctrl, and function keycodes. The +# default value is 30 which is Ctrl-^. So, for example, F1 is +# 'Ctrl-^ 1', Alt-F7 is 'Ctrl-^ a Ctrl-^ 7'. For online help, press +# 'Ctrl-^ h'. +# +# Use the following to enable the IBM character set. +#terminal { charset ibm color on } +# +# Use this for color xterms or rxvt's with no IBM font, with only 8 colors. +#terminal { charset latin color on } +# +# Use this for color xterms or rxvt's with IBM font, with only 8 colors. +#terminal { charset ibm color on } +# +# More detailed line for user configuration: +terminal { charset latin updatefreq 4 color on } + +#************************* X SUPPORT ************************************** +# +# valid keywords for the X { } config line: +# +# "updatefreq" value (default 8) +# A number indicating the frequency of X updates of the screen. +# The smaller the number, the more frequent. A value of 20 gives a +# frequency of about one per second, which is very slow. However, more +# CPU time is given to DOS applications when updates are less frequent. +# +# "display" string (default ":0") +# The X server to use. If this is not specified, dosemu will use +# the DISPLAY environment variable. (This is the normal case) +# +# "title" string (default "dosemu") +# What you want dosemu to display in the title bar of its window. +# +# "icon_name" string (default "dosemu") +# Used when the dosemu window is iconified. +# +# "keycode" (default 0) +# Used to give Xdos access to keycode part of XFree86. +# +# "blinkrate" value (default 8) +# Used to add blinking to cursor. +# +# "font" value (default vga) +# Used to pick a font other than vga. Must be monospaced. +# +# "sharecmap" (default 0) +# Used to share the colormap with other applications in graphics mode. +# If not set, a private colormap is used. +# +X { updatefreq 8 title "DOS in a BOX" icon_name "xdos" } + + + +#************************* VIDEO ****************************************** +# +# !!WARNING!!: A LOT OF THIS VIDEO CODE IS ALPHA! IF YOU ENABLE GRAPHICS +# ON AN INCOMPATIBLE ADAPTOR, YOU COULD GET A BLANK SCREEN OR MESSY SCREEN +# EVEN AFTER EXITING DOSEMU. JUST REBOOT (BLINDLY) AND THEN MODIFY CONFIG. +# +# QuickStart: +# Start with only text video using the following line, to get started. +# then when DOSEMU is running, you can set up a better video configuration. +# +video { vga } # Use this line, if you are using VGA +#video { cga console } # Use this line, if you are using CGA +#video { ega console } # Use this line, if you are using EGA +#video { mda console } # Use this line, if you are using MDA +# +# QuickStart Notes for Graphics: +# - If your VGA-Bios resides at E000-EFFF, turn off video BIOS shadow +# for this address range and add the statement vbios_seg 0xe000 +# to the correct vios-statement, see the example below +# - If your VBios size is only 32K you set it with vbios_size 0x8000, +# you then gain some space for UMB or hardware ram locations. +# - Set "allowvideoportaccess on" earlier in this configuration file +# if DOSEMU won't boot properly, such as hanging with a blank screen, +# beeping, leaving Linux video in a bad state, or the video card +# bootup message seems to stick. +# - Video BIOS shadowing (in your CMOS setup) at C000-CFFF must be disabled. +# +# *> CAUTION <*: TURN OFF VIDEO BIOS SHADOWING BEFORE ENABLING GRAPHICS! +# This is not always necessary, but a word to the wise +# shall be sufficient. +# +# - If you have a dual-monitor configuration (e.g. MDA as second display), +# you then may run CAD programs on 2 displays or let play your debugger +# on the MDA while debugging a graphics program on the VGA (e.g TD -do ). +# You also may switch to the MDA display by using the DOS command +# mode mono (mode co80 returns to your normal display). +# This feature can be enabled by the switch "dualmon" like this: +# video { vga console graphics dualmon } +# and can be used on a xterm and the console, but of course not, if you +# have the MDA as your primary display. +# You also must set USE_DUALMON 1 in include/video.h. +# NOTE: Make sure no more then one process is using this feature ! +# ( you will get funny garbage on your MDA display. ) +# Also, you must NOT have the dualmon-patches for kernel applied +# ( having the MDA as Linux console ) +# - If you want to run dosemu in situations when human doesn't sit at console +# (for instance to run it by cron) and want console option be enabled +# you should use option forcevtswitch. +# { vga console forcevtswitch } +# Without the option dosemu waits for becoming virtual terminal +# on which dosemu is run active (i.e. user must press Alt-F?). +# With this option dosemu perform the switch itself. +# Be careful with this option because with it user sat at console +# may face with unexpected switch. +# +# +# It may be necessary to set this to "on" if DOSEMU can't boot up properly +# on your system when it's set "off" and when graphics are enabled. +# Note: May interfere with serial ports when using certain video boards. +#allowvideoportaccess on +# +# Any 100% compatible standard VGA card _MAY_ work with this: +#video { vga console graphics } +# +# If your VGA-BIOS is at segment E000, this may work for you: +#video { vga console graphics vbios_seg 0xe000 } +# +# Trident SVGA with 1 megabyte on board +#video { vga console graphics chipset trident memsize 1024 } +# +# Diamond SVGA +#video { vga console graphics chipset diamond } +# +# ET4000 SVGA card with 1 megabyte on board: +#video { vga console graphics chipset et4000 memsize 1024 } +# or +#video { vga console graphics chipset et4000 memsize 1024 vbios_size 0x8000 } +# +# S3-based SVGA video card with 1 megabyte on board: +#video { vga console graphics chipset s3 memsize 1024 } +# For ATI graphic mode +#ports { 0x1ce 0x1cf 0x238 0x23b 0x23c 0x23f 0x9ae8 0x9ae9 0x9aee 0x9aef } + + +#************************** MISCELLANEOUS ********************************** +# +# QuickStart: +# For "mathco", set this to "on" to enable the coprocessor during DOSEMU. +# This really only has an effect on kernels prior to 1.0.3. +# For "cpu", set this to the CPU you want recognized during DOSEMU. +# For "bootA"/"bootC", set this to the bootup drive you want to use. +# It is strongly recommended you start with "bootA" to get DOSEMU +# going, and during configuration of DOSEMU to recognize hard disks. +# +mathco on # Math coprocessor valid values: on off +cpu 80386 # CPU emulation valid values: 80286 80386 80486 +bootA # Startup drive valid values: bootA bootC + + +#*********************** MEMORY ****************************************** +# +# QuickStart: +# These are memory parameters, stated in number of kilobytes. +# If you get lots of disk swapping while DOSEMU runs, you should +# reduce these values. Also, DPMI is still somewhat unstable, +# (as of early April 1994) so be careful with DPMI parameters. +# +# For ems, you now can set the frame to any 16K between 0xc800..0xe000 +# +# If you have adapters, which have memory mapped IO, you may now +# map those regions with hardware_ram { .. }. You can only map in +# entities of 4k, you give the address, not the segment. +# +# umb_max is a new parameter which tells DOSEMU to be more aggressive +# about finding upper memory blocks. The default is 'off'. +# + +#umb_max on # be more aggressive about finding XMS UMB blocks + +dpmi 4086 # DPMI size in K, or "off" +xms 1024 # XMS size in K, or "off" +ems 1024 # EMS size in K, or "off" +#ems { ems_size 1024 ems_frame 0xe000 } +#ems { ems_size 2048 ems_frame 0xd000 } + +#hardware_ram { 0xc8000 range 0xcc000 0xcffff } + # maps 0xc8000..0xc8fff and 0xcc000..0xcffff + +#dosmem 640 # Maximum conventional RAM to show apps + +#*********************** IRQ ****************************************** +# +# QuickStart: +# These are parameters needed for SIG, the Silly Interrupt Generator. +# To use this feature, you also must have the emumodule.o driver +# loaded. For more details see emumod/README.emumod. +# +# The sillyint statement accepts IRQ values between 3..15, +# if using the { .. } syntax each value or range can be prefixed +# by the keyword use_sigio to monitor the IRQ via SIGIO. +# If this is missing the IRQ is monitored by SIGALRM. +# + +sillyint off # this disables IRQ monitoring +#sillyint 15 +#sillyint { 15 } +#sillyint { use_sigio 15 } +#sillyint { 10 use_sigio range 3 5 } + + +#********************** PORT ACCESS ************************************** +# +# These keywords are allowable on a "ports" line (* denotes default): +# range addr1 addr2 allow access in this range of ports +# ormask (*=0) +# andmask (*=0xffff) +# rdonly|wronly|rdwr(*) specify what access to allow +# fast (*=not fast) put port(s) in the ioperm bitmap (only +# valid for ports below 0x400) +# An access doesn't trap and isn't logged, but +# as vm86() isn't interrupted, it's much faster. +# device if ports are registered, open device to block +# access. Open must be successfull or access to +# ports will be denied. If you know what you are +# doing, use /dev/null to fake a device to block +# +# !!WARNING!!: GIVING ACCESS TO PORTS IS BOTH A SECURITY CONCERN AND +# SOME PORTS ARE DANGEROUS TO USE. PLEASE SKIP THIS SECTION, AND +# DON'T FIDDLE WITH THIS SECTION UNLESS YOU KNOW WHAT YOU'RE DOING. +# +# ports { 0x388 0x389 } # for SimEarth +# ports { 0x21e 0x22e 0x23e 0x24e 0x25e 0x26e 0x27e 0x28e 0x29e } # for jill + + +#******************* SPEAKER ********************************************* +# +# These keywords are allowable on the "speaker" line: +# native Enable DOSEMU direct access to the speaker ports. +# emulated Enable simple beeps at the terminal. +# off Disable speaker emulation. +# +speaker native # or "off" or "emulated" + + +#******************* HARD DISKS ****************************************** +# +# !!WARNING!!: DAMAGE MIGHT RESULT TO YOUR HARD DISK (LINUX AND/OR DOS) +# IF YOU FIDDLE WITH THIS SECTION WITHOUT KNOWING WHAT YOU'RE DOING! +# +# QuickStart: +# The best way to get started is to start with a boot floppy, and set +# "bootA" above in the configuration. Keep using the boot floppy +# while you are setting this hard disk configuration up for DOSEMU, +# and testing by using DIR C: or something like that. +# If you want DOSEMU to be able to access a DOS partition, the +# safer type of access is "partition" access, because "wholedisk" +# access gives DOSEMU write access to a whole physical disk, +# including any vulnerable Linux partitions on that drive! +# +# !!! IMPORTANT !!! +# You must not have LILO installed on the partition for dosemu to boot off. +# As of 04/26/94, doublespace and stacker 3.1 will work with wholedisk +# or partition only access. Stacker 4.0 has been reported to work with +# wholedisk access. +# +# Please read the documentation in the "doc" subdirectory for info +# on how to set up access to real hard disk. +# +# "image" specifies a hard disk image file. +# "partition" specifies partition access, with device and partition number. +# "wholedisk" specifies full access to entire hard drive. +# "readonly" for read only access. A good idea to set up with. +# "bootfile" to specify an image of a boot sector to boot from. +# +disk { image "/var/lib/dosemu/hdimage.fdos" } # use diskimage file. +#disk { partition "/dev/hda1" readonly } # 1st partition on 1st IDE. +#disk { partition "/dev/hda1" bootfile "/var/lib/bootsect.dos" } + # 1st partition on 1st IDE + # booting from the specified + # file. +#disk { partition "/dev/hda6" readonly } # 6th logical partition. +#disk { partition "/dev/sdb1" readonly } # 1st partition on 2nd SCSI. +#disk { wholedisk "/dev/hda" } # Entire disk drive unit + + +#******************* DOSEMU BOOT ******************************************* +# +# Use the following option to boot from the specified file, and then +# once booted, have bootoff execute in autoexec.bat. Thanks Ted :-). +# Notice it follows a typical floppy spec. To create this file use +# dd if=/dev/fd0 of=/var/lib/dosemu/bdisk bs=16k +# +#bootdisk { heads 2 sectors 18 tracks 80 threeinch file /var/lib/dosemu/bdisk } +# +# Specify extensions for the CONFIG and AUTOEXEC files. If the below +# are uncommented, the extensions become CONFIG.EMU and AUTOEXEC.EMU. +# NOTE: this feature may affect file naming even after boot time. +# If you use MSDOS 6+, you may want to use a CONFIG.SYS menu instead. +# +#EmuSys EMU +#EmuBat EMU + + +#******************* FLOPPY DISKS **************************************** +# +# QuickStart: +# This part is fairly easy. Make sure that the first (/dev/fd0) and +# second (/dev/fd1) floppy drives are of the correct size, "threeinch" +# and/or "fiveinch". A floppy disk image can be used instead, however. +# +# FOR SAFETY, UNMOUNT ALL FLOPPY DRIVES FROM YOUR FILESYSTEM BEFORE +# STARTING UP DOSEMU! DAMAGE TO THE FLOPPY MAY RESULT OTHERWISE! +# +# floppy { device /dev/fd1 fiveinch } +floppy { heads 2 sectors 18 tracks 80 threeinch file /var/lib/dosemu/diskimage.fdos } +floppy { device /dev/fd0 threeinch } + +# +# If floppy disk speed is very important, uncomment the following +# line. However, this makes the floppy drive a bit unstable. This +# is best used if the floppies are write-protected. +# Use an integer value to set the time between floppy updates. +# +#FastFloppy 8 + + +#******************* PRINTERS ******************************************** +# +# QuickStart: +# Printer is emulated by piping printer data to a file or via a unix +# command such as "lpr". Don't bother fiddling with this configuration +# until you've got DOSEMU up and running already. +# +# NOTE: Printers are assigned to LPT1:, LPT2:, and LPT3: on a one for +# one basis with each line below. The first printer line is assigned +# to LPT1:, second to LPT2:, and third to LPT3:. If you do not specify +# a base port, the emulator will setup the bios to report 0x378, 0x278, +# and 0x3bc for LPT1:, LPT2:, and LPT3: respectively. +# +# To use standard unix lpr command for printing use this line: +# +#printer { options "%s" command "lpr" timeout 20 } +# +# And for any special options like using pr to format files, +# add it to the options parameter: +# +#printer { options "-p %s" command "lpr" timeout 10 } # pr format it +# +# To just have your printer output end up in a file, use the following line: +# +#printer { file "lpt3" } +# +# If you have a DOS application that is looking to access the printer +# port directly, and uses the bios LPT: setting to find out the port to use, +# you can modify the base port the bios will report with the following: +# +#printer { options "%s" command "lpr" base 0x3bc } +# +# Be sure to also add a port line to allow the application access to +# the port: +# +#ports { 0x3bc 0x3bd 0x3be } +# +# NOTE: applications that require this will not interfere with applications +# that continue to use the standard bios calls. These applications will +# continue to send the output piped to the file or unix command. +# + + +#******************* SOUND *********************************************** +# +# This is likely to be very broken at the moment. 8-( +# +# sb_base - base address of the SB (HEX) +# sb_irq - IRQ for the SB +# sb_dma - DMA channel for the SB +# sb_dsp - Path the sound device +# sb_mixer - path to the mixer control +# mpu_base - base address for the MPU-401 chip (HEX) (Not Implemented) +# + +# Linux defaults +#sound_emu { sb_base 0x220 sb_irq 5 sb_dma 1 sb_dsp /dev/dsp sb_mixer /dev/mixer mpu_base 0x330 } +# NetBSD defaults +#sound_emu { sb_base 0x220 sb_irq 5 sb_dma 1 sb_dsp /dev/sound sb_mixer /dev/mixer mpu_base 0x330 }