Page 34 of 62

Re: XT-IDE on PCjr

Posted: Sat Sep 10, 2011 10:31 pm
by alanh
Optimized the in-line asm now:

Code: Select all

extern void _xfer_sector_in (uint16_t far *dst);
#pragma aux _xfer_sector_in = \
	"push ds" \
	"lds si, dword ptr ide_sector" \
	"mov cx, 0x100" \
	"cld" \
	"rep movsw" \
	"pop ds" \
	parm [di es] \
	modify [si es di cx];

static void _xfer_sectors (uint16_t cyl, uint8_t head, uint8_t count, uint16_t far *ptr)
{
	ide_window[IDE_REG_ADDR_CYL_L] = cyl & 0xff;
	ide_window[IDE_REG_ADDR_CYL_H] = cyl >> 8;
	ide_window[IDE_REG_ADDR_HEAD]  = 0xa0 | head;
	ide_window[IDE_REG_SEC_COUNT] = count;
	ide_window[IDE_REG_ADDR_SEC]  = 1;

	ide_window[IDE_REG_COMMAND] = 0x20;

	for (; count; --count)
	{
		while (!(ide_window[IDE_REG_STATUS] & 0x08));

		_xfer_sector_in (ptr);

		ptr += 256;
	}

	return;
}

extern uint16_t get_ds(void);
#pragma aux get_ds = \
    "mov ax,ds" \
    value [ax];

uint16_t sector[63 * 256];


static void ide_test (void)
{
	uint16_t c;
	register uint16_t h;
	uint16_t far *ptr;

	ptr = (uint16_t far *) MK_FP(get_ds(), sector);

	for (c = 0; c < 16383; c++)
	{
		for (h = 0; h < 16; h++)
		{
			printf ("%d/%d\n", c, h);

			_xfer_sectors (c, h, 63, ptr);
		}
	}
}

~330 KB/s direct reads!

Re: XT-IDE on PCjr

Posted: Sun Sep 11, 2011 6:23 am
by Brutman
See! I've been telling people this was possible. :-)

Congratulations on getting it working. This will be the fastest hard drive controller since the old SCSI controllers .. IDE can't touch it.


Mike

Re: XT-IDE on PCjr

Posted: Sun Sep 11, 2011 7:39 am
by MattCarp
>This will be the fastest hard drive controller since the old SCSI controllers .. IDE can't touch it.

I don't follow. How fast were the old SCSI controllers?

IDE can't touch it? This is IDE.

Mike, do you happen to have the benchmarks handy?

I recall the IBM FDA is somewhere ~80KB/s.

330 is just awesome. You're filling RAM in <3 sec!

Re: XT-IDE on PCjr

Posted: Sun Sep 11, 2011 7:43 am
by Brutman
MattCarp wrote:>This will be the fastest hard drive controller since the old SCSI controllers .. IDE can't touch it.

I don't follow. How fast were the old SCSI controllers?

IDE can't touch it? This is IDE.

Mike, do you happen to have the benchmarks handy?

I recall the IBM FDA is somewhere ~80KB/s.

330 is just awesome. You're filling RAM in <3 sec!
"IDE can't touch this" means using the standard method of data access that IDE provides, which is repeated reads to a single 16 bit I/O port. Yes, we have an IDE device, but the way the data register is being exposed does not conform to any known IDE specification anymore. And thus the comment ...

XT-IDE does around 85KB/sec normally. The IBM FDA on an XT is more like 100 to 120 depending on the interleave.


Mike

Re: XT-IDE on PCjr

Posted: Sun Sep 11, 2011 10:29 am
by MattCarp
ok, gotcha - thanks. So you're using memory mapped registers to achieve the speed vs. a typical IDE setup using the 16-bit port I/O.

Do you recall the SCSI performance benchmarks? TMC 850 Jr? Parallel port SCSI?

-Matt

Re: XT-IDE on PCjr

Posted: Sun Sep 11, 2011 7:27 pm
by alanh
On the subject of board changes, I'm still under an area limitation with Eagle. I don't think I can fit a 2.5" 2mm 44-pin right angle board mount and a .1" 40 pin header too. Let's discuss options for Rev.P2.

A) Keep it the way it is -> 2.5" HD w/ 44-pin 2mm right angle header and screw holes to allow a HD to mount directly to the PCB and stick out ~1.1" through the rear of the side-car. I would fix the connector pin orientation and change routing to make this work. The HD screw holes need to be adjusted slightly too. I would also change the drill size so that the right angle male header fits too allowing for a 44 pin flash module.

B) Put a 40 pin .1" hole grid for either a vertical (cable) or right angle (cable or flash module) header. Shorten the board length as the extra space needed to support mounting holes for the 2.5" drive would no longer be needed; potentially saving some board cost. The biggest problem would be providing drive power. I could also add a connector of some sort to provide drive power. There probably would not be room for a standard Molex 4-pin. So it would either need to be a Berg FDC connector or something really non-standard. We could make cables.

C) Add SMT pads for a CF module. It involves SMT soldering of .5mm pitch leads. CF cards have less compatibility than actual drive in my experience. Mileage may vary. May be some voltage issues too.

D) Really vote against having to choose just one and guilt me into buying Eagle Pro and adding 2 or all 3 of the above.

Re: XT-IDE on PCjr

Posted: Sun Sep 11, 2011 7:46 pm
by Brutman
I prefer option B. I plan on using either a real IDE drive in another enclosure (with it's own power supply) or a flash module.

Over the years I've had too many problems with 2.5" laptop IDE drives. Unless you have them new, they are used and are not as reliable as the desktop drives even when the desktop drives are broken in. Given that SATA has been with us a few years now, there is not a lot of new/old stock hard drives floating around.

Option B still gives you the option to use a laptop drive with an adapter. But you probably can't hide it in the sidecar.

Option C is dicey - older CF cards tend to support CHS addressing but newer ones often do not.

Option D - how much are we talking? You've got some expense tied up in this and I'm willing to chip in.


Mike

Re: XT-IDE on PCjr

Posted: Sun Sep 11, 2011 9:58 pm
by alanh
After working on this a bit tonight, I could accommodate both A and B if I put the 40 pin .1" header inside the posts. It would rule out a flash module, but it would allow for a cable. I guess you could call it an option E. I'm not real keen on the CF adapter unless I go option D in which case I can lay it out for nothing. I personally prefer B, but not die-hard about it.

There is an option D' (prime). I need to hit up a co-worker who is senior EE lead at work. He's been promising me a seat license for our EDA software but never has time to follow through with setting me up for EE internal process training. I could re-lay out the board using it. I'll see what I can do.

Re: XT-IDE on PCjr

Posted: Mon Sep 12, 2011 10:00 am
by jmetal88
Why not try to learn KiCAD? I'm sure there are trade-offs compared to commercially available software, but at least you can do what it's capable of without limitation without having to pay someone.

Re: XT-IDE on PCjr

Posted: Mon Sep 12, 2011 10:49 am
by alanh
I might. It would be the third EDA tool I would have to use on a regular basis. Two are bad enough. And I used yet another, PCAD, in my last job. I've looked at KiCAD before, and unless there isn't another option, Eagle is so much better imo.