VOGONS


Reply 20 of 32, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

don't expect that to always go right. especially on networked drives with caching and such.
(2 instances using the same files)

Although it could be that your clipper application has no sense of file locking at all. I've debugged 3 different database programs in depth in the past.
2 relied on filelocking (and worked perfectly when implemented) and 1 didn't. That one did some locking itself by keeping some sort of counter inside the database.
I didn't analyse your application on how and if it handles file locks. So it might work, but if I were you I'd do a lot of testing with multiple people changing data at the same time. Running 2 instances on the same computer is not a good test of networked file sharing.

Water flows down the stream
How to ask questions the smart way!

Reply 21 of 32, by sarbash

User metadata
Rank Newbie
Rank
Newbie

You're right. I should take into consideration your advice about serious testing before apply this solution into production environment.
I have another thought about recompiling this app into native linux executable... I've got Valkyrie. I'm only not sure about a correctness of decompiling process. But I can make a try.

P.S. I think I would note that our girls run the same executable from different PCs from shared Netware volume. If that works with Netware and dos network clients for netware I guess that should work the same with linux NFS-share. At least I hope that is that. Surely, everything will be tested before use in a production.

Reply 22 of 32, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Surely, everything will be tested before use in a production.

You can't test "everything". dosbox is not intended to run anything besides games so it's fully your responsibility if you use it in a different scenario.

Reply 23 of 32, by sarbash

User metadata
Rank Newbie
Rank
Newbie

I didn't threw away my responsibility. Saying "everything" mean "the everything in the app I plan to use under dosbox emulation". I didn't meant "the everything in dosbox itself". Sorry for the ambiguity.
Maybe I'll be lucky enough to rebuild it as native linux executable. But, yet only my dreams.

Reply 25 of 32, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I was mistaken, the app does not run out of handles in MS-DOS 5/6. The default file handle table in the PSP is 20 entries, and trying to specify fewer than 20 in a call INT 21/67 is treated as if 20 was specified. It makes sense because there is no benefit to setting less than 20; the table space in the PSP is reserved.

Easy enough to have DOSBox work more like DOS here, and the app is working with this change:

 bool DOS_PSP::SetNumFiles(Bit16u fileNum) {
if (fileNum>20) {
// Allocate needed paragraphs
fileNum+=2; // Add a few more files for safety
Bit16u para = (fileNum/16)+((fileNum%16)>0);
RealPt data = RealMake(DOS_GetMemory(para),0);
sSave(sPSP,file_table,data);
sSave(sPSP,max_files,fileNum);
Bit16u i;
for (i=0; i<20; i++) SetFileHandle(i,(Bit8u)sGet(sPSP,files[i]));
for (i=20; i<fileNum; i++) SetFileHandle(i,0xFF);
- } else {
- sSave(sPSP,max_files,fileNum);
};
return true;
}

Not sure if the devs will care about the issue, as there is no game known to be affected by it, but I have verified the behavior in real DOS:

int2167.png

Reply 27 of 32, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Yes, and I guess going back to 20 exactly is not allowed for in the change.

Furthermore, DOSBox does not currently try to do everything DOS does with INT 21/67. From the RBIL:

If BX <= 20, no action is taken if the handle limit has not yet been increased, and the table is copied back into the PSP if the limit is currently > 20 handles.

AFAICT, DOSBox always allocates more memory, so there is no behavior of copying back into the PSP when reducing to <= 20. There is also no freeing of previous blocks, so you could run out of memory eventually if the handle count is changed multiple times; but most apps are only going to set it once.

I wasn't going to suggest overhauling the function to behave exactly like DOS in all respects when it's probably good enough for most cases, but the 20 minimum is very simple to implement.

Reply 28 of 32, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

maybe a

else if(current_max_files >20) {
sSave..

Would solve this specific case and behave identical for the other case (although the behaviour there is indeed pretty wrong)

Water flows down the stream
How to ask questions the smart way!

Reply 31 of 32, by NolaJen

User metadata
Rank Newbie
Rank
Newbie

Hi
I keep getting the "too many files open" error when I try to run my program in DOSBOX. I cannot find where in the DOSBOX config to change the to files=200 instead of the default 127 (this is what I read that Dosbox uses). I see in this post that someone was able to change it to 250 and I was wondering if someone could tell me where to put that in the config.
Please help, with having to take all of my xp machines off of my network, I am at a loss for getting this program to work.