English Amiga Board Amiga Lore


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 24 May 2016, 22:19   #1
BlankVector
Registered User
 
Join Date: Jun 2012
Location: Paris, France
Posts: 148
IDE trouble with 68060 + EmuTOS

Hello.

I experience strange IDE trouble with some EmuTOS builds when using WinUAE configured with 68060. It has been happening since WinUAE 3.2.0, including 3.3.0 beta 15. It worked fine with previous WinUAE versions.

Strangely, it works fine as soon as I select a CPU different than 68060. The problem can also disappear/reappear depending on the EmuTOS optimization level (-O2 or -Os).

What happens:
- at EmuTOS startup, the IDE hard disk and partition are properly detected
- I use some autostart programs. At some point, EmuTOS tries to read 31 sectors in 1 command. Then it seems that something gets out of sync, a few "IDE INT" messages are missing. See full WinUAE traces as attachment.

Normal traces:
Code:
**** IDE0 command 20 
IDE0 read off=1409, sec=31 (0) lba48=0 

IDE0 off=1409, nsec=31 (0) lba48=0 
IDE0 initial read, 15872 bytes 
IDE0 read, read 512/15872 bytes, buffer offset=0 
IDE INT 80 -> 08 

IDE0 off=1410, nsec=30 (0) lba48=0 
IDE0 read, read 512/15360 bytes, buffer offset=512 
IDE INT 08 -> 08 

IDE0 off=1411, nsec=29 (0) lba48=0 
IDE0 read, read 512/14848 bytes, buffer offset=1024 
IDE INT 08 -> 08 

... 

IDE0 off=1439, nsec=1 (0) lba48=0 
IDE0 read, read 512/512 bytes, buffer offset=15360 
IDE INT 08 -> 08 
IDE0 read finished
Notes:
- "read off" means starting sector
- (0) means that the "read multiple" command is not used
- "IDE INT 80 -> 08" indicates an interrupt, with the previous and new value of the status register
- 80 means IDE_STATUS_BSY
- 08 means IDE_STATUS_DRQ

In the case it does not work, it looks like this:
Code:
**** IDE0 command 20 
IDE0 read off=1409, sec=31 (0) lba48=0 

IDE0 off=1409, nsec=31 (0) lba48=0 
IDE0 initial read, 15872 bytes 
IDE0 read, read 512/15872 bytes, buffer offset=0 
IDE INT 80 -> 08 

IDE0 off=1410, nsec=30 (0) lba48=0 
IDE0 read, read 512/15360 bytes, buffer offset=512 
IDE INT 08 -> 08 

IDE0 off=1411, nsec=29 (0) lba48=0 
IDE0 read, read 512/14848 bytes, buffer offset=1024 
IDE INT 08 -> 08 

IDE0 off=1412, nsec=28 (0) lba48=0 
IDE0 read, read 512/14336 bytes, buffer offset=1536 
# Note: interrupt not generated! 

IDE0 off=1413, nsec=27 (0) lba48=0 
IDE0 read, read 512/13824 bytes, buffer offset=2048 
IDE INT 08 -> 08 

... 

IDE0 off=1439, nsec=1 (0) lba48=0 
IDE0 read, read 512/512 bytes, buffer offset=15360 
IDE0 read finished 
IDE INT 00 -> 08 
# Note strange 00 compared to good case.
Is there a good reason that the "IDE INT" trace is missing in some cases? And that strange "IDE INT 00 -> 08" at the end?
Could this be a WinUAE bug with very special timings? Or an EmuTOS bug?
Any hint will be welcome.
Attached Files
File Type: zip traces.zip (2.3 KB, 21 views)
BlankVector is offline  
AdSense AdSense  
Old 25 May 2016, 17:07   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,565
Does http://www.winuae.net/files/b/winuae.7z work?

I found one possible bug that may have caused BSY bit to be not set until one scanline later when program polls (not using interrupts) for BSY.
Toni Wilen is online now  
Old 25 May 2016, 22:00   #3
BlankVector
Registered User
 
Join Date: Jun 2012
Location: Paris, France
Posts: 148
Toni, you are the best
Your new binary worked immediately.
And indeed, the current EmuTOS IDE driver uses polling.
Many thanks

Last edited by BlankVector; 26 May 2016 at 01:39.
BlankVector is offline  
Old 26 May 2016, 08:57   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,565
Of course I checked emutos sources first

It was the biggest hint because nearly all Amiga IDE controller drivers use interrupts.
Toni Wilen is online now  
Old 26 June 2016, 23:44   #5
BlankVector
Registered User
 
Join Date: Jun 2012
Location: Paris, France
Posts: 148
Toni, I'm experiencing a new problem with IDE and WinUAE, and it still happens only with 68060 (whatever advanced CPU settings I use).

Basically, a program (namely DESKTOP.PRG) crashes at startup. I looked at the memory with the WinUAE debugger, and I compared it with the original executable data. It appears that somewhere inside the executable, a WORD has been duplicated, causing the remaining data to be shifted. In other words, it seems that a WORD has been inserted inside the executable data, with the same value as the previous one.

I couldn't find precisely how that happened, but by thinking a bit, the simplest explanation would be that in some rare circumstances the same word is read twice from the IDE data register. Remember that EmuTOS uses IDE polling.

Do you think that such scenario can happen in WinUAE with 68060 emulation?
BlankVector is offline  
Old 27 June 2016, 08:51   #6
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,565
There is nothing CPU specific, at least if MMU is not in use.

Did the first or last word of disk sector get duplicated? Or some random middle one (which should be impossible)

What was the IDE command and did it use multiple sector mode?
Toni Wilen is online now  
Old 28 June 2016, 01:28   #7
BlankVector
Registered User
 
Join Date: Jun 2012
Location: Paris, France
Posts: 148
Investigation reveals that this last issue is unrelated to IDE. It is actually related to the movep instruction on 68060. Since this is finally out of topic here, I opened a new topic for that. Please continue the discussion there.
BlankVector is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
EmuTOS for Amiga BlankVector News 200 13 September 2017 22:22
A600 having trouble booting from IDE Shatterhand support.Hardware 4 14 February 2015 12:47
Trouble Setting up Transcend 4GB IDE Flash Disk mfletcher support.Hardware 15 07 January 2014 11:22
We NEED something like EmuTOS Antiriad Amiga scene 10 25 June 2012 00:21
4way ide splitter trouble loth77 support.Hardware 9 11 October 2010 01:30

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 22:15.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.12878 seconds with 12 queries