Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

/usr/news/gotcha


devel / comp.os.cpm / Re: BDOS 40

SubjectAuthor
* BDOS 40dxforth
+* Re: BDOS 40Martin
|`* Re: BDOS 40dxforth
| +- Re: BDOS 40dxforth
| `* Re: BDOS 40Martin
|  +- Re: BDOS 40Martin
|  `* Re: BDOS 40dxforth
|   `- Re: BDOS 40Martin
`- Re: BDOS 40Martin

1
BDOS 40

<sqj2b6$vbf$1@gioia.aioe.org>

 copy mid

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

 copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: BDOS 40
Date: Thu, 30 Dec 2021 12:34:30 +1100
Organization: Aioe.org NNTP Server
Message-ID: <sqj2b6$vbf$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="32111"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 30 Dec 2021 01:34 UTC

I'm contemplating using this in my compiler instead of BDOS 34.
AFAIK BDOS 40 avoids the problem of 'sparse files' which most
file utilities can't handle anyway.

My question - what's wrong with BDOS 40 given almost nobody
appears to use it?

Re: BDOS 40

<sqjcnu$1vf8$1@gioia.aioe.org>

 copy mid

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

 copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!aioe.org!yK7nUsNSoepUkJrzy00ZRw.user.46.165.242.75.POSTED!not-for-mail
From: this.is....@so.its.invalid (Martin)
Newsgroups: comp.os.cpm
Subject: Re: BDOS 40
Date: Thu, 30 Dec 2021 05:29:55 +0100
Organization: Aioe.org NNTP Server
Message-ID: <sqjcnu$1vf8$1@gioia.aioe.org>
References: <sqj2b6$vbf$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="65000"; posting-host="yK7nUsNSoepUkJrzy00ZRw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:20.0) Gecko/20100101 SeaMonkey/2.17.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: Martin - Thu, 30 Dec 2021 04:29 UTC

Am 12/30/2021 02:34 AM, dxforth schrieb:
> I'm contemplating using this in my compiler instead of BDOS 34.
> AFAIK BDOS 40 avoids the problem of 'sparse files' which most
> file utilities can't handle anyway.
>
> My question - what's wrong with BDOS 40 given almost nobody
> appears to use it?
>
>

You zero fill the remainder of only one block.
The rest of the extent and all other extents before and after
remain sparse the same as for BDOS 34.
So this does not help in any way.

I don't want to first find out the block size of the drive in
the program I write just in order to use that BDOS call.

To add this BDOS call IMHO was a bad idea, and I would acknowledge and
respect past experience to better NOT use it.

HTH
Martin

Re: BDOS 40

<sqjdpk$8b2$1@gioia.aioe.org>

 copy mid

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

 copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: BDOS 40
Date: Thu, 30 Dec 2021 15:49:57 +1100
Organization: Aioe.org NNTP Server
Message-ID: <sqjdpk$8b2$1@gioia.aioe.org>
References: <sqj2b6$vbf$1@gioia.aioe.org> <sqjcnu$1vf8$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="8546"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Thu, 30 Dec 2021 04:49 UTC

On 30/12/2021 15:29, Martin wrote:
> Am 12/30/2021 02:34 AM, dxforth schrieb:
>> I'm contemplating using this in my compiler instead of BDOS 34.
>> AFAIK BDOS 40 avoids the problem of 'sparse files' which most
>> file utilities can't handle anyway.
>>
>> My question - what's wrong with BDOS 40 given almost nobody
>> appears to use it?
>>
>>
>
>
> You zero fill the remainder of only one block.
> The rest of the extent and all other extents before and after
> remain sparse the same as for BDOS 34.
> So this does not help in any way.
>
> I don't want to first find out the block size of the drive in
> the program I write just in order to use that BDOS call.
>
> To add this BDOS call IMHO was a bad idea, and I would acknowledge and
> respect past experience to better NOT use it.

Ok, so not much use. When you say "one block" you mean disk block
e.g. 2K, 4K etc. ? That would wipe out other records in the block?

Re: BDOS 40

<sqjeka$epu$1@gioia.aioe.org>

 copy mid

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

 copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: BDOS 40
Date: Thu, 30 Dec 2021 16:04:11 +1100
Organization: Aioe.org NNTP Server
Message-ID: <sqjeka$epu$1@gioia.aioe.org>
References: <sqj2b6$vbf$1@gioia.aioe.org> <sqjcnu$1vf8$1@gioia.aioe.org>
<sqjdpk$8b2$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="15166"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 30 Dec 2021 05:04 UTC

On 30/12/2021 15:49, dxforth wrote:
> On 30/12/2021 15:29, Martin wrote:
>> Am 12/30/2021 02:34 AM, dxforth schrieb:
>>> I'm contemplating using this in my compiler instead of BDOS 34.
>>> AFAIK BDOS 40 avoids the problem of 'sparse files' which most
>>> file utilities can't handle anyway.
>>>
>>> My question - what's wrong with BDOS 40 given almost nobody
>>> appears to use it?
>>>
>>>
>>
>>
>> You zero fill the remainder of only one block.
>> The rest of the extent and all other extents before and after
>> remain sparse the same as for BDOS 34.
>> So this does not help in any way.
>>
>> I don't want to first find out the block size of the drive in
>> the program I write just in order to use that BDOS call.
>>
>> To add this BDOS call IMHO was a bad idea, and I would acknowledge and
>> respect past experience to better NOT use it.
>
> Ok, so not much use. When you say "one block" you mean disk block
> e.g. 2K, 4K etc. ? That would wipe out other records in the block?

Not to worry. I read the spec again and it says "previously unallocated
block".

Re: BDOS 40

<sqjikp$1hnj$1@gioia.aioe.org>

 copy mid

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

 copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!aioe.org!yK7nUsNSoepUkJrzy00ZRw.user.46.165.242.75.POSTED!not-for-mail
From: this.is....@so.its.invalid (Martin)
Newsgroups: comp.os.cpm
Subject: Re: BDOS 40
Date: Thu, 30 Dec 2021 07:10:38 +0100
Organization: Aioe.org NNTP Server
Message-ID: <sqjikp$1hnj$1@gioia.aioe.org>
References: <sqj2b6$vbf$1@gioia.aioe.org> <sqjcnu$1vf8$1@gioia.aioe.org> <sqjdpk$8b2$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="50931"; posting-host="yK7nUsNSoepUkJrzy00ZRw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:20.0) Gecko/20100101 SeaMonkey/2.17.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: Martin - Thu, 30 Dec 2021 06:10 UTC

Am 12/30/2021 05:49 AM, dxforth schrieb:
> On 30/12/2021 15:29, Martin wrote:
>> Am 12/30/2021 02:34 AM, dxforth schrieb:
>>> I'm contemplating using this in my compiler instead of BDOS 34.
>>> AFAIK BDOS 40 avoids the problem of 'sparse files' which most
>>> file utilities can't handle anyway.
>>>
>>> My question - what's wrong with BDOS 40 given almost nobody
>>> appears to use it?
>>>
>>>
>>
>>
>> You zero fill the remainder of only one block.
>> The rest of the extent and all other extents before and after
>> remain sparse the same as for BDOS 34.
>> So this does not help in any way.
>>
>> I don't want to first find out the block size of the drive in
>> the program I write just in order to use that BDOS call.
>>
>> To add this BDOS call IMHO was a bad idea, and I would acknowledge and
>> respect past experience to better NOT use it.
>
> Ok, so not much use. When you say "one block" you mean disk block
> e.g. 2K, 4K etc. ? That would wipe out other records in the block?

Here is a nice introduction into BDOS expecially using and comparing
the differences between BDOS 34 and DBOS 40 (Part III):

<https://hc-ddr.hucki.net/wiki/doku.php/cpm/sliding_into_bdos>

After you previously used that function there is no way to find out
if that "Zero's" were part of the unused part of your file.

I just tried out the example on a real CP/M 2.2 system.
To check what was really written I used ZAP.COM, a file/disk editor.
You have to configure it for your terminal once,
but then it has a very nice full screen interface.

This is the directory entry on my drive, it is the same in
both cases:

:fRANDFILE.TST
40 0052414E 4446494C 45545354 0100000D *.RANDFILETST....*
50 41000000 00000000 42000000 00000000 *A.......B.......*
G=00:00, T=3, S=1, PS=0

The first example using WRITE RANDOM:
Record 0 is written with 'A'
Record 1-15 contain garbage (the first block of the first extent)
Record 128-142 contain garbage (the second allocation block
of the second extent)
Record 143 is written with 'B'

The program modified to youe WRITE RANDOM the second time
(modified as in the article):
Record 0 is written with 'A'
Record 1-15 contain garbage (the first block of the first extent)
Record 128-142 contain *00s* (the first allocation block
of the second extent)
Record 143 is written with 'B'

On my drive the block size just happens to be 16 records so record
16-128 are not allocated and record 143 is the last record of the
block.

In the "Programmer's CP/M Handbook" by Andy Johnson-Laird there is a
hint why this function exists at all:

[Purpose
This function is an extension to the Write Random function described pre-
viously. In addition to performing the Write Random, it will also fill each new
allocation block with OOH's. Digital Research added this function to assist Micro-
soft with the production of its COBOL compiler-it makes the logic of the file
handling code easier. It also is an economical way to completely fill a random file
with OOH's. You need only write one record *per allocation block*; the BOOS will
clear the rest of the block for you.]

Re: BDOS 40

<sqjjhe$1p16$1@gioia.aioe.org>

 copy mid

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

 copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!aioe.org!yK7nUsNSoepUkJrzy00ZRw.user.46.165.242.75.POSTED!not-for-mail
From: this.is....@so.its.invalid (Martin)
Newsgroups: comp.os.cpm
Subject: Re: BDOS 40
Date: Thu, 30 Dec 2021 07:25:55 +0100
Organization: Aioe.org NNTP Server
Message-ID: <sqjjhe$1p16$1@gioia.aioe.org>
References: <sqj2b6$vbf$1@gioia.aioe.org> <sqjcnu$1vf8$1@gioia.aioe.org> <sqjdpk$8b2$1@gioia.aioe.org> <sqjikp$1hnj$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="58406"; posting-host="yK7nUsNSoepUkJrzy00ZRw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:20.0) Gecko/20100101 SeaMonkey/2.17.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: Martin - Thu, 30 Dec 2021 06:25 UTC

Am 12/30/2021 07:10 AM, Martin schrieb:
> I just tried out the example on a real CP/M 2.2 system.
> To check what was really written I used ZAP.COM, a file/disk editor.
> You have to configure it for your terminal once,
> but then it has a very nice full screen interface.
>

Ooops:
Before posting I also tried out to modify the example, to see what
happens if I write record 140 instead:

I used the directory record after running my modified example,
so the last used record field does not match the example, sorry.
Byte 4fh below really is 10h after having written record 143!

RANDFILE.34 was created with BDOS 34.
RANDFILE.40 was created with BDOS 40.
RANDFILE.TST was created with BDOS 40 to record 140.

B>a:stat *.*

Recs Bytes Ext Acc
144 4k 1 R/W B:RANDFILE.34
144 4k 1 R/W B:RANDFILE.40
141 4k 1 R/W B:RANDFILE.TST

So, I should have used one of RANDFILE.34 or RANDFILE.40 below.

> This is the directory entry on my drive, it is the same in
> both cases:
>
> :fRANDFILE.TST
> 40 0052414E 4446494C 45545354 0100000D *.RANDFILETST....*
> 50 41000000 00000000 42000000 00000000 *A.......B.......*
> G=00:00, T=3, S=1, PS=0
>
>

Re: BDOS 40

<sqjmaq$ida$1@gioia.aioe.org>

 copy mid

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

 copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!aioe.org!yK7nUsNSoepUkJrzy00ZRw.user.46.165.242.75.POSTED!not-for-mail
From: this.is....@so.its.invalid (Martin)
Newsgroups: comp.os.cpm
Subject: Re: BDOS 40
Date: Thu, 30 Dec 2021 08:13:35 +0100
Organization: Aioe.org NNTP Server
Message-ID: <sqjmaq$ida$1@gioia.aioe.org>
References: <sqj2b6$vbf$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="18858"; posting-host="yK7nUsNSoepUkJrzy00ZRw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:20.0) Gecko/20100101 SeaMonkey/2.17.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: Martin - Thu, 30 Dec 2021 07:13 UTC

Am 12/30/2021 02:34 AM, dxforth schrieb:
> I'm contemplating using this in my compiler instead of BDOS 34.
> AFAIK BDOS 40 avoids the problem of 'sparse files' which most
> file utilities can't handle anyway.
>
> My question - what's wrong with BDOS 40 given almost nobody
> appears to use it?
>
>

The situation seen from another perspective,
how to emulate it.

1) On a real system:

It could work out nicely...
Any unallocated block gives you an error on read,
and any allocated block has zeroes in all unwritten
records and also in all written records, where it
just happens that the binary content is all zero's.

But after having written one record with zero fill,
the number of records returning zero data without
error vs. returning an Error Code 01, 03, 04, 05, 06. is
different on every distribution / drive.

2) On an emulator:

I just use seek/write whenever BDOS 34 or BDOS 40 is called.
All data before the written record is then allocated (under
Linux as sparse file).

So seen from the CP/M system, every allocation block before
the write is always allocated and returns an allocated zero record
on read without error.

I have not seen any problems in the past using this simplified
BDOS implementation.

Martin

Re: BDOS 40

<sqk6ep$1ekf$1@gioia.aioe.org>

 copy mid

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

 copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: BDOS 40
Date: Thu, 30 Dec 2021 22:50:48 +1100
Organization: Aioe.org NNTP Server
Message-ID: <sqk6ep$1ekf$1@gioia.aioe.org>
References: <sqj2b6$vbf$1@gioia.aioe.org> <sqjcnu$1vf8$1@gioia.aioe.org>
<sqjdpk$8b2$1@gioia.aioe.org> <sqjikp$1hnj$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="47759"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.4.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Thu, 30 Dec 2021 11:50 UTC

On 30/12/2021 17:10, Martin wrote:
>
> ...
> In the "Programmer's CP/M Handbook" by Andy Johnson-Laird there is a
> hint why this function exists at all:
>
> [Purpose
> This function is an extension to the Write Random function described pre-
> viously. In addition to performing the Write Random, it will also fill each new
> allocation block with OOH's. Digital Research added this function to assist Micro-
> soft with the production of its COBOL compiler-it makes the logic of the file
> handling code easier. It also is an economical way to completely fill a random file
> with OOH's. You need only write one record *per allocation block*; the BOOS will
> clear the rest of the block for you.]

It could also be used to convert a sparse file to a regular file but the risk
is it may no longer fit the disk. (Copying the file to empty disk should be ok
however). Wonder if such a utility already exists? The zero-fill would result
in good compression by SQ etc.

Re: BDOS 40

<sqkagk$19do$1@gioia.aioe.org>

 copy mid

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

 copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!aioe.org!yK7nUsNSoepUkJrzy00ZRw.user.46.165.242.75.POSTED!not-for-mail
From: this.is....@so.its.invalid (Martin)
Newsgroups: comp.os.cpm
Subject: Re: BDOS 40
Date: Thu, 30 Dec 2021 13:58:00 +0100
Organization: Aioe.org NNTP Server
Message-ID: <sqkagk$19do$1@gioia.aioe.org>
References: <sqj2b6$vbf$1@gioia.aioe.org> <sqjcnu$1vf8$1@gioia.aioe.org> <sqjdpk$8b2$1@gioia.aioe.org> <sqjikp$1hnj$1@gioia.aioe.org> <sqk6ep$1ekf$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="42424"; posting-host="yK7nUsNSoepUkJrzy00ZRw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:20.0) Gecko/20100101 SeaMonkey/2.17.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: Martin - Thu, 30 Dec 2021 12:58 UTC

Am 12/30/2021 12:50 PM, dxforth schrieb:
>
> It could also be used to convert a sparse file to a regular file but the
> risk
> is it may no longer fit the disk. (Copying the file to empty disk
> should be ok
> however). Wonder if such a utility already exists? The zero-fill would
> result
> in good compression by SQ etc.

I also don't know such an utility. Tried NSWEEP and PIP, both stop at
record 16 (after the first extent).

Such an utility would probably use BDOS 35 to get the amount of used
records of the file.

It loops over every record with BDOS 33, and does BDOS 34 on success,
skips 1 record on error 1, skips 128 records on error 4. The utility
however doesn't need to use BDOS 40 itself.

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor