Repository navigation
Commit 419ba06
committed
mem: don't count reserved memory as used upper memory
Upper memory was a fixed 256K region, 0xA000-0xDFFF, with used taken
as that total minus the free blocks found in the chain. Anything in
the region that the upper memory chain does not reach - video memory,
option ROMs, the BIOS - was therefore reported as in use by somebody,
although DOS can neither give it out nor account for it.
Take the upper total from the chain instead, as FreeDOS MEM does: the
blocks themselves, allocated and free, wherever they sit, and the rest
of the area above 640K is the reserved region, whose size is now what
is left over rather than a fixed 128K.
Measured under dosemu2 with the FreeDOS MEM.EXE beside our own, which
is what dosemu2's test/func_comcom_internal.py compares. With a 32K
hole in the chain, which `$_umb_b0 = (0)` makes:
before after FreeDOS MEM.EXE
Upper 256K 120K 136K 224K 88K 136K 224K 88K 136K
Reserved 128K 128K 0K 160K 160K 0K 160K 160K 0K
The two agreed in the default configuration only by accident: the 36K
hole the chain skips at 0xB800 happens to be the size of the free area
it reports above 0xE000, and the two errors cancelled. With the holes
of any other size, the fixed total charged the difference to "used".
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 167666c commit 419ba06
1 file changed
Lines changed: 21 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
| 64 | + | |
67 | 65 | | |
68 | 66 | | |
69 | 67 | | |
| |||
572 | 570 | | |
573 | 571 | | |
574 | 572 | | |
| 573 | + | |
575 | 574 | | |
576 | 575 | | |
577 | 576 | | |
| |||
662 | 661 | | |
663 | 662 | | |
664 | 663 | | |
| 664 | + | |
665 | 665 | | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
666 | 670 | | |
667 | 671 | | |
668 | 672 | | |
| |||
789 | 793 | | |
790 | 794 | | |
791 | 795 | | |
792 | | - | |
| 796 | + | |
793 | 797 | | |
794 | 798 | | |
795 | 799 | | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
796 | 803 | | |
797 | 804 | | |
798 | 805 | | |
| |||
924 | 931 | | |
925 | 932 | | |
926 | 933 | | |
927 | | - | |
| 934 | + | |
928 | 935 | | |
929 | 936 | | |
930 | 937 | | |
| |||
942 | 949 | | |
943 | 950 | | |
944 | 951 | | |
945 | | - | |
| 952 | + | |
946 | 953 | | |
947 | | - | |
| 954 | + | |
948 | 955 | | |
949 | 956 | | |
950 | 957 | | |
| |||
0 commit comments