Re: [Freedos-user] Problem w/ CONFIG.SYS INSTALL

2010-11-01 Thread BretJ

Thanks, Christian!

When I first came across this problem, it seemed like maybe INSTALL= was
using memory without an appropriate MCB, though from just perusing the code
it looked like it was using INT 21.48 to allocate the memory.  I had
actually tried allocating an extra 64k segment at the top of conventional
memory before, but that didn't fix it, so I assumed it was probably
something else.

I just did some testing, and it turns out that an extra 64k isn't enough to
solve the problem, but 128k seems to be.  The real number to use is
probably somewhere in between.  I'll leave it at 128k for now.

Note to developers:

If you're writing or modifying any new programs, and there's even a remote
possibility that the user will try to use INSTALL= and will be using an
un-patched version of FreeDOS, the the top part of conventional memory is
off-limits!
-- 
View this message in context: 
http://old.nabble.com/Problem-w--CONFIG.SYS-INSTALL-tp30076203p30107045.html
Sent from the FreeDOS - User mailing list archive at Nabble.com.


--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] Problem w/ CONFIG.SYS INSTALL

2010-10-31 Thread BretJ

I'm attaching a file that has a simple TSR with the problem (TESTFAIL.COM),
as well as one that doesn't (TESTPASS.COM).  I'm also including the source
code (TEST.A36, in A386 format), as well as the KERNEL.SYS  CONFIG.SYS I
used to test with.  The only difference between TESTFAIL  TESTPASS is the
size of the executable file itself.  In the source code, I change
ProgStackSize (line 1364 in TEST.A36) from 1024 for TESTFAIL to (1024-16)
for TESTPASS.  IOW, I simply decrease the executable's size by 1 paragraph
and it starts working.

TESTPASS  TESTFAIL both work from the FreeDOS command-line, and they also
work from MS-DOS 6.20 CONFIG.SYS and command-line.  But only TESTPASS works
from FreeDOS CONFIG.SYS.  Changing the executable size up and down (by
manipulating ProgStackSize in increments of 16 bytes) will cause different
kinds of errors to occur.

What the TSR does is simply intercept INT 8, and toggles the character at
row 2, column 80 on the screen.  There is still quite a bit of extra
(uncalled) code in the program, but I stopped changing things when I got to
a point where I could make it start and stop working with a single, simple
change.

Also, the program currently uses a TSR Exit (INT 21.31), even though it
doesn't actually need to.  I was just experimenting with INT 21.31 vs. INT
21.4C to see if it made any difference.  So, as it is now, it leaves a
real TSR segment in memory (one that intercepts INT 08  INT 2D), as well
as a small segment near the top of conventional memory that doesn't actually
do anything.  I figured if the TSR exit worked but a regular exit didn't
(for whatever reason), I could simply trap INT 28 or INT 21 with the TSR and
release the unnecessary segment at a later point in time.

It's very possible that there's a problem with my code and there's nothing
wrong with the FreeDOS kernel, so any help at all would be appreciated.

http://old.nabble.com/file/p30101181/TEST.ZIP TEST.ZIP 

___
Bret
-- 
View this message in context: 
http://old.nabble.com/Problem-w--CONFIG.SYS-INSTALL-tp30076203p30101181.html
Sent from the FreeDOS - User mailing list archive at Nabble.com.


--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] Problem w/ CONFIG.SYS INSTALL

2010-10-28 Thread Eric Auer

Hi Bret,

 I am writing a TSR, and having trouble getting it to work with FreeDOS.  It
 installs just fine in MSDOS, also also installs just fine from a FreeDOS
 command prompt.  But, when I try to install it using an INSTALL= or
 INSTALLHIGH= from CONFIG.SYS, the machine hangs.  The hang occurs right
 after the program exits (INT 21.4Ch or INT 21.31h).  If it helps in
 troubleshooting, the TSR does allocate and leave in place some extra
 memory segments that the TSR needs.

That could be related. How do you allocate the extra memory and where?

 I can install some of my other TSR's just fine from CONFIG.SYS.  If I load
 JEMMEX, when the problem program exits, JEMM displays an Error 0D at CS:EIP
 X:Y, where X is always the CS of the previous TSR that was installed, and Y
 is always either  or 0001.  If I don't use JEMM, the machine
 just hangs with no error messages at all.

Maybe JEMMEX has problems with fragmented memory, did you try JEMM386?
The error itself does not tell much - GPF at a 64k segment boundary...
Could mean that code jumped into an empty segment and fell of its end.

 I've been looking at some of the source code for FreeDOS, but nothing has
 revealed itself yet.  I'm just wondering if someone could explain, at least
 in general terms, what is not there or is different (other than the
 shell program) when INSTALL is being used as opposed to an installation from
 the command-line?

While INSTALL differs from normal running of apps
(as child tasks of SHELL) it should do so in the
same way for different versions of DOS.

In FreeDOS, you get - apart from a not complete PSP which
is probably normal for all INSTALL situations anyway...:

STATIC VOID InstallExec(struct instCmds *icmd)
...
   exb.exec.env_seg  = 0;
   exb.exec.cmd_line = (CommandTail FAR *) args;
   exb.exec.fcb_1 = exb.exec.fcb_2 = (fcb FAR *) 0xul;
... init_DosExec(icmd-mode, exb, filename) ...
...

...where AL = mode is either 0 or 0x80 for low / high install
which is a non-standard use of the high bit of AL. A possible
bug in FreeDOS could be:

COUNT DosExec(COUNT mode, exec_blk FAR * ep, BYTE FAR * lp)
...
   if (mode == LOAD  rc == SUCCESS)
 fmemcpy(ep, TempExeBlock, sizeof(exec_blk));
...

This should probably use if mode and 0x7f is load instead?
However, INSTALL does not use LOAD mode, it uses LOADNGO...
And value LOAD_HIGH which is 0x80 is defined but never used.

Other functions: DosExeLoader, DosComLoader, load_transfer...

It might be possible that DosComLoader tries to give the COM
all available memory and unless you specify otherwise when
going TSR none is left for others, but thats just guessing.

Is your TSR a COM or is it EXE?  Does it keep handles open?
Does it use environment variables or other PSP related data?
Does it make a difference whether to INSTALL or INSTALLHIGH?

Regards, Eric


--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] Problem w/ CONFIG.SYS INSTALL

2010-10-28 Thread Christian Masloch
 Maybe JEMMEX has problems with fragmented memory, did you try JEMM386?

Maybe not..? The issue does not appear to be related to JEMM (as usual).

 The error itself does not tell much - GPF at a 64k segment boundary...
 Could mean that code jumped into an empty segment and fell of its end.

It would appear so.

 It might be possible that DosComLoader tries to give the COM
 all available memory and unless you specify otherwise when
 going TSR none is left for others, but thats just guessing.

Bret allocates other memory blocks, so he does resize the process first as  
necessary. (As an aside, such a situation should not make the kernel crash  
like that.)

 Is your TSR a COM or is it EXE?  Does it keep handles open?
 Does it use environment variables or other PSP related data?
 Does it make a difference whether to INSTALL or INSTALLHIGH?

Educated guess: COM, no (shouldn't matter though), no (except as allowed,  
before the TSR is resident), no (Bret said so).

Regards,
Christian

--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] Problem w/ CONFIG.SYS INSTALL

2010-10-28 Thread Bret Johnson
Hi Bret,

 I checked the system's state with INSTALL=DEBUG.COM on a boot disk
 (Rugxulo's bare DOS disk, with a 2008-03-08 kernel, build 2038) and
 it appears fine to me. Memory that belongs to the
 configuration/initialization program is allocated to a PSP at
 segment 60h (!) which is properly set up except there's no MCB in
 front of it. (This means programs that display a process's name
 display garbage instead.)
 Some simple tests, including resident installation of a TSR that
 uses process relocation and the new Int21.4C method, passed.

 Tell us the programs that are used and their versions, that might
 help.

The TSR I'm working on can't be published just yet, so that's not an option 
right now.  It's also _really_ complicated, so I'm not sure anyone would want 
to mess with it anyway.

I'm using an older version of the kernel -- I'm not sure exactly which one 
right now, but it's one from right after FreeDOS version 1 was released.  I'm 
working with some other programmers who are using the latest versions of the 
kernel.  I can find out exact details if it might help.
  
 Can you reproduce the crash with a minimal (dummy) TSR? Could you
 make a TSR available that causes this crash?

I don't know -- I'll see if I can create a simple TSR that still has the 
problem.

--
Bret


--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] Problem w/ CONFIG.SYS INSTALL

2010-10-28 Thread Christian Masloch
 The TSR I'm working on can't be published just yet, so that's not an  
 option right now.

I thought so.

 It's also _really_ complicated, so I'm not sure anyone would want to  
 mess with it anyway.

You know me.

 I'm using an older version of the kernel -- I'm not sure exactly which  
 one right now, but it's one from right after FreeDOS version 1 was  
 released.  I'm working with some other programmers who are using the  
 latest versions of the kernel.  I can find out exact details if it might  
 help.

Yes, details would help. I would strongly recommend you to update your  
kernel, that might fix the problem.

Regards,
Christian

--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] Problem w/ CONFIG.SYS INSTALL

2010-10-28 Thread Bret Johnson
I was using kernel 2036.  Just tried 2038 -- no effective difference.  The JEMM 
error is different now (Error 06 at a seemingly random CS:EIP, near the top of 
conventional memory but where there is no associated PSP).

--
Bret


--
Nokia and ATT present the 2010 Calling All Innovators-North America contest
Create new apps  games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user