• CP/M 2.2 SYS attribute

    From Ed Batalha@21:1/5 to All on Tue Feb 7 00:10:40 2023
    Hi,

    I'm new to CP/M and so, I'm sure this has been discussed a lot in the
    past already. I looked for this in other places on the internet but
    found no answer, so here goes:

    In the CP/M 2.2 manual, in the glossary [1] we see this text
    "
    system attribute (SYS)
    File attribute. You can give a file the system attribute by using
    the SYS option in the STAT command or by using the set file attributes function, BDOS Function 12. A file with the SYS attribute is not
    displayed in response to a DIR command. If you give a file with user
    number 0 the SYS attribute, you can read and execute that file from any
    user number on the same drive. Use this feature to make your commonly
    used programs available under any user number.
    "
    I tried to test this by changing the attributes of a file to SYS with
    STAT but then, after changing user was still unable to execute it.

    Is this a known CP/M bug? If so, has it ever been patched?
    Or is the manual just wrong?

    [1]
    http://www.gaby.de/cpm/manuals/archive/cpm22htm/axh.htm

    Thanks,
    Ed

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steven Hirsch@21:1/5 to Ed Batalha on Mon Feb 6 20:00:25 2023
    On 2/6/23 19:10, Ed Batalha wrote:
    Hi,

    I'm new to CP/M and so, I'm sure this has been discussed a lot in the past already. I looked for this in other places on the internet but found no answer, so here goes:

    In the CP/M 2.2 manual, in the glossary [1] we see this text
    "
    system attribute (SYS)
        File attribute. You can give a file the system attribute by using the SYS
    option in the STAT command or by using the set file attributes function, BDOS Function 12. A file with the SYS attribute is not displayed in response to a DIR command. If you give a file with user number 0 the SYS attribute, you can read and execute that file from any user number on the same drive. Use this feature to make your commonly used programs available under any user number. "
    I tried to test this by changing the attributes of a file to SYS with STAT but
    then, after changing user was still unable to execute it.

    Is this a known CP/M bug? If so, has it ever been patched?
    Or is the manual just wrong?

    [1]
    http://www.gaby.de/cpm/manuals/archive/cpm22htm/axh.htm

    I'm not aware that vanilla DRI CP/M 2 ever supported "public" files. The feature is available under NZCOM using ZRDOS. There, files in any user area can have the public bit set and be seen from any other.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Douglas Miller@21:1/5 to All on Mon Feb 6 19:35:02 2023
    There were some vendors that created their own CCP that would search for the COM file in user 0 if it didn't exist at the current user number. Many of these required the SYS attribute to be set in order to work. CP/M 3 took the feature further to allow
    data files to be matched on user 0 as well. CP/M 3 also introduced more options for searching for COM files. So, the CP/M 2.2 BDOS did not support such a feature, but some vendors replaced the standard CCP with one that could do more searching for COM
    files.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Douglas Miller@21:1/5 to All on Mon Feb 6 19:43:51 2023
    I also have a copy of that manual, and I don't know when/why that was added to a manual for CP/M 2.2. I see the manual was last updated 1983, which could easily have allowed some CP/M 3 features to be accidentally added. The title page of the manual
    actually does not specify a version, although the commands described are certainly 2.2 and not 3. It may have been a mistake from trying to keep one set of documentation for different versions/variations of the OS.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence Woodman@21:1/5 to Ed Batalha on Mon Feb 6 23:52:59 2023
    On Tuesday, 7 February 2023 at 00:10:42 UTC, Ed Batalha wrote:

    In the CP/M 2.2 manual, in the glossary [1] we see this text
    "
    system attribute (SYS)
    File attribute. You can give a file the system attribute by using
    the SYS option in the STAT command or by using the set file attributes function, BDOS Function 12. A file with the SYS attribute is not
    displayed in response to a DIR command. If you give a file with user
    number 0 the SYS attribute, you can read and execute that file from any
    user number on the same drive. Use this feature to make your commonly
    used programs available under any user number.
    "
    Is this a known CP/M bug? If so, has it ever been patched?
    Or is the manual just wrong?

    For CP/M 2.2 the manual is wrong. This must have slipped in there from
    CP/M Plus or possibly a vendor patched version.

    In any case you can easily patch a standard BDOS with the following code:

    cat > bdos-pat.asm <<\xxxxxxxxxx
    title 'BDOS patch for CP/M 2.2 to make USER 0 public'
    ;
    ;5/15/80
    ;
    ;patch courtesy of Andy Johnson-Laird
    ;
    ;******************************CAUTION******************************
    ;
    ;This patch is for grown-ups who know what they are doing.
    ;Note that if files of the same name are present on both USER 0 and
    ;the logged-in USER number, the OPEN, SEARCH for FIRST, SEARCH for NEXT
    ;and READ SEQUENTIAL functions will match directory entries on a first-come ;first-served basis. This will cause exciting results if multiple extent ;files of the same name are present on both USER 0 and logged-in USER.
    ;
    ;Recommended use:
    ;
    ; 1) Keep on USER 0 only commonly used programs (Files.COM)
    ; 2) Set these programs to $SYS to reduce directory clutter.
    ; 3) Set these programs to $R/O to avoid accidental erasure of
    ; invisible programs.
    ; 4) NEVER place on any other USER number programs of the same name.
    ; 5) Have turn-key applications cold-boot directly into the assigned
    ; USER number. The USER number is the high nibble of address 4.
    ;
    ;
    msize equ 20 ;set your memory size here
    ;
    bdos equ (msize-20)*1024+3C00h
    ;
    patch$area equ ?????? ;this will depend on YOUR system, and
    ;should probably be in your BIOS area
    ;
    org bdos+075eh
    jmp patch ;overlays: mov a,b
    ; cpi 0dh
    ;
    ;
    org patch$area
    patch: mov a,b
    ora a
    jnz patch2
    ldax d
    cpi 0e5h
    jz patch2
    mov a,m
    ora a
    jz bdos+077ch
    patch2: mov a,b
    cpi 0dh
    jmp bdos+0761h
    ;
    end
    xxxxxxxxxx

    Alternatively you could use a shell extension such as XCCP or EPEX.


    Best wishes


    Lorry

    ---
    XCCP: A Shell Extension for CP/M https://techtinkering.com/articles/xccp-a-shell-extension-for-cpm/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ed Batalha@21:1/5 to Lawrence Woodman on Tue Feb 7 21:36:02 2023
    Lawrence Woodman wrote:
    On Tuesday, 7 February 2023 at 00:10:42 UTC, Ed Batalha wrote:

    In the CP/M 2.2 manual, in the glossary [1] we see this text
    "
    system attribute (SYS)
    File attribute. You can give a file the system attribute by using
    the SYS option in the STAT command or by using the set file attributes
    function, BDOS Function 12. A file with the SYS attribute is not
    displayed in response to a DIR command. If you give a file with user
    number 0 the SYS attribute, you can read and execute that file from any
    user number on the same drive. Use this feature to make your commonly
    used programs available under any user number.
    "
    Is this a known CP/M bug? If so, has it ever been patched?
    Or is the manual just wrong?

    For CP/M 2.2 the manual is wrong. This must have slipped in there from
    CP/M Plus or possibly a vendor patched version.

    In any case you can easily patch a standard BDOS with the following code:

    cat > bdos-pat.asm <<\xxxxxxxxxx
    title 'BDOS patch for CP/M 2.2 to make USER 0 public'
    ;
    ;5/15/80
    ;
    ;patch courtesy of Andy Johnson-Laird
    ;
    ;******************************CAUTION******************************
    ;
    ;This patch is for grown-ups who know what they are doing.
    ;Note that if files of the same name are present on both USER 0 and
    ;the logged-in USER number, the OPEN, SEARCH for FIRST, SEARCH for NEXT
    ;and READ SEQUENTIAL functions will match directory entries on a first-come ;first-served basis. This will cause exciting results if multiple extent ;files of the same name are present on both USER 0 and logged-in USER.
    ;
    ;Recommended use:
    ;
    ; 1) Keep on USER 0 only commonly used programs (Files.COM)
    ; 2) Set these programs to $SYS to reduce directory clutter.
    ; 3) Set these programs to $R/O to avoid accidental erasure of
    ; invisible programs.
    ; 4) NEVER place on any other USER number programs of the same name.
    ; 5) Have turn-key applications cold-boot directly into the assigned
    ; USER number. The USER number is the high nibble of address 4.
    ;
    ;
    msize equ 20 ;set your memory size here
    ;
    bdos equ (msize-20)*1024+3C00h
    ;
    patch$area equ ?????? ;this will depend on YOUR system, and
    ;should probably be in your BIOS area
    ;
    org bdos+075eh
    jmp patch ;overlays: mov a,b
    ; cpi 0dh
    ;
    ;
    org patch$area
    patch: mov a,b
    ora a
    jnz patch2
    ldax d
    cpi 0e5h
    jz patch2
    mov a,m
    ora a
    jz bdos+077ch
    patch2: mov a,b
    cpi 0dh
    jmp bdos+0761h
    ;
    end
    xxxxxxxxxx

    Alternatively you could use a shell extension such as XCCP or EPEX.


    Best wishes


    Lorry

    ---
    XCCP: A Shell Extension for CP/M https://techtinkering.com/articles/xccp-a-shell-extension-for-cpm/


    Thanks, it worked!!!

    I changed the msize to 64 and found what looked like a reasonable value
    for 'patch$area' (0fbdfh).
    Then assembled the file with asm and loaded the resulting hex to memory
    with DDT. Will do a bit more testing now...
    I'm still not really familiar with the whole putsys, movcpm, etc etc.
    Hopefully I'll b able find some later to study all of that.

    Cheers,
    Ed

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)