X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f NNTP-Posting-Date: Mon, 02 Apr 2007 00:25:24 -0500 Date: Sun, 01 Apr 2007 22:25:16 -0700 From: Jim Michaels User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: cwsdpmi "protected mode not availible" on win2k, stub don't work References: <4610253F DOT 18094 DOT 166783AF AT gerritvn DOT gpvno DOT co DOT za> In-Reply-To: <4610253F.18094.166783AF@gerritvn.gpvno.co.za> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 71 NNTP-Posting-Host: 24.20.110.103 X-Trace: sv3-vR5xLcHeQeGz51F+ocGqsFg0UN6j9V7cR+kp/Aszi/ZgNGKWGDuZ1dxyFTSMPwflrzoEQbV40Ic5VBf!/oL8h4LB0QkRkR9FONPl/PgVnaxkZXakm009+2H+ivoDsWx52d5eU0TYZMCaAd4UoMX1VTo65M1N!wz5IbG7xb7YtFE4s2UQLEcGFrp4Y4w== X-Complaints-To: abuse AT comcast DOT net X-DMCA-Complaints-To: dmca AT comcast DOT net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.34 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Gerrit van Niekerk wrote: > On 31 Mar 2007 at 11:30, Jim Michaels wrote: > >> I get "Protected mode not avcailible" when I run my app under Windows >> 2000 consistently, whether I include the stub or whether I have the >> cwsdpmi.exe alongside it. >> >> Without these it just says "cwsdpmi not found". >> Something always goes wrong. >> >> gxx whatever.c >> (which generates a.out & a.exe) >> exe2coff a.exe >> (which generates a) >> copy /b f:\djgpp\2.03\v2misc\bin\cwsdstub.exe+a whatever.exe >> (which generates whatever.exe) >> >> and "availible" is misspelled. >> >> tried this with CMD.exe shell and with command.com. >> >> If it's of any interest, this computer was made for Windows 98, before >> ACPI-compliant power supplies were made, so it must be turned off manually. >> I saw the earlier post about ACPI and CWSDPMI having a problem with >> windows, but I wasn't quite sure what to make of it in the end. > > Windows 2000 has it's own DPMI support - you should not use CWSDPMI > at all. I'm using only the latest binaries from the 2.03 compiler set of DJGPP. I'm looking at the generated EXE code by gxx and gcc and they both have this at the top close to somewhere after the MZ signature of a standard EXE: stub.h generated from stub.asm by djasm, on Mon Dec 24 21:21:52 2001 The STUB.EXE stub loader is Copyright (C) 1993-1995 DJ Delorie. Permission granted to use for any purpose provided this copyright remains present and unmodified. This only applies to the stub, and not necessarily the whole program. $Id: stub.asm built 12/24/01 21:21:52 by djasm $ @(#) stub.asm built 12/24/01 21:21:52 by djasm go32stub, v 2.02T @ CWSDPMI.EXE followed by a section of binary. I don't know how not to get it not to do the stub.h (or do I need it?) Does it necessarily call *any* DPMI services or only CWSDPMI? in any case, I can't get either to work. The application calls BIOS.H's biosdisk(): under windows XP the application causes Windows to throw the message: 16-bit MSDOS Subsystem: An application has attempted to directly access the hard disk, which cannot be supported. This may cause the application to function incorrectly. Choose "Close" to terminate the application. If I choose Ignore, the biosdisk calls apparently are ignored and the buffers I get back are full of uninitialized memory stuff (which is what gets written to disk with fwrite) which should have been written to. this is another hump DJGPP may need to get over. within the "Windows NT resource Kit" is a Disk Editor tool. you can hex-edit your hard drive. I didn't think that was possible given the existing API's I saw exposed in Visual C++ and the Platform SDK. but there's probably something in the kernel or a trick to getting directly at the IO device. I need to read the boot & partition sectors. AHA! you are right! my autoexec.nt in the windows 2000 machine has been compromised. it has 1 line: "Prompt $P$G". some offending installer did that a while back. I think it was an old HP Printer Driver.