Visopsys 0.84+ (2019-08-09) cannot detect a harddrive

General discussion about Visopsys.
User avatar
ronaldlees
Posts: 120
Joined: Tue May 20, 2014 5:19 pm

Re: Visopsys 0.84+ (2019-08-09) cannot detect a harddrive

Post by ronaldlees »

Hi Andy,

Thought I'd stop by and see if you'd released another version. I must have had a clairvoyant connection - since you've just mentioned in the previous post that you're about ready to do it. Any networking in the next version uptick or is that still targeted for the dot nine release? With your being so busy, it seems like maybe you've switched your day job?

- Ron
User avatar
andymc
Posts: 589
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.84+ (2019-08-09) cannot detect a harddrive

Post by andymc »

andymc wrote: Sun Dec 01, 2019 10:44 am My own dev workstation can't boot Visopsys. It looks like the problem is also interrupt-related. Maybe the same cause? I've been procrastinating debugging it because it's awkward to test on the same machine you normally use for compiling :-) Anyway, maybe I should focus on this one here, and give you whatever debug version proves useful. Debugging interrupts is a pain.
Yeah, looks like something's not quite right with the APIC driver on this machine. There's some device that keeps firing unserviced interrupts and it's messing everything up. It's a complicated thing though, so I'll need a bit of time just to re-read the docs and get my mind back in that zone. Unless something just pops out at me, we'll see.

Hopefully whatever I fix here will fix your problem too.
User avatar
andymc
Posts: 589
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.84+ (2019-08-09) cannot detect a harddrive

Post by andymc »

ronaldlees wrote: Sun Dec 01, 2019 11:01 pm Thought I'd stop by and see if you'd released another version. I must have had a clairvoyant connection - since you've just mentioned in the previous post that you're about ready to do it. Any networking in the next version uptick or is that still targeted for the dot nine release? With your being so busy, it seems like maybe you've switched your day job?
Hi Ron!

No, still at the same old job. What's changed is an extra child, a wee one who's not quite sleeping through the night yet, and who at the same time is very active and mobile for her age - with limited understanding of gravity/danger :-)

The TCP/DNS code is all in 0.9 I'm afraid, but it's getting close now. I want to finish one more feature and then a bit of visual updating, that's all.

In the meantime though 0.85 is ready to go anytime. I might just see how this APIC debugging goes, so I can get any fix out to qmastery ASAP.
User avatar
andymc
Posts: 589
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.84+ (2019-08-09) cannot detect a harddrive

Post by andymc »

andymc wrote: Mon Dec 02, 2019 12:09 am Yeah, looks like something's not quite right with the APIC driver on this machine. There's some device that keeps firing unserviced interrupts and it's messing everything up. It's a complicated thing though, so I'll need a bit of time just to re-read the docs and get my mind back in that zone. Unless something just pops out at me, we'll see.
Update: still working on this, but it's a MOFO tricky one. It's like legitimate devices are interrupting legitimately, but the interrupt service routines (ISRs) of several PCI drivers (IDE, different USB ones) aren't recognizing them, and then complaining about missed interrupts. Very weird, doesn't seem like a timing issue (lots of retries in the ISRs don't help). Maybe an end-of-interrupt problem in the APICs. Anyway, still working.
User avatar
ronaldlees
Posts: 120
Joined: Tue May 20, 2014 5:19 pm

Re: Visopsys 0.84+ (2019-08-09) cannot detect a harddrive

Post by ronaldlees »

andymc wrote: Mon Dec 02, 2019 12:16 am
Hi Ron!

No, still at the same old job. What's changed is an extra child, a wee one who's not quite sleeping through the night yet, and who at the same time is very active and mobile for her age - with limited understanding of gravity/danger :-)
OK Andy. Those little ones take priority, no doubt. Had four of them myself (long, long time ago). Thanks for the update. That network stuff will be fun to tinker with - when dot nine arrives. BTW: Merry Christmas to you and yours (including newest addition).

- Ron
User avatar
andymc
Posts: 589
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.84+ (2019-08-09) cannot detect a harddrive

Post by andymc »

andymc wrote: Sun Dec 08, 2019 2:24 am Update: still working on this, but it's a MOFO tricky one. It's like legitimate devices are interrupting legitimately, but the interrupt service routines (ISRs) of several PCI drivers (IDE, different USB ones) aren't recognizing them, and then complaining about missed interrupts. Very weird, doesn't seem like a timing issue (lots of retries in the ISRs don't help). Maybe an end-of-interrupt problem in the APICs. Anyway, still working.
Update/ping: Still working. This is a real head-scratcher on my dev workstation. One of the toughest hardware debugging jobs I've ever attempted.

I've relearned everything I ever knew about APICs (as when I wrote the driver) plus some extra, and made a number of tweaks. Everything seems to be working perfectly there. Seems like real devices are (unexpectedly) asserting their interrupt lines, and the end-of-interrupt is clearing them properly, but they just keep coming. And just now I retried disabling the APIC code entirely, and basically all the same stuff with unserviced interrupts is happening with the legacy PIC.

On this machine it seems like the IDE controller might be the culprit (or else a couple of network devices that haven't been enabled) but the OHCI and XHCI controllers might be in on it too. The OHCI driver is perhaps lightly tested, but XHCI driver is much more mature. The fact that this is happening across multiple devices suggests a problem more fundamental with the interrupts, but I'm currently stumped about what it could be. I'll keep trying.
User avatar
andymc
Posts: 589
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.84+ (2019-08-09) cannot detect a harddrive

Post by andymc »

qmastery wrote: Sun Nov 24, 2019 6:26 am Yes, I could debug it using a USB. Will be waiting patiently for your USB debug image ;)
So after disabling all the PCI interrupts by default: Apparently, yes, on this machine my IDE controller is actually going wild with interrupts, and the OHCI and XHCI USB controllers are doing a few unexpected ones too. But these are unlikely to be related to your problem qmastery.

All my little tweaks to the APIC code might help, though, and if not, I've got a lot of targeted debugging output enabled in my current version. Are you ready to test a new image if I post one up?
qmastery
Posts: 31
Joined: Mon Nov 19, 2018 8:48 pm

Re: Visopsys 0.84+ (2019-08-09) cannot detect a harddrive

Post by qmastery »

andymc wrote: Wed Dec 18, 2019 1:02 amAll my little tweaks to the APIC code might help, though, and if not, I've got a lot of targeted debugging output enabled in my current version. Are you ready to test a new image if I post one up?
Yes, I am ready to test the new images. Wish you a Happy New Year ! :)
User avatar
andymc
Posts: 589
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.84+ (2019-08-09) cannot detect a harddrive

Post by andymc »

qmastery wrote: Wed Jan 01, 2020 9:46 pmYes, I am ready to test the new images. Wish you a Happy New Year ! :)
Happy new year to you as well.

OK cool, I'm just integrating a few patches (all improvements related to this investigation). I hope to finish that tonight or tomorrow night, and then I'll post one or more images for you to try.

On my machine, the real problem was related to something you mentioned early on: My AMD SATA controller was set to IDE (legacy) mode in the BIOS, with no SATA controller showing up in PCI. In this legacy IDE mode it was not playing well with the kernel code.

It didn't occur to me initially that the disks should've been showing up as SATA disks, but were instead detecting as IDE - with interrupt timeouts, and then the controller was going nuts with interrupts that weren't showing up on the IDE channels. Anyway, with that controller in SATA mode everything works with the latest code, and the interrupts are mostly as expected; OHCI and XHCI still do a few weird ones during initialization, but then everything's fine.
User avatar
andymc
Posts: 589
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.84+ (2019-08-09) cannot detect a harddrive

Post by andymc »

Sorry for the delay. The patches ended up being quite large, mostly because I'm fussy about my code, and ended up rearranging and reformatting a bunch of (mostly older) stuff.

Here's your first link. This is just a debug USB image with my latest code - just in case I've already solved the problem. This is pretty close to what 0.85 will be, pending any new developments resulting from this thread. Apropos of this thread, there is an updated APIC driver, PCI driver, memory page caching, and interrupt infrastructure.

https://visopsys.org/files/misc/visopsy ... sb-img.zip

Fingers crossed, although my suspicions about your problem have returned to the IDE and/or SATA drivers.

Andy
Post Reply