[Patch] Intel PIIX3 southbridge (including USB controller)

Post new patches here!
Post Reply
grommit2007
Posts: 43
Joined: Sat 22 Apr, 2017 3:26 pm

[Patch] Intel PIIX3 southbridge (including USB controller)

Post by grommit2007 »

This is a patch that I created to replace the Intel PIIX southbridge on all 430HX and 430VX motherboards with the PIIX3 southbridge, which is the southbridge that came with motherboards based on these chipsets.

I created it by using the code structure from the VIA VT82C586B southbridge, which is already emulated and contains the structures necessary for the USB controller emulation, as well as the existing the PIIX emulation, which was also reworked with the PIIX3 specific hardware registers.

I have been working on this patch since late July, and after many, many weeks of testing, I can now say that this is on par with the existing PIIX emulation and the added PIIX3 specific functions work (USB enable/disable, installing the Windows 95 USB supplement, of which various versions were tested, as well as the built in USB support of Windows 98 and ME).

Some other changes include changing values in the PCI to ISA bridge as well as the IDE controller to make them more closely match what is shown in the latest datasheet for the latest stepping of this chip.

In short, I created this using most of the code from the existing PIIX emulation, but the code structure from the aforementioned VIA southbridge was used to get all of the stuff working.

The patch is attached below.

I would like to hear any feedback on this, as well as any information about any issues that may arise which I may have not seen, also I would like to ask the developers if this patch may be considered for the next release of PCem.
Attachments
piix3.patch
PIIX3 emulation with working USB controller emulation
(26 KiB) Downloaded 425 times
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: [Patch] Intel PIIX3 southbridge (including USB controller)

Post by omarsis81 »

so... we could plug external usb devices with this?
grommit2007
Posts: 43
Joined: Sat 22 Apr, 2017 3:26 pm

Re: [Patch] Intel PIIX3 southbridge (including USB controller)

Post by grommit2007 »

omarsis81 wrote: Sat 22 Aug, 2020 9:36 am so... we could plug external usb devices with this?
The USB emulation is similar to the emulation for serial and parallel ports, it does not allow you to plug in external devices into the computer and use them in PCem.

It's basically like the USB emulation found in the VIA southbridge which is already emulated. (This could eventually lead to stuff like USB keyboards, mice and gamepads, etc being emulated one day).
User avatar
leilei
Posts: 1039
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [Patch] Intel PIIX3 southbridge (including USB controller)

Post by leilei »

USB passthrough would probably be a huge headache for platform support.

I can see it being a big benefit for emulating the better USB version of the Interact Hammerhead (vintage and close enough to the typical modern gamepad and carries the 3dfx brand cult appeal), as the gameport version drivers breaks badly in the NTs
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Intel PIIX3 southbridge (including USB controller)

Post by SarahWalker »

Sorry for taking so long to comment on this!

My main reaction is that I don't think the PIIX3 should be completely separate from the existing PIIX; apart from the USB controller the two are basically identical, so let's keep the existing code unified for the sake of maintainability. I'd be happier if piix_init() were extended to take a 'type' parameter, and initialise the USB section only if PIIX3 is requested. USB code could be split into a piix_usb.c file.
grommit2007
Posts: 43
Joined: Sat 22 Apr, 2017 3:26 pm

Re: [Patch] Intel PIIX3 southbridge (including USB controller)

Post by grommit2007 »

SarahWalker wrote: Sun 23 Aug, 2020 2:33 pm Sorry for taking so long to comment on this!

My main reaction is that I don't think the PIIX3 should be completely separate from the existing PIIX; apart from the USB controller the two are basically identical, so let's keep the existing code unified for the sake of maintainability. I'd be happier if piix_init() were extended to take a 'type' parameter, and initialise the USB section only if PIIX3 is requested. USB code could be split into a piix_usb.c file.
Sorry for the late reply, I was busy for a few days. I will see how best I can try to implement the PIIX3 emulation according to your recommendations.

Also, I happened to notice that the infrastructure for the potential emulation of the Intel i430NX (Neptune) chipset from 1994 is already present, as it is basically the i430LX chipset (used with the original 1993 Pentium models) with support for Socket 5 CPUs.

Is it OK if I can make a patch to add this chipset and an Intel Desktop Board (Intel Premiere PCI/II) which supports it?
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: [Patch] Intel PIIX3 southbridge (including USB controller)

Post by omarsis81 »


Is it OK if I can make a patch to add this chipset and an Intel Desktop Board (Intel Premiere PCI/II) which supports it?
All boards/computers additions are more than welcome!
grommit2007
Posts: 43
Joined: Sat 22 Apr, 2017 3:26 pm

Re: [Patch] Intel PIIX3 southbridge (including USB controller)

Post by grommit2007 »

omarsis81 wrote: Tue 01 Sep, 2020 1:10 am

Is it OK if I can make a patch to add this chipset and an Intel Desktop Board (Intel Premiere PCI/II) which supports it?
All boards/computers additions are more than welcome!
Actually, after some work, I got the BIOS to work and it boots (I tried DOS from a floppy disk and it boots to it). However, it hangs when I try to access the BIOS, or when NVR data is saved.
grommit2007
Posts: 43
Joined: Sat 22 Apr, 2017 3:26 pm

Re: [Patch] Intel PIIX3 southbridge (including USB controller)

Post by grommit2007 »

SarahWalker wrote: Sun 23 Aug, 2020 2:33 pm Sorry for taking so long to comment on this!

My main reaction is that I don't think the PIIX3 should be completely separate from the existing PIIX; apart from the USB controller the two are basically identical, so let's keep the existing code unified for the sake of maintainability. I'd be happier if piix_init() were extended to take a 'type' parameter, and initialise the USB section only if PIIX3 is requested. USB code could be split into a piix_usb.c file.
I have not been working on the PIIX3 emulation for a few months now, but I noticed the feature freeze is upcoming, so I have attempted to place the USB emulation into a separate piix_usb.c codefile.

I am working on reworking the existing PIIX emulation to have both the PIIX and PIIX3 in the same file, as per your recommendations.

I have attached the work I have done so far to create a piix_usb.c file, however I am not sure what to put in the piix_usb.h file. In addition, I have attached a modification of the existing PIIX emulation which uses the structure of the code in the PIIX3 emulation that I am working on, as well as a copy of the PIIX3 emulation I already submitted publicly as a patch.

(Note: The attachments are not patches, as I am still doing work on them, and I am posting them publicly mainly for review and assistance).

I do need some assistance with integrating the two emulations into one file (This is mostly with extending the piix.c file to take a 'type' parameter).

I highly appreciate your feedback on my attempts to add the emulation of this southbridge to PCem.
Attachments
piix3.c
PIIX3 emulation previously submitted as a patch
(11.79 KiB) Downloaded 407 times
piix_usb.c
USB code separated into a piix_usb.c file
(2.3 KiB) Downloaded 377 times
piix.c
Existing PIIX emulation reworked using structures of previously created PIIX3 emulation
(7.9 KiB) Downloaded 363 times
Post Reply