halfix icon indicating copy to clipboard operation
halfix copied to clipboard

Exploring halfix with emulation of web browsers

Open ikreymer opened this issue 5 years ago • 7 comments

This is more a question / inquiry about using halfix.

I've just released an updated version of https://oldweb.today (https://github.com/oldweb-today/oldweb-today), which runs several browsers in JS-based emulators to run old browsers, connected to web archives. The system connects to a custom network stack, also running in the browser. Currently, I'm using v86 and basilisk emulators, and it would be neat to also add halfix, eventually.

I'd in trying out Halfix, if it can support more recent browsers, especially ones that can run Flash, probably a later version of Firefox. So far, I haven't been able to get it to load a Win98 image, though it did load WinXP. To make this performant, would also need to have save state / load state working..

I'm curious what combinations of browsers have been tested and do work well..

ikreymer avatar Dec 25 '20 20:12 ikreymer

Hi,

I haven't tried many browsers yet due to the lack of Internet connectivity in the emulator, but I have been able to run a few:

  • IE 8 in WinXP
  • IE 3 in Win95
  • Netscape Navigator 3 in WinNT4
  • IE10 in Win7, though it was unstable and you might run into legal issues if you try to distribute that
  • Not a browser per se, but Node 12.x worked to a degree in the emulator. It was very slow

Likely more can run, but again, they haven't been my focus.

Savestate support was implemented from the beginning, although it was mostly for debugging purposes (didn't want to wait hours for Windows 7 to boot to reproduce one tiny bug) and it works extremely well if you use it correctly. One nice thing is that it only downloads the device state and the RAM images on startup and the disk chunks are only loaded as needed. That's definitely something that I want to look at in the future.

The part about not being able to boot Win98 is strange -- my installation runs quite well. If you used the disk image from v86, you might have to enable PCI VGA, which is disabled by default because it slows down VGA BIOS performance (most OSes do fine with it off). You could also try using SeaBIOS/SeaVGABIOS, again with PCI VGA on. I haven't tested this, though.

nepx avatar Dec 26 '20 02:12 nepx

Thanks for sharing the examples!

Unfortunately, I haven't been able to run any Win98 image that I have so far, either with the bochs or the seagate bios. It goes to an empty screen followed by 'Windows Protection Error' message. This is both in emscripten and native builds. I enabled the Plug-and-Play BIOS to 'PCI Bus', which was necessary to get the network card to work in QEMU and v86.. Perhaps that is the issue? Happy to share an image that repros the issue.

ikreymer avatar Dec 26 '20 17:12 ikreymer

Where did you get the image? I have an older image that I used to test it (installed fresh on Bochs), and it works. It might be the hardware (PnP or network card), actually -- the network card hasn't been tested yet. 98 has historically been difficult to work with, especially with regards to hardware: https://github.com/nepx/halfix/commit/44480fc60d17e4058e2db332bebec8d2f94540e1

nepx avatar Dec 26 '20 20:12 nepx

Where did you get the image?

I built it from Win98 SE ISO in QEMU.

Re: networking, it looks like ne2000.c is not actually part of the build in hardware_files.json, and ne2000_init is not called anywhere. Though, netdrv.c in core-files.json, but is not in the repo.. Is NE2000 disabled for now, or just an oversight in committing it? (I tried adding it manually and it did show up in Win2K, though appear to be PCI conflicts so far, and hitting an assertion in pci_write)

ikreymer avatar Dec 27 '20 19:12 ikreymer

Just a quick update, I've made significant progress on getting ne2k working in Win2k. It's being detected and is able to exchange IP packets, and (sometimes) get DHCP assignment. TCP doesn't appear to be working, yet. The work (+misc fixes to build on osx) can be found here: https://github.com/ikreymer/halfix/blob/ne2k-work/src/hardware/ne2000.c

I'm hoping that it's pretty close to fully working, mostly have been comparing to the QEMU and v86 implementation and filling in what's missing

ikreymer avatar Dec 28 '20 20:12 ikreymer

An update on network driver. After much debugging, I was able to make more progress on both the BasicLinux example, and Win2k!

  • Solved: A main bug (which took forever to find!) was that packets <60 bytes need to be padded to 60, otherwise reading just hangs. That solved issue with ARP packets <60 being rejected. Still remaining:
  • PCI remapping: The card works only with PCI remapping on Linux, and only w/o it on Win2K! The pci write function tries to modify additional bytes in thee 64-byte PCI config space. Even if unchanged, it seems to not work. Setting the base address to the same (0xc020) seems to load ok though.
  • TCP connections seem very slow on windows still.. maybe ACKs are not being sent, not quite sure. Also not sure if the IRQ interrupts are working correctly..

I can clean up my changes and make a PR if you'd like..

ikreymer avatar Dec 30 '20 20:12 ikreymer

whaats the online link

vackyton avatar Feb 23 '21 00:02 vackyton