Skip to contentSkip to conversation

Terminal Video Problem Solved (and sound too!)

DISCUSSION Stas Sergeev 1 participant 1 message Dec 3, 2002

lore
Share & tools
lore
#0 lore raw

Hello.

Quoted 1 line · Mushroom

I am now ready to try any settings the 2 of you suggest in the conf files.

OK, no special settings, just disabled $_pci and $_chipset="plainvga".
To make your test more valuable, please apply the attached patch. It disallows any IO except for that was granted by ioperm() for v86 mode.
This patch will prevent dosemu from cleaning the screen properly, so avoid killing it while in graphics mode (or keep your X ready to switch there). Apply this patch without anything else like post-less "cost-less" init to 1.1.3.7. If this, by any chance, also makes the lock-ups to go away, then we are dealing with some very bad bug. This patch will produce a lot of output in your boot.log or console or whatever you are using to get an output from dosemu, send this log to me.
But if you have lock-ups also with that patch... then is seems that only touching the VGA registers is already enough to lock up the entire system with some video cards:( In that case the post-less init looks like the only solution.

include/port.h +22 -15
@@ -15,6 +15,7 @@
 #include "config.h"
 #include "types.h"
 #include "priv.h"
+#include "dosemu_debug.h"
 
 /* port i/o privileges */
 #define IO_READ  1
@@ -60,47 +61,53 @@
 static __inline__ void port_real_outb(ioport_t port, Bit8u value)
 {
   if (!can_do_root_stuff) return;
-  __asm__ __volatile__ ("outb %0,%1"
+  error("IO attempt: outb, port 0x%x\n", port);
+/*  __asm__ __volatile__ ("outb %0,%1"
 		    ::"a" ((Bit8u) value), "d"((Bit16u) port));
-}
+*/}
 
 static __inline__ Bit8u port_real_inb(ioport_t port)
 {
-  Bit8u _v;
+//  Bit8u _v;
   if (!can_do_root_stuff) return 0xff;
-  __asm__ __volatile__ ("inb %1,%0"
+  error("IO attempt: inb, port 0x%x\n", port);
+/*  __asm__ __volatile__ ("inb %1,%0"
 		    :"=a" (_v):"d"((Bit16u) port));
-  return _v;
+*/  return 0xff;
 }
 
 static __inline__ void port_real_outw(ioport_t port, Bit16u value)
 {
   if (!can_do_root_stuff) return;
-  __asm__ __volatile__ ("outw %0,%1" :: "a" ((Bit16u) value),
+  error("IO attempt: outw, port 0x%x\n", port);
+/*  __asm__ __volatile__ ("outw %0,%1" :: "a" ((Bit16u) value),
 		"d" ((Bit16u) port));
-}
+*/}
 
 static __inline__ Bit16u port_real_inw(ioport_t port)
 {
-  Bit16u _v;
+//  Bit16u _v;
   if (!can_do_root_stuff) return 0xffff;
-  __asm__ __volatile__ ("inw %1,%0":"=a" (_v) : "d" ((Bit16u) port));
-  return _v;
+  error("IO attempt: inw, port 0x%x\n", port);
+/*  __asm__ __volatile__ ("inw %1,%0":"=a" (_v) : "d" ((Bit16u) port));
+*/  return 0xffff;
 }
 
 static __inline__ void port_real_outd(ioport_t port, Bit32u value)
 {
   if (!can_do_root_stuff) return;
-  __asm__ __volatile__ ("outl %0,%1" : : "a" (value),
+  error("IO attempt: outd, port 0x%x\n", port);
+/*  __asm__ __volatile__ ("outl %0,%1" : : "a" (value),
 		"d" ((Bit16u) port));
-}
+*/}
 
 static __inline__ Bit32u port_real_ind(ioport_t port)
 {
-  Bit32u _v;
+//  Bit32u _v;
   if (!can_do_root_stuff) return 0xffffffff;
-  __asm__ __volatile__ ("inl %1,%0":"=a" (_v) : "d" ((Bit16u) port));
-  return _v;
+  error("IO attempt: ind, port 0x%x\n", port);
+/*  __asm__ __volatile__ ("inl %1,%0":"=a" (_v) : "d" ((Bit16u) port));
+*/  return 0xffffffff;
 }
 
 
env/video/vga.c +1 -1
@@ -619,7 +619,7 @@
     error("CAN'T DO VIDEO INIT, BIOS NOT MAPPED!\n");
     return;
   }
-  if (set_ioperm(0x3b0, 0x3db - 0x3b0, 1))
+  if (set_ioperm(0x3b0, 0x3df - 0x3b0, 1))
     warn("couldn't get range!\n");
   config.vga = 1;
   set_vc_screen_page(READ_BYTE(BIOS_CURRENT_SCREEN_PAGE));