[Etherboot-developers] IDE implementation ramblings....
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: Eric W B. <ebi...@ln...> - 2002-07-27 10:59:10
|
Starting with the IDE driver that has been in various etherboot patches I am successfully booting from ide. Hopefully I will check this in the next couple of days. IDE is a strange beast. Reading and writing to a drive is easy. Reliably finding a drive immediately after power up is hard. Especially if you don't want to wait 31 seconds which is the worst case drive spinup time. The problem is that IDE drives don't respond to any commands until after they have spunup. And the maximum legal spinup delay is 31 seconds so there is quite a wait before a command can be said to have failed. So I don't have to wait 31 seconds in every case I depend on the BSY bit being set on the drive during spinup. And then I just wait for that bit to clear. According to the IDE spec, IDE drives must set their BSY bit during spinup, and on every board I have tested this works the IDE controller relays this bit. But I have reports this technique does not work on every board. Past that I weed out a lot of false positives, by writing multiple drive registers with different values, reading them back, and seeing if any of the values are different. This quickly weeds out empty cables and the like. So only in very rare circumstances do I need to worry about waiting for a full command timeout to detect a drive is actually missing from the system. I don't plan to implement drive speed tuning. For boot up that should not be an issue. I don't do DMA transfers either but that is just because the PIO transfers are trivial to setup, and since I performance isn't a major objective this shouldn't be an issue. There are still a lot of pieces of the code that need little bits of attention before it integrates in well with etherboot. Roughly I need to make IDE a layer like pci, or ISA_PNP. And put my ide_disk code on top of that, allowing for further developments like cdrom support. Plus I need to implement code to actually find the image to boot on the hard drive instead of just hard coding a fixed offset. But as I take the little problems one at a time they all seem to have pretty decent solutions so I'm not to worried. Sizewise the ide driver has about a 2k text section. So it is about the same size as a NIC driver. So no extraordinary size impacts are present. Eric |