Commit eb66956
committed
header.asm: fix crash from DOS DS re-init after INSTALL= sharer (imported)
imported from: https://hg.pushbx.org/ecm/edrdos/rev/6c174e5361fb
Reference: #139
===
In EDR-DOS, the DOS DS is initialised at a high address [1] in the
Low Memory Area and later relocated either to the start of available
memory or to the UMA. This relocation happens after INSTALL= time
but before INSTALLLAST= time. The dos_init pointer is advanced by
3 bytes [2] and then later it is called to re-init the DOS DS after
the relocation [3].
In a retrocomputing stackexchange comment [4] I noticed that lDOS's
DOSREINIT function [5] should take care to relocate SFT references.
(In lDOS / MS-DOS / FreeDOS, the first 5 SFT entries live at
DOSDATA:00CCh. In EDR-DOS due to the SFT layout extension, only 3
entries live there.)
Specifically, if the sharer is installed using INSTALL= then in the
sharer and within SFTs, pointers to the first 5 SFTs could exist at
the time DOSREINIT is called to relocate the DOS DS.
In EDR-DOS, the re-init seems to be done by jumping to the second
DOS entrypoint [6] called "PCMODE Re Init Entry". This branches to
the "pcmode_init2" function [7]. Much like current lDOS, this does
not relocate references to the SFTs. Now here's the kicker: it
re-initialises the sharer jump table [8] -- without regard to what
it contains. So if you install a (compatible) sharer using INSTALL=,
it seems like its entry pointers will be corrupted here because this
code doesn't check that the pointers still point into the DOS DS.
lDOS doesn't have this problem because its sharer jump table's [9]
default entries point into the DOSENTRY segment where they relocate
to the DOSCODE segment [10]. So DOSREINIT never has to relocate the
sharer table contents, nor does anyone else have to.
Homework: Does EDR-DOS indeed crash if the DR-DOS sharer is installed
using INSTALL= ?
===
Installing https://pushbx.org/ecm/download/edrdos/share.zip (file
from the defunct DR-DOS/OpenDOS Enhancement Project [11]) using
INSTALL= does indeed crash current lDOS flavour EDR-DOS, whereas
using INSTALLLAST= or running it from the command prompt don't crash.
[1]: https://hg.pushbx.org/ecm/edrdos/file/a43d98646dad/drbio/biosinit.nas#l481
[2]: https://hg.pushbx.org/ecm/edrdos/file/a43d98646dad/drbio/biosinit.nas#l512
[3]: https://hg.pushbx.org/ecm/edrdos/file/a43d98646dad/drbio/biosinit.nas#l919
[4]: https://retrocomputing.stackexchange.com/questions/31384/whats-the-86-dos-system-with-the-smallest-low-memory-area-footprint#comment113902_31385
[5]: https://hg.pushbx.org/ecm/msdos4/file/108036fb9c72/src/DOS/msinit.nas#l272
[6]: https://hg.pushbx.org/ecm/edrdos/file/a43d98646dad/drdos/header.nas#l113
[7]: https://hg.pushbx.org/ecm/edrdos/file/a43d98646dad/drdos/header.nas#l1557
[8]: https://hg.pushbx.org/ecm/edrdos/file/a43d98646dad/drdos/header.nas#l1601
[9]: https://hg.pushbx.org/ecm/msdos4/file/108036fb9c72/src/DOS/msconst.nas#l169
[10]: https://hg.pushbx.org/ecm/msdos4/file/108036fb9c72/src/BIOS/entry.asm#l198
[11]: http://web.archive.org/web/20111218020655/http://drdosprojects.de/1 parent aaf2359 commit eb66956
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1558 | 1558 | | |
1559 | 1559 | | |
1560 | 1560 | | |
| 1561 | + | |
1561 | 1562 | | |
1562 | 1563 | | |
1563 | 1564 | | |
| |||
1590 | 1591 | | |
1591 | 1592 | | |
1592 | 1593 | | |
1593 | | - | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
1594 | 1600 | | |
1595 | 1601 | | |
1596 | 1602 | | |
| |||
0 commit comments