Wack0 / maciNTosh

PowerPC Windows NT ported to Power Macintosh systems
GNU General Public License v2.0
516 stars 16 forks source link

NT Installer unable to see valid partition on which to install #12

Closed JonObst closed 1 month ago

JonObst commented 1 month ago

I got to the point where it should have enumerated my mass storage devices and located the partition I created from the ARC firmware menu, but it says it can't find a suitable partition.

Machine type: B&W G3 Build: nt_arcfw_grackle_fwonly_test20240715_1913 (used for partitioning and execution of setupldr) Disk: 8 GB IDE Partition size defined: 1500mb

IMG_0165

Wack0 commented 1 month ago

hmm, seems something's up with the HAL reading the ARC environent variables on disk...

is the optical drive the ide device 0 and hard drive the ide device 1? if so could you try swapping them? (you will probably need to repartition after that, due to arc paths changing)

Wack0 commented 1 month ago

Additionally, could you try the checked build? (you can find it on winworld) It shows the detected drives on boot (and if you deliberately choose the wrong video driver like VGA the output will remain on the screen), which should be helpful.

JonObst commented 1 month ago

Swapped the HD and Optical drives and yea that was it. Do you want me to put them back and run with dbg/chk NT CD still?

IMG_0169

JonObst commented 1 month ago

I made a video here of the installation process on the B&W G3: https://youtu.be/rt2VsFz5adI, feel free to link/share if you think that would be useful for others.

Overall awesome project, nice work, 10/10!

Happy to run the dbg/chk version of NT 4 still if that is helpful for you.

Wack0 commented 1 month ago

It's fine, now I know it's NT not liking the HD as IDE device 1 I can set that exact scenario up under emulation for doing my own tests.

dosdude1 commented 1 month ago

This same issue occurs most of the time (but not all the time) on my PowerBook G3 Lombard... Seems to mostly happen when re-partitioning the disk a second time after firmware has already been installed once. I've tried with multiple hard disks, which makes no difference. Hard disk has been detected as IDE device 0 consistently.

Wack0 commented 1 month ago

Does a simple reboot solve this when it occurs?

If not, can you do a raw dump of the ARC environment area of the hard disk (1024 bytes / 2 sectors at offset 0xA8200 / sector 1345)?

dosdude1 commented 1 month ago

Rebooting makes no difference, just does the same every time the system is rebooted and installation is attempted again. Here is the requested dump.

arc_env.bin.zip

Wack0 commented 1 month ago

that looks correct, could you try the checked build to see what drive letters it assigns on boot? (again, if you deliberately choose an incorrect video driver like VGA, setup will error and hang with the details still on screen)

WGriffithsBLI commented 1 month ago

Okay, so gone through all of this. I still seem to have a hard lockup of ARC when having the hard drive set to master and the CD drive set to slave. The freeze happens immediately when the main menu shows up and I cannot select anything with the ADB keyboard. I've tried this with two CD drives as well.

The hard lockup only occurs when booting from CD and not from Hard Drive, and when the drive's already been partitioned by ARC. I've tried wiping the drive and reformatting it from ARC when booted from CD after having HD as master. Still same issue once the post partition reboot happens.

I could get around the issue if there is a way I could load the RAM disk when booted from ARC using the hard drive.

Wack0 commented 1 month ago

"I could get around the issue if there is a way I could load the RAM disk when booted from ARC using the hard drive."

There's an option in the firmware setup menu for that now.

About the hard lockup, I've seen something similar happen under emulation if I hold the "c" key down for too long. I've worked around it by releasing the key as soon as I see optical drive activity in the emulator logs, I think others have also plugged in a usb keyboard purely for holding down the "c" key on boot...

Wack0 commented 1 month ago

Here's another test build. I modifed the HAL to delegate the ARC environment reads/writes to a system worker thread. I don't know if this will fix this specific issue, but on initial testing it appears to make the installation process more stable (I didn't get a bugcheck at end of setup, nor on first boot afterwards).

nt_arcfw_grackle_fwonly_test20240717_1107.zip

WGriffithsBLI commented 1 month ago

Yes, you were right about not holding 'C' for too long. That's managed to get me back into setup with the HD as master. Unfortunately, it's still returning the no valid system partitions error even with the HD as master. I've validated that ARC sees the hard drive as disk0, so yes I'm real puzzled. I repartitioned again, just with the 1900MB NT partition and the error still persists.

I'll give your test build a go and see if that makes a difference.

I did find that running the load RAM disk option returns an error when loaded from hard disk, says "Failed to load ramdisk: Invalid device name".

Haha, I'm beginning to think my B&W is cursed!

WGriffithsBLI commented 1 month ago

Issue still happens on the test build sadly.

Oh I should add, my B&W G3 is a Rev. 1 with the 'meh' PCI646U2 IDE controller. It was different from the Rev 2 that had the 646U2-402.

Wack0 commented 1 month ago

Can you try the checked build as mentioned above?

WGriffithsBLI commented 1 month ago

So I grabbed Build 1381.chk and we get this after going through the driver configuration part of the text-based setup. I'm using your test build of ARC that you uploaded earlier. image

Wack0 commented 1 month ago

This is a breakpoint that's getting hit in checked builds because of some kind of timing issue. I got this under emulation but didn't know if it reproduced on real hardware so I thought it was some emulator problem.

Now I know it can indeed reproduce on real hardware, I'm looking at it now.

Wack0 commented 1 month ago

Here's a test build, which should allow NT4 checked build to boot.

nt_arcfw_grackle_fwonly_test20240718_1835.zip

WGriffithsBLI commented 1 month ago

Thanks for the test build. I can confirm that the checked build is now able to boot. Unfortunately the no system partition error persists. I've never used the checked builds before, so I'm not sure of the best process to get the logging from this. I've got it up on that screen at the moment, so if there's anything you need me to do to troubleshoot this, please let me know! c:

Wack0 commented 1 month ago

If you choose the wrong video driver, like VGA, an error message will show on the boot screen allowing to see the extra text printed by the checked build.

Wack0 commented 1 month ago

That said, I just had a thought and wonder if it's some sort of incompatibilty with the hard drive. The IDE driver under NT does only use the old CHS addressing, perhaps some newer IDE hard drives can't handle it correctly?

WGriffithsBLI commented 1 month ago

Okay, I get this when I use the VGA driver - it does spit out an error and refuse to continue. However we can see it initializing the drive letters for the system and main partitions. image

The drive I'm using is pretty old, it came with a PCI PowerMac G4 and is 14GB.

Wack0 commented 1 month ago

It is picking up the hard disk, then.

There might be some other problem with the on-disk ARC environment variables. Has this drive been freshly partitioned using the ARC firmware?

WGriffithsBLI commented 1 month ago

It sure has, I repartitioned again with a 1900MB main partition when you provided the last test build. No Mac partitions created. Though I have created them in the past and still had this error come up.

Wack0 commented 1 month ago

Here's a test build that shows some debug output about reading the ARC environment from disk:

nt_arcfw_grackle_fwonly_test20240718_2248.zip

WGriffithsBLI commented 1 month ago

Hm, that one returns the bugcheck on the NT4 setup again. Is there somewhere within ARC I can get that debug output or is that still supposed to show on the NT4 kernel screen?

Wack0 commented 1 month ago

Still supposed to show on NT boot. That said, it will show on the free build too, you don't need to use the checked build.

WGriffithsBLI commented 1 month ago

Okay, got it here: image

Wack0 commented 1 month ago

ok, seems more debug output is required. can you try this build?

nt_arcfw_grackle_fwonly_test20240719_2139.zip

WGriffithsBLI commented 1 month ago

Alrighty, this is what we get with this build: image

Wack0 commented 1 month ago

Can you repartition with the latest build and try installing again? Latest builds will use partition type 0x06 for MBR partition 3, not type 0x0e (this is for supporting NT 3.51)

WGriffithsBLI commented 1 month ago

image Okay reformatted, I've got 06 now, but the issue still persists!

Wack0 commented 1 month ago

What size of NT partition did you create?

WGriffithsBLI commented 1 month ago

I was created at 1900MB

Wack0 commented 1 month ago

When watching Michael MJD's video I noticed there was some crap file in the ARC system partition root directory, which made me realise I was leaving crap in the FAT sectors too.

This test build should fix the issue, you'll need to repartition the drive.

nt_arcfw_grackle_fwonly_test20240720_1817.zip

WGriffithsBLI commented 1 month ago

Oh my god, that fixed it! Thank you so much!!

Wack0 commented 1 month ago

In that case, fixed in f3ba0a18b569b8a65698255b291da8f8951249d4 and 16e31b8d68443eda2242c81bf69b723d9043cd91, and v0.05 :)