>This is a bit long, so don't read unless you are actually interested in
>the file-type/suffix debate.

[Excellent break-down deleted]

>I personally like the Unix approach, where the OS only enforces file
>typing where it matters to the OS. On the SAM, as mentioned here
>already, only the various BASIC file types need to be known to the OS.
>In fact it would probably be desirable if "OPENTYPE" files
>were indistinguishable in practice from "CODE" files.

Okay... here's a few ways of doing things:

\begin ramble
If we need new file types, we could do with an EXEC type - which will load
in the first x (as specified in the file header) bytes to a buffer area
(above the current screen? free pages?), which in turn can be called (code
must be relocatable), and can request memory pages, and then ask the DOS to
load in specific length chunks. Something like a modified +D header at the
start could specify it (note that because this is a new file type, we don't
need to keep the +D one if we REALLY don't want to... and new format discs
(EDOS et al), won't use the +D info. So let's stick a magic number at the
beginning of the EXEC file, just so that if it's copied to a DOS disk, we
don't need to worry about bringing it back in the correct format. Let's make
it a 4 character one (but not starting with MZ :) )... hey, EXEC (with bit 7
set on the C) sounds nice. :)

After the EXEC we need some kind of length byte for the amount of code that
we're bringing in in this chunk. Let's make that a 16-bit word, and add the
restriction that you can't have more than 8192 bytes of code in there.

Code to that length will then be loaded in at &E000 and called -- BUT that
shouldn't be relied upon. We need totally relocatable code in that section -
god knows what future DOS writers might do. The code in that section will
use hook-codes to reserve memory for itself, and to load itself into the
memory map, and install any heap stuff that might be needed - so guess what?
We can use this load-method for driver code as well as for neat & tidy
applications. The hook codes used will not allow data to be loaded into any
page other than a screen, blank or a specified page type - should stop bad
apps treading on other people's toes.

As for OPENTYPE files, looking through the DOS source, there appears to be a
couple of types of them - remnants from the Speccy DOSes etc... all in all
this shouldn't really matter, but perhaps we need a conversion program or
command which can take one file type and transform it into another.
"Floating" code files is something I'd like - ie CODE ones without a start
address - just a length, which would REQUIRE you to specify a start address.
Maybe these ARE Opentype files? :)

If the DOS is done correctly, it shouldn't be difficult to have files as
long as you want, or as short as you want, just using the hook codes. I'm
going to leaf through the UNIX commands et al, and see what I can come up with.

When the hard drive comes along, by all means, people can start using magic
numbers all over the place - it won't matter then, as the DOS will be able
to leaf through a file in /etc/ and get the info it needs out of it. Until
then I don't think we really need them... especially as things like GIF
files, IFF files, PKZIP files etc all have their own Magic numbers built in
anyway. By all means, stick one at the beginning of your data files - I
already have done in some cases - but save them under the CODE type perhaps?

Anybody come up with a good way of copying files to MS-DOS disks, retaining
the file headers etc, yet also leaving say ASCII files unharmed if the PC
wants to read them? I was going to use the reserved 10 bytes in the
directory area, but I don't know if they're used by OS/2 or Novell Netware...

\ramble off

I'll leave it at that for now. Come up with the hook codes you've always
wanted to see (I'm going to stick CRC ones in the DOS too), and lemme know
what they are...

Simon
-!- Mains Hum: A sine of the times???

+- Email:[EMAIL PROTECTED] ---- Fidonet: 2:250/124.2 (Simon Cooke) -+
|  Snail:1 Dovey Close, Astley, Tyldesley, Manchester, M29 7NP, UK        |
|  Tel: (01942) 886084  Fax: (01942) 886084 (ring voice first to confirm!)|
+- WWW: http://jumper.mcc.ac.uk/~simonc ----------------------------------+

Reply via email to