Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

CM's questions, answered (Miscellaneous)

posted by Ninho(R) E-mail, 12.12.2009, 18:22
(edited by Ninho on 12.12.2009, 19:26)

Moving the technical questions to this thread

CM asked :

1 > How do you find the DOS code segment?

There are more than one roads. I try to choose the quickest yet secure one.
Here's my pick. Once we've asserted we are under a true MSWinDOS 7/8, as discussed in earlier exchanges :

- Case DOS 8 (checked the version of IO.SYS for floppies, since the regular one does not even process a Config.Sys hence is of no relevance) : easiest, DOSCode = FFFFh. Seems to be hardwired, HiMem is built-into IO.SYS and DOS is always loaded in the HMA (DOS=LOW has no effect).

Amusingly Microsoft seems to ignore this fact and includes a copy of HIMEM.SYS on their boot disquettes, which is just wasting space (unless you want to give HIMEM extra parameters, you may delete it).

- Case DOS 7.x : peek into DOSData, there is a table of 8 far pointers used by DOS to jump to the actual internal interrupt entries in its main code segment, whether in HMA or not.
Any one will do, they should all have the desired segment number - of particular interest may be the pointer to int 27 code, at DATA:0F8E, because that one points very near the Magic TEST Instruction, that could provide a double/triple checking if we wanted.

2 > How do you locate the instruction that has to be patched?
Search for the MTI and a few bytes of context. Actually the MTI alone appears to be unique in the CodeSeg, adding some context will render us quieter. And we could add more checks like the proximity to the int 27 entry per the above, or check vs. the offsets we found by manual examination of various versions of IO.SYS. The MTI should not wander too far away from its expected location, even allowing for internal revisions, QFEs and the like. Not all these checks will be needed I think.

3 > If you release the program (hopefully generally including the source), could you document the DOS data segment items that you found to be used by MS-DOS? I'm just interested.

I think I will provide the source code per request rather than make it downloadable anonymously. I'll try to make the comments readable and useful before that happens.




Complete thread:

Back to the forum
Board view  Mix view
15296 Postings in 1378 Threads, 254 registered users, 13 users online (0 registered, 13 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum