Mail Archives: djgpp/1996/12/29/21:00:05
Once upon a time (on 29 Dec 96 at 4:01) Murray Stokely said:
> Can anyone tell me the best way to detect the host Operating
> System in DJGPP? I know about _go32_info_block.run_mode but it
> doesn't seem to be able to give me the exact information I need.
> I'd like to be able to detect Windows 95/NT, OS/2 and Linux/DosEmu.
There's a function to get information on the DOS version you're
running ('_get_dos_version()'). It recognizes over 20 DOSes from
various manufacturers. However it cannot help you with the other
systems DJGPP can run on. Here's what you should do to detect the
other ones (namely Win95, WinNT, DOSemu and OS/2) that emulate DOS
(well, actually Win95 IS still DOS, but what the heck! ;-)):
1. DOSemu.
Attached to this message you will find a simple utility called
'isemu'. It detects DOSemu v0.53.58 and higher.
2. Windows 95/NT
There's another way to that suggested by Eli in the other posting.
Taken from Ralph Brown's Interrupt List:
INT 2F - MS Windows -
WINDOWS ENHANCED MODE INSTALLATION CHECK
AX = 1600h
Return:
AL = status
00h neither Windows 3.x enhanced mode nor Windows/386 2.x
running
01h Windows/386 2.x running
80h XMS version 1 driver installed (neither Windows 3.x enhanced
mode nor Windows/386 2.x running) (obsolete -- see note)
FFh Windows/386 2.x running
AL = anything else
AL = Windows major version number >= 3
AH = Windows minor version number
Notes: INT 2F/AH=16h comprises an API for non-Windows programs (DOS
device drivers, TSRs, and applications) to cooperate with
multitasking Windows/386 2.x and Windows 3.x and higher enhanced mode.
Certain calls are also supported in the Microsoft 80286 DOS extender in
Windows standard mode this function served as the installation check
and AX=1610h served to get the driver entry point for XMS version 1,
which is now obsolete. Use AX=4300h and AX=4310h instead
> Also is it possible to use the Windows 95 print manager from
> console applications with DJGPP? Wouldn't I need a windows.h file
> or something? Printing straight to LPT1 can realy mess up things if
> you're already printing something in Windows. I thought for sure
> this topic had been discussed before, but I checked the faq and mail
> archives with no avail. Any help would be appreciated, thanks..
>
>
>
> Murray Stokely ( murray AT southeast DOT net )
> http://www.cdrom.com/pub/artpacks
>
===================================================================
From the delequeue to the regiment, a profession in a flash. But
remember Monday signings when from door to door you dash... On the
news the nation mourns you - Unknown Soldier count the cost: for a
second you'll be famous but labeled posthumous... Forgotten Sons...
---
Visit http://ananke.amu.edu.pl/~grendel
- Raw text -