Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Help me, I'm a prisoner in a Fortune cookie file!


devel / comp.os.cpm / ZCPR Command Line Parsing Question

SubjectAuthor
* ZCPR Command Line Parsing QuestionLawrence Nelson
+- Re: ZCPR Command Line Parsing QuestionLawrence Nelson
`- Re: ZCPR Command Line Parsing QuestionWayne Hortensius

1
ZCPR Command Line Parsing Question

<6b13680c-946e-415d-9e82-dd6deb6b1acbn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2546&group=comp.os.cpm#2546

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:ac8:5946:: with SMTP id 6mr48348848qtz.366.1621087272245;
Sat, 15 May 2021 07:01:12 -0700 (PDT)
X-Received: by 2002:a9d:d0f:: with SMTP id 15mr43909994oti.255.1621087271969;
Sat, 15 May 2021 07:01:11 -0700 (PDT)
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.cpm
Date: Sat, 15 May 2021 07:01:11 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=74.78.214.240; posting-account=B0A6CgkAAAB6FiCHlGWGm95Bgsdc11rG
NNTP-Posting-Host: 74.78.214.240
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6b13680c-946e-415d-9e82-dd6deb6b1acbn@googlegroups.com>
Subject: ZCPR Command Line Parsing Question
From: larsnel...@adelphia.net (Lawrence Nelson)
Injection-Date: Sat, 15 May 2021 14:01:12 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Lawrence Nelson - Sat, 15 May 2021 14:01 UTC

This all started when I decided to make UNZIPZ utilize named directories since help indicates the program support DU:. Currently the code gets the drive from location 0x5C (default FCB, dfcb) for the input file and at location 0x6C (alternate FCB, afcb) for the output file. The user #s are obtained from locations 0x69(dfcb+13) and 0x79 (afcb+13) respectively. So UNZIPZ was obviously letting ZCPR3x parse the command line! While running some tests, I also noticed an issue with UNZIPZ where it failed to find the input file even though it obviously existed. So I decided to investigate how ZCPR34 parses the command line so Iissued the following command (system prompt included) where ROOT: is C0.
C0:ROOT>ddt root:bpbn.img
and got the following response
DDT VERS 2.2
NEXT PC
2D80 0100
- Wow it actually found BPBN.IMG and loaded it. Then I dumped the FCB
-d50 6f
0050 FF FF FF FF FF FF FF FF FF FF FF 00 03 42 50 42 .............BPB
0060 4E 20 20 20 20 49 4D 47 00 80 80 59 E8 00 E9 00 N IMG...Y....
Ok the drive is at 0x5C and 0x69 is 80 which indicates the default user #.
Then I tried the following where BIN: is C15 and GAMES: is D1
C0:ROOT>DDT bin:file1.com games:file2.com
DDT VERS 2.2
? -d50 7f
0050 FF FF FF FF FF FF FF FF FF FF FF 00 03 46 49 4C .............FIL
0060 45 31 20 20 20 43 4F 4D 00 80 00 00 04 46 49 4C E1 COM.....FIL
0070 45 32 20 20 20 43 4F 4D 00 01 00 00 00 0B 00 00 E2 COM........
- Drives are at 0x5C and 0x6C and user # for file2.com is at 0x79 but 0x69 contains 80 not 0F as expected. This appears to bug in ZCPR34! Just to confirm there was a bug, I tried
C0:ROOT>ddt c15:file1.com d1:file2.com
DDT VERS 2.2
? -d50 7f
0050 FF FF FF FF FF FF FF FF FF FF FF 00 03 46 49 4C .............FIL
0060 45 31 20 20 20 43 4F 4D 00 80 00 00 04 46 49 4C E1 COM.....FIL
0070 45 32 20 20 20 43 4F 4D 00 01 00 00 00 0B 00 00 E2 COM........
- Again the user number for file1.com was wrong. I am running BPBios so tried running NZCOM in case the CPR in BPBios was corrupt. Unfortunately I got the same results. I don't have ZCPR30. Can anyone with ZCPR30 try this experiment? Found several other examples programs the assumed 0x69 contained the user #.

Re: ZCPR Command Line Parsing Question

<e2888311-0fe4-418e-bdd1-7ebfb698804dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2547&group=comp.os.cpm#2547

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:ad4:5aa1:: with SMTP id u1mr53161216qvg.23.1621131791488;
Sat, 15 May 2021 19:23:11 -0700 (PDT)
X-Received: by 2002:a9d:6106:: with SMTP id i6mr40292488otj.354.1621131791236;
Sat, 15 May 2021 19:23:11 -0700 (PDT)
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.cpm
Date: Sat, 15 May 2021 19:23:11 -0700 (PDT)
In-Reply-To: <6b13680c-946e-415d-9e82-dd6deb6b1acbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=74.78.214.240; posting-account=B0A6CgkAAAB6FiCHlGWGm95Bgsdc11rG
NNTP-Posting-Host: 74.78.214.240
References: <6b13680c-946e-415d-9e82-dd6deb6b1acbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e2888311-0fe4-418e-bdd1-7ebfb698804dn@googlegroups.com>
Subject: Re: ZCPR Command Line Parsing Question
From: larsnel...@adelphia.net (Lawrence Nelson)
Injection-Date: Sun, 16 May 2021 02:23:11 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Lawrence Nelson - Sun, 16 May 2021 02:23 UTC

On Saturday, May 15, 2021 at 10:01:12 AM UTC-4, Lawrence Nelson wrote:
> This all started when I decided to make UNZIPZ utilize named directories since help indicates the program support DU:. Currently the code gets the drive from location 0x5C (default FCB, dfcb) for the input file and at location 0x6C (alternate FCB, afcb) for the output file. The user #s are obtained from locations 0x69(dfcb+13) and 0x79 (afcb+13) respectively. So UNZIPZ was obviously letting ZCPR3x parse the command line! While running some tests, I also noticed an issue with UNZIPZ where it failed to find the input file even though it obviously existed. So I decided to investigate how ZCPR34 parses the command line so Iissued the following command (system prompt included) where ROOT: is C0.
> C0:ROOT>ddt root:bpbn.img
> and got the following response
> DDT VERS 2.2
> NEXT PC
> 2D80 0100
> -
> Wow it actually found BPBN.IMG and loaded it. Then I dumped the FCB
> -d50 6f
> 0050 FF FF FF FF FF FF FF FF FF FF FF 00 03 42 50 42 .............BPB
> 0060 4E 20 20 20 20 49 4D 47 00 80 80 59 E8 00 E9 00 N IMG...Y....
> Ok the drive is at 0x5C and 0x69 is 80 which indicates the default user #..
> Then I tried the following where BIN: is C15 and GAMES: is D1
> C0:ROOT>DDT bin:file1.com games:file2.com
> DDT VERS 2.2
> ?
> -d50 7f
> 0050 FF FF FF FF FF FF FF FF FF FF FF 00 03 46 49 4C .............FIL
> 0060 45 31 20 20 20 43 4F 4D 00 80 00 00 04 46 49 4C E1 COM.....FIL
> 0070 45 32 20 20 20 43 4F 4D 00 01 00 00 00 0B 00 00 E2 COM........
> -
> Drives are at 0x5C and 0x6C and user # for file2.com is at 0x79 but 0x69 contains 80 not 0F as expected. This appears to bug in ZCPR34! Just to confirm there was a bug, I tried
> C0:ROOT>ddt c15:file1.com d1:file2.com
> DDT VERS 2.2
> ?
> -d50 7f
> 0050 FF FF FF FF FF FF FF FF FF FF FF 00 03 46 49 4C .............FIL
> 0060 45 31 20 20 20 43 4F 4D 00 80 00 00 04 46 49 4C E1 COM.....FIL
> 0070 45 32 20 20 20 43 4F 4D 00 01 00 00 00 0B 00 00 E2 COM........
> -
> Again the user number for file1.com was wrong. I am running BPBios so tried running NZCOM in case the CPR in BPBios was corrupt. Unfortunately I got the same results. I don't have ZCPR30. Can anyone with ZCPR30 try this experiment? Found several other examples programs the assumed 0x69 contained the user #.

Post Script

Tried ZCPR1.0. Same results! Looked at the source code and found the following comment
; Added ZCPR3 style drive/user number to all FCB parsing.
; S1 in the FCB is used to store the user number. If S1 contains a valid
; user number, bit 7 will be set. If no user number is specified, S1 will
; contain 0.
Evident that there are two problems in the above example. First while the specified user number for file1.com is 15, 80 is stored at S1 implying that 0 is the valid user number. Second, while the specified user number for file2.com is 1, bit 7 is not set to indicate that it is correct.

Re: ZCPR Command Line Parsing Question

<20210518173856.1c172063@earth>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2563&group=comp.os.cpm#2563

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx19.iad.POSTED!not-for-mail
From: me...@somewhere.foo (Wayne Hortensius)
Newsgroups: comp.os.cpm
Subject: Re: ZCPR Command Line Parsing Question
Message-ID: <20210518173856.1c172063@earth>
References: <6b13680c-946e-415d-9e82-dd6deb6b1acbn@googlegroups.com>
X-Newsreader: Claws Mail 3.14.1 (GTK+ 2.24.31; arm-unknown-linux-gnueabihf)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Lines: 42
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Tue, 18 May 2021 23:38:56 UTC
Date: Tue, 18 May 2021 17:38:56 -0600
X-Received-Bytes: 2699
 by: Wayne Hortensius - Tue, 18 May 2021 23:38 UTC

Part of it appears to be DDT or BDOS changing the FCB before you get
to look at it. I wrote a quick little program in Turbo Pascal to dump
out the DFCB and AFCB blocks as the transient sees them. This was done
with ZCPR3.3.

A6:PASCAL>>PWD
PWD, Version 1.4
DU : DIR Name DU : DIR Name DU : DIR Name DU : DIR Name
---- -------- ---- -------- ---- -------- ---- --------
A 0: BASE A 1: COMM A 2: SOURCE A 3: ZCPR3
A 4: DOC A 5: LADDER A 6: PASCAL A 8: BBS
A 11: TPSRC A 14: HELP A 15: ROOT

B 2: AMPRO B 3: ASTRO B 4: NOVADOS B 5: GAMES
B 7: GSX B 8: CATCHUM B 9: VLIB B 10: CIOS
B 12: CC B 13: ZMODEM

C 2: SYSLIB C 3: Z3LIB C 4: DSLIB C 5: ZSLIB

A6:PASCAL>>dumpfcbs zslib:file1.com vlib:file2.com
DR F1 F2 F3 F4 F5 F6 F7 F8 T1 T2 T3 EX S1 S2 RC
005C 03 46 49 4C 45 31 20 20 20 43 4F 4D 00 05 00 00 .FILE1 COM....
006C 02 46 49 4C 45 32 20 20 20 43 4F 4D 00 09 00 00 .FILE2 COM....

A6:PASCAL>>dumpfcbs c5:file1.com b9:file2.com
DR F1 F2 F3 F4 F5 F6 F7 F8 T1 T2 T3 EX S1 S2 RC
005C 03 46 49 4C 45 31 20 20 20 43 4F 4D 00 05 00 00 .FILE1 COM....
006C 02 46 49 4C 45 32 20 20 20 43 4F 4D 00 09 00 00 .FILE2 COM....

As you can see, the user numbers in S1 are correct for both named and
du prefixes.

In regards the comment about bit 7 being set in S1 to indicate a
valid user number, was that in UNZIPZ itself rather than somewhere in
ZCPR? If that was in UNZIPZ, it makes sense. On a call to open a file,
ZSDOS/ZDDOS will only use the value in S1 as a user number if b7 is set
and the BDOS error mode is non-zero. As far as I remember, the only
place that the b7 check is applicable is on a ZSDOS/ZDDOS file open (but
that's just going from memory, so I could be wrong about that).

Regards,
Wayne

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor