Skip to contentSkip to conversation

ERROR: BUG: dosemu touched the protected video memory!!!

DISCUSSION Julius Schwartzenberg 2 participants 6 messages Jan 9, 2004 – Jan 25, 2004

lore
Share & tools
lore
#0 lore raw

Hi,
When I run a program such as Duke Nukem, Dosemu quits with the following error:
ERROR: BUG: dosemu touched the protected video memory!!!
ERROR: cpu exception in dosemu code outside of VM86()!
trapno: 0x0e errorcode: 0x00000006 cr2: 0x000a7000
eip: 0x08092657 esp: 0xbffff290 eflags: 0x00200246
cs: 0x0023 ds: 0x002b es: 0x002b ss: 0x002b
Page fault: write instruction to linear address: 0x000a7000
CPU was in user mode
Exception was caused by non-available page
ERROR: leavedos() called from within a signal context!
It works fine when running with direct video access on a console.
Other software such as Windows for Workgroups 3.11 and MS Word 6 for Windows works without problems.
I tried it with Dosemu 1.2.0 RC1 and stable 2003. With both version King's Quest seems to give the same problem. Prince of Persia works with stable 2003, but I believe it didn't work with 1.2.0 RC1. Am I doing something completely wrong or is this a bug?
Thanks in advance,
Julius

#1 lore raw
Quoted 4 lines · Julius Schwartzenberg

When I run a program such as Duke Nukem, Dosemu quits with the following error:
ERROR: BUG: dosemu touched the protected video memory!!!
ERROR: cpu exception in dosemu code outside of VM86()!

Quoted 8 lines

trapno: 0x0e errorcode: 0x00000006 cr2: 0x000a7000
eip: 0x08092657 esp: 0xbffff290 eflags: 0x00200246
cs: 0x0023 ds: 0x002b es: 0x002b ss: 0x002b
Page fault: write instruction to linear address: 0x000a7000 CPU was in user mode
Exception was caused by non-available page
ERROR: leavedos() called from within a signal context! It works fine when running with direct video access on a console.

This can be tricky depending on where dosemu is. One such instance was solved fairly recently. Can you check where 0x8092657 (the value behind eip:) is in bin/dosemu.map or by using gdb?

Were you talking about duke nukem 3d or some earlier duke?

Quoted 1 line

I tried it with Dosemu 1.2.0 RC1 and stable 2003.

The "DoSEMU stable 2003" you saw is a joke (witness DoS = denial of service) -- it should have been called "cvs head 31 Dec 2003". Anyway I got tired of him so it no longer exists.

Bart

#2 lore raw

Bart Oldeman schreef:

Quoted 7 lines

This can be tricky depending on where dosemu is. One such instance was solved fairly recently. Can you check where 0x8092657 (the value behind eip:) is in bin/dosemu.map or by using gdb?

Were you talking about duke nukem 3d or some earlier duke?

I can't seem to find bin/dosemu.map is it created somewhere? I also don't know how to use gdb.
I was talking about the very old Duke Nukem (dn1.exe). The problem only seems to happen with simpler applications also ZSNES works fine for example. I'm using PC DOS 2000 (7.0 Rev 1) btw. Julius

#3 lore raw
In reply to Bart Oldeman

Bart Oldeman schreef:

Quoted 3 lines

Were you talking about duke nukem 3d or some earlier duke?

It still doesn't work with version 1.2.0 :(
You can download the Duke Nukem I was talking about here btw:
ftp://ftp.3drealms.com/share/1duke.zip
Julius

#4 lore raw
Quoted 6 lines · Julius Schwartzenberg

Bart Oldeman schreef:

Quoted 3 lines

Were you talking about duke nukem 3d or some earlier duke?

It still doesn't work with version 1.2.0 :(

yes, I know, noone has tried to fix it so far, and I didn't want to do it myself because that would just delay 1.2.0 even more (ie. not classified as "release critical"). Can you put it in the SF BTS (bugs link on www.dosemu.org) so that it won't be forgotten easily?

Bart

#5 lore raw
In reply to Julius Schwartzenberg
Quoted 8 lines · Julius Schwartzenberg

Bart Oldeman schreef:

Quoted 3 lines

Were you talking about duke nukem 3d or some earlier duke?

It still doesn't work with version 1.2.0 :(
You can download the Duke Nukem I was talking about here btw:
ftp://ftp.3drealms.com/share/1duke.zip

yep, I downloaded that one. Seems to work fine for me though... When would it happen?

I just did
xdosemu
cd duke
dn1
press "s" from main menu
press "space" twice
duke can walk left and right
which Linux kernel version are you running on? Distribution?

Can you also look up the value of eip in the dump and compare it to bin/dosemu.map (you get this file when compiled from source code), and give the full ~/.dosemu/boot.log contents?

Bart

(BTW Duke had a graphics glitch for me which was fixed in CVS but not in -stable yet: but this as far as I can see should not be the cause for the crash.
Fix:

env/video/vgaemu.c renamed from env/video/vgaemu.c.~1.4.2.2.~ +8 -2
@@ -2307,7 +2307,7 @@
  * Set visible text page.
  *
  * `vga.display_start' is set to `page' * `page_size'.
- * In graphics modes to 'page' * 'page_size' * 8 (quick workaround, FIXME!)
+ * In graphics modes the page_size is determined from memory/vga settings
  *
  * arguments:
  * page      - Number of the text page.
@@ -2320,7 +2320,13 @@
 int vga_emu_set_text_page(unsigned page, unsigned page_size)
 {
   if(vga.mode_class != TEXT) {
-    page_size *= 8;
+    page_size = vga.scan_len * vga.height;
+    if (page_size != 0) {
+      page_size = vga.mem.bank_pages * 4096 / page_size;
+      if (page_size != 0) {
+	page_size = vga.mem.bank_pages * 4096 / page_size;
+      }
+    }
   }
 
   if((page + 1) * page_size > vga.mem.size) {