I'm writing a fairly small TSR and in my limited testing (so far only under NTVDM in Windows 7 and under DOS 6.22 running in Bochs) I'm having problems due to the resident size being too small.
According to RBIL the minimum is 11h paragraphs in DOS 2.x and 06h paragraphs in DOS 3.0+. However, in NTVDM under Window 7 (yes, I know it's not "real" DOS) the limit is 0Ch paragraphs. Anything less than that will seem to work - a first mem/c will list the TSR but on subsequent runs it's removed and sometimes other strange things happens such as crashes with an invalid instruction error message with Close or Ignore buttons (selecting Ignore usually causes junk to be printed and in the end I have to close the CMD window anyway).
Of course, this in itself is not a problem. The TSR isn't supposed to work under Windows 7. But then when I test it under DOS 6.22 running in Bochs the machine appears to hang and the Bochs console log window keeps spewing the same message over and over again.
So at this point I start googling and find a post on stackoverflow that links to the source for MS-DOS 2.0 on github: https://github.com/microsoft/MS-DOS...74892b2bb1713bde0f7f/v2.0/source/PROC.ASM#L70
Reading that makes two things clear. The limit is actually 06h paragraphs in DOS 2 (methinks good ole Ralph got confused and mixed things up) and that DOS will actually adjust the value in DX if it's too small.
So, can I count on all DOS versions to behave like this? Will the paragraph count in DX (or the byte count if using INT 27h) be adjusted if too small? I'm guessing not since DOS 6.22 crashed under Bochs and the NTVDM which is supposed to mimic DOS version 5 apparently doesn't.
Can I assume that DOS 3.0+ will work with 11h paragraphs? Or better yet, is there a list of the limits for each version of DOS somewhere (in case the limit for DOS 5 actually is 0Ch paragraphs)?
According to RBIL the minimum is 11h paragraphs in DOS 2.x and 06h paragraphs in DOS 3.0+. However, in NTVDM under Window 7 (yes, I know it's not "real" DOS) the limit is 0Ch paragraphs. Anything less than that will seem to work - a first mem/c will list the TSR but on subsequent runs it's removed and sometimes other strange things happens such as crashes with an invalid instruction error message with Close or Ignore buttons (selecting Ignore usually causes junk to be printed and in the end I have to close the CMD window anyway).
Of course, this in itself is not a problem. The TSR isn't supposed to work under Windows 7. But then when I test it under DOS 6.22 running in Bochs the machine appears to hang and the Bochs console log window keeps spewing the same message over and over again.
So at this point I start googling and find a post on stackoverflow that links to the source for MS-DOS 2.0 on github: https://github.com/microsoft/MS-DOS...74892b2bb1713bde0f7f/v2.0/source/PROC.ASM#L70
Reading that makes two things clear. The limit is actually 06h paragraphs in DOS 2 (methinks good ole Ralph got confused and mixed things up) and that DOS will actually adjust the value in DX if it's too small.
So, can I count on all DOS versions to behave like this? Will the paragraph count in DX (or the byte count if using INT 27h) be adjusted if too small? I'm guessing not since DOS 6.22 crashed under Bochs and the NTVDM which is supposed to mimic DOS version 5 apparently doesn't.
Can I assume that DOS 3.0+ will work with 11h paragraphs? Or better yet, is there a list of the limits for each version of DOS somewhere (in case the limit for DOS 5 actually is 0Ch paragraphs)?