Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Delta: A real man lands where he wants to. -- David Letterman


devel / comp.os.msdos.programmer / initial memory

SubjectAuthor
* initial memorymuta...@gmail.com
+* Re: initial memoryJJ
|`* Re: initial memorymuta...@gmail.com
| +* Re: initial memoryMateusz Viste
| |+- Re: initial memorymuta...@gmail.com
| |`* Re: initial memoryJJ
| | +- Re: initial memoryR.Wieser
| | `* Re: initial memoryMateusz Viste
| |  +* Re: initial memoryR.Wieser
| |  |`* Re: initial memoryMateusz Viste
| |  | `* Re: initial memoryR.Wieser
| |  |  `* Re: initial memoryMateusz Viste
| |  |   +* Re: initial memoryR.Wieser
| |  |   |`* Re: initial memoryMateusz Viste
| |  |   | `- Re: initial memoryR.Wieser
| |  |   `* Re: initial memorymuta...@gmail.com
| |  |    `- Re: initial memoryMateusz Viste
| |  `- Re: initial memoryJJ
| `* Re: initial memoryJJ
|  `* Re: initial memorymuta...@gmail.com
|   `* Re: initial memoryJJ
|    `* Re: initial memorymuta...@gmail.com
|     `- Re: initial memoryJJ
`* Re: initial memoryR.Wieser
 `* Re: initial memorymuta...@gmail.com
  `* Re: initial memoryR.Wieser
   `* Re: initial memorymuta...@gmail.com
    `* Re: initial memoryR.Wieser
     `* Re: initial memory - SS:SPR.Wieser
      `- Re: initial memory - SS:SPR.Wieser

Pages:12
initial memory

<8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=147&group=comp.os.msdos.programmer#147

  copy link   Newsgroups: comp.os.msdos.programmer
X-Received: by 2002:a05:6214:c28:: with SMTP id a8mr16553491qvd.24.1638482825322;
Thu, 02 Dec 2021 14:07:05 -0800 (PST)
X-Received: by 2002:ad4:5f87:: with SMTP id jp7mr15774731qvb.28.1638482825187;
Thu, 02 Dec 2021 14:07:05 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.msdos.programmer
Date: Thu, 2 Dec 2021 14:07:04 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=202.169.113.201; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 202.169.113.201
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com>
Subject: initial memory
From: mutazilah@gmail.com (muta...@gmail.com)
Injection-Date: Thu, 02 Dec 2021 22:07:05 +0000
Content-Type: text/plain; charset="UTF-8"
 by: muta...@gmail.com - Thu, 2 Dec 2021 22:07 UTC

When some/all com/exe receive control from MSDOS,
all available memory has been allocated and the onus
is on the executable to free it if it wishes to be able to
do some mallocs in the future.

What is the rationale for this, and what is the situation?

I have startup code below that resizes that memory, as
per rules I no longer remember. I'd like to remove this
code if possible because it hardcodes the segment
shift (4), and it prevents the code/data/stack being
placed in non-contiguous areas of memory.

Where do I stand?

Thanks. Paul.

; determine how much memory is needed. The stack pointer points
; to the top. Work out what segment that is, then subtract the
; starting segment (the PSP), and you have your answer.

mov ax, sp
mov cl, 4
shr ax, cl ; get sp into pages
mov bx, ss
add ax, bx
add ax, 2 ; safety margin because we've done some pushes etc
mov bx, es
sub ax, bx ; subtract the psp segment

; free initially allocated memory

mov bx, ax
mov ah, 4ah
int 21h

Re: initial memory

<8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=148&group=comp.os.msdos.programmer#148

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!Fk1lZGC01RcTAqqOTDGujQ.user.46.165.242.91.POSTED!not-for-mail
From: jj4public@gmail.com (JJ)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Fri, 3 Dec 2021 15:05:58 +0700
Organization: Aioe.org NNTP Server
Message-ID: <8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="2385"; posting-host="Fk1lZGC01RcTAqqOTDGujQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: 40tude_Dialog/2.0.15.84
X-Notice: Filtered by postfilter v. 0.9.2
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
 by: JJ - Fri, 3 Dec 2021 08:05 UTC

On Thu, 2 Dec 2021 14:07:04 -0800 (PST), muta...@gmail.com wrote:
> When some/all com/exe receive control from MSDOS,
> all available memory has been allocated and the onus
> is on the executable to free it if it wishes to be able to
> do some mallocs in the future.
>
> What is the rationale for this, and what is the situation?

It's for backward compatibility reason. Keep in mind that, MCB is added only
at later DOS version.

> I have startup code below that resizes that memory, as
> per rules I no longer remember. I'd like to remove this
> code if possible because it hardcodes the segment
> shift (4), and it prevents the code/data/stack being
> placed in non-contiguous areas of memory.
>
> Where do I stand?
>
> Thanks. Paul.

That code shouldn't removed for TSRs and programs which need to spawn other
program. If a program needs continuous memory area, it needs to do so
manually.

MCB is not meant to separate programs' parts such as initial data, stacks,
heaps, buffers, etc. In DOS, those are application managed. As for stack,
DOS simply prepares the memory area for it. It's up to the application what
to do with it, once DOS gives control to the application.

Re: initial memory

<da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=149&group=comp.os.msdos.programmer#149

  copy link   Newsgroups: comp.os.msdos.programmer
X-Received: by 2002:a05:622a:389:: with SMTP id j9mr19821387qtx.504.1638520681556;
Fri, 03 Dec 2021 00:38:01 -0800 (PST)
X-Received: by 2002:a05:622a:14d1:: with SMTP id u17mr18939455qtx.579.1638520681406;
Fri, 03 Dec 2021 00:38:01 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.msdos.programmer
Date: Fri, 3 Dec 2021 00:38:01 -0800 (PST)
In-Reply-To: <8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net>
Injection-Info: google-groups.googlegroups.com; posting-host=202.169.113.201; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 202.169.113.201
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com> <8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com>
Subject: Re: initial memory
From: mutazilah@gmail.com (muta...@gmail.com)
Injection-Date: Fri, 03 Dec 2021 08:38:01 +0000
Content-Type: text/plain; charset="UTF-8"
 by: muta...@gmail.com - Fri, 3 Dec 2021 08:38 UTC

On Friday, December 3, 2021 at 7:06:01 PM UTC+11, JJ wrote:

> That code shouldn't removed for TSRs and programs which need to spawn other
> program.

Ok, this is generic startup code for C programs, which may
do a system().

So for all executables, all of memory is allocated until
released?

Do you think that ideally MSDOS 2.0 should have included
a call to auto-release extra memory?

PDOS/86 has the ability to add extra calls like that. But I
need some way of testing whether I am running under a
PDOS-compliant (or some other existing standard). I was
thinking of getting the MSDOS version number and if it
was 0.1 or something like that, then it meant additional
calls were available to find more things like manufacturer
and capability (extra INT 21H calls).

BFN. Paul.

Re: initial memory

<soclec$tcv$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=150&group=comp.os.msdos.programmer#150

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!a/T4ApFfDwfCJeUuLpbuYw.user.46.165.242.75.POSTED!not-for-mail
From: mateusz@xyz.invalid (Mateusz Viste)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Fri, 3 Dec 2021 09:45:00 +0100
Organization: . . .
Message-ID: <soclec$tcv$1@gioia.aioe.org>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com>
<8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net>
<da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="30111"; posting-host="a/T4ApFfDwfCJeUuLpbuYw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Mateusz Viste - Fri, 3 Dec 2021 08:45 UTC

2021-12-03 at 00:38 -0800, muta...@gmail.com wrote:
> So for all executables, all of memory is allocated until
> released?

AFAIK this is true only for COM files, where CS=DS=ES=SS.
This mechanism allows for a very easy way DOS can load these programs.
Just allocate a single 64K block, put the COM image there, prefixed
with a PSP, preset CS=DS=ES=SS and point SP to the end of block.
EXE-style loading, in contrast, is *way* more complex.

> Do you think that ideally MSDOS 2.0 should have included
> a call to auto-release extra memory?

There is no reliable way to know how much memory your program needs.
Only you know that.

Mateusz

Re: initial memory

<c9beac2d-b41f-4831-b3be-600b1e23ae61n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=151&group=comp.os.msdos.programmer#151

  copy link   Newsgroups: comp.os.msdos.programmer
X-Received: by 2002:a05:6214:13d1:: with SMTP id cg17mr17516415qvb.131.1638523354238;
Fri, 03 Dec 2021 01:22:34 -0800 (PST)
X-Received: by 2002:ac8:5c16:: with SMTP id i22mr19123366qti.641.1638523354096;
Fri, 03 Dec 2021 01:22:34 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.msdos.programmer
Date: Fri, 3 Dec 2021 01:22:33 -0800 (PST)
In-Reply-To: <soclec$tcv$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=202.169.113.201; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 202.169.113.201
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com>
<8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net> <da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com>
<soclec$tcv$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c9beac2d-b41f-4831-b3be-600b1e23ae61n@googlegroups.com>
Subject: Re: initial memory
From: mutazilah@gmail.com (muta...@gmail.com)
Injection-Date: Fri, 03 Dec 2021 09:22:34 +0000
Content-Type: text/plain; charset="UTF-8"
 by: muta...@gmail.com - Fri, 3 Dec 2021 09:22 UTC

On Friday, December 3, 2021 at 7:45:01 PM UTC+11, Mateusz Viste wrote:

> > Do you think that ideally MSDOS 2.0 should have included
> > a call to auto-release extra memory?

> There is no reliable way to know how much memory your program needs.
> Only you know that.

It looks like this is the problem:

https://stackoverflow.com/questions/43214906/asm-exe-program-16bit-error-changing-size-of-memory

tlink (which is what I originally used) puts x'ffff' as the number
of paragraphs to allocate, meaning allocate all memory.

So this problem needs to be solved by me using a sensible
toolchain.

I still need to know whether PDOS extensions are available
though, because I want to be able to allocate memory by a
32-bit number of bytes rather than paragraphs (and returns
a far pointer), so need another API call. Because I want to
produce an executable that works on both RM16 and PM16
with linear GDT+LDT.

BFN. Paul.

Re: initial memory

<socrrm$1tl0$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=152&group=comp.os.msdos.programmer#152

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Fri, 3 Dec 2021 11:25:35 +0100
Organization: Aioe.org NNTP Server
Lines: 57
Message-ID: <socrrm$1tl0$1@gioia.aioe.org>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com>
Injection-Info: gioia.aioe.org; logging-data="63136"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
 by: R.Wieser - Fri, 3 Dec 2021 10:25 UTC

Muta,

> I have startup code below that resizes that memory, as
> per rules I no longer remember.
....
> mov ax, sp
> mov cl, 4
> shr ax, cl ; get sp into pages

When a COM runs SP is set to the end of the SS segment. As a COM has all
the segments overlapping its upto how big your program is how much stack you
are actually reserving. But looking at my own programs I don't think that
reserving 60KB stack for a 4KB program is normally called for.

Hence I set SP myself (sometimes even to the programs top at 0100h) and
instead use a LASTBYTE label to figure out how much room I actually need
calculated the # of pages from it :

- - - - - - - - - - - - - - - - - - - -
lea sp,[StackTop] ;Set new Stack-top

mov bx,(offset LASTBYTE)+000Fh ;number of bytes in program + round-up
mov cl,04h ;convert to pages
shr bx,cl ;/
mov ah,4ah ;resize program space
int 21h ;/
jc @@Main_Error ;ERROR : Out of Memory !
- - - - - - - - - - - - - - - - - - - -

As you might see, I also made sure I could actually allocate it, as its
possible a COM gets loaded in a memory fragment thats not actually large
enough to hold it and the "extra" memory it needs.

> So for all executables, all of memory is allocated until
> released?

Yes for a .COM style program, and "it depends" for a .EXE style one - as
that latter one has got a header wich specifies lots of stuff.

> tlink (which is what I originally used) puts x'ffff' as the number
> of paragraphs to allocate, meaning allocate all memory.

Indeed it does (using Borlands Tasm v4.1 and TLink v7.1). I've never been
able to find a "minimize footprint" switch or setting, which has irked me to
no end. You see, one of the fields in an .EXEs header is
"min_extra_paragraphs" , containing - you guessed it - exactly how much it
needs. As such I wrote a small program that copies that field into the
"max_extra_paragraphs" one (which is, in our case, the culprit), recalculate
the SS:SP value from it and put it into their respective fields.

From than on the OS does, for the .EXE, all the work for me, allowing me to
drop the "shrink my memory" code from it. :-)

Regards,
Rudy Wieser

Re: initial memory

<0e2bde4b-b93c-481c-9525-cdb03d863b1dn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=153&group=comp.os.msdos.programmer#153

  copy link   Newsgroups: comp.os.msdos.programmer
X-Received: by 2002:a05:620a:4107:: with SMTP id j7mr16856600qko.645.1638530324538;
Fri, 03 Dec 2021 03:18:44 -0800 (PST)
X-Received: by 2002:a05:620a:2589:: with SMTP id x9mr16646704qko.325.1638530324387;
Fri, 03 Dec 2021 03:18:44 -0800 (PST)
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.msdos.programmer
Date: Fri, 3 Dec 2021 03:18:44 -0800 (PST)
In-Reply-To: <socrrm$1tl0$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=202.169.113.201; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 202.169.113.201
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com> <socrrm$1tl0$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0e2bde4b-b93c-481c-9525-cdb03d863b1dn@googlegroups.com>
Subject: Re: initial memory
From: mutazilah@gmail.com (muta...@gmail.com)
Injection-Date: Fri, 03 Dec 2021 11:18:44 +0000
Content-Type: text/plain; charset="UTF-8"
 by: muta...@gmail.com - Fri, 3 Dec 2021 11:18 UTC

On Friday, December 3, 2021 at 9:34:34 PM UTC+11, R.Wieser wrote:

> > tlink (which is what I originally used) puts x'ffff' as the number
> > of paragraphs to allocate, meaning allocate all memory.

> Indeed it does (using Borlands Tasm v4.1 and TLink v7.1). I've never been
> able to find a "minimize footprint" switch or setting, which has irked me to
> no end. You see, one of the fields in an .EXEs header is
> "min_extra_paragraphs" , containing - you guessed it - exactly how much it
> needs. As such I wrote a small program that copies that field into the
> "max_extra_paragraphs" one (which is, in our case, the culprit), recalculate
> the SS:SP value from it and put it into their respective fields.

Could you explain these min/max/ss:sp rules please?

I see from here:

http://blog.marcinchwedczuk.pl/a-closer-look-at-portable-executable-msdos-stub

e_cp: 0x0003 // Pages in file

e_minalloc: 0x0000 // Minimum extra paragraphs needed
e_maxalloc: 0xffff // Maximum extra paragraphs needed

e_ss: 0x0000 // Initial (relative) SS value
e_sp: 0x00b8 // Initial SP value

What I would guess is that e_minalloc is the size of the
bss and stack segment. e_cp is the size of the code and
data segments (not including bss).

And thus I don't know why you can't just copy the minalloc
value to the maxalloc.

Or maybe minalloc is ONLY the bss size, in which case the
maxalloc extends the BSS, and the stack is placed after that.
That would be surprising though, as it means when you
release the memory you create a hole. But maybe the
allocated memory doesn't include the stack in the first place.

Looking at the PDOS/86 code it looks like the stack size is
included, and you can't create a hole otherwise your stack
will be overwritten by a spawned program.

BFN. Paul.

Re: initial memory

<sod5i3$j44$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=154&group=comp.os.msdos.programmer#154

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Fri, 3 Dec 2021 14:19:21 +0100
Organization: Aioe.org NNTP Server
Lines: 43
Message-ID: <sod5i3$j44$1@gioia.aioe.org>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com> <socrrm$1tl0$1@gioia.aioe.org> <0e2bde4b-b93c-481c-9525-cdb03d863b1dn@googlegroups.com>
Injection-Info: gioia.aioe.org; logging-data="19588"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-RFC2646: Format=Flowed; Original
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MSMail-Priority: Normal
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Fri, 3 Dec 2021 13:19 UTC

Mta (paul),

> Could you explain these min/max/ss:sp rules please?

Perhaps. Its a while ago ...

> What I would guess is that e_minalloc is the size of the
> bss and stack segment.

Yup.

> And thus I don't know why you can't just copy the minalloc
> value to the maxalloc.

Thats exactly what I did.

But when you do that you also need to recalculate SS/SP, otherwise it most
likely will point far beyond your program. Which is not a good idea.

> Looking at the PDOS/86 code it looks like the stack size is
> included,

Yep. Its comprised of all data areas that have no ititial value.

> and you can't create a hole otherwise your stack
> will be overwritten by a spawned program.

I think we need to define what a "hole" is here. But yes, its never a good
idea use memory areas you do not own for either BSS or stack.

> Or maybe minalloc is ONLY the bss size

Definitily not.

But why don't you just try to make a program in which you enlarge the code,
BSS and stack areas (several combinations) and look at how the fields in the
EXE header change ? I found the EXE header info on the web and that is
what I did to verify if I understood it right.

Regards,
Rudy Wieser

Re: initial memory

<6600e32b-5168-459a-ab8d-93eeeca412b8n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=155&group=comp.os.msdos.programmer#155

  copy link   Newsgroups: comp.os.msdos.programmer
X-Received: by 2002:a05:6214:20ee:: with SMTP id 14mr21879814qvk.94.1638560145031;
Fri, 03 Dec 2021 11:35:45 -0800 (PST)
X-Received: by 2002:a37:ec2:: with SMTP id 185mr19220394qko.690.1638560144903;
Fri, 03 Dec 2021 11:35:44 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.msdos.programmer
Date: Fri, 3 Dec 2021 11:35:44 -0800 (PST)
In-Reply-To: <sod5i3$j44$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=202.169.113.201; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 202.169.113.201
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com>
<socrrm$1tl0$1@gioia.aioe.org> <0e2bde4b-b93c-481c-9525-cdb03d863b1dn@googlegroups.com>
<sod5i3$j44$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6600e32b-5168-459a-ab8d-93eeeca412b8n@googlegroups.com>
Subject: Re: initial memory
From: mutazilah@gmail.com (muta...@gmail.com)
Injection-Date: Fri, 03 Dec 2021 19:35:45 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2206
 by: muta...@gmail.com - Fri, 3 Dec 2021 19:35 UTC

On Saturday, December 4, 2021 at 12:20:05 AM UTC+11, R.Wieser wrote:

> > And thus I don't know why you can't just copy the minalloc
> > value to the maxalloc.

> Thats exactly what I did.
>
> But when you do that you also need to recalculate SS/SP, otherwise it most
> likely will point far beyond your program. Which is not a good idea.

If the SS/SP are disturbed it implies that the difference between
minalloc and maxalloc is put between the bss and stack.

In addition, it means when MSDOS is loading the program,
it would need to manipulate the SS itself, depending how
much memory between minalloc and maxalloc it was able
to allocate.

> But why don't you just try to make a program in which you enlarge the code,
> BSS and stack areas (several combinations) and look at how the fields in the
> EXE header change ? I found the EXE header info on the web and that is
> what I did to verify if I understood it right.

That's a good idea.

Thanks. Paul.

Re: initial memory

<soe3dh$uvq$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=156&group=comp.os.msdos.programmer#156

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Fri, 3 Dec 2021 22:30:51 +0100
Organization: Aioe.org NNTP Server
Lines: 31
Message-ID: <soe3dh$uvq$1@gioia.aioe.org>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com> <socrrm$1tl0$1@gioia.aioe.org> <0e2bde4b-b93c-481c-9525-cdb03d863b1dn@googlegroups.com> <sod5i3$j44$1@gioia.aioe.org> <6600e32b-5168-459a-ab8d-93eeeca412b8n@googlegroups.com>
Injection-Info: gioia.aioe.org; logging-data="31738"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-MSMail-Priority: Normal
X-Notice: Filtered by postfilter v. 0.9.2
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Priority: 3
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Fri, 3 Dec 2021 21:30 UTC

Muta (paul),

> If the SS/SP are disturbed it implies that the difference between
> minalloc and maxalloc is put between the bss and stack.

Nope. Minalloc refers to to the end of the combined the bss and following
stack segments. Maxalloc can go, as you read yourself, way beyond that.

But I owe you an apology : I remember updating SS/SP after setting MaxAlloc
to MinAlloc, but a peek into my program (still have it!) showed I made it
optional. In case I did not define a stack segment at all (but just kept
some BSS space free for it), causing SS:SP to be Zero in the EXE header.
And that ofcourse doesn't really work. So, I than can force it to be set to
the end of the BSS segment itself.

IOW, for a program in which a stack segment has been defined you only need,
as you mentioned, to copy MinAlloc into MaxAlloc.

I hope I did not create to much of a confusion.

> That's a good idea.

:-) Its the way I've had to, and still do figure out lots of stuff, which
sometimes makes you run into the darnest things. And even when full
documentation was/is available I always had/have the need to verify what was
said.

Regards,
Rudy Wieser

Re: initial memory

<18xw4wam0sv01$.15vxgi1xg9ahw.dlg@40tude.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=157&group=comp.os.msdos.programmer#157

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!IV51k2578VAyZaOT4WBlVQ.user.46.165.242.91.POSTED!not-for-mail
From: jj4public@gmail.com (JJ)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Sat, 4 Dec 2021 14:00:06 +0700
Organization: Aioe.org NNTP Server
Message-ID: <18xw4wam0sv01$.15vxgi1xg9ahw.dlg@40tude.net>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com> <8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net> <da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com> <soclec$tcv$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="28277"; posting-host="IV51k2578VAyZaOT4WBlVQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: 40tude_Dialog/2.0.15.84
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Notice: Filtered by postfilter v. 0.9.2
 by: JJ - Sat, 4 Dec 2021 07:00 UTC

On Fri, 3 Dec 2021 09:45:00 +0100, Mateusz Viste wrote:
> 2021-12-03 at 00:38 -0800, muta...@gmail.com wrote:
>> So for all executables, all of memory is allocated until
>> released?
>
> AFAIK this is true only for COM files, where CS=DS=ES=SS.

EXE files can be made to allocate the maximum available memory. e.g.
compiling a tiny model program into an EXE.

Re: initial memory

<50lb84n8i1yv$.aq6aqn9li16a$.dlg@40tude.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=158&group=comp.os.msdos.programmer#158

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!IV51k2578VAyZaOT4WBlVQ.user.46.165.242.91.POSTED!not-for-mail
From: jj4public@gmail.com (JJ)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Sat, 4 Dec 2021 14:01:21 +0700
Organization: Aioe.org NNTP Server
Message-ID: <50lb84n8i1yv$.aq6aqn9li16a$.dlg@40tude.net>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com> <8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net> <da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="28284"; posting-host="IV51k2578VAyZaOT4WBlVQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: 40tude_Dialog/2.0.15.84
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Notice: Filtered by postfilter v. 0.9.2
 by: JJ - Sat, 4 Dec 2021 07:01 UTC

On Fri, 3 Dec 2021 00:38:01 -0800 (PST), muta...@gmail.com wrote:
> On Friday, December 3, 2021 at 7:06:01 PM UTC+11, JJ wrote:
>
> So for all executables, all of memory is allocated until
> released?

For EXE files, it's header tells DOS how much memory should be allocated -
which can be specific amount, or maximum available.

> Do you think that ideally MSDOS 2.0 should have included
> a call to auto-release extra memory?

No, because that may break compatibility with old programs which are not
aware of MCBs. The program may end up corrupting the MCB following the
current one.

> PDOS/86 has the ability to add extra calls like that. But I
> need some way of testing whether I am running under a
> PDOS-compliant (or some other existing standard). I was
> thinking of getting the MSDOS version number and if it
> was 0.1 or something like that, then it meant additional
> calls were available to find more things like manufacturer
> and capability (extra INT 21H calls).
>
> BFN. Paul.

You can use the DOS OEM number returned by AH=30h. Though, that service is
DOS 2.0+ only. For DOS 1.0, I don't think there's a CP/M specification to
provide ID for CP/M variants.

Re: initial memory

<sof888$9ts$2@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=159&group=comp.os.msdos.programmer#159

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Sat, 4 Dec 2021 08:39:34 +0100
Organization: Aioe.org NNTP Server
Lines: 18
Message-ID: <sof888$9ts$2@gioia.aioe.org>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com> <8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net> <da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com> <soclec$tcv$1@gioia.aioe.org> <18xw4wam0sv01$.15vxgi1xg9ahw.dlg@40tude.net>
Injection-Info: gioia.aioe.org; logging-data="10172"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
 by: R.Wieser - Sat, 4 Dec 2021 07:39 UTC

JJ,

> EXE files can be made to allocate the maximum available memory.
> e.g. compiling a tiny model program into an EXE.

Hmmm... MaxAlloc getting set to $FFFF because of using the tiny model ? I
did not consider that - I always thought it was just a(n obnoxious) TLink
thing ...

Even after all these years I still learn new stuff. :-)

And I just remembered a problem I've never been able to figure out having to
do with not using the tiny model. Firing off a new subject in 3.. 2.. 1..

Regards,
Rudy Wieser

Re: initial memory

<sof98p$ihu$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=161&group=comp.os.msdos.programmer#161

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!a/T4ApFfDwfCJeUuLpbuYw.user.46.165.242.75.POSTED!not-for-mail
From: mateusz@xyz.invalid (Mateusz Viste)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Sat, 4 Dec 2021 09:35:37 +0100
Organization: . . .
Message-ID: <sof98p$ihu$1@gioia.aioe.org>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com>
<8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net>
<da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com>
<soclec$tcv$1@gioia.aioe.org>
<18xw4wam0sv01$.15vxgi1xg9ahw.dlg@40tude.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="19006"; posting-host="a/T4ApFfDwfCJeUuLpbuYw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Mateusz Viste - Sat, 4 Dec 2021 08:35 UTC

2021-12-04 at 14:00 +0700, JJ wrote:
> On Fri, 3 Dec 2021 09:45:00 +0100, Mateusz Viste wrote:
> > 2021-12-03 at 00:38 -0800, muta...@gmail.com wrote:
> >> So for all executables, all of memory is allocated until
> >> released?
> >
> > AFAIK this is true only for COM files, where CS=DS=ES=SS.
>
> EXE files can be made to allocate the maximum available memory. e.g.
> compiling a tiny model program into an EXE.

"can be made", yes, through fiddling with exe headers, but then that's
done on purpose, and not a by-design behavior, right?

Mateusz

Re: initial memory

<b30669e2-c878-4b1c-bd05-9a4f042c04e9n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=162&group=comp.os.msdos.programmer#162

  copy link   Newsgroups: comp.os.msdos.programmer
X-Received: by 2002:a05:620a:284b:: with SMTP id h11mr22507559qkp.90.1638612015440; Sat, 04 Dec 2021 02:00:15 -0800 (PST)
X-Received: by 2002:a05:620a:2493:: with SMTP id i19mr22067594qkn.40.1638612015271; Sat, 04 Dec 2021 02:00:15 -0800 (PST)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.msdos.programmer
Date: Sat, 4 Dec 2021 02:00:15 -0800 (PST)
In-Reply-To: <50lb84n8i1yv$.aq6aqn9li16a$.dlg@40tude.net>
Injection-Info: google-groups.googlegroups.com; posting-host=202.169.113.201; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 202.169.113.201
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com> <8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net> <da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com> <50lb84n8i1yv$.aq6aqn9li16a$.dlg@40tude.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b30669e2-c878-4b1c-bd05-9a4f042c04e9n@googlegroups.com>
Subject: Re: initial memory
From: mutazilah@gmail.com (muta...@gmail.com)
Injection-Date: Sat, 04 Dec 2021 10:00:15 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 51
 by: muta...@gmail.com - Sat, 4 Dec 2021 10:00 UTC

On Saturday, December 4, 2021 at 6:01:23 PM UTC+11, JJ wrote:

> > PDOS/86 has the ability to add extra calls like that. But I
> > need some way of testing whether I am running under a
> > PDOS-compliant (or some other existing standard). I was
> > thinking of getting the MSDOS version number and if it
> > was 0.1 or something like that, then it meant additional
> > calls were available to find more things like manufacturer
> > and capability (extra INT 21H calls).

> You can use the DOS OEM number returned by AH=30h. Though, that service is
> DOS 2.0+ only. For DOS 1.0, I don't think there's a CP/M specification to
> provide ID for CP/M variants.

DOS 2.0+ is fine. Thanks for that.

I see that Freedos already has a number. I might make
contact with them. I really need a number that does not
represent a particular OEM but instead a "standard". And
I just realized that if MSDOS was theoretically updated to
follow the standard, they wouldn't be able to switch to that
new number. Hmmm. Maybe they could. Maybe everyone
who wished to follow the standard could switch to that
number, and then if they wanted the "true manufacturer"
they have to do another API call.

Any thoughts?

There are a few extensions I am after:

1. A memory allocation routine that takes a 32-bit number
of bytes and returns a far pointer. I might also have a flag
to say whether I want the memory to be allocated in the
first 1 MiB. This is for a theoretical processor where the
segment shift value can be changed from 4 to anything
up to 16, or the equivalent is being done using a selector
and GDT+LDT maxed out and lined up.

2. I want to know if there is a PDOS-generic style parameters
on the stack.

3. I want a routine that takes a far pointer and a 32-bit integer
and adds them together to produce a normalized far pointer
(huge pointer) as per current segment shift/selector rules.

4. I want a routine to get the command line.

I'm not 100% certain about this because I think I might have
to instead just create a new 8086 OS and not attempt to be
MSDOS-compatible.

BFN. Paul.

Re: initial memory

<sofle0$1i11$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=163&group=comp.os.msdos.programmer#163

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Sat, 4 Dec 2021 13:00:51 +0100
Organization: Aioe.org NNTP Server
Lines: 15
Message-ID: <sofle0$1i11$1@gioia.aioe.org>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com><8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net><da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com><soclec$tcv$1@gioia.aioe.org><18xw4wam0sv01$.15vxgi1xg9ahw.dlg@40tude.net> <sof98p$ihu$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="51233"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Priority: 3
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Notice: Filtered by postfilter v. 0.9.2
X-MSMail-Priority: Normal
 by: R.Wieser - Sat, 4 Dec 2021 12:00 UTC

Mateusz,

> "can be made", yes, through fiddling with exe headers,
> but then that's done on purpose, and not a by-design
> behavior, right?

In the case of Borlands Tasm it seems to be by design. And with no option
to override *I* had to "fiddle" the EXE headers. :-\

And pardon me saying so, but how is "by design" *not* "on purpose" :-)

Regards,
Rudy Wieser

Re: initial memory

<sofluh$1la0$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=164&group=comp.os.msdos.programmer#164

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!a/T4ApFfDwfCJeUuLpbuYw.user.46.165.242.75.POSTED!not-for-mail
From: mateusz@xyz.invalid (Mateusz Viste)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Sat, 4 Dec 2021 13:12:01 +0100
Organization: . . .
Message-ID: <sofluh$1la0$1@gioia.aioe.org>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com>
<8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net>
<da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com>
<soclec$tcv$1@gioia.aioe.org>
<18xw4wam0sv01$.15vxgi1xg9ahw.dlg@40tude.net>
<sof98p$ihu$1@gioia.aioe.org>
<sofle0$1i11$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="54592"; posting-host="a/T4ApFfDwfCJeUuLpbuYw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Mateusz Viste - Sat, 4 Dec 2021 12:12 UTC

2021-12-04 at 13:00 +0100, R.Wieser wrote:
> In the case of Borlands Tasm it seems to be by design. And with no
> option to override *I* had to "fiddle" the EXE headers. :-\

Still, the Tasm tool does it on purpose. It has choice, it just decides
oterwise. When dealing with COM files, there is no choice.

> And pardon me saying so, but how is "by design" *not* "on purpose" :-)

The design of the COM-style loading led to simplistic stack
sizing and allocation. I doubt COM loading was designed with the
specific goal of allocating a full 64K of memory with stack at the end -
it was just a consequence of an earlier design choice.

In the case of EXE files, there are headers to deal with this
situation. A tool that sets the headers in a specific way does so on
purpose.

Mateusz

Re: initial memory

<sofvm6$1ruj$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=166&group=comp.os.msdos.programmer#166

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Sat, 4 Dec 2021 15:55:30 +0100
Organization: Aioe.org NNTP Server
Lines: 24
Message-ID: <sofvm6$1ruj$1@gioia.aioe.org>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com><8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net><da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com><soclec$tcv$1@gioia.aioe.org><18xw4wam0sv01$.15vxgi1xg9ahw.dlg@40tude.net><sof98p$ihu$1@gioia.aioe.org><sofle0$1i11$1@gioia.aioe.org> <sofluh$1la0$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="61395"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-RFC2646: Format=Flowed; Original
X-Priority: 3
X-Notice: Filtered by postfilter v. 0.9.2
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Sat, 4 Dec 2021 14:55 UTC

Mateusz,

> Still, the Tasm tool does it on purpose.

Thats how its normally done. Waiting for it to do it by accident could
take a loooong time. :-)

> It has choice, it just decides oterwise.

You sound as if you think it made the wrong one. Which decision do you
think should it have made and on what grounds ?

> When dealing with COM files, there is no choice.

Huh? I thought I was responding to a remark pertaining the EXE style
programs.

But yes, I know that with the COM format there isn't much choice in this
regard. As such I already removed it from consideration.

Regards,
Rudy Wieser

Re: initial memory

<sog1jd$1vpa$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=168&group=comp.os.msdos.programmer#168

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!a/T4ApFfDwfCJeUuLpbuYw.user.46.165.242.75.POSTED!not-for-mail
From: mateusz@xyz.invalid (Mateusz Viste)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Sat, 4 Dec 2021 16:30:53 +0100
Organization: . . .
Message-ID: <sog1jd$1vpa$1@gioia.aioe.org>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com>
<8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net>
<da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com>
<soclec$tcv$1@gioia.aioe.org>
<18xw4wam0sv01$.15vxgi1xg9ahw.dlg@40tude.net>
<sof98p$ihu$1@gioia.aioe.org>
<sofle0$1i11$1@gioia.aioe.org>
<sofluh$1la0$1@gioia.aioe.org>
<sofvm6$1ruj$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="65322"; posting-host="a/T4ApFfDwfCJeUuLpbuYw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Mateusz Viste - Sat, 4 Dec 2021 15:30 UTC

2021-12-04 at 15:55 +0100, R.Wieser wrote:
> You sound as if you think it made the wrong one. Which decision do
> you think should it have made and on what grounds ?

I don't think it made the wrong one. Or the good one. I do not discuss
the choice itself, surely it was backed up with careful consideration. I
only point out that it *is* a choice of the tool you use.

Now, just wondering aloud: is there an obvious reason why
Tasm does not pre-set MAXALLOC to be the same as MINALLOC? In the case
of high-level compilers, having a big MAXALLOC allows the runtime
to provide near pointers to the program via malloc(), but I assume that
Tasm, being an assembler, does not provide such conveniences.

Isn't it because the EXE header is, in fact, not generated by Tasm,
but by the linker (tlink)? Tlink might not know whether or not the
objects it links together come from Tasm or something else (that might
include libc calls). If that would be vaguely correct, then maybe
there's some tlink switch that could make it behave differently in this
context?

Mateusz

Re: initial memory

<sog9d5$gc3$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=170&group=comp.os.msdos.programmer#170

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Sat, 4 Dec 2021 18:11:43 +0100
Organization: Aioe.org NNTP Server
Lines: 20
Message-ID: <sog9d5$gc3$1@gioia.aioe.org>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com><8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net><da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com><soclec$tcv$1@gioia.aioe.org><18xw4wam0sv01$.15vxgi1xg9ahw.dlg@40tude.net><sof98p$ihu$1@gioia.aioe.org><sofle0$1i11$1@gioia.aioe.org><sofluh$1la0$1@gioia.aioe.org><sofvm6$1ruj$1@gioia.aioe.org> <sog1jd$1vpa$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="16771"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Priority: 3
X-Notice: Filtered by postfilter v. 0.9.2
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Original
 by: R.Wieser - Sat, 4 Dec 2021 17:11 UTC

Mateusz,

> Now, just wondering aloud: is there an obvious reason why
> Tasm does not pre-set MAXALLOC to be the same as MINALLOC?
....
> Isn't it because the EXE header is, in fact, not generated
> by Tasm, but by the linker (tlink)?

Really ? You're suggesting that Tasm is some kind of culprit and than
"solve" it by telling us that its actually TLink who does it ? And with it
"answering" a question which was never asked ?

Nope, not going to play that game.

Goodbye.

Regards,
Rudy Wieser

Re: initial memory

<sogajd$tm7$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=173&group=comp.os.msdos.programmer#173

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!a/T4ApFfDwfCJeUuLpbuYw.user.46.165.242.75.POSTED!not-for-mail
From: mateusz@xyz.invalid (Mateusz Viste)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Sat, 4 Dec 2021 19:04:29 +0100
Organization: . . .
Message-ID: <sogajd$tm7$1@gioia.aioe.org>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com>
<8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net>
<da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com>
<soclec$tcv$1@gioia.aioe.org>
<18xw4wam0sv01$.15vxgi1xg9ahw.dlg@40tude.net>
<sof98p$ihu$1@gioia.aioe.org>
<sofle0$1i11$1@gioia.aioe.org>
<sofluh$1la0$1@gioia.aioe.org>
<sofvm6$1ruj$1@gioia.aioe.org>
<sog1jd$1vpa$1@gioia.aioe.org>
<sog9d5$gc3$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="30407"; posting-host="a/T4ApFfDwfCJeUuLpbuYw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Mateusz Viste - Sat, 4 Dec 2021 18:04 UTC

2021-12-04 at 18:11 +0100, R.Wieser wrote:
> Really ? You're suggesting that Tasm is some kind of culprit

I never suggested that, you did. Almost exactly 6 hours ago.

> and than "solve" it by telling us that its actually TLink who does it

You seem to be misreading me. I am not solving anything, merely
suggesting that perhaps the problem is not where you are pointing at.

Mateusz

Re: initial memory

<soghop$70d$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=174&group=comp.os.msdos.programmer#174

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!BHGTVyTGRwF2ntnqLVfpDg.user.46.165.242.75.POSTED!not-for-mail
From: address@not.available (R.Wieser)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Sat, 4 Dec 2021 21:02:18 +0100
Organization: Aioe.org NNTP Server
Lines: 29
Message-ID: <soghop$70d$1@gioia.aioe.org>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com><8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net><da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com><soclec$tcv$1@gioia.aioe.org><18xw4wam0sv01$.15vxgi1xg9ahw.dlg@40tude.net><sof98p$ihu$1@gioia.aioe.org><sofle0$1i11$1@gioia.aioe.org><sofluh$1la0$1@gioia.aioe.org><sofvm6$1ruj$1@gioia.aioe.org><sog1jd$1vpa$1@gioia.aioe.org><sog9d5$gc3$1@gioia.aioe.org> <sogajd$tm7$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="7181"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Priority: 3
X-Notice: Filtered by postfilter v. 0.9.2
X-RFC2646: Format=Flowed; Original
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
 by: R.Wieser - Sat, 4 Dec 2021 20:02 UTC

Mateusz,

> I never suggested that, you did. Almost exactly 6 hours ago.

Than you misunderstood. When I said "Borlands Tasm" I was referring to the
package. The Tasm as well as TLink programs, as you need both to be able to
create an executable.

> You seem to be misreading me. I am not solving anything,

Thats for sure.

> merely suggesting that perhaps the problem is not where
> you are pointing at.

And which "the problem" might that be ? I do not remember having a problem.
Just something that I like to have seen different.

Also, I don't think I pointed anywhere, as I do not even have a solid idea
what exactly causes the particular result.

.... Which I tried to make clear in that "almost exactly 6 hours ago" post.
Or did you really think that I only looked at one of the two involved
programs for such an option ?

Regards,
Rudy Wieser

Re: initial memory

<ezpb3vmdlaf0.26fbn6tirxs.dlg@40tude.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=177&group=comp.os.msdos.programmer#177

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!IV51k2578VAyZaOT4WBlVQ.user.46.165.242.91.POSTED!not-for-mail
From: jj4public@gmail.com (JJ)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Sun, 5 Dec 2021 14:03:28 +0700
Organization: Aioe.org NNTP Server
Message-ID: <ezpb3vmdlaf0.26fbn6tirxs.dlg@40tude.net>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com> <8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net> <da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com> <soclec$tcv$1@gioia.aioe.org> <18xw4wam0sv01$.15vxgi1xg9ahw.dlg@40tude.net> <sof98p$ihu$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="2212"; posting-host="IV51k2578VAyZaOT4WBlVQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: 40tude_Dialog/2.0.15.84
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Notice: Filtered by postfilter v. 0.9.2
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
 by: JJ - Sun, 5 Dec 2021 07:03 UTC

On Sat, 4 Dec 2021 09:35:37 +0100, Mateusz Viste wrote:
> 2021-12-04 at 14:00 +0700, JJ wrote:
>> On Fri, 3 Dec 2021 09:45:00 +0100, Mateusz Viste wrote:
>>> 2021-12-03 at 00:38 -0800, muta...@gmail.com wrote:
>>>> So for all executables, all of memory is allocated until
>>>> released?
>>>
>>> AFAIK this is true only for COM files, where CS=DS=ES=SS.
>>
>> EXE files can be made to allocate the maximum available memory. e.g.
>> compiling a tiny model program into an EXE.
>
> "can be made", yes, through fiddling with exe headers, but then that's
> done on purpose, and not a by-design behavior, right?
>
> Mateusz

It's the default result of MASM as well as TASM. No command line switch
required. The EXE has to be made like that to make the binaries of source
code for old system not break the system.

Re: initial memory

<pq6e66lkv2ow$.1ud0edca7fcu0$.dlg@40tude.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=178&group=comp.os.msdos.programmer#178

  copy link   Newsgroups: comp.os.msdos.programmer
Path: i2pn2.org!i2pn.org!aioe.org!IV51k2578VAyZaOT4WBlVQ.user.46.165.242.91.POSTED!not-for-mail
From: jj4public@gmail.com (JJ)
Newsgroups: comp.os.msdos.programmer
Subject: Re: initial memory
Date: Sun, 5 Dec 2021 14:12:52 +0700
Organization: Aioe.org NNTP Server
Message-ID: <pq6e66lkv2ow$.1ud0edca7fcu0$.dlg@40tude.net>
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com> <8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net> <da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com> <50lb84n8i1yv$.aq6aqn9li16a$.dlg@40tude.net> <b30669e2-c878-4b1c-bd05-9a4f042c04e9n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="7559"; posting-host="IV51k2578VAyZaOT4WBlVQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: 40tude_Dialog/2.0.15.84
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Notice: Filtered by postfilter v. 0.9.2
 by: JJ - Sun, 5 Dec 2021 07:12 UTC

On Sat, 4 Dec 2021 02:00:15 -0800 (PST), muta...@gmail.com wrote:
>
> I see that Freedos already has a number. I might make
> contact with them. I really need a number that does not
> represent a particular OEM but instead a "standard". And
> I just realized that if MSDOS was theoretically updated to
> follow the standard, they wouldn't be able to switch to that
> new number. Hmmm. Maybe they could. Maybe everyone
> who wished to follow the standard could switch to that
> number, and then if they wanted the "true manufacturer"
> they have to do another API call.

Nowadays, OS detection by detecting OS features is more reliable than simply
reading the OS ID.

Re: initial memory

<b0b9e913-a6b4-4a6f-ad55-205da586e927n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=186&group=comp.os.msdos.programmer#186

  copy link   Newsgroups: comp.os.msdos.programmer
X-Received: by 2002:ac8:4155:: with SMTP id e21mr35611577qtm.312.1638745271498;
Sun, 05 Dec 2021 15:01:11 -0800 (PST)
X-Received: by 2002:a37:3c4:: with SMTP id 187mr29305519qkd.755.1638745271368;
Sun, 05 Dec 2021 15:01:11 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.msdos.programmer
Date: Sun, 5 Dec 2021 15:01:11 -0800 (PST)
In-Reply-To: <sog1jd$1vpa$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=202.169.113.201; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 202.169.113.201
References: <8808cb98-5cfd-444d-87ac-a71ef937f64cn@googlegroups.com>
<8mnduvhd2fdw$.33ex4smmmt4t$.dlg@40tude.net> <da470e5b-c79a-4f5d-add7-9d7ea0a313a0n@googlegroups.com>
<soclec$tcv$1@gioia.aioe.org> <18xw4wam0sv01$.15vxgi1xg9ahw.dlg@40tude.net>
<sof98p$ihu$1@gioia.aioe.org> <sofle0$1i11$1@gioia.aioe.org>
<sofluh$1la0$1@gioia.aioe.org> <sofvm6$1ruj$1@gioia.aioe.org> <sog1jd$1vpa$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b0b9e913-a6b4-4a6f-ad55-205da586e927n@googlegroups.com>
Subject: Re: initial memory
From: mutazilah@gmail.com (muta...@gmail.com)
Injection-Date: Sun, 05 Dec 2021 23:01:11 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 12
 by: muta...@gmail.com - Sun, 5 Dec 2021 23:01 UTC

On Sunday, December 5, 2021 at 2:30:58 AM UTC+11, Mateusz Viste wrote:

> In the case
> of high-level compilers, having a big MAXALLOC allows the runtime
> to provide near pointers to the program via malloc(),

Can you elaborate on this? I'm not familiar with how
other people implement their runtime libraries, but to
use a near pointer (offset only), the maxalloc won't
be able to be more than 64k, less the size of the stack,
less the size of the bss, less the size of the data section.

Thanks. Paul.

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor