Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exploring halfix with emulation of web browsers #16

Open
ikreymer opened this issue Dec 25, 2020 · 7 comments
Open

Exploring halfix with emulation of web browsers #16

ikreymer opened this issue Dec 25, 2020 · 7 comments

Comments

@ikreymer
Copy link

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..

@nepx
Copy link
Owner

nepx commented Dec 26, 2020

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.

@ikreymer
Copy link
Author

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.

@nepx
Copy link
Owner

nepx commented Dec 26, 2020

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: 44480fc

@ikreymer
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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..

@vackyton
Copy link

whaats the online link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants