Is the IDE driver in the BIOS? If it is located it in the BIOS it should not be too difficult to extend the IDE driver to support 48 bit addressing....
** POST MODIFIED WITH DETAILS BELOW **
48 bit addressing was purposely created to allow backward compatibility with old IDE host controllers (even with controllers older than "ATA-33"...) The actual hard drive contains the logic for handling 48 bit addressing, not the host controller!
You can refer to the ATA-6 or ATA-7 specifications (drafts can be found here) for specific details on how an IDE DRIVE handles 48 bit addresses:
You can also see that the ATA Host Adapter Standards spec does not contain any mention of 48-bit addressing (since it is handled in the drive):
** Things to keep in mind regarding ATA/IDE **
(Forgive the long post...I hope somebody finds this stuff interesting.)
* I use the ATA and IDE interchangably
* Terms such as ATA33/ATA66/ATA100/ATA133 are really just marketing terms that describe the maximum DMA transfer rate that a specific drive supports. This is also sometimes called UDMA33/UDMA66/UDMA100/UDMA133.
* The actual DMA transfer mode used by a PC (or in this case XBOX) will the the highest common mode supported by both the drive and the PC (in the XBOX's case this will be ATA33 as most drives you buy today will support better transfer rates than ATA33).
* "Typical" PC IDE Host controller's are not very intellegent. The only thing they really do is implement a scatter gather DMA engine. During boot the BIOS queries the drive and configures the Host and drive for the fastest transfer mode possible. This transfer mode is used for all future DMA commands issued to the disk drive.
* There are many features that are implemented in later ATA specs that do not require any changes to most host controllers (ATAPI, 48 bit LBA, SMART, etc.) These are all handled in the IDE driver.
* A command is issued to an IDE disk drive in a sequence that looks something like this:
1. LBA/Size request comes to IDE driver from somewhere (FS/OS/Upper level driver/etc)
2. IDE driver generates DMA scatter gather tables and configures PC host controller DMA engine (probably enables the DMA transfer here -- the host controller waits for signals from the IDE drive to begin transfer)
3. Commands to a IDE disk drive are issued through a defined set of registers that are actually located in the disk drive (as opposed to command packets which are used for things like SCSI, and 1394). (IDE ATAPI devices use a combination of registers and command packets.) The IDE driver programs these drive registers with the LBA and block size of the transfer (these are 8 bit registers with a total supported LBA range of 28 bits). With 48 bit addressing the driver essentially writes each register twice to give a total of 48 bits of addressing.
4. IDE driver writes to the command register of disk drive with the desired command (in this case a DMA read or DMA write). The disk drive initiates transfer with host controller when it is ready to transfer data.
4a. Some host controllers try to be smart (like caching the IDE registers and only writing them to the IDE disk drive when the command register is written). In reality this is not smart as it prevents new features from properly being implemented and can cause havok for IDE driver developers. I hope the XBOX hardware does not do this...
5. Eventually the command completes and an interrupt is generated. The IDE driver checks for errors, cleans up, and returns status.
It seems to me that step #3 is pretty easy to fix to support bigger drives in the XBOX (assuming the XBOX IDE controller works the same as most PC controllers). The big question is #1. Is the filesystem/os restricted to 28 bits of LBA. I'm hoping that it uses 32 bits (which would still allow us to use very large disk drives).
* I believe that support for 48 bit LBA was added to the Linux kernel around version 2.4.20. Even if large disks cannot be supported for standard XBOX applications, the XBOX Linux project should still be able to use > 137 GB HDDs (assuming the XBOX IDE controller does not try to be fancy).
** FYI: I took a look at the Cromwell BIOS ide driver source code. I don't see anything there that would lead me to believe that there is any hardware limitation in the XBOX for supporting the 48 bit LBA addressing (somebody just needs to write a little code). However, the Cromwell BIOS is using an "int" for the "block" (LBA) parameter so that would leave us with 31 bits of usable LBA address space (that's still a terabyte which is a lot better than 137 GB). Also, it looks like the XBOX linux kernel is using the off-the-shelf source for the IDE disk driver (it's not in their CVS repository), so that should already have support for > 137 gb HDDs.
Edited by bobmckenzie, 20 April 2003 - 03:08 AM.