86Box / 86Box

Emulator of x86-based machines.
GNU General Public License v2.0
2.71k stars 335 forks source link

Protected mode violation error on 286 machines with Windows 3.0 and 3.0a #3827

Closed Fenix770 closed 9 months ago

Fenix770 commented 11 months ago

What happened?

I installed Windows 3.0 and then 3.0a with both versions I found a strange error about a protected mode violation. Windows 3.0a does not works in real mode either. Also I tested EGA and VGA video modes and several ISA 286 machines Windows 3.0 starts but some apps may have strange issues about a protection violation.

This screen is from EGA black and white configuration but affects other video modes too. Monitor_1_20231114-191224-041 Monitor_1_20231111-230226-787

Here is the HDD a file Hyundai 286C.zip

Configuration file

[Paradise PVGA1A]
memory = 512

[IBM PC/AT Memory Expansion #1]
size = 1024
start = 1024

[General]
vid_renderer = qt_software
rctrl_is_lalt = 1
vid_resize = 1
dpi_scale = 0
video_fullscreen_scale = 2
video_gl_shader = 
window_remember = 1
video_gl_vsync = 1

[Machine]
machine = ibmatquadtel
cpu_family = 286
cpu_speed = 8000000
cpu_multi = 1
cpu_use_dynarec = 0
fpu_softfloat = 0
time_sync = local
cpu = 1
mem_size = 2048

[Video]
gfxcard = ega
video_fullscreen_scale_maximized = 1

[Input devices]
mouse_type = msserial

[Sound]
fm_driver = nuked
sndcard = adlib

[Network]
net_01_link = 0
net_02_link = 0
net_03_link = 0
net_04_link = 0

[Storage controllers]
hdc = ide_isa
cassette_mode = load

[Hard disks]
hdd_01_parameters = 17, 15, 900, 0, ide
hdd_01_fn = 
hdd_01_speed = 1989_3500rpm
hdd_01_vhd_blocksize = 1024
hdd_01_ide_channel = 0:0

[Floppy and CD-ROM drives]
fdd_01_type = 35_2hd
fdd_02_type = 525_2hd

[Everex EV-159 RAM 3000 Deluxe #1]
size = 2048
start = 0
length = 0
width = 1
speed = 1
ems = 1
base = 0258

[SuperEGA]
memory = 256
monitor_type = 9

[Sound Blaster v1.0]
base = 0220
irq = 7
dma = 1
opl = 1
receive_input = 1

[Monitor #1]
window_coordinates = 0, 23, 1366, 636
window_maximized = 1

[Monitor #2]
window_coordinates = 0, 0, 0, 0

[EGA]
memory = 256
monitor_type = 9

Operating system

Windows 10

CPU

i5 4210U

86Box version

4.1.0.5206

Build architecture

Windows - x86 (32-bit)

Build type

Download source

Official website (Jenkins, GitHub)

Additional context

No response

TC1995 commented 11 months ago

SuperEGA is a bit broken.

TC1995 commented 11 months ago

Wait, are you able to run Win3.0 on a standard EGA color configuration (not b&w)? And does it happen on earlier builds?

Fenix770 commented 11 months ago

But, I suspect is related to 286 protected mode emulaton, since it happens on VGA video mode too.

Fenix770 commented 11 months ago

I tried to install Win 3.0a on the ADI 386 SX/20 and color EGA it have the same issue. The machine crash when the setup program reach the graphical part of the installation.

Fenix770 commented 11 months ago

PD: The install program of Win 3.0a exists to DOS when reach the graphical part on ADI 386 SX/20 with AVGA-1 (Acumos).

Monitor_1_20231114-213804-038

Fenix770 commented 11 months ago

PD: Same on build 5979

Fenix770 commented 11 months ago

I installed Windows 3.0a on ADI 386 SX, and Windows freezes at the startup screen in standard (Win /S) and enhanced modes (WIN /3) only real modes works I tried the standard VGA video mode with different VGA video cards. It happen since at least the build 4.0.0.4640 Win x32 Hyundai 286C.zip

Fenix770 commented 11 months ago

I just tested other machines and even the 486 SX is affected by this bug.

TC1995 commented 11 months ago

for the AVGA one, I think it's a win3.1 only driver.

TC1995 commented 11 months ago

I think the EGA B/W driver requires at least 1.5MB of ram. Edit: or actually, standard mode itself requires 1.5MB of memory.

OBattler commented 11 months ago

I installed Windows 3.0a on ADI 386 SX, and Windows freezes at the startup screen in standard (Win /S) and enhanced modes (WIN /3) only real modes works I tried the standard VGA video mode with different VGA video cards. It happen since at least the build 4.0.0.4640 Win x32 Hyundai 286C.zip

That can't possibly be the build that introduced it because there's no CPU changes in that build.

Fenix770 commented 11 months ago

PD: I found some interesting!. Windows 3.0 (non "a") does not throw the "unrecoverable application error" on MS-DOS 4.00. The problem seems to be with the MS-DOS version 5.0. I found is also affected an old VM I have with SCAT 286, MS-DOS 5.0 and QRAM 2.02. Maybe it is related to the management of the HMA (fist 64kb of extended memory)

Fenix770 commented 11 months ago

I installed MS-DOS 4.01 on Shuttle 386 SX/20 with MS-DOS 4.01 and monochrome EGA card and monitor an works just fine. The issue happens on MS-DOS 5.0 but I don't know why.

DOS 4 01 Win 3 0a

Fenix770 commented 11 months ago

I installed MS-DOS 5.0 upgrade version, it seems to work fine. The files are dated as April 1991. The version that has issues is dated as February, 1992.

MS-DOS 5 0 upgrade MS-DOs 5 0 2-92 version

OBattler commented 11 months ago

Link to that February 1992 version?

OBattler commented 11 months ago

Try using the HIMEM.SYS that comes with the DOS version instead of the one from 1990.

Fenix770 commented 11 months ago

I already tried, the version of DOS 5.0 released in 1992 includes a HIMEM.SYS dated as September, 1991.

OBattler commented 11 months ago

Can you link me to that february 1992 version?

And can you upload your VM that uses the normal April 1991 MS-DOS 5.00?

Fenix770 commented 11 months ago

Here is the 1992 version of MS-DOS 5.0 MS-DOS 5.00.ver.5.00.02.English.zip

The July,1991 version is in Spanish languague. (Other versions exist and are dated as April, 1991 and a version 5.00a dated as November 1991) Microsoft MS-DOS 5.00 [Spanish] (3.5).zip

Fenix770 commented 11 months ago

PD: here is the Goldstar 286 VM with DOS 5.0 (july, 1991) and QRAM installed

286 Goldstar.zip SCAT type 4 hd.zip

OBattler commented 9 months ago

@Fenix770 Try reinstalling the broken configuration and see if things work correctly now. It could have been the IDE bug causing this as well.

Fenix770 commented 9 months ago

The bug seems to be fixed now!. The protection error was triggered, before, by the Windows Calc utility.

PD:

  1. I also discovered it is possible to use the ATI VGA 800x600x16 video mode on Windows 3.0 with the ATI EGA+

  2. The Win 1x/2.x drivers for the ATI EGA (not plus) for the resolutions 640x480 752x410 and 800x560 are not compatible with the EGA+. It seems the non-Plus is closer that the old EGA, and EGA+ is closer to the ATI VGA-88, the only difference may be the lack of the 8-bit DAC for the 256 color VGA modes.

Monitor_1_20240112-133521-484

OBattler commented 9 months ago

Well then, this can be closed as well.