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

General discussion about Visopsys.
qmastery
Posts: 31
Joined: Mon Nov 19, 2018 8:48 pm

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

Post by qmastery »

Finally I got a new hard drive and tried to test it with your 2019-08-09 floppy from https://visopsys.org/forums/viewtopic.php?f=3&t=338 .
Compared to a previous boot log, a few new lines appeared:
Detecting hardware: SATA disk controller Error::kernelSataAhciDriver.c:issueCommand(1404):
Command failed - timeout
Error::kernelSataAhciDriver.c:detectDisks(1587):
Identify device command failed for port 0
Error::kernelSataAhciDriver.c:issueCommand(1404):
Command failed - timeout

Error::kernelSataAhciDriver.c:detectDisks(1587):
Identify device command failed for port 1
Map RAM disk physical 001b7000 to fec01000 size 1474560
Disk trying fd0 looking for 5d4cb4cc
Error:kernel process:kernelFloppyDriver.c:waitOperationComplete(180):
Command timed out
Error:kernel process:kernelFloppyDriver.c:readWriteSectors(566):
Seek error: Unknown error
Error:kernel process:kernelDisk.c:realReadWrite(401):
Error -24 reading 1 sectors at 0, disk fd0
Disk trying fd1 looking for 5d4cb4cc
Error:kernel process:kernelFloppyDriver.c:waitOperationComplete(180):
Command timed out
Error:kernel process:kernelFloppyDriver.c:readWriteSectors(566):
Seek error: Unknown error
Error:kernel process:kernelDisk.c:realReadWrite(401):
Error -24 reading 1 sectors at 0, disk fd1
Disk trying sd0a looking for 5d4cb4cc
Boot sig 00000000
Disk trying rd0 looking for 5d4cb4cc
Boot sig 5d4cb4cc
After Visopsys completes booting, I'm trying to see the available hard drives but get a window with error message: No hard disks registered. Also, for some reason after I've installed a hard drive, now Visopsys freezes easily if I try to quickly move a touch pad, forcing me to hard reboot.This has not happened before the installation of a hard drive. What may be a cause of this issue, maybe something like an IRQ lines overlap? (just a wild guess)

My laptop has AMD FCH SATA Controller, VEN_ID:DEV_ID = [1022:7801], which is integrated into southbridge AMD A76M Fusion (Bolton-M3, 218-0844012). coreboot initializes it in a native mode, unless the OS will re-initialize it in AHCI. I wonder if anything can be done to improve a Visopsys support for this controller, and always ready to provide the logs for any experimental build.
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 »

Hi qmastery!
qmastery wrote: Fri Sep 20, 2019 5:07 am
Detecting hardware: SATA disk controller Error::kernelSataAhciDriver.c:issueCommand(1404):
Command failed - timeout
Error::kernelSataAhciDriver.c:detectDisks(1587):
Identify device command failed for port 0
Error::kernelSataAhciDriver.c:issueCommand(1404):
Command failed - timeout

Error::kernelSataAhciDriver.c:detectDisks(1587):
Identify device command failed for port 1
qmastery wrote: Fri Sep 20, 2019 5:07 am Also, for some reason after I've installed a hard drive, now Visopsys freezes easily if I try to quickly move a touch pad, forcing me to hard reboot.This has not happened before the installation of a hard drive. What may be a cause of this issue, maybe something like an IRQ lines overlap? (just a wild guess)
I think your wild guess sounds about right. This does look like it could be an interrupt problem.

The SATA driver is relatively new compared to the IDE/PATA one, but in general it seems to work well. It would switch the controller to 'native' mode (as opposed to 'legacy') if it can.

I think I would look at the APIC interrupt driver code first, since that's new-ish, and maybe a bit less reliable, and could be responsible. If you go into the 'devices' program in Visopsys, does it seem to think you've got a supported APIC, or just an old PIC?
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 Sep 25, 2019 9:19 pmI think I would look at the APIC interrupt driver code first, since that's new-ish, and maybe a bit less reliable, and could be responsible. If you go into the 'devices' program in Visopsys, does it seem to think you've got a supported APIC, or just an old PIC?
Hi Andy,

'Devices' program isn't available at floppy version, but luckily - for debugging of course ;) - a USB Visopsys has the same freezing problem as 2019-08-09 floppy. Although this problem seems to also depend on something else than a touchpad movement, maybe there are heat-related interrupts or something else: I discovered that the easiness of reproducing this issue could vary greatly from time to time, hinting that it depends not just on touchpad but on some other random thing as well.

Please check a devices.txt file at the attachments or here - https://pastebin.com/b9HNDShS . I could see both PIC and APIC controllers and it's unclear which one is active and how many devices it is controlling. It also shows that SATA disk controller has the same 17 interrupt as USB (is it normal?), but don't know what's the interrupt number for "PS/2 mouse" which is the internal touchpad of this laptop.

Is there any other debug info I could get, and what do you think about this one?
Attachments
devices.txt
(3.35 KiB) Downloaded 882 times
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 Sep 25, 2019 9:19 pmAPIC, or just an old PIC?
Small bump ;) How could I get more debug info for you?
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: Fri Nov 15, 2019 4:10 pm
andymc wrote: Wed Sep 25, 2019 9:19 pmAPIC, or just an old PIC?
Small bump ;) How could I get more debug info for you?
Hi qmastery, sorry for the delay. I guess I was in transit to Australia, in Hong Kong, and I saw this but didn't have my dev environment available, and then forgot about this!

It's normal for several PCI devices to share a few interrupt vectors. And yes, laptop touchpads are usually implemented as PS2 mice, using a fixed interrupt number.

I think the first thing I'll do is get you to try a version with the APIC code disabled. If that magically solves things, then that'll show me that the APIC code needs more debugging.

It's too big to attach and I can't upload to the server from this network, but I'll give you a link tonight.
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 »

And here's your link:
https://visopsys.org/files/visopsys/vis ... 15-img.zip

Let me know if that's any better!
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: Fri Nov 15, 2019 7:26 pmlink
Sadly it can't boot to Visopsys as a virtual floppy ( have you also applied your workaround from https://visopsys.org/forums/viewtopic.p ... =338#p1594 ? ). A bit later I'm going to try USB.
Just in case, here's a new log - with a "Controller has no interrupt" message

Code: Select all

Detecting hardware: SATA disk controller Error::kernelSataAhciDriver.c:setupController(837):
Controller has no interrupt
Error:kernel process:kernelFloppyDriver.c:waitOperationComplete(180):
Command timed out
Error:kernel process:kernelFloppyDriver.c:readWriteSectors(566):
Seek error: Unknown error
Error:kernel process:kernelDisk.c:realReadWrite(400):
Error -24 reading 1 sectors at 0, disk fd0
Error:kernel process:kernelFloppyDriver.c:waitOperationComplete(180):
Command timed out
Error:kernel process:kernelFloppyDriver.c:readWriteSectors(566):
Seek error: Unknown error
Error:kernel process:kernelDisk.c:realReadWrite(400):
Error -24 reading 1 sectors at 0, disk fd1
Error:kernel process:kernelDisk.c:identifyBootDisk(2081):
The boot device could not be identified
Error:kernel process:kernelInitialize.c:kernelInitialize(370):
Disk functions initialization failed
Error:kernel process:kernelMain.c:kernelMain(85):
Initialization failed.  Press any key (or the "reset" button) to reboot.
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: Tue Nov 19, 2019 9:34 am
andymc wrote: Fri Nov 15, 2019 7:26 pmlink
Sadly it can't boot to Visopsys as a virtual floppy ( have you also applied your workaround from https://visopsys.org/forums/viewtopic.p ... =338#p1594 ? ). A bit later I'm going to try USB.
Just in case, here's a new log - with a "Controller has no interrupt" message

Code: Select all

Detecting hardware: SATA disk controller 
Sorry, I forgot to make the RAM disk image for you.

But, this indicates that the APIC is needed in order to use this controller.

The last thing to try, I guess, is to give you some kind of debug version that outputs about what's going on with the APIC. That's tricky though, with a floppy image. There's not enough space for a debug kernel in a floppy image. Seems like we could do it with USB though, if you can boot that.
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: Fri Nov 22, 2019 11:27 pm Sorry, I forgot to make the RAM disk image for you. But, this indicates that the APIC is needed in order to use this controller. The last thing to try, I guess, is to give you some kind of debug version that outputs about what's going on with the APIC. That's tricky though, with a floppy image. There's not enough space for a debug kernel in a floppy image. Seems like we could do it with USB though, if you can boot that.
Yes, I could debug it using a USB. Will be waiting patiently for your USB debug image ;)
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 ;)
Apologies for the delay - I've been pushing (in my small amount of free time) to get everything finished for 0.85 and 0.9. I think I'll do the 0.85 release in the next few days.

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