Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

MSDOS 4.0 (Announce)

posted by kerravon, Ligao, Free World North, 27.04.2024, 15:53

> 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:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 119 users online (0 registered, 119 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum