Date: Tue, 04 Mar 1997 09:15:59 +1200 From: Bill Currie Subject: Re: ERROR 0004 To: djgpp AT delorie DOT com, giva AT bbb DOT no Reply-to: billc AT blackmagic DOT tait DOT co DOT nz Message-id: <331B3F8F.440C@blackmagic.tait.co.nz> Organization: Tait Electronics NZ MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit References: <199703031001 DOT KAA02454 AT bryggen> > > ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire) writes: > > 0004 is general protection fault. Ptttt! Not bloody likey! Get a 386, 486, or Pentium developers manual and READ it, then make statements on what's what. DONT GUESS, it causes more trouble than its worth (been there, done that:) > > void main (void) { > > int a; > > a= *((int *)0); > > } > > > > This will cause a GPF. Wrong, this will cause a page fault under cwsdpmi and a being filled with garbage under windows. > > Beware dereferencing NULL! > Gisle Vanem wrote: [some very good discriptions snipped] > The opposite mode (bit 2=0) is supervisor mode. AFAIK, the CPU is always > in user-mode (except for when e.g. laptops/green-PC's shuts down). > Maybe the real experts out there care to comment. Almost: there is user mode (ring 3) and supervisor mode (rings 0-2). (most) DJGPP apps run in user mode, as do most windows/linux/os2/... apps. The KERNELS (cwsdpmi, windows ... (basicly the dpmi servers)) run in supervisor mode (usually only ring 0, 1-2 are usually ignored). These modes have absolutly nothing to do with power savers and other such filth ;) (don't get me wrong, I'm not in for wasting resources, but I hate it when those things cut in at the worst possible moment (which is what they always do)). Bill -- Leave others their otherness.