Jump to content

Windows 9x driver programming


CamTron

Recommended Posts


I tried setting it to something other than 640x480x4bit, but I get the "There is a problem with your display settings. The adapter type is incorrect, or the current settings do not work with your hardware." message box, and it still always loads vga.drv. How does Windows determine whether to show that error?

Is anyone familiar with SoftICE? According to the documentation, I believe the "int 3h" instruction should break into the debugger, but I'm doing that at the very beginning of my driver's Enable function and nothing happens, so I assume Windows isn't loading my driver for some reason.

 

EDIT: It turns out I had to use the "SET I3HERE ON" command in order to make SoftICE break on "int 3h". My driver is actually loading and is being called, but errors because I haven't implemented the necessary code.

Edited by CamTron
Link to comment
Share on other sites

I finally got my driver to work in 256 color mode!

4YeLrAB.png

However, it locks up the system when changing resolution or color depth.

 

I'm also having issues with SoftICE not handling resolution changes correctly. Whenever my driver changes the screen resolution, SoftICE's output becomes garbled and unreadable.

Edited by CamTron
Link to comment
Share on other sites

The corrupted text in SoftICE prevents me from further debugging this driver. Apparently, it's possible to use SoftICE over a serial port, but it somehow treats it as a modem and requires a telephone dial-in number. If anyone knows how to get that to work, it would be appreciated.

 

EDIT: After doing some research, I figured out how to do serial debugging with SoftICE. Not sure if this is useful to anyone out there, but here's what I did.

In the SoftICE settings in the Windows 98 guest, I added "SERIAL VT100 1 57000" to the initialization string.

On my Linux host machine, I made this script which creates a virtual serial connection and attaches a virtual terminal to one end of it.

#!/bin/bash
# Script for setting up a virtual serial connection to use with SoftICE
# This must be started before starting the guest VM

# Create a virtual null modem
# This command will create two virtual serial ports, typically named
# /dev/pts/N, where N is a number. Since the numbers are unpredictable,
# we use the link option which makes socat put user-specified symlinks to these
# devices.
# The COM1 serial port in VirtualBox must be set up to use the host device at /tmp/guestPort
socat -d -d pty,raw,echo=0,link=/tmp/hostPort pty,raw,echo=0,link=/tmp/guestPort &

# Create a terminal connected to /tmp/hostPort
# I run this in xterm, because all of the GTK-based terminals seem to intercept
# the F1-F12 keys, which we need in the debugger
xterm -e screen /tmp/hostPort 57000

# Stop the serial connection when xterm exits
killall socat
	

In the VirtualBox guest settings, I enabled the COM1 serial port and set the port mode to "Host Device" and the Path/Address to /tmp/guestPort.

Now, all I have to do is run that script, start my Windows 98 guest VM, and after a few seconds, I have a serial connection with SoftICE.

Edited by CamTron
Link to comment
Share on other sites

So there are a few problems using the VT100 serial, mainly that many of SoftICE's keyboard shortcuts (such as the F1-F12 keys) don't work correctly. It turns out that SoftICE comes with SERIAL.EXE, which is a DOS program that can control SoftICE over serial and has better functionality than a VT100 terminal. To use it, I copied the SERIAL.EXE to my Linux host, replaced the

xterm -e screen /tmp/hostPort 57000

line with

dosemu -I 'serial { com 1 device /tmp/hostPort }' -E SERIAL.EXE 1 57000

in the script, and then changed SoftICE's initialization string to "SERIAL ON 1 57000". Now, dosemu connects with the Windows 98 VM over serial, and keyboard shortcuts and colors work in SoftICE.

Edited by CamTron
Link to comment
Share on other sites

21 hours ago, CamTron said:

but it somehow treats it as a modem and requires a telephone dial-in number. If anyone knows how to get that to work, it would be appreciated.

ice for remote debugging need just serial link ("null modem") btw two machines.

also, you can connect ice via LAN.

for example, make two vm, one for debugee, other for control.

Link to comment
Share on other sites

Yes, that's basically what I figured out. I'm using Linux, and my script creates a virtual null modem. I have the Windows 98 VM running in VirtualBox, which is connected to one end of the null modem, and I'm running the SERIAL.EXE program in DOSEmu (a DOS emulator for Linux), which is connected to the other end of the null modem and allows me to view and control SoftICE.

The virtual serial connection is a bit slow, but at least now I can see and control the debugger without its output getting messed up by my WIP graphics driver.

Link to comment
Share on other sites

Is there any place I can download debugging symbols for Windows 98 SE, specifically for DIBENG.DLL? Opening certain dialog boxes makes DIBENG.DLL crash at this line of code, and if I knew what function it was crashing in, I may be able to figure out why.

0R4Vgst.png

Link to comment
Share on other sites

11 hours ago, CamTron said:

Is there any place I can download debugging symbols for Windows 98 SE, specifically for DIBENG.DLL?

yes, just look for old ms DDKs on MDGX site:
http://www.mdgx.com/add.htm
then unpack *.sym files from it, place it \winidr\system, and run nmsym for all files.

after this you get *.nms files, and can write
load=\windir\dibeng.dll
in winice.ini for EACH that file....

Link to comment
Share on other sites

On 2/5/2021 at 8:09 PM, CamTron said:

DLLs are always protected mode ring-3 and don't have direct access to ports and memory mapping IO

You are in Windows, not Windows _NT_.

Off-topic: And just for completeness - it is possible to have access to ports from ring 3 even in NT. Some special privilege or little help from driver...

Link to comment
Share on other sites

The Windows 98 DDK (despite MDGX saying "SE") appears to only have symbols for Windows 98 First Edition.

I tried downloading the "Windows 98 Second Edition Retail Symbols" from here (link from the MDGX page), and I get a Win98SE.exe file (which appears to be a DOS program). Running it results in an invalid instruction operation, and it does nothing.

I can install First Edition in my VM, but I'd like to get symbols for Second Edition, as that's what I have set up right now.

Edited by CamTron
Link to comment
Share on other sites

4 hours ago, CamTron said:

I tried downloading the "Windows 98 Second Edition Retail Symbols" from here (link from the MDGX page), and I get a Win98SE.exe file (which appears to be a DOS program). Running it results in an invalid instruction operation, and it does nothing.

Just extract it with 7zip.

Link to comment
Share on other sites

7-zip says it's not a valid archive. Interestingly, I get a different file if I set the Wayback machine to 2000 vs 2008, however, both versions just crash with an invalid instruction when run.

I'll just set up a Windows 98 FE VM. It's simpler than tracking down some 20 year old files on the internet.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...