Hi BDD,
Thanks for replying on this... much appreciated. I've not had a chance to start writing any code just yet, but have spent some time defining the BIOS functions for both the IDE interface and the RTC access.
I also recall your POC V1 discussion where you tried to use the 1511 for the jiffy clock and the issues. Like you, I'm also using the timer/counter on the NXP UART (SCC2691 in my Pocket SBC) for a (10ms) jiffy clock.
For the RTC BIOS functions, I went back to the BIOS calls that (IBM) implemented for the initial RTC hardware which was implemented with the PC-AT (1984...). These calls are via INT 1Ah:
0- Read RTC
1- Set RTC
2- Read RTC Time (HH:MM:SS)
3- Set RTC Time (HH:MM:SS)
4- Read RTC Date (Mon/Day/Year)
5- Set RTC Date (Mon/Day/Year)
6- Set RTC Alarm
7- Reset RTC Alarm
Granted, I need to go back to my old BIOS listings to see the differences between calls 0 and 1 vs 2 and 3. As the 1511 has 256 bytes of NVRAM, I'll likely use calls 0 and 1 to read and write the 256 bytes of NVRAM. As the 1511 uses BCD values, I'll convert them to binary and load my existing RTC code, albeit I'll need to implement month/day/year for the next BIOS release. Currently I just calculate seconds, minutes, hours and days... with days being a 16-bit count.
I''m also leaning towards a small set of calls for the CF-Card, which is configured for true IDE mode. As there's a number of typical BIOS INT 13h calls that don't apply to the CF-Card and also some that are handled, but nothing done by the CF-Card (for compatibility), I'm leaning towards the following:
0- Reset/Initialize CF Card (Test ready (diags), Set PIO mode, Zero pointers)
1- Get Status/Error code from last operation
2- Read One or more blocks from CF Card
3- Write One or more blocks to CF Card
4- Verify One or more blocks to CF Card
5- Set Transfer Address for Read/Write/Verify
6- Set starting LBA for Read/Write/Verify (24-bit address = 8GB)
7- Read CF Card Parameters (total LBA Count, PIO mode, etc.)
The idea is to keep the BIOS functions short and simple and use LBA only, no CHS access. When trying to use it with an OS (like Bill's upcoming Flex for the 6502 or Richard Leary's DOS/65) which use CHS access, there will be a translation layer to provide what the OS needs to function and provide sector/block level access via the actual BIOS. It would also allow the CF-Card to be divided into multiple virtual drives to get around the filesystem limitations for older OSes.
Still defining/redefining this in my little brain but should start writing code soon. In the meantime, I'm doing house projects, car projects, visiting/helping Mom (since Dad passed away in March) and starting to learn 68000 assembly for a 68K based Pocket SBC project