Development of an XTIDE-Compatible IDE
-
- Top Contributor
- Posts: 401
- Joined: Wed May 18, 2022 11:20 am
- Has thanked: 127 times
- Been thanked: 412 times
Re: Development of an XTIDE-Compatible IDE
For those willing to help, I have uploaded the source code.
https://github.com/kitune-san/PCXT_MiST ... /ide-test1
https://github.com/kitune-san/PCXT_MiST ... /ide-test1
- spark2k06
- Core Developer
- Posts: 876
- Joined: Sat Jun 06, 2020 9:05 am
- Has thanked: 409 times
- Been thanked: 969 times
Re: Development of an XTIDE-Compatible IDE
Thank you. Knowing that you will be using the ao486 IDE for the moment I'm going to prepare a test Main to take it into account so you don't have to use ao486 in the menu.kitune-san wrote: ↑Thu Nov 03, 2022 12:22 pm Progress report:
I used an AO486 IDE and connected it to the PCXT bus.
When a VHD file is set, universal BIOS returns recognition.
However, after this, it does not work properly.
For some reason, it also recognizes slave that do not exist.
2022-11-03 195926.png
I still don't know why it detects you as master and slave, but here would be the XTIDE source code:
https://www.xtideuniversalbios.org/svn/ ... ios/trunk/
- spark2k06
- Core Developer
- Posts: 876
- Joined: Sat Jun 06, 2020 9:05 am
- Has thanked: 409 times
- Been thanked: 969 times
Re: Development of an XTIDE-Compatible IDE
Here it is attached, @kitune-san. And this is the commit I will perform when everything is ready:kitune-san wrote: ↑Thu Nov 03, 2022 12:55 pm For those willing to help, I have uploaded the source code.
https://github.com/kitune-san/PCXT_MiST ... /ide-test1
https://github.com/spark2k06/Main_MiSTe ... 9f83ca592e
Everything related to serdrive will be removed , you can now revert this commit:
https://github.com/kitune-san/PCXT_MiST ... b06a76f8e7
A note. Right now, if you want to boot by FDD, no HDD must be mounted, otherwise the MiSTer Main itself crashes and you have to reset it.
- Attachments
-
- MiSTer_XTIDE_01.zip
- (546.1 KiB) Downloaded 230 times
-
- Top Contributor
- Posts: 1311
- Joined: Mon Jul 06, 2020 9:37 pm
- Has thanked: 634 times
- Been thanked: 308 times
Re: Development of an XTIDE-Compatible IDE
Curious about the method you used to connect the 16-bit bus to the 8-bit bus? Was it derived from the link I provided or from the method XT-IDE uses? This is only a wild guess, but you might have bits or bytes out of order feeding through the bus. From the screenshot, what it detects are not valid characters. Looking at the bits of the characters and trying to rearrange them to see what the ascii text might be could be interesting. It's very cool that you are starting with a known IDE like ao486 to see what happens. I am curious about if you plan to implement XT-IDE hardware down the road. The schematic is available as well as Xilinx Verilog. Just some ideas in case they help.kitune-san wrote: ↑Thu Nov 03, 2022 12:22 pm Progress report:
I used an AO486 IDE and connected it to the PCXT bus.
When a VHD file is set, universal BIOS returns recognition.
However, after this, it does not work properly.
For some reason, it also recognizes slave that do not exist.
-
- Top Contributor
- Posts: 860
- Joined: Wed Feb 09, 2022 11:50 pm
- Has thanked: 64 times
- Been thanked: 194 times
Re: Development of an XTIDE-Compatible IDE
It probably needs some logic changes to send result data 8 bits at a time. It's likely to assume that it can send 16 bits on the ISA bus, which AFAIK the 8088 can't handle.
I'm not sure if that's a chip or a bus limitation, though. Original ISA slots could only do 8 bits because that's all the pins that existed. The socket was extended to 16 bits when the AT (80286) came out. If the 8088 has enough data lines, you *might* be able to drive a virtual 16-bit ISA slot with one.
I do not expect that to work, however. I think that's probably dead wrong, and that the 8088 can only read 8 bits at a time from ISA.
I'm not sure if that's a chip or a bus limitation, though. Original ISA slots could only do 8 bits because that's all the pins that existed. The socket was extended to 16 bits when the AT (80286) came out. If the 8088 has enough data lines, you *might* be able to drive a virtual 16-bit ISA slot with one.
I do not expect that to work, however. I think that's probably dead wrong, and that the 8088 can only read 8 bits at a time from ISA.
-
- Top Contributor
- Posts: 1311
- Joined: Mon Jul 06, 2020 9:37 pm
- Has thanked: 634 times
- Been thanked: 308 times
Re: Development of an XTIDE-Compatible IDE
I just took a quick look, and noticed this part:kitune-san wrote: ↑Thu Nov 03, 2022 12:55 pm For those willing to help, I have uploaded the source code.
https://github.com/kitune-san/PCXT_MiST ... /ide-test1
always_ff @(posedge clock, posedge reset)
begin
if (reset)
read_buffer <= 8'hFF;
else if (~ide_io_read_n_delay & latch_high_read_byte)
read_buffer <= ide_data_bus_in[15:8];
else
read_buffer <= read_buffer;
end
It doesn't appear that the read_buffer is previously defined, so the last else line looks suspect to me. It might use the last known value, but what about the first time it happens when there is no value. I am certainly no expert, so take this with a grain of salt. Maybe reset takes care of the first time. I am not sure.
-
- Top Contributor
- Posts: 401
- Joined: Wed May 18, 2022 11:20 am
- Has thanked: 127 times
- Been thanked: 412 times
Re: Development of an XTIDE-Compatible IDE
Thanks for the info. I'll check it.
I have noticed that at least access to the control registers is not proper.
I have noticed that at least access to the control registers is not proper.
-
- Top Contributor
- Posts: 401
- Joined: Wed May 18, 2022 11:20 am
- Has thanked: 127 times
- Been thanked: 412 times
Re: Development of an XTIDE-Compatible IDE
I created an XUB build with MODULE_8BIT_IDE_ADVANCED disabled and changed to Compatibility mode wiring.
With this change, the drive was recognized.
This is an empty VHD file created by Windows, so I have not yet checked it after this.
With this change, the drive was recognized.
This is an empty VHD file created by Windows, so I have not yet checked it after this.
-
- Top Contributor
- Posts: 401
- Joined: Wed May 18, 2022 11:20 am
- Has thanked: 127 times
- Been thanked: 412 times
Re: Development of an XTIDE-Compatible IDE
The following is a test branch.
https://github.com/kitune-san/PCXT_MiST ... /ide-test3
This is the RBF file and custom XUB ROM (and Makefile).
https://github.com/kitune-san/PCXT_MiST ... /ide-test3
This is the RBF file and custom XUB ROM (and Makefile).
-
- Top Contributor
- Posts: 401
- Joined: Wed May 18, 2022 11:20 am
- Has thanked: 127 times
- Been thanked: 412 times
- spark2k06
- Core Developer
- Posts: 876
- Joined: Sat Jun 06, 2020 9:05 am
- Has thanked: 409 times
- Been thanked: 969 times
Re: Development of an XTIDE-Compatible IDE
Very good progress. Keep in mind that in that mode you may need another I/O port for the HD to boot and work:
- spark2k06
- Core Developer
- Posts: 876
- Joined: Sat Jun 06, 2020 9:05 am
- Has thanked: 409 times
- Been thanked: 969 times
Re: Development of an XTIDE-Compatible IDE
I attach the version I have shown you (XTIDE r1), generated from the previous one and with the xtidecfg.com tool that I also attach. Also, I have removed the default serial port search from Boot settings, so it starts faster:
It also detects the HD but does not boot, however, you can now see that we have the 308h I/O port available in addition to the 300h.
It also detects the HD but does not boot, however, you can now see that we have the 308h I/O port available in addition to the 300h.
- Attachments
-
- xtidecfg + rom xtide rev 1.zip
- (25.39 KiB) Downloaded 243 times
-
- Top Contributor
- Posts: 401
- Joined: Wed May 18, 2022 11:20 am
- Has thanked: 127 times
- Been thanked: 412 times
Re: Development of an XTIDE-Compatible IDE
It appears that XUB is reading the first 512 bytes.
There may be a problem with drive capacity recognition.
There may be a problem with drive capacity recognition.
-
- Top Contributor
- Posts: 401
- Joined: Wed May 18, 2022 11:20 am
- Has thanked: 127 times
- Been thanked: 412 times
Re: Development of an XTIDE-Compatible IDE
Apparently, it is necessary to set the SPT (Secter per track) to one of 1 to 63.kitune-san wrote: ↑Wed Nov 09, 2022 2:01 pm It appears that XUB is reading the first 512 bytes.
There may be a problem with drive capacity recognition.
The second byte of SPT is ignored.
How do I create a VHD file with SPT = 63?
EDIT:
It may be possible to set the spt to 63 using the sectors argument of ide_img_set().
I will prepare the build environment for Main_MiSTer ....
- spark2k06
- Core Developer
- Posts: 876
- Joined: Sat Jun 06, 2020 9:05 am
- Has thanked: 409 times
- Been thanked: 969 times
Re: Development of an XTIDE-Compatible IDE
If so, I'll try it out later.kitune-san wrote: ↑Thu Nov 10, 2022 1:13 pm
EDIT:
It may be possible to set the spt to 63 using the sectors argument of ide_img_set().
I will prepare the build environment for Main_MiSTer ....
On the other hand, I attach the VHD specification document, in case you find it useful:
https://go.microsoft.com/fwlink/p/?linkid=137171
-
- Top Contributor
- Posts: 860
- Joined: Wed Feb 09, 2022 11:50 pm
- Has thanked: 64 times
- Been thanked: 194 times
Re: Development of an XTIDE-Compatible IDE
With the Minimig core, you create a blank file of some size, and then the core appears to choose a geometry for that size, and passes it into the guest OS. You might be able to steal that algorithm. You might also be able to steal it from WinUAE. I think its algorithms are different for SCSI and IDE, as I don't think the images are cross-compatible, so you'll want to focus on the IDE code. The interesting code is likely to be in the RDB (rigid disk block) version of IDE.
edit: AO486 is probably doing the same thing, and stealing code from there might be easier, particularly since it's probably already loaded into your dev environment. However, that controller in general seems to be less complete, so it could potentially be taking shortcuts it maybe shouldn't. But the actual process of exposing the geometry to DOS should be all finished, where the Amiga code won't help at all.
edit: AO486 is probably doing the same thing, and stealing code from there might be easier, particularly since it's probably already loaded into your dev environment. However, that controller in general seems to be less complete, so it could potentially be taking shortcuts it maybe shouldn't. But the actual process of exposing the geometry to DOS should be all finished, where the Amiga code won't help at all.
- pgimeno
- Top Contributor
- Posts: 709
- Joined: Thu Jun 11, 2020 9:44 am
- Has thanked: 277 times
- Been thanked: 226 times
Re: Development of an XTIDE-Compatible IDE
I'm pretty sure that the VHD format that MiSTer uses is a raw disk image and not in VirtualPC VHD image format. As such, there's no data about number of sectors per track, number of heads or number of cylinders; I don't know how MiSTer main handles it but I'd guess it uses the maximum for sectors and heads, namely 63 and 16 respectively.spark2k06 wrote: ↑Thu Nov 10, 2022 1:57 pm On the other hand, I attach the VHD specification document, in case you find it useful:
https://go.microsoft.com/fwlink/p/?linkid=137171
To answer kitune-san's question, to create such image you just need to create a file with a multiple of 512*63*16 bytes, so a multiple of 516096 bytes.
Converters I've written: Floppy DIM/FDI/FDD/HDM to D88, D88 to XDF, Tape SVI 318/328 CAS to WAV
- spark2k06
- Core Developer
- Posts: 876
- Joined: Sat Jun 06, 2020 9:05 am
- Has thanked: 409 times
- Been thanked: 969 times
Re: Development of an XTIDE-Compatible IDE
It works perfectly!kitune-san wrote: ↑Thu Nov 10, 2022 1:13 pm
EDIT:
It may be possible to set the spt to 63 using the sectors argument of ide_img_set().
I will prepare the build environment for Main_MiSTer ....
I have prepared a test MiSTer_Main, forcing CHS to the following values: 940, 6, 17
I attach an empty HDD image with those parameters... just prepare it with FDISK and format it.
I will have to check MiSTer_Main so that it detects these parameters correctly and does not exceed the value 63 for SPT.
I can't try any more today, but here it is, so you can try it out...
- Attachments
-
- MiSTer.zip
- (546.06 KiB) Downloaded 228 times
-
- hdd.zip
- (46.81 KiB) Downloaded 243 times
-
- Top Contributor
- Posts: 401
- Joined: Wed May 18, 2022 11:20 am
- Has thanked: 127 times
- Been thanked: 412 times
-
- Top Contributor
- Posts: 401
- Joined: Wed May 18, 2022 11:20 am
- Has thanked: 127 times
- Been thanked: 412 times
Re: Development of an XTIDE-Compatible IDE
The module (XT2IDE.sv) is created with reference to the XTIDE card, and the ao486 IDE module(IDE.sv) is connected.
This is a simple diagram. There are actually several glue codes.
-
- Top Contributor
- Posts: 1311
- Joined: Mon Jul 06, 2020 9:37 pm
- Has thanked: 634 times
- Been thanked: 308 times
Re: Development of an XTIDE-Compatible IDE
Very cool! Thanks for the helpful diagram. I am very much looking forward to watching the future progress of this including the next release. The ao486 IDE module is not perfect in ao486 because some operating systems don't play nice with it (OS/2, NT, etc.), but it seems fine in DOS. In the case of PCXT, it will probably be just fine. It would be very cool if someday after PCXT is finished you could find the fixes to the remaining issues with the IDE controller in ao486 so it would work out of the box with the other operating systems, and maybe PCXT would benefit in some way as well. Thanks again!
Re: Development of an XTIDE-Compatible IDE
Xt ide might hide such errors as it is an interface controller, I guess.thorr wrote: ↑Thu Nov 10, 2022 10:24 pm Very cool! Thanks for the helpful diagram. I am very much looking forward to watching the future progress of this including the next release. The ao486 IDE module is not perfect in ao486 because some operating systems don't play nice with it (OS/2, NT, etc.), but it seems fine in DOS. In the case of PCXT, it will probably be just fine. It would be very cool if someday after PCXT is finished you could find the fixes to the remaining issues with the IDE controller in ao486 so it would work out of the box with the other operating systems, and maybe PCXT would benefit in some way as well. Thanks again!
- spark2k06
- Core Developer
- Posts: 876
- Joined: Sat Jun 06, 2020 9:05 am
- Has thanked: 409 times
- Been thanked: 969 times
Re: Development of an XTIDE-Compatible IDE
I have updated Main_MiSTer with the implementation of the CHS detection already used previously in serdrive, and borrowed from the 86Box/PCem code. This implementation will also benefit ao486, although it does not really need it:
https://github.com/MiSTer-devel/Main_MiSTer/pull/706
As you can see, I have already taken the opportunity to send a pull request to sorgelig. For the time being, I will not send an update of the PCXT core for everyone, as long as Main_MiSTer has not been released. However, I attach both MiSTer_Main with IDE support and a prerelease of the core so you can enjoy it:
https://github.com/MiSTer-devel/PCXT_Mi ... prerelease
I recommend using 86Box or PCEm to create the HD images for use in the PCXT core, as this ensures correct CHS values:
Otherwise, the head and sector values of 16 and 63 respectively will be used, and thereafter the cylinders will be calculated automatically. In this case, the size of the VHD must not exceed 8063Mb, because it would only be compatible with ao486.
In this prerelease I have also taken the opportunity to include the latest development of the Tandy 640x200x4 mode:
viewtopic.php?t=5642
I have also moved the mouse port to COM1, and removed the COM2 port for the time being.
I attach again the XTIDE BIOS that supports it, and that has the automatic detection of disk drives on the serial port disabled, to speed up the boot.
https://github.com/MiSTer-devel/Main_MiSTer/pull/706
As you can see, I have already taken the opportunity to send a pull request to sorgelig. For the time being, I will not send an update of the PCXT core for everyone, as long as Main_MiSTer has not been released. However, I attach both MiSTer_Main with IDE support and a prerelease of the core so you can enjoy it:
https://github.com/MiSTer-devel/PCXT_Mi ... prerelease
I recommend using 86Box or PCEm to create the HD images for use in the PCXT core, as this ensures correct CHS values:
Otherwise, the head and sector values of 16 and 63 respectively will be used, and thereafter the cylinders will be calculated automatically. In this case, the size of the VHD must not exceed 8063Mb, because it would only be compatible with ao486.
In this prerelease I have also taken the opportunity to include the latest development of the Tandy 640x200x4 mode:
viewtopic.php?t=5642
I have also moved the mouse port to COM1, and removed the COM2 port for the time being.
I attach again the XTIDE BIOS that supports it, and that has the automatic detection of disk drives on the serial port disabled, to speed up the boot.
- Attachments
-
- ide_xt.zip
- (7.87 KiB) Downloaded 271 times
-
- PCXT-PRERELEASE.zip
- (1.23 MiB) Downloaded 272 times
-
- MiSTer-PRERELEASE.zip
- (546.64 KiB) Downloaded 236 times
- Newsdee
- Top Contributor
- Posts: 873
- Joined: Mon May 25, 2020 1:07 am
- Has thanked: 104 times
- Been thanked: 239 times
Re: Development of an XTIDE-Compatible IDE
How about adding a blank pre-formatted HD image to the repo (maybe 20 or 40MB) without any data,
so users can easily load a floppy and install their own OS?
- spark2k06
- Core Developer
- Posts: 876
- Joined: Sat Jun 06, 2020 9:05 am
- Has thanked: 409 times
- Been thanked: 969 times
Re: Development of an XTIDE-Compatible IDE
We already have a disk image with freedos, and a quickstart for beginners
-
- Top Contributor
- Posts: 531
- Joined: Tue May 26, 2020 5:06 am
- Has thanked: 87 times
- Been thanked: 211 times
Re: Development of an XTIDE-Compatible IDE
Do you think you could make COM2 connected to /dev/ttyS1 so that it would work with the TCP modem?
- spark2k06
- Core Developer
- Posts: 876
- Joined: Sat Jun 06, 2020 9:05 am
- Has thanked: 409 times
- Been thanked: 969 times
Re: Development of an XTIDE-Compatible IDE
It could be valued, write it down as a suggestion so that I don't forget it:
https://github.com/MiSTer-devel/PCXT_MiSTer/issues
-
- Top Contributor
- Posts: 531
- Joined: Tue May 26, 2020 5:06 am
- Has thanked: 87 times
- Been thanked: 211 times
Re: Development of an XTIDE-Compatible IDE
Ok, got the new IDE to work
and I used this benchmark --> https://github.com/foone/DiskTest
MS-DOS Disk performance tester, by James Pearce. I compiled it in Turbo Pascal 7.0 (with patches) with 8087 emulation.
This is "Before" with serial set to 460K:
This is A: dive for comparison:
Now this is "After" at 14mhz - I should mention its slower at 4.77 and 7.1 Mhz, but still much better than "before"... I think this is a huge step for PCXT. Much thanks to spark2k06!
I'm creating a floppy disk .IMG with several benchmarks appropriate for an XT class machine: I think that might be useful...
and I used this benchmark --> https://github.com/foone/DiskTest
MS-DOS Disk performance tester, by James Pearce. I compiled it in Turbo Pascal 7.0 (with patches) with 8087 emulation.
This is "Before" with serial set to 460K:
This is A: dive for comparison:
Now this is "After" at 14mhz - I should mention its slower at 4.77 and 7.1 Mhz, but still much better than "before"... I think this is a huge step for PCXT. Much thanks to spark2k06!
I'm creating a floppy disk .IMG with several benchmarks appropriate for an XT class machine: I think that might be useful...