Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"You can have my Unix system when you pry it from my cold, dead fingers." -- Cal Keegan


devel / comp.os.msdos.programmer / Re: initial memory - SS:SP

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
Re: initial memory

<87a9b7b1-af44-4b6a-aea7-8805ece469ffn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.os.msdos.programmer
X-Received: by 2002:ac8:57c2:: with SMTP id w2mr35587921qta.54.1638745356822;
Sun, 05 Dec 2021 15:02:36 -0800 (PST)
X-Received: by 2002:a05:6214:2608:: with SMTP id gu8mr33513950qvb.18.1638745356742;
Sun, 05 Dec 2021 15:02:36 -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:02:36 -0800 (PST)
In-Reply-To: <pq6e66lkv2ow$.1ud0edca7fcu0$.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> <b30669e2-c878-4b1c-bd05-9a4f042c04e9n@googlegroups.com>
<pq6e66lkv2ow$.1ud0edca7fcu0$.dlg@40tude.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <87a9b7b1-af44-4b6a-aea7-8805ece469ffn@googlegroups.com>
Subject: Re: initial memory
From: mutazilah@gmail.com (muta...@gmail.com)
Injection-Date: Sun, 05 Dec 2021 23:02:36 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 19
 by: muta...@gmail.com - Sun, 5 Dec 2021 23:02 UTC

On Sunday, December 5, 2021 at 6:12:53 PM UTC+11, JJ 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.

It's actually OS features rather than OS ID that I want. How do
you suggest I do that? I need to know if the new style memory
allocation routine exists etc.

Thanks. Paul.

Re: initial memory

<1wyu5jw17hoi2$.znfdtjhc4ctl$.dlg@40tude.net>

  copy mid

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

  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: Mon, 6 Dec 2021 13:28:59 +0700
Organization: Aioe.org NNTP Server
Message-ID: <1wyu5jw17hoi2$.znfdtjhc4ctl$.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> <pq6e66lkv2ow$.1ud0edca7fcu0$.dlg@40tude.net> <87a9b7b1-af44-4b6a-aea7-8805ece469ffn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="8730"; posting-host="IV51k2578VAyZaOT4WBlVQ.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-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
 by: JJ - Mon, 6 Dec 2021 06:28 UTC

On Sun, 5 Dec 2021 15:02:36 -0800 (PST), muta...@gmail.com wrote:
>
> It's actually OS features rather than OS ID that I want. How do
> you suggest I do that? I need to know if the new style memory
> allocation routine exists etc.
>
> Thanks. Paul.

You'll have to try using a feature and check whether the OS supports it or
not. Though, standard/common features are likely already supported by most
DOS variants. So, undocumented features are better targets. Or check
features which are non standard, or specific to a DOS variant. Preferrably,
those which are actually used by the included tools of those DOS variants to
check whether they're running in their own OS or not.

Other things that can be used is the fact that while all DOS variants likely
to already support all standard DOS features, their implementations are not.
It could be that some DOS services have different behaviour/algorithm, or
give different result. Or the OS has different/unusual data placements/order
for e.g. BUFFERS, FILES, and standard devices such as AUX, CON, PRN, etc.

Re: initial memory

<sokhha$dt9$1@gioia.aioe.org>

  copy mid

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

  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: Mon, 6 Dec 2021 09:27:22 +0100
Organization: . . .
Message-ID: <sokhha$dt9$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>
<b0b9e913-a6b4-4a6f-ad55-205da586e927n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="14249"; 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 - Mon, 6 Dec 2021 08:27 UTC

2021-12-05 at 15:01 -0800, muta...@gmail.com wrote:
> 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.

SS might be somewhere else in the small model. Your remark is perfectly
valid for the tiny model of course. MAXALLOC is a way (for the
compiler/programmer) to tell DOS "please try putting this program
somewhere in memory where extra space is available because I might want
to use such near memory". From within a C program, the usual way (for
the programmer) to reclaim this memory is via malloc/calloc.

I can only imagine that's why the tlink thing maxes out MAXALLOC: it
assumes it might be used as a memory pool for runtime C near
malloc/calloc calls. This is, however, for those like Rudy using tasm,
since in a constrained environment (last 64K block used by DOS to load
the program) they won't be able to obtain any memory via int 21h,48h.

A possible workaround is to pre-allocate the necessary buffers through
a table (or some other filler) within assembly. The downside of this
solution is that it will obviously make the on-disk size of the program
that much larger. And you must know the amount of memory you need in
advance, too.

Mateusz

Re: initial memory - SS:SP

<sol3fe$1g7s$1@gioia.aioe.org>

  copy mid

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

  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 - SS:SP
Date: Mon, 6 Dec 2021 14:32:05 +0100
Organization: Aioe.org NNTP Server
Lines: 64
Message-ID: <sol3fe$1g7s$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> <soe3dh$uvq$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="49404"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
X-RFC2646: Format=Flowed; Response
X-Notice: Filtered by postfilter v. 0.9.2
X-Priority: 3
 by: R.Wieser - Mon, 6 Dec 2021 13:32 UTC

Muta (paul),

> 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.

I took another look at the EXE header and how it sets up SS:SP. I had to
notice that regardless of the memory model I chose (tiny, small, etc.) it
was either 0:0, or SS being an offset to the defined ".stack ..." area and
SP its size. IOW, it /never/ pointed at what DS should be(come).

As I always use the "tiny" memory model (again, my programs never get /that/
big), a (p)recalculation of SS:SP is rather simple : add (SS - CS) * 10h to
SP and set SS to Zero. In the program itself than only CS needs to be
copied to DS (and possibly ES).

In all other memory models this is not possible as there DS is never equal
CS, and DS is not mentioned in the executables header (meaning you can't
recalculate SS in reference to it)

.... having said that, if you want to use memory models other than "tiny" you
could try to see if you could find the start of the _DATA segment from the
generated .LST file :

-- "Tiny" memory model

DGROUP Group
...STACK 16 0100 Para Stack STACK
..._BSS 16 000E Word Public BSS
..._DATA 16 0017 Word Public DATA
..._TEXT 16 0958 Word Public CODE

(".." indicates indentation)

The above looks to be indicating that all groups are inside DGROUP.

-- "Small" memory model

DGROUP Group
...STACK 16 0100 Para Stack STACK
..._BSS 16 0800 Word Public BSS
..._DATA 16 0043 Word Public DATA
_TEXT 16 0288 Word Public CODE

Here the "_TEXT" group is outside the DGROUP. The start of the "_DATA"
segment /should/ therefore be the size of the "_TEXT" segment, rounded-up to
the next segment ofcourse -> 0290. And a quick check in the executable
shows that is indeed the case.

A double check using "mov ax,_DATA" shows the same (subtract CS and multiply
by 10h)

Caveat : I've only looked at the TINY and SMALL models, in Tasms default
configuration (its possible to have the segments in a different order).

Hope that helps.

Regards,
Rudy Wieser

Re: initial memory - SS:SP

<sol4i5$38k$1@gioia.aioe.org>

  copy mid

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

  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 - SS:SP
Date: Mon, 6 Dec 2021 14:51:59 +0100
Organization: Aioe.org NNTP Server
Lines: 13
Message-ID: <sol4i5$38k$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> <soe3dh$uvq$1@gioia.aioe.org> <sol3fe$1g7s$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="3348"; posting-host="BHGTVyTGRwF2ntnqLVfpDg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-Priority: 3
 by: R.Wieser - Mon, 6 Dec 2021 13:51 UTC

Muta (paul),

> ... having said that, if you want to use memory models other than "tiny"
> you could try to see if you could find the start of the _DATA segment from
> the generated .LST file :

I forgot all about the .MAP file. Even easier, as it already contains the
starting offsets of each segment.

Regards,
Rudy Wieser

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor