View Full Version : XTIDE project debug log

June 13th, 2009, 06:10 AM
Please use this page to make notes on the debugging process of the XT IDE controller card.
This may be a temporary page in the end, but we need a place to keep track of all the things we've tried and things still left to be examined.
Main XT-IDE page
Things to do and test: (make comments below as required. this is a free forum) You can sign your name by using 4 ~ characters in a row.
BIOS code cleanup and initial release. (owner=hargle)

i'm not ready to release the code yet due to cleanup and licensing issues. it will happen eventually, i just need some time to think about how i want to do it properly. Hargle 14:23, 22 May 2009 (UTC)
<s>BIOS bugs exist on drives smaller than 8.4G. Use at your own risk. Big drives work better at the moment.

currently chasing down small drive issues. it's either a translation problem using the LBA assist method, or an error/bit drop issue when receiving the IDentify device data during post. Use I13test and ID_dump utilities to gather information on this issue.</s> <br>
<s>We're trying to get the drive parameters (cylinders/heads/sectors) as reported by INT 13 to match modern machines. This means that you can fill up a drive on a new machine and move it to your XT without data corruption. That's important! <br></s>
totally fixed? v0.08 BIOS<br>
Partially Fixed? v0.06 BIOS<br>
the following drives have been tested and match the parameters given on a modern VIA motherboard with Phoenix BIOS. Tested on a 486 machine, and with DOS 6.22 only:<br>
Seagate ST3250823A (250G) Parameter check only<br>
Seagate ST32122A (2012MB), fdisk, formatted and booted.<br>
WD 80EB (7632MB). Booted. Already fdisk and formatted elsewhere.<br>
Conner CFA850A (813MB), fdisk, formatted and booted.<br>
Seagate ST310014ACE (10G), fdisk, formatted and booted.<br>
WD Caviar 21000 (1033MB), fdisk, formatted, <s>failed boot. bad sectors during format. No problems on modern machine. Still have issues here.</s> booted with 0.08 BIOS<br>
WD Caviar 21200 (1222MB), fdisk, formatted, <s>failed boot. bad sectors during format. No problems on modern machine. Still have issues here.</s> booted with 0.08 BIOS<br>
Maxtor 7L250RO (250G), parameter check only<br>
WD 2500JB-00READ (250G), parameter check only<br>
Fujitsu MPF3204AT (30G), parameter check only<br>
Sandisk SDCFX-1024 (1G) CF card, parameter check, booted. (formatted elsewhere) Different parameters: VIA board did not pick up LBA size, and eINT13 fn48 returns that there are 0000 user addressable sectors. Phoenix BIOS bug?!<br>
Sandisk SDCFB-128 (128MB) CF card, different parameters. Phoenix used a translated table, even though it technically shouldn't because the drive is less than 512MB. Interesting. FDISKs fine, format fails with "Bad partition table" error. No problems on modern machine. <s>Still have issues here. Fixed "bad partition table" error in 0.07 BIOS. Still has issues booting. </s>Fixed all booting issues in 0.08 BIOS.
<s> Test and debug the cable select (CS) functionality. Pull CSEL signal low and re-test.

Got a soldering iron? I think this one should be easy to rework merely by pulling CSEL pin to ground. (do we need a resistor?)
At the moment, putting a single drive on our card as "cable select" causes the drive to show up as the slave device. <br>
putting 2 devices on with cable select jumpers set causes neither drive to show up. ATA specs say that CSEL signal should be pulled low at the host. Andrew says that has caused compatibility issues with drives on previous projects. Let's see if pulling it low has any impact on compatibility and gets CS jumper settings on the drive to work Hargle 14:23, 22 May 2009 (UTC)
More information here:http://www.pcguide.com/ref/hdd/if/ide/confCS-c.html</s>
Pull CSEL pin low off the IDE connector properly puts CS jumpered drives in the order they should be. Saw no other impact on drive readability/reliability. Hargle 22:20, 7 June 2009 (UTC)
<s>Test two drive configurations. BIOS works as expected. (using 10G+ drives though)

Briefly tested. Fdisk saw 2 drives at least. Both drives showed up in POST. Hargle 14:23, 22 May 2009 (UTC)</s>
Works great. heck, with 2+ cards it works even better! Hargle 22:20, 7 June 2009 (UTC)
<s>* Test and debug auto detecting of the IO base address.
Have a method to do this now. Need to implement, and need to redo that method slightly for the production board. Hargle 14:23, 22 May 2009 (UTC)</s>
auto detect has been abandoned. with no hard drive attached, the IO ports are completely unreadable. (returns FFs) so the detect will fail. Instead of auto detecting it, the base IO address is stored inside the BIOS. This requires a flash of the eeprom whenever the IO base address is changed, but it simplifies things overall, especially for multiple card use. Hargle 17:11, 27 May 2009 (UTC)
<s>* Find out why coretest.exe won't run on our BIOS
any takers? I have coretest if you need it. It doesn't seem to really work well on 8088 machines anyway. I tested it with an acculogic card, and it ran, but the timer seemed weird. Hargle 14:23, 22 May 2009 (UTC)</s> fixed, mostly? 009 BIOS Hargle 16:08, 7 June 2009 (UTC)
008 BIOS and earlier was trashing SI register on reads, which caused the program (and likely others too) to fail. the program still runs really slow. Hargle 16:08, 7 June 2009 (UTC)
Add IRQs usage. Currently there is no IRQ usage at all.
Add CHS support

someday. CHS support is very low priority. Every drive above 512 MB has support for LBA, so the additional drive support isn't really worth the trouble yet. Older drives are also less specification-friendly, so signaling and timing become more of an issue.
Add boot menu (owner=per)

<s>boot menu is in the 0.05 builds and onward. lightly tested on my end. Hargle 14:23, 22 May 2009 (UTC)</s>
Boot menu works, however, some operating systems (including DOS) are hard-wiered to expect the system files in floppy drive A. Because of this, some floppy disks booting from floppy drive other-than-A must be patched if they don't support to be booted from other drive letters.
A posibility might be to swap the drive letters in the BIOS, but that requires brand new floppy-disk based Int 13h routines.Per 22:54, 27 May 2009 (Central Europe Time).
Since our BIOS hooks int 13, currently all floppy access just gets pushed over to the old interrupt vector. (which gets moved to INT 40h). It would be pretty easy to check a bit at the entry point of INT 13, and if "boot B" was selected from the menu, just exchange a 1 for 0 in DL and then A: and B: drives would be swapped for the duration of that boot. Issues could certainly arise from 4 floppy systems, but I think those are few and far enough between that we should concentrate on only 2 floppy systems. Hargle 20:30, 2 June 2009 (UTC)
Speaking of the boot menu, I want to make it dynamic with menu choices. Check the results from INT 11h. If there is only 1 floppy drive, remove the boot B: option from the menu. Likewise with hard drives. Check 40:75 and get the drive count. Hargle 20:30, 2 June 2009 (UTC)
Fix possible INT 19 issue with other bootable cards.

Need another boot ROM that hooks int 19 to test. The boot menu may alter this issue. Hargle 14:23, 22 May 2009 (UTC)
<s>Test 2 or more cards.

Currently the card steals 1k from the top of base memory for a scratchpad area. 2nd card might (untested) detect the 1st card's signature there and re-use it, but I'm not sure. Need to get IO base address auto detection working first to test this. How will card 2 not auto detect the IO address of card #1? Hargle 14:23, 22 May 2009 (UTC)
Maybe the variables after the signature can be used?
Yes. having the base address embedded inside each card's eeprom is a perfect solution. this should make 2 or more cards completely isolated from each other, with the minor exception of sharing the scratch pad memory space stored at 639k. </s>
Done in 009 BIOS. Support for up to 4(!) cards available. This may help to allow the card to play nice with other HDD controllers. Hargle 16:08, 7 June 2009 (UTC)
More diagnostics, especially for initial bring up of a new card to test functionality.

Have read/write via INT13 diagnostics complete, could use others. Ideas/suggestions welcome. See the downloads section on the main page.
wrote a CHS2LBA test. run the write portion of the test on a modern machine, read it back on the xt card. It uses CHS to write the data and LBA to read it back. Hargle 17:11, 27 May 2009 (UTC)
Test overall INT 13 compatibility. (CY set on errors, proper flags set in AH, etc)

Need to locate a failing drive to test timeout errors as well.
slow IDing on faster computers. Low priority, since if you're actually using this card on a 286+, you should really try and locate a normal ISA 16bit controller and you'll see significant speed improvements. Seems to vary depending on the hard drive installed. on my 486, the sandisk CF waits for 5+ seconds before timing out on the not-installed slave drive. The older WD 1.2G drive zips past the 2nd drive check instantly. others have seen timeouts as long as 1 minute?!

The timeout itself is merely a "retry up to FFFF times, or until a signal is detected" loop, so technically it should be faster on faster machines. It is not realtime based at all. interesting.
device IDing technique will be altered in the future to better support CD-ROM drives.

*Re CSEL (K1) - it appears that CSEL should be directly connected to ground at the interface (10k pull-up in the drives). I tested this mod on the DP CPLD prototype and confirm two drives were then detected via CSEL, where before neither were detected. On the original XT/IDE it looks that R6 should be zero-ohms and K1 set at position L.