visopsys.org

Visopsys Forums
It is currently Wed Jan 17, 2018 11:47 am

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Testing request
PostPosted: Tue Oct 14, 2014 12:07 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 7:20 pm
Posts: 460
Cheers Ron,

There's something there that caught my eye. Do you know whether there's a slave drive on the primary channel?

Right after the line
Code:
DEBUG IDE try to detect disk 0:1
there's a line
Code:
DEBUG IDE disk 01 driverDetect:2899 expect interrupt
In the code comments I noted that some controllers fire an interrupt if you try to 'select' a nonexistent slave, but I'm not doing any acknowledgement of the interrupt if it comes (in this case, it does come). Then, when I send the 'identify' command, that unacknowledged previous interrupt fools the
Code:
DEBUG IDE disk 01 wait (poll) for interrupt 14 ack=0
code into thinking the command completed, but the 'real' interrupt hasn't arrived. Note how the sequence is slightly different, interrupt-wise, for the master and the slave. If there's no drive there, it should time out instead (or I should skip it altogether, if the controller's trying to tell me it's not there, with that interrupt).

I'll need to check the code that issues the 'identify' command for robustness, so that it doesn't crash if there's no/bogus data in the buffer (bug #1 - the actual crash), and hopefully adding an interrupt acknowledgement will stop the polling code from being fooled (bug #2) by that extra interrupt.


Top
 Profile  
 
 Post subject: Re: Testing request
PostPosted: Tue Oct 14, 2014 4:13 pm 
Offline
User avatar

Joined: Tue May 20, 2014 5:19 pm
Posts: 80
Exactly what caught my eye!

My setup is:

Code:
Primary master:       Seagate hard drive
Primary slave:          None
Secondary master:      LiteOn CD drive
Secondary slave:      None


Maybe we're making some progress!


Top
 Profile  
 
 Post subject: Re: Testing request
PostPosted: Tue Oct 14, 2014 4:17 pm 
Offline
User avatar

Joined: Tue May 20, 2014 5:19 pm
Posts: 80
Here is the NOAPIC run:

Code:
Detecting hardware: IDE disk controller
warning::kernelIdeDriver.c:waitOperationComplete(395):
Disk 02 no interrupt received - timeout
warning::kernelIdeDriver.c:identify(1201): unknown error
Detecting hardware: PS/2 mouse warning::kernelPS2MouseDriver.c:command(352):
Not resending reset (no PS2 mouse?)
Error: kernelprocess::kernelDisk.c:identifyBootCd(1994):
The boot CD could not be identified
Error: kernelprocess::kernelInitialize.c:kernelInitialize(363):
Disk functions initialization failed
Error: kernelprocess::kernelMain.c:kernelMain(77):
Initialization failed
Press any key to reboot ...


Top
 Profile  
 
 Post subject: Re: Testing request
PostPosted: Tue Oct 14, 2014 4:22 pm 
Offline
User avatar

Joined: Tue May 20, 2014 5:19 pm
Posts: 80
Andy:

By the way - I have both USB (Microsoft) and PS/2 mouse plugged in.

Edit: But - now looking at the FreeBSD dmesg, I see it doesn't see the PS/2 mouse either. So, maybe a bad mouse. I usually use the MS USB mouse.

- Ron


Top
 Profile  
 
 Post subject: Re: Testing request
PostPosted: Tue Oct 14, 2014 5:31 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 7:20 pm
Posts: 460
Yes, I think we're gonna fix this one. Judging from that code comment I mentioned, it's likely that I have a test system at home that fires these same 'no slave' interrupts. I'd like to see if I can find it and try out my changes before I upload a new version for you, probably in a few hours - is that OK?

The 'no APIC' version I gave you doesn't have IDE debugging turned on :doh:. It does seem likely that the same unacknowledged interrupt is preventing your CD-ROM on the second channel from being identified.

The APIC being enabled/disabled makes some difference to the timing. Seems like APICs are faster than the old PICs, and they showed up a handful of race conditions in my drivers. That's probably why the APIC version crashes, even though both versions really suffer from the same bug.


Top
 Profile  
 
 Post subject: Re: Testing request
PostPosted: Tue Oct 14, 2014 8:47 pm 
Offline
User avatar

Joined: Tue May 20, 2014 5:19 pm
Posts: 80
andymc wrote:
Yes, I think we're gonna fix this one. Judging from that code comment I mentioned, it's likely that I have a test system at home that fires these same 'no slave' interrupts. I'd like to see if I can find it and try out my changes before I upload a new version for you, probably in a few hours - is that OK?

The 'no APIC' version I gave you doesn't have IDE debugging turned on :doh:. It does seem likely that the same unacknowledged interrupt is preventing your CD-ROM on the second channel from being identified.

The APIC being enabled/disabled makes some difference to the timing. Seems like APICs are faster than the old PICs, and they showed up a handful of race conditions in my drivers. That's probably why the APIC version crashes, even though both versions really suffer from the same bug.


Andy: the 'noapic' version basically seems to confirm the suspicion induced by the 'idedebug' run. Sure - if you have time to create another ISO - I'll test it.


Top
 Profile  
 
 Post subject: Re: Testing request
PostPosted: Wed Oct 15, 2014 2:12 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 7:20 pm
Posts: 460
I've tried out all my workstations, and my test laptops here, and couldn't find one that does that interrupt (although I discovered that a couple of the latter batch have gone to the great 'lap' in the sky since the last time I started them).

I've tried to fix things up for your system, and tuned a couple of other bits as well, so hopefully this will work better now:
http://visopsys.org/files/visopsys/visopsys-2014-10-15-idefix-iso.zip
http://visopsys.org/files/visopsys/visopsys-2014-10-15-idefix-usb-img.zip

Thanks Ron,
Andy


Top
 Profile  
 
 Post subject: Re: Testing request
PostPosted: Wed Oct 15, 2014 2:35 am 
Offline
User avatar

Joined: Tue May 20, 2014 5:19 pm
Posts: 80
Hmmm. In terms of interrupt handling I might have the exceptional system. Anyway, in the morning I'll give the new ISO a go. I have a feeling it'll work. Thanks Andy!

BTW: I'm really impressed by this OS project. Out of hundreds of projects that have been started to build the "next big OS" - only a handful have reached the maturity level of this one (not including the Linux/Unix knockoff type of system). And - of the handful that are on the level of this one, I can think of only two that are primarily the efforts of a single person. So - hat's off to ya!


- Ron


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group