delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/21/15:41:15

Message-Id: <199902212039.PAA00064@delorie.com>
From: "Laurynas Biveinis" <lauras AT softhome DOT net>
To: djgpp AT delorie DOT com
Date: Sun, 21 Feb 1999 21:42:27 +0100
MIME-Version: 1.0
Subject: Help : cannot switch screen mode
X-mailer: Pegasus Mail for Win32 (v3.01d)
Reply-To: djgpp AT delorie DOT com

Hi everybody,
	
I'm trying to switch video mode with BIOS int 0x10 using DPMI.

I wrote following simple program:

#include <conio.h>
#include <dpmi.h>

int main(void)
{
  __dpmi_regs regs;
  regs.x.ax = 0x0013;
  _dpmi_int(0x10, &regs);
  getch();
  regs.x.ax = 0x0003;
  _dpmi_int(0x10, &regs);
  return 0;
};

But it doesn't work: on first _dpmi_int call I get:

Exiting due to signal SIGSEGV
General Protection Fault at eip=0000002d
eax=00000000 ebx=00052340 ecx=00000000 edx=00000003 
esi=04e0c1f4 edi=0000e8e0
ebp=0004e8b4 esp=0004e878 
program=C:\PROGRA~2\DJGPP\PROGRAMS\MODE13.EXE
cs: sel=01f7  base=833ff000  limit=0005ffff
ds: sel=01ff  base=833ff000  limit=0005ffff
es: sel=01ff  base=833ff000  limit=0005ffff
fs: sel=012f  base=000169c0  limit=0000ffff
gs: sel=020f  base=00000000  limit=ffffffff
ss: sel=01ff  base=833ff000  limit=0005ffff

Call frame traceback EIPs:
  0x0000002d
  0x00001b06

I can easy switch to mode 0x13 using any real mode compiler.
I tried runing this program under Windows98 and plain DOS
Please say, what I'm doing wrong?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019