[Coco] Are the files in the /dd/SYS directory always ASCII ?

Bill Pierce ooogalapasooo at aol.com
Fri Sep 25 13:36:41 EDT 2020


Jeff, ahhhh, didn't even think about Cobol. I always thought it was for a version of C that was compiled into something like I-Code.
I was always leery of learning C for OS-9 back in the old days as I always saw people talking about the "overhead" and that it waisted memory. It wasn't until about 2012 that I jumped in head first into C for OS-9 and found it's actually pretty efficient code (yes, it could be more so), and that it compiled to assembly, then machine code. I now have a few optimizations I do on my code once I get it to RMA assembly, the do the final compile stages.


-----Original Message-----
From: Jeff Teunissen <deek at d2dc.net>
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Sent: Fri, Sep 25, 2020 1:15 pm
Subject: Re: [Coco] Are the files in the /dd/SYS directory always ASCII ?

You've probably never seen "C-code" because Tandy never sold the CIS
COBOL package from Micro Focus. That's what it's for. The C compiler
never produced an intermediate code that could be run like that, but
COBOL did.

On Fri, Sep 25, 2020 at 8:47 AM Bill Pierce via Coco
<coco at maltedmedia.com> wrote:
>
> FWIW, you can "sorta" ID OS-9 files by looking at the file descriptor and the file header.
>
> In the file descriptor (the first 32 bytes in the sector pointed to by the last 3 bytes of the 32 byte directory entry, which is also followed by the FAT for the file), you'll find the file attributes (which can distinguish if it's executable or read/write only and also flag directory entries), file creation date, file last modified date, calculate file size, and determine the owner of the file.
>
> The header can identify the file type as "Program/Object", "P-Code" (pascal), "I-Code" (basic09), "C-Code" (never seen this used in Coco OS-9), and "Data" (rare), as well as the version/revision. The file ID bytes at the beginning (first 2 bytes of any file) of the header can help as well. If the first 2 bytes are "$87 $CD", then it is some sort of executable module. If they are "62 $CD", then the file is an ROF (relocatable object file) for use in compiling C code (it can also be a C library file which is nothing but a merged ROF). There may be other OS-9 defined ID bytes, but those are the only 2 I've seen used in Coco OS-9. Basically, if the 2nd byte is NOT $CD, then it is most likely a text file or raw binary data file.
>
> There are a few utilities out there (with sources) that can access this info (ident, id, attr, vfy, verify, etc.).
> Bob Devries wrote a nice utility to read the file descriptor "fileinfo", in which the C source explains how to read the file descriptor.
>
> I used these sources (and more) to help write my file identification routines in my MShell project.
>
> Bill
>
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco

-- 
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco


More information about the Coco mailing list