Page 1 of 1

BK-0011M HDD image format

Posted: Tue Jul 14, 2020 12:15 pm
by smaslov
Hi,

I am working on an HDI to VHD conversion utility, in order to mount HDI disk images in MiSTER under the BK-0011М core. I have a couple of questions:

After looking into the sources of bkhdutil.exe, I got the following understanding of the disk image file format.
The first 512 byte block of the image is reserved for the logical disk's table ("partition" table). The format of this block is as follows:

Byte Offset: Length, Description
===================================
0: 4, "BKHD" (ascii)
4: 1, 0x01 (version number)
5-15: 11, 0x00 (reserved)
16: 4, offset to first logical disk (C:), in units of 512 byte blocks (DWORD)
20: 4, offset to second logical disk (D:) ....
.....

Remaining bytes in the block are set to 0x00. Although bkhdutil.exe supports up to 64 logical disks, there is space for up to (512 - 16) / 4 = 124 logical disk records in the table. I suppose, all these records can be used, if needed? Also, is the above description correct?

BR,

Stanislav

Re: BK-0011M HDD image format

Posted: Fri Aug 14, 2020 9:52 am
by Sorgelig
HDD format and access is tuned to CSIDOS i've wrote in 90x. Access to logical disk number is done by letters, so the number of logical disks are limited by ASCII symbols (both upper and lower) number from CSIDOS. I don't remember the details now, but i think you can access up to 124 disks if OS supports the way to submit the correct logical disk number.
Core intercepts standard disk rom entries, so the actual code from ROM (160000 addresses) isn't really executed. HDL executes a simple state machine to calculate the offset and load the requested sector (both FDD and HDD) and then injects a dummy RET instruction.
So the whole HDD logical disk work is in the core.
Thus if you will use other OS, then make sure it uses standard ROM entries to access FDD and HDD or it won't work.