startup rules (Developers)
> I am currently bound by wlink, and I took a look at
> one of my programs and see:
>
> DGROUP 0dec:0004 0000bb4c
>
> Memory size: 00019a10 (104976.)
>
> C:\devel\pdos\src>hexdump pcomm.exe 0 50
> 000000 4D5AF801 8B00F700 40008208 FFFFA118 MZ......@.......
> 000010 00100000 B8B90000 20000000 00000000 ........ .......
>
> minalloc of 882 - I don't have any idea what this
> is for. I assume someone thinks it is a good idea
> to max out the 64k addressable by DS.
(Sorry, may be i am will write the same as you say, - i am not so good known about segment groups in obj/omf, i try live in rdf without this hell , so i am skip some parts)
This is NOT one segment. This is memory can be:
1. Stack segment. IMHO, SS:SP (exe header fields) must point to this area.
2. Multiple bss segments. How to deal with it - this .exe problem and dos don't worry. (exe deal with it via relocation records and this is pain for compiler/linker).
3. Memory available for malloc/free. I don't investigate TC, but 99% it is true for TP and 80% for WC.
How to mean "min memory" and "max memory" into exe:
min memory = stack + all bss + min memory available for malloc/free
max memory = stack + all bss + max memory available for malloc/free
In this memory model, malloc/free (or pascal's getmem/freemem) don't call INT21 to (de)allocate memory. malloc/free have sandbox which full allocated at start and FULL unallocated at end.
So, if program have memory leaks - it will be more safe (then work with INT21).
Bad idea put FFFF to maxmem by default - it cause problem if need run another exe from your program. (i fight with it into make - Exesize-workaround)
I don't known how to change min/max mem values for C compilers/linkers and how it calculates. TP is more flexible and have compiler directive:
{$M stackSizeBytes,minMemoryBytes,maxMemoryBytes}
for example:
{$M 10240,128000,650000}
---
Make DOS great again!
Carthago delenda est, Ceterum censeo Carthaginem delendam esse.
Complete thread:
- startup rules - kerravon, 24.11.2022, 22:47
- startup rules - kerravon, 24.11.2022, 23:04
- startup rules - ecm, 25.11.2022, 08:30
- startup rules - kerravon, 28.11.2022, 23:06
- startup rules - DosWorld, 29.11.2022, 01:21
- startup rules - kerravon, 29.11.2022, 02:24
- startup rules - DosWorld, 29.11.2022, 03:03
- startup rules - kerravon, 29.11.2022, 02:24
- startup rules - DosWorld, 29.11.2022, 01:21
- startup rules - kerravon, 28.11.2022, 23:06