3 SFT entries stuck in the Low Memory Area? #202
Replies: 2 comments 2 replies
-
Reminded of this while working on #203 |
Beta Was this translation helpful? Give feedback.
-
Doesn't that cause problems with the config.sys CHAIN directive? If MAX_CHAINS is 5 and the files are not closed it would exceed the 8 SFT entries, wouldn't it? CHAIN directive is processed in DoConfig(2) pass, but additional FILES are allocated after that in the PostConfig() function. Btw. CHAIN is a misleading name, as there is nothing "chained". It more resembles a call, continuing the "calling" file at the position after the chain, if I understand the code. MS-DOS does not seem to have this directive? Line 151 in b8ef68f Lines 2610 to 2630 in b8ef68f |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I found that in config.c at
kernel/kernel/config.c
Line 408 in 192cccc
MS-DOS v4 and the lDOS kernel (based on the former) work well with only the 5 SFT entries that are a part of the DOSDATA segment. This may be correlated with the fact that they open the configuration file (
ldos.ini
orconfig.sys
by default, like FreeDOS the names can be changed using the lDOS kernel command line) once and read the entire contents of the file into a buffer, then close the file before processing the config directives. If I recall, the FreeDOS kernel keeps the file opened.(The FreeDOS kernel does have 5 SFT entries in the DOSDATA segment as well, and it never relocates DOSDATA. Enhanced DR-DOS only has 3 SFT entries in the DOSDATA segment, due to its larger layout for the cleaner FAT32 extensions and the additional 2 dwords for FAT+ extension per SFT entry.)
Note that it is not trivial to relocate possibly open SFT entries. In lDOS's DOSREINIT function (called initially to init DOS DS and then upon relocation of DOS DS, which always happens at some point) I specifically added code to process the sharer tables in case the sharer is already installed. This involves the sharer structure known as the Master File Table (MFT), the SFT's own "next SFT" pointer, and the sharer's lock records, all of which may point to open SFTs by a far pointer address.
I already referred to the LMA SFTs both on the freedos-devel list and in a retrocomputing stackexchange answer.
Beta Was this translation helpful? Give feedback.
All reactions