Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

There are two ways to write error-free programs; only the third one works.


devel / comp.os.os2.programmer.misc / Re: command line parameters

SubjectAuthor
* command line parametersPaul Edwards
`* Re: command line parametersPaul Edwards
 `- Re: command line parametersPaul Edwards

1
command line parameters

<urrm8m$12mes$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.os2.programmer.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mutazilah@gmail.com (Paul Edwards)
Newsgroups: comp.os.os2.programmer.misc
Subject: command line parameters
Date: Fri, 1 Mar 2024 12:40:49 +0800
Organization: A noiseless patient Spider
Lines: 57
Message-ID: <urrm8m$12mes$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 1 Mar 2024 04:40:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1f04345046046ea4eb841c70e7979180";
logging-data="1137116"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mkPVRhi4DpqNR/zoatVgfQrEIkyRLdb0="
User-Agent: Mozilla/5.0 (OS/2; Warp 4.5; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:Pic2VPDPjA77aE0wpAg2cKay028=
X-Mozilla-News-Host: news://news.eternal-september.org:119
 by: Paul Edwards - Fri, 1 Mar 2024 04:40 UTC

My 32-bit OS/2 applications rely on this parameter on the stack:

__intstart proc
mov eax, [esp+16]
push eax
call __start

in order to get access to the command line.

However, I would like to not have to rely on either
the stack or register at entry for my OS/2 applications,
so I would like an alternate way of getting that
information.

(that way I can provide my own stack format and no
register values, in PDOS-generic form suitable for
running PDOS-generic apps).

For OS/2 16-bit I was able to do this:

#ifdef __16BIT__
{
USHORT seg, offs;

if (DosGetEnv(&seg, &offs) != 0)
{
p = "\0"; /* two NUL characters */
}
p = (char *)(((unsigned long)seg << 16)
| offs);
}
#endif
argv[0] = p;
p += strlen(p) + 1;

But that function doesn't seem to exist in OS/2 2.x.

http://www.edm2.com/index.php/Control_Program_Functions_List

"The" documentation says to use a newer replacement, but
doesn't specify what that might be:

http://www.edm2.com/index.php/DosGetEnv

Until this is resolved, the new pdos.zip at pdos.org
is capable of running pdptest.exe built with makefile.wat,
but it doesn't print the parameters.

Any idea what options I have?

Thanks. Paul.

Re: command line parameters

<urrut2$1458a$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.os2.programmer.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mutazilah@gmail.com (Paul Edwards)
Newsgroups: comp.os.os2.programmer.misc
Subject: Re: command line parameters
Date: Fri, 1 Mar 2024 15:08:15 +0800
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <urrut2$1458a$1@dont-email.me>
References: <urrm8m$12mes$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 1 Mar 2024 07:08:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1f04345046046ea4eb841c70e7979180";
logging-data="1185034"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Ql0V1/lLc9+5u7MRGSbJjcm20C2dJr+g="
User-Agent: Mozilla/5.0 (OS/2; Warp 4.5; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:dp64ss+tmbm3ijDi0GIpB95Huho=
In-Reply-To: <urrm8m$12mes$1@dont-email.me>
 by: Paul Edwards - Fri, 1 Mar 2024 07:08 UTC

On 01/03/24 12:40, Paul Edwards wrote:

> "The" documentation says to use a newer replacement, but
> doesn't specify what that might be:
>
> http://www.edm2.com/index.php/DosGetEnv

Maybe this?

https://groups.google.com/g/comp.os.os2.programmer.misc/c/1fD8SdG4mmM/m/Mw8bnKAx3hgJ

if (DosGetInfoBlocks(&tib, &pib))
return 5;

e = pib->pib_pchenv;

BFN. Paul.

Re: command line parameters

<urscbr$16o2v$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.os.os2.programmer.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mutazilah@gmail.com (Paul Edwards)
Newsgroups: comp.os.os2.programmer.misc
Subject: Re: command line parameters
Date: Fri, 1 Mar 2024 18:57:59 +0800
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <urscbr$16o2v$1@dont-email.me>
References: <urrm8m$12mes$1@dont-email.me> <urrut2$1458a$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 1 Mar 2024 10:58:04 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1f04345046046ea4eb841c70e7979180";
logging-data="1269855"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18O1GzScpxF3BZGmHYpZ3hfecknB3e7mZs="
User-Agent: Mozilla/5.0 (OS/2; Warp 4.5; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:ismjSpfMarDmLztuOKhFe1ATdoQ=
In-Reply-To: <urrut2$1458a$1@dont-email.me>
 by: Paul Edwards - Fri, 1 Mar 2024 10:57 UTC

On 01/03/24 15:08, Paul Edwards wrote:

> e = pib->pib_pchenv;

I used pchcmd instead, and now parameters are working!

New version of pdos.zip at pdos.org runs the test
program built by makefile.wat, including parameters.

You can't allocate memory or open files yet though.

Unless I'm missing something, I don't think that
will be difficult to add (to doscalls.c in pdos/src)
tomorrow.

BFN. Paul.


devel / comp.os.os2.programmer.misc / Re: command line parameters

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor