MSDOS 4.0 (Announce)
> Also I noticed that this has things like DosWrite().
> This is basically an early incarnation of OS/2 - and
> one that looks better to me - ie it doesn't use the
> ULONG etc.
Just to expand - Microsoft *did* create a C-callable
interface to MSDOS - ie DosWrite() etc. This is apart
from anything they included in their C compiler
(write() or whatever - not sure what they provided).
And if you accept the legitimacy of the DosWrite()
call interface (used - albeit barely - by Microsoft's
own utilities), like:
v4.0/src/CMD/RESTORE/RTFILE.C
/*************************************************************/
/* write to dest file */
/*************************************************************/
retcode =
DOSWRITE
(dest_file_handle,
(char far *)&buf_pointer[0],
(unsigned) numread,
(unsigned far *) &numwrite
);
Then the definition of "32-bit MSDOS" would be:
v4.0/src/H/DOSCALLS.H
extern unsigned far pascal DOSWRITE (
unsigned,
char far *,
unsigned,
unsigned far * );
but those 16-bit unsigned parameters now naturally
morph into 32-bit (exactly what should happen for
a transition to 32-bit), and the pointers remain
as 32-bit, but obviously the "far" keyword is no
longer applicable, and they are flat pointers.
Since a recompilation is being done regardless, the
"pascal" calling convention could be dropped in
favor of cdecl.
And given the naming convention, you end up with
something similar to OS/2.
OS/2 in actuality went with:
USHORT APIENTRY DosWrite(USHORT hfile, void *ptr,
USHORT towrite, USHORT *tempWritten);
for 16-bit
and:
ULONG APIENTRY DosWrite(ULONG hfile, void *ptr,
ULONG towrite, ULONG *tempWritten);
ie the source code is not compatible.
In actuality you can simply ignore the official OS/2
documentation and use the MSDOS 4.0 definitions and
source, and it will happen to work with both 16-bit
and 32-bit OS/2.
So I would suggest that this (MSDOS 4.0) should be
adopted as the official standard to use instead of
POSIX or Windows or OS/2 (I don't like any of them
except the OS/2 function names), and provide existing
use (MSDOS 4.0, OS/2 1.x, Windows up to 2000, OS/2 2.0+).
The existing header file - doscalls.h - could be used too.
And the nature of the beast means that a thin wrapper
could be written to translate that into Win32 equivalents
so that everything from Win 95 to Win 11 is also covered.
Any thoughts?
BFN. Paul.
Complete thread:
- MSDOS 4.0 - kerravon, 26.04.2024, 04:43 (Announce)
- MSDOS 4.0 - Guti, 26.04.2024, 14:06
- MSDOS 4.0 - Oso2k, 26.04.2024, 15:38
- MSDOS 4.0 - roytam, 26.04.2024, 17:05
- MSDOS 4.0 - rr, 26.04.2024, 22:00
- MSDOS 4.0 - usotsuki, 30.04.2024, 17:41
- MSDOS 4.0 - boeckmann, 30.04.2024, 21:03