public inbox for linux-msdos@vger.kernel.org
 help / color / mirror / Atom feed
* comcom.com
@ 2003-01-03 13:15 Jan Willem Stumpel
  2003-01-03 18:24 ` comcom.com Bart Oldeman
  0 siblings, 1 reply; 14+ messages in thread
From: Jan Willem Stumpel @ 2003-01-03 13:15 UTC (permalink / raw)
  To: linux-msdos

When I use freedos, the command interpreter (in my system
/usr/lib/dosemu/commands/comcom.com) has several bugs. Should they
  be reported to the freedos people or to the dosemu people? This
program announces itself as

   DOSEMU built-in command.com version  1.0

which suggests it belongs to dosemu.

I have this program still from my original 1.0.2.1 installation.
New versions are not built when I compile newer versions of
dosemu; however, in src/plugin/commands I find a comcom.c, -.d,
and -.o. I'm a bit confused. Is this built into newer versions of
dosemu.bin itself? But if I do not have my old comcom.com (or a
link to it) in the dos boot directory, dosemu complains of a
missing command interpreter.

Anyway the bugs I found are:

1) changing directory:
C:\>cd\ws\text
cd\ws\text: file not found

A space is needed. This is unexpected (MS-DOS command.com does not
need it) and therefore (IMHO) a bug.

2) running a program in a directory above the present one:
C:\>cd \ws\text
C:\WS\TEXT>..\ws
..\ws: file not found

The file extension is needed: the command ..\ws.exe succeeds.

3) Problems with a TSR
C:\WS\TEXT>cd\
cd\: file not found

Same as bug 1): but now I install a TSR and do the same:

C:\WS\TEXT>\oldc\tsr\minimon
MiniMon Version 1.0 installed. Activate with <Ctrl-Alt-M>
C:\WS\TEXT>cd\
cd\: insufficient memory

Not "file not found" this time, but "insufficient memory",
apparently caused by the TSR (even though freedos "mem" shows 619
k free at this point).

Regards, Jan


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: comcom.com
@ 2003-01-12 17:15 Stas Sergeev
  2003-01-15 12:50 ` comcom.com Clarence Dang
  0 siblings, 1 reply; 14+ messages in thread
From: Stas Sergeev @ 2003-01-12 17:15 UTC (permalink / raw)
  To: linux-msdos; +Cc: Clarence Dang

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

Hello.

Clarence Dang wrote:
> If you CC me comcom or joystick bug reports they will get fixed faster 
> (as opposed to probably not at all :)) since I don't read every single 
> email that comes up on MLs.
Hmm, how about updating the doc/DPR
then?

> BTW, Stas, I'm looking into the comcom problem at sourceforge.
OK, I just wanted to finally give a
comcom a try, but it appeared to be
completely useless for me:(
At first, it simply crashes my dosemu
without the attached hack: for some
reasons the duplicate_env() is called
when ctcb->envir_frame==0, hence the
crash. Do you know why is this happens?
Then, with the hack applied, it started
to complain on using "lh" in autoexec.
That was enough of trying it for now:)

[-- Attachment #2: comcom.diff --]
[-- Type: text/plain, Size: 797 bytes --]

--- comcom.c.old	Sat Jan 11 05:44:58 2003
+++ comcom.c	Sun Jan 12 20:07:03 2003
@@ -3514,15 +3514,20 @@
 static int duplicate_env(int size)
 {
 	struct com_starter_seg  *ctcb = CTCB;
-	struct com_MCB *mcb = (void *)((ctcb->envir_frame-1) << 4);
 	char *newenv;
-	int oldsize = mcb->size << 4;
+	struct com_MCB *mcb = NULL;
+	int oldsize = 0;
 
+	if (ctcb->envir_frame) {
+	    mcb = (void *)((ctcb->envir_frame-1) << 4);
+	    oldsize = mcb->size << 4;
+	}
 	size = (size+15) & -16;
 	if (size <= oldsize) size = oldsize;
 	newenv = (char *)com_dosallocmem(size);
 	if ((int)newenv < 0) return oldsize;	/* giving up */
-	memcpy(newenv, ((char *)mcb)+16, oldsize);
+	if (oldsize)
+	    memcpy(newenv, ((char *)mcb)+16, oldsize);
 	ctcb->envir_frame = ((unsigned int)newenv) >> 4;
 	return size;
 }

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: comcom.com
@ 2003-01-12 17:16 Clarence Dang
  2003-01-12 10:26 ` comcom.com Jan Willem Stumpel
  0 siblings, 1 reply; 14+ messages in thread
From: Clarence Dang @ 2003-01-12 17:16 UTC (permalink / raw)
  To: Jan Willem Stumpel; +Cc: linux-msdos

[-- Attachment #1: Type: text/plain, Size: 1778 bytes --]

On Fri, 3 Jan 2003 06:24 pm, Bart Oldeman wrote:
> On Fri, 3 Jan 2003, Jan Willem Stumpel wrote:
> > When I use freedos, the command interpreter (in my system
> > /usr/lib/dosemu/commands/comcom.com) has several bugs. Should they
> >   be reported to the freedos people or to the dosemu people?
>
> dosemu, preferrably in the SF bug tracker.
> it is built into dosemu.bin indeed.
>
If you CC me comcom or joystick bug reports they will get fixed faster (as 
opposed to probably not at all :)) since I don't read every single email that 
comes up on MLs.  Just don't deliberately stress-test comcom because it's 
known to be buggy.

>
> > 1) changing directory:
> > C:\>cd\ws\text
> > cd\ws\text: file not found
>
> yes, this is a known bug.
>
Bart, I've recycled your 1.1.3.8 comcom patch and moved it to com_argparse in 
coopthreads to make comcom-space.patch which should solve the problem once 
and for all (argument parsing in comcom is still far from perfect but good 
enough for the time being).  I checked for the possibility of an introduced 
buffer overrun but it shouldn't happen since 256 is much larger than the 
maximum command line length of about 128.

> > 2) running a program in a directory above the present one:
> > C:\>cd \ws\text
> > C:\WS\TEXT>..\ws
> > ..\ws: file not found
> >
> > The file extension is needed: the command ..\ws.exe succeeds.
>
> this one I haven't observed before. Thanks.
>
comcom-exist-exec.patch

> > C:\WS\TEXT>\oldc\tsr\minimon
> > MiniMon Version 1.0 installed. Activate with <Ctrl-Alt-M>
> > C:\WS\TEXT>cd\
> > cd\: insufficient memory
>
> well, first fix bug 1 and then look again :)
>
Does it still happen after the attached patches have been applied?

Clarence

BTW, Stas, I'm looking into the comcom problem at sourceforge.

[-- Attachment #2: comcom-space.patch --]
[-- Type: text/x-diff, Size: 1412 bytes --]

--- 1141pr/src/plugin/coopthreads/coopthreads.c	2002-03-18 21:58:14.000000000 +0000
+++ comhack/src/plugin/coopthreads/coopthreads.c	2003-01-10 15:37:03.000000000 +0000
@@ -1734,6 +1734,20 @@
    }
    else s[1+(unsigned char)s[0]] = 0;
    s++;
+
+   /* transform:
+    *    dir/p to dir /p
+    *    cd\ to cd \
+    *    cd.. to cd ..
+    */
+   p = s;
+   while (isalnum(*p)) p++;
+   if (*p == '\\' || *p == '/' || (*p == '.' && p[1] == '.')) {
+      memmove(p+1, p, s [-1] - (p - s) + 1/*NUL*/);
+      *p = ' ';
+      s[-1]++; /* update length */
+   }
+
    maxarg --;
    for ( ; *s; s++) {
       if (!mode) {
--- 1141pr/src/plugin/commands/comcom.c	2002-12-21 01:27:13.000000000 +0000
+++ comhack/src/plugin/commands/comcom.c	2003-01-10 15:17:29.000000000 +0000
@@ -1324,6 +1324,7 @@
 		i = replen - (s - replbuf);
 		memcpy(p, s, i+1);
 		callbuf[0] = p - (callbuf+1) + i;
+		/* WARNING! callbuf may be modified by com_argparse */
 		j = com_argparse(callbuf, argv+arg0_new, MAXARGS - (argc-arg0_new) -1);
 		saved_dta = PSP_DTA;
 		SET_CHILD_ARGS(arg0_new);
@@ -3276,6 +3277,7 @@
 		if (!bdta.mode) com_doswrite(2, "\r\n", 2);
 
 		memcpy(argbuf, &LEN0A, LEN0A+2); /* save contents */
+		/* WARNING! argbuf may be modified by com_argparse */
 		argc = com_argparse(argbuf, argv, MAXARGS -1);
 		bdta.argcsub = bdta.argc = argc; /* save positional variables */
 		bdta.argvsub = bdta.argv = argv;

[-- Attachment #3: comcom-exist-exec.patch --]
[-- Type: text/x-diff, Size: 947 bytes --]

--- 1141pr/src/plugin/commands/comcom.c	2002-12-21 01:27:13.000000000 +0000
+++ comhack/src/plugin/commands/comcom.c	2003-01-11 19:05:10.000000000 +0000
@@ -1016,10 +1016,20 @@
 	int i;

 	if ((len >4) && (file[len-4] == '.')) {
-		for (i=0; i<3; i++)
-			if (!strncasecmp(file+len-3, extlist[i], 3))
-				if (com_exist_file(file)) return i+1; 
-		return 0;
+		/* '..\ws' does _not_ mean a file with extension '\ws' */
+		boolean isext = TRUE;
+		for (i = len - 3; i < len; i++) {
+			if (!isalnum (file[i])) {
+				isext = FALSE;
+				break;
+			}
+		}
+		if (isext) {
+			for (i=0; i<3; i++)
+				if (!strncasecmp(file+len-3, extlist[i], 3))
+					if (com_exist_file(file)) return i+1;
+			return 0;
+		}
 	}
 	*p++ = '.';
 	for (i=0; i<3; i++) {
@@ -1164,7 +1175,7 @@
 	char *p;

 	if (!expand || (expand && com_doscanonicalize(buf, path)))
-							strcpy(buf, path);
+		strcpy(buf, path);
 	p = basename_of(buf,0);
 	*p = 0;
 	return p - buf;

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: comcom.com
@ 2003-01-15  3:04 Stas Sergeev
  0 siblings, 0 replies; 14+ messages in thread
From: Stas Sergeev @ 2003-01-15  3:04 UTC (permalink / raw)
  To: linux-msdos

Hello.

Clarence Dang wrote:
>> when ctcb->envir_frame==0, hence the
>> crash. Do you know why is this happens?
>  Absolutely no idea.
But then, to (hopefully) reproduce
that, you need to add the line like
this to your config.sys:
SHELL=G:\COMCOM.COM /E:2048 /k call autoexel.bat
It crashes exactly when it goes to
parsing an autoexel.bat (my alternative
autoexec.bat).

>> to complain on using "lh" in autoexec.
>  Comcom has always worked for me...
Does the "lh" command work for you?

> Have you been using any more kernel patches, Stas? :)
Yes, my kernel is always patched in
some ways (and sometimes it turns out
to be usefull also for dosemu:), but
since 2.4.20 I don't have any dosemu-
specific patches here, so I doubt
the kernel can be the problem in that
case.


^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <3E2576E0.6050605@yahoo.com>]
* Re: comcom.com
@ 2003-01-17 18:47 Stas Sergeev
  2003-01-17 23:03 ` comcom.com Jochen Reinwand
  0 siblings, 1 reply; 14+ messages in thread
From: Stas Sergeev @ 2003-01-17 18:47 UTC (permalink / raw)
  To: linux-msdos

Hello.

Jochen Reinwand wrote:
>  I think it would be too miserable since there are so few people 
>  working on
>  > dosemu nowadays :(
>  Is that really true? Has the interest in a DOS emulation dropped so 
>  much?
At least for dosemu it is true.
Most developers are gone, as well
as the most distributors.
My personal opinion is that this
is more because dosemu always failed
to achieve the necessary level of
stability and security in order the
users and distributors to trust it
any longer after it crossed the 1.0
boundary.
Now we are finally approaching that,
but I think the loses were fatal.
But at least I know two distributors
who decided to give it a chance once
again, packaging 1.1.4+.

> Btw: I came across an interesting project a few days ago. It is called 
> dosbox 
> (http://dosbox.zophar.net/) and it seems to be a DOS emulator for Linux 
> _and_ Windows. It seems like there is done a lot of work for it.
It is intended to run games and only
games. This is official. Dosemu is
intended to do *much* more, actually
the games were never (until recently)
the main goal of dosemu, so that
projects cannot be compared.

> Does anybody know more about it?
Yes. At least people here:
http://sourceforge.net/forum/forum.php?forum_id=174313
should know much more about it.

> Why have they started a new project? DOSemu is much better at the 
> moment. So why spending time for implementing things already done?
There were reasons:
1. Dosemu isn't portable (very bad).
2. Dosemu was *dead* (not any more)
3. Dosemu didn't have a sound support,
so it was useless for games (not any
longer, the sound support is much better
than anywhere else now, except probably
the bochs, but the bochs have so many
developers...)
4. I don't think DOSbox is intended
to compete with dosemu at all.
I think most users of DOSbox are the
WinNT/2000 users. That people always
suffered a horrible DOS support.
Now I think WinXP have somewhat better
DOS support (including sound, VESA and
DPMI, but I may be misleaded as I am
not a Windows user). Let's see what
DOSbox can offer in exchange.
As for linux, dosemu is unbeatable
here, that's for sure (IMHO), but
with such a few developers this can
be eventually changed.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2003-01-17 23:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-03 13:15 comcom.com Jan Willem Stumpel
2003-01-03 18:24 ` comcom.com Bart Oldeman
2003-01-03 19:18   ` comcom.com Jan Willem Stumpel
2003-01-03 22:36     ` comcom.com Bart Oldeman
  -- strict thread matches above, loose matches on Subject: below --
2003-01-12 17:15 comcom.com Stas Sergeev
2003-01-15 12:50 ` comcom.com Clarence Dang
2003-01-17 15:56   ` comcom.com Jochen Reinwand
2003-01-12 17:16 comcom.com Clarence Dang
2003-01-12 10:26 ` comcom.com Jan Willem Stumpel
2003-01-15 12:55   ` comcom.com Clarence Dang
2003-01-15  3:04 comcom.com Stas Sergeev
     [not found] <3E2576E0.6050605@yahoo.com>
2003-01-17 14:38 ` comcom.com Clarence Dang
2003-01-17 18:47 comcom.com Stas Sergeev
2003-01-17 23:03 ` comcom.com Jochen Reinwand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox