From f3dd2dae6cb12d82e1a19ecea967f52e7581086e Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 3 Aug 2017 11:17:48 +0100 Subject: [PATCH] Added disk image documentation. --- en-idedos.html | 209 +++++++++++++++++++++++++++++++++++++++++++++++++ nfdr0.txt | 62 +++++++++++++++ nfdr1.txt | 122 +++++++++++++++++++++++++++++ 3 files changed, 393 insertions(+) create mode 100644 en-idedos.html create mode 100644 nfdr0.txt create mode 100644 nfdr1.txt diff --git a/en-idedos.html b/en-idedos.html new file mode 100644 index 0000000..22d7585 --- /dev/null +++ b/en-idedos.html @@ -0,0 +1,209 @@ + + + + + + + IDEDOS - the access to harddisks + + + + + + + + + + + + + + +
Polski + English +
+ + + +
Home + Guide + RSXes + Files + Functions + Versions + Releases + Users + Download +
+ + + +
CP/M + MEMDISK + IDEDOS +
+
+ +

IDEDOS - the access to harddisks

+ +

The IDEDOS means extra facilities of the +3e operating system, + written by Garry Lancaster. For more details please consult his + page at http://www.zxplus3e.plus.com/. + +

In ZXVGS and CPM22QED is implemented the IDEDOS partition table + (also called IDEDOS system partition). + +

Searching for IDEDOS structures: +

    +
  1. Read the sector 1 on cylinder 0 and head 0. +
  2. If sector length is 512B (full IDE), go to 5. +
  3. (Simple IDE - sector length is 256B.) If "PLUSIDEDOS" signature found, go to 10. +
  4. Don't mount the disk at all. +
  5. If "PLUSIDEDOS" signature found, go to 10. +
  6. If "P?L?U?S?I?D?E?D?O?S" signature found, switch disk + access to 8-bit and go to 10. +
  7. Read the sector 1 on cylinder 0 and head 1. +
  8. If "PLUSIDEDOS" signature found, go to 10. +
  9. Don't mount the disk. (Or try to analyse MS-DOS + partition tables.) +
  10. Analyse IDEDOS partition table. +
+ + + +
The 64 bytes partition entry
OffsetLengthDescription +
+016Partition name (case-insensitive, space-padded). +
+1616Partition definition. +

+
+161Partition type (0=free handle) +
+172Starting cylinder. +
+191Starting head. +
+202Ending cylinder. +
+221Ending head. +
+234Largest logical sector number. +
+275Type-specific information. +
+3232Type-specific information. +
+ +

+ + + + + + + + + + + + + + + + +
Partition types
Partition
type
number +
Description +
#00 + Unused partition/free handle. +
#01 + System partition. The first partition on a disk, starting at phisical + sector 1 (cylinder 0, head 0 or 1), is always the system partition and + contains a list of 64-byte + partition entries that define all the partitions on the disk (including + the system one). Only one partition of this type is + permitted on a disk, and this is always the first partition. The name + is always "PLUSIDEDOS" (followed by 6 spaces). +
#02 + Swap partition. +
#03 + +3DOS partition. The maximum theoretical size for a +3DOS + partition is just under 32Mb. The XDPB has logical geometry. +
#04 + CP/M partition with XDPB that reflects phisical +disk structure. So if the disk has 17 spt, the LSPT is +68. The partition uses always integer number of +cylinders and uses whole cylinder (from head 0). +Otherwise (when from not track 0) this is converted to +reserved tracks (OFF in XDPB). This is required for my +DSKHNDLR low level disk drivers. +
#05 + Boot partition. This is only one file, stored +as a partition. Used to boot a hardware. Eg. Timex FDD 3000 +extedend with YABUS.TF, will search the IDEDOS partiton +table to find "YABUS.TF" partition. If found, the partition +contents is loaded into RAM and started. The partition size +is usually 8k to 64kB, what gives 1..2 tracks (or 1..8 track +for disks with 17 spt). The number of sectors to load is in +partition definition. +
#10 + MS-DOS (FAT16) partition. +
#20 + UZI(X) partition. +
#30 + TR-DOS diskimage partition. Usually 640kB. Sector offset. +
#31 + SAMDOS diskimage partition (B-DOS record), 800kB. Sector offset. +
#32 + MB-02 diskimage partition. Usually 1804kB. Sector offset. +
#FE + Bad disk space. +
#FF + Free disk space. +
+ +

Example partitions data

+ +

The disk is Seagate ST351A/X and its structure is 980/5/17 (not the +reported in manual 820/6/17). +

First track is reserved to allow MBR and MS-DOS partitions table in +0/0/1 sector. The MS-DOS (and other) partitions can start at cylinder +198 as IDEDOS structure ends at cylinder 197 inclusive. IDEDOS structure +could also take whole disk and contain MS-DOS partition inside. +

IDEDOS structure starts at sector 0/1/1, so 1 * 17 * 512 = 8704 = #2200 +bytes are skpipped.
+

02200  50 4C 55 53 | 49 44 45 44 | 4F 53 20 20 | 20 20 20 20   PLUSIDEDOS       
+02210  01 00 00 01 | 00 00 01 10 | 00 00 00 00 | 00 00 00 00   ................ 
+02220  C6 00 05 11 | 55 00 87 00 | 02 00 00 00 | 00 00 00 00   O...U........... 
+02230  00 00 00 00 | 00 00 00 00 | 00 00 00 00 | 00 00 00 00   ................ 
+
IDEDOS system partition (type #01 - area that describes other partitions). +Starts at cylinder 0 head 1 and ends at the same one. +Partition size is 11 sectors (#00000010). +At #02220 disk parameters are defined: 198 cylinders (#0C6, two bytes), +5 heads (one byte), 17 sectors per track (#11, one byte), sectors +per cylinder is calculated to 85 (#0055, two bytes). Up to 136 +partitions can be defined (#0087 is last number = 1 * 17 * 512 / 64 - 1, two +bytes). Area behind from cylinder 198 is reserved for other systems +(e.g. MS-DOS) and not available as IDEDOS partitions. + +
02240  5A 58 56 47 | 53 20 20 20 | 20 20 20 20 | 20 20 20 20   ZXVGS            
+02250  04 02 00 00 | C5 00 04 13 | 41 00 00 00 | 00 00 00 00   ....L...A....... 
+02260  44 00 04 0F | 00 44 10 FF | 03 FF FF 00 | 00 00 00 02   D....D.ÿ.ÿÿ..... 
+02270  03 04 C4 11 | 01 00 02 00 | 00 A1 FF 00 | 00 00 00 00   ..A.......ÿ..... 
+
Main CP/M partition (type #04). Starts at cylinder 2 head 0 +and ends at cylinder 197 (#00C5) head 4 inclusive. At #02260 XDPB +is provided. Partition has 16660 sectors (#00004113). + +
02280  50 4C 33 4D | 45 4D 2E 53 | 59 53 20 20 | 20 20 20 20   PL3MEM.SYS
+02290  05 01 00 03 | 01 00 04 1F | 00 00 00 00 | 00 00 00 00   ................
+022A0  00 00 00 00 | 00 00 00 00 | 00 00 00 00 | 00 00 00 00   ................
+022B0  00 00 00 00 | 00 00 00 00 | 00 00 00 00 | 00 00 00 00   ................
+
Boot file (type #05) dedicated for the PL3MEM interface. +Starts at cylinder 1 head 3 and ends at cylinder 1 head 4. +File size is 32 sectors (#0000001F) - last two are unused. + +
022C0  46 52 45 45 | 20 20 20 20 | 20 20 20 20 | 20 20 20 20   FREE
+022D0  FE 00 00 02 | 01 00 02 65 | 00 00 00 00 | 00 00 00 00   t......e........ 
+022E0  00 00 00 00 | 00 00 00 00 | 00 00 00 00 | 00 00 00 00   ................ 
+022F0  00 00 00 00 | 00 00 00 00 | 00 00 00 00 | 00 00 00 00   ................ 
+
Some free space (type #FE). Starts at cylinder 0 head 2 +and ends at cylinder 1 head 2 inclusive. Has 102 sectors (#00000065). +Can be used later to place more boot files. + + +
+
© 2003-06-24 12:48:59 Jarek Adamski + zxvgs@yarek.com, + http://zxvgs.yarek.com
+ + diff --git a/nfdr0.txt b/nfdr0.txt new file mode 100644 index 0000000..7d76e15 --- /dev/null +++ b/nfdr0.txt @@ -0,0 +1,62 @@ +NFD r0Œ`Ž®ƒtƒ@ƒCƒ‹\‘¢Žd—l + 2001/01/22 LED + + ‚Í‚¶‚ß‚É + +‚±‚̃eƒLƒXƒg‚ÍPC9821ƒGƒ~ƒ…ƒŒ[ƒ^T98-Next‚̃tƒƒbƒs[ƒfƒBƒXƒNƒCƒ[ƒWƒtƒ@ƒCƒ‹ +NFD r0Œ`Ž®‚Ì\‘¢‚ð‹K’肵‚½‚à‚̂ł·Bƒf[ƒ^‰ðÍAƒc[ƒ‹ŠJ”­“™‚É‚²Ž©—R‚É—˜—p +‚µ‚Ä‚­‚¾‚³‚¢B + + \‘¢‚ɂ‚¢‚Ä + +NFDŒ`Ž®‚Ì\‘¢‚͑傫‚­ƒwƒbƒ_•”‚ƃf[ƒ^•”‚É•ª‚¯‚ç‚ê‚Ü‚·B +ƒtƒ@ƒCƒ‹‚Ìæ“ª‚©‚çƒwƒbƒ_•”‚ª‘¶Ý‚µA‚»‚ÌŒã‚ë‚Ƀf[ƒ^•”‚ª‘¶Ý‚µ‚Ü‚·B + +yƒwƒbƒ_•”z + +typedef struct { + char szFileID[15]; // ޝ•ÊID "T98FDDIMAGE.R0" + char Reserve1[1]; // —\–ñ + char szComment[0x100]; // ƒCƒ[ƒWƒRƒƒ“ƒg(ASCIIz) + DWORD dwHeadSize; // ƒwƒbƒ_•”‚̃TƒCƒY + BYTE flProtect; // 0ˆÈŠO : ƒ‰ƒCƒgƒvƒƒeƒNƒg + BYTE byHead; // ƒwƒbƒh” + char Reserve2[10]; // —\–ñ + NFD_SECT_ID si[163][26]; // ƒZƒNƒ^ID(Œãq) + char Reserve3[0x10]; // —\–ñ +}NFD_FILE_HEAD,*LP_NFD_FILE_HEAD; +’)\‘¢‘̂̋«ŠE‚Í‚PƒoƒCƒg’PˆÊ‚Æ‚·‚é +—\–ñ—̈æ‚Í0‚Å–„‚߂邱‚Æ + +ƒZƒNƒ^ID(NFD_SECT_ID)‚Í163ƒgƒ‰ƒbƒN26ƒZƒNƒ^•ª‚ªŒÅ’è‚ÅŠm•Û‚³‚ê‚Ä‚¨‚è +ˆÈ‰º‚Ì\‘¢‚ðŽ‚Â + +typedef struct { + BYTE C; // C i0xFF‚ÌŽžƒZƒNƒ^–³‚µj + BYTE H; // H + BYTE R; // R + BYTE N; // N + BYTE flMFM; // 0:FM / 1:MFM + BYTE flDDAM; // 0:DAM / 1:DDAM + BYTE byStatus; // READ DATA(FDDBIOS)‚ÌŒ‹‰Ê + BYTE byST0; // READ DATA(FDDBIOS)‚ÌŒ‹‰Ê ST0 + BYTE byST1; // READ DATA(FDDBIOS)‚ÌŒ‹‰Ê ST1 + BYTE byST2; // READ DATA(FDDBIOS)‚ÌŒ‹‰Ê ST2 + BYTE byPDA; // FDDBIOS‚ÅŽg—p‚·‚éƒAƒhƒŒƒX + char Reserve1[5]; // —\–ñ +}NFD_SECT_ID,*LP_NFD_SECT_ID; +’)\‘¢‘̂̋«ŠE‚Í‚PƒoƒCƒg’PˆÊ‚Æ‚·‚é +—\–ñ—̈æ‚Í0‚Å–„‚߂邱‚Æ + +ƒZƒNƒ^ID‚ÍŠî–{“I‚ÉPC98ã‚ÅFDD BIOS‚ÌREADDATA‚ðs‚Á‚½Œ‹‰Ê‚ð•Û‘¶‚·‚éB +C‚ª0xFF‚̂Ƃ«A‚»‚̃ZƒNƒ^ID‚Í–³Ž‹‚³‚ê‚éB +byPDA‚ÍFD‚ª1.2M‚Ìê‡0x90A1.44M‚Ìê‡0x30A640K‚Ìê‡0x10‚ð“ü‚ê‚éB + + + +yƒf[ƒ^•”z + +ƒtƒ@ƒCƒ‹‚Ìæ“ª‚©‚çƒwƒbƒ_•”‚ÌdwHeadSizeƒoƒCƒgˆÈ~‚©‚çƒf[ƒ^•”‚ƂȂè‚Ü‚·B +ƒf[ƒ^•”‚̓ZƒNƒ^IDŠi”[‡‚Ƀf[ƒ^‚ð˜A‘±‚É”z’u‚µ‚Ü‚·B + + diff --git a/nfdr1.txt b/nfdr1.txt new file mode 100644 index 0000000..33518c2 --- /dev/null +++ b/nfdr1.txt @@ -0,0 +1,122 @@ +NFD r1Œ`Ž®ƒtƒ@ƒCƒ‹\‘¢Žd—l + 2001/09/14 LED + + ‚Í‚¶‚ß‚É + +‚±‚̃eƒLƒXƒg‚ÍPC9821ƒGƒ~ƒ…ƒŒ[ƒ^T98-Next‚̃tƒƒbƒs[ƒfƒBƒXƒNƒCƒ[ƒWƒtƒ@ƒCƒ‹ +NFD r1Œ`Ž®‚Ì\‘¢‚ð‹K’肵‚½‚à‚̂ł·Bƒf[ƒ^‰ðÍAƒc[ƒ‹ŠJ”­“™‚É‚²Ž©—R‚É—˜—p +‚µ‚Ä‚­‚¾‚³‚¢B + + \‘¢‚ɂ‚¢‚Ä + +NFDŒ`Ž®‚Ì\‘¢‚͑傫‚­ƒwƒbƒ_•”‚ƃf[ƒ^•”‚É•ª‚¯‚ç‚ê‚Ü‚·B +ƒtƒ@ƒCƒ‹‚Ìæ“ª‚©‚çƒwƒbƒ_•”‚ª‘¶Ý‚µA‚»‚ÌŒã‚ë‚Ƀf[ƒ^•”‚ª‘¶Ý‚µ‚Ü‚·B + +yƒwƒbƒ_•”z + +ƒwƒbƒ_•”‚Í‚»‚Ì’†‚Å‚³‚ç‚Éu‘S‘Ìî•ñ•”vuƒZƒNƒ^î•ñ•”vu“ÁŽê“ǂݞ‚Ýî•ñ•”v +‚É•ª‚¯‚ç‚ê‚Ü‚· + +u‘S‘Ìî•ñ•”v +ƒCƒ[ƒW‘S‘Ì‚Ìî•ñ‚ðŠi”[‚µ‚Ü‚·B‚±‚Ì•”•ª‚̓tƒ@ƒCƒ‹æ“ª‚æ‚èŒÅ’è‚Å“ü‚è‚Ü‚· + +typedef struct { + char szFileID[sizeof(NFD_FILE_ID1)]; /* ޝ•ÊID "T98FDDIMAGE.R1" */ + char Reserv1[0x10-sizeof(NFD_FILE_ID1)]; /* —\”õ */ + char szComment[0x100]; /* ƒRƒƒ“ƒg */ + DWORD dwHeadSize; /* ƒwƒbƒ_‚̃TƒCƒY */ + BYTE flProtect; /* ƒ‰ƒCƒgƒvƒƒeƒNƒg0ˆÈŠO */ + BYTE byHead; /* ƒwƒbƒh” 1-2 */ + char Reserv2[0x10-4-1-1]; /* —\”õ */ + DWORD dwTrackHead[164]; /* ƒgƒ‰ƒbƒNIDˆÊ’u */ + DWORD dwAddInfo; /* ’ljÁî•ñƒwƒbƒ_‚̃AƒhƒŒƒX */ + char Reserv3[0x10-4]; /* —\”õ */ +}NFD_FILE_HEAD1,*LP_NFD_FILE_HEAD1; +’)\‘¢‘̂̋«ŠE‚Í‚PƒoƒCƒg’PˆÊ‚Æ‚·‚é +—\–ñ—̈æ‚Í0‚Å–„‚߂邱‚Æ + +dwHeadSize‚̓wƒbƒ_•”‘S‘̂̑傫‚³‚ðŽ¦‚· +swTrackHead‚̓ZƒNƒ^î•ñ•”‚̃gƒ‰ƒbƒN‚Ìæ“ªˆÊ’u‚ðâ‘΃AƒhƒŒƒX‚ÅŽ¦‚· +’A‚µA‘¶Ý‚µ‚È‚¢ƒgƒ‰ƒbƒN‚Ìê‡0‚ª“ü‚é +dwAddInfo‚Í—\–ñ‚ÅŒ»ó‚Å‚Í0ŒÅ’è‚Å‚·B + +‘S‘Ìî•ñ•”‚ÌŒã‚Ƀgƒ‰ƒbƒN’PˆÊ‚ÅuƒZƒNƒ^î•ñ•”v‚Æu“ÁŽê“ǂݞ‚Ýî•ñ•”v‚ª +¬‡‚µ‚Ä“ü‚è‚Ü‚· + +typedef struct { + WORD wSector; /* ƒZƒNƒ^ID” */ + WORD wDiag; /* “ÁŽê ID” */ + char Reserv1[0x10-4]; /* —\”õ */ +}NFD_TRACK_ID1,*LP_NFD_TRACK_ID1; + +wSector‚É‚»‚̃gƒ‰ƒbƒN’†‚̃ZƒNƒ^”‚ðŠi”[‚µ‚Ü‚· +wDiag‚É‚»‚̃gƒ‰ƒbƒN’†‚Ì“ÁŽêƒf[ƒ^”‚ðŠi”[‚µ‚Ü‚· + +wSector‚Ì”•ªˆÈ‰º‚̃ZƒNƒ^î•ñƒwƒbƒ_‚ðŠi”[‚µ‚Ü‚· + +typedef struct { + BYTE C; /* C */ + BYTE H; /* H */ + BYTE R; /* R */ + BYTE N; /* N */ + BYTE flMFM; /* MFM(1)/FM(0) */ + BYTE flDDAM; /* DDAM(1)/DAM(0) */ + BYTE byStatus; /* READ DATA RESULT */ + BYTE bySTS0; /* ST0 */ + BYTE bySTS1; /* ST1 */ + BYTE bySTS2; /* ST2 */ + BYTE byRetry; /* RetryData‚È‚µ(0)‚ ‚è(1-) */ + BYTE byPDA; /* PDA */ + char Reserv1[0x10-12]; /* —\”õ */ +}NFD_SECT_ID1,*LP_NFD_SECT_ID1; + +CHRN‚É‚»‚̃ZƒNƒ^‚̃ZƒNƒ^ID‚ðŠi”[‚µ‚Ü‚· +byStatus‚ÉPC98x1‚Å‚»‚̃ZƒNƒ^‚ðINT 1Bh‚ÌREADDATA‚œǂ݂ƂÁ‚½‚Æ‚«‚ÌƒŠƒUƒ‹ƒg‚ð +Ši”[‚µ‚Ü‚· +bySTS0-2‚à“¯—l‚ÅFDC‚ÌST0-2‚ðŠi”[‚µ‚Ü‚· +byRetry‚Í•sˆÀ’èƒf[ƒ^‚ðŽ‚ÂƒZƒNƒ^‚Ìê‡Aƒf[ƒ^‚ð•¡”‰ñ“Ç‚ñ‚Å‹L‰¯‚·‚éê‡‚É +Žg—p‚µA—Ⴆ‚ÎbyRetry=8‚Ìê‡Aƒf[ƒ^‚ð9’ʂ莂‚±‚Æ‚ªo—ˆ‚Ü‚· +T98-Next‚ÍbyRetry‚ª0ˆÈŠO‚Ìê‡ƒŠƒgƒ‰ƒCƒf[ƒ^‚ð‡‚ÉŽg—p‚µ‚Ü‚· +byPDA‚͑Ήž‚·‚éƒfƒoƒCƒXƒAƒhƒŒƒX‚̉ºˆÊ‚Sƒrƒbƒg‚ð‚O‚É‚µ‚½’l‚ðŠi”[‚µ‚Ü‚· +byPDA‚ª‚O‚Ìê‡T98-Next‚̓ZƒNƒ^ƒTƒCƒY‚©‚烃fƒBƒA‚ðŽ©“®”»•Ê‚µ‚Ü‚· + +‚»‚ÌŒã‚ÉwDiag‚Ì”•ªA“ÁŽê“ǂݞ‚Ýî•ñƒwƒbƒ_‚ðŠi”[‚µ‚Ü‚· + +typedef struct { + BYTE Cmd; /* Command */ + BYTE C; /* C */ + BYTE H; /* H */ + BYTE R; /* R */ + BYTE N; /* N */ + BYTE byStatus; /* READ DATA RESULT */ + BYTE bySTS0; /* ST0 */ + BYTE bySTS1; /* ST1 */ + BYTE bySTS2; /* ST2 */ + BYTE byRetry; /* RetryData‚È‚µ(0)‚ ‚è(1-) */ + DWORD dwDataLen; + BYTE byPDA; /* PDA */ + char Reserv1[0x10-15]; /* —\”õ */ +}NFD_DIAG_ID1,*LP_NFD_DIAG_ID1; + +Cmd‚ɂ͓ÁŽê“ǂݞ‚Ý‚ðs‚¤ƒRƒ}ƒ“ƒh‚ðINT 1Bh‚ÌAH’l‚̉ºˆÊ4bit‚ÅŠi”[‚µ‚Ü‚· +READ DATA‚ɑ΂µ‚Ä“ÁŽê“ǂݞ‚Ý‚ð‹K’è‚·‚éꇂÍ06hAREAD DIAGNOSTIC‚Ìê‡02h“™ +CHRN‚ɂ͓ÁŽê“ǂݞ‚Ý‚ªŒÄ‚΂ê‚éۂ̃ZƒNƒ^ID‚ðŠi”[‚µ +byStatusAbySTS0-2‚Í“ÁŽê“ǂݞ‚ÝŒã‚̃Xƒe[ƒ^ƒX‚ðŠi”[‚µ‚Ü‚· +byRetry‚̓ZƒNƒ^ID“¯—l‚ÉŽg—p‚µ‚Ü‚· +dwDataLen‚Í“]‘—‚ðs‚¤ƒf[ƒ^ƒTƒCƒY‚ðŠi”[‚µ‚Ü‚· +byPDA‚͑Ήž‚·‚éƒfƒoƒCƒXƒAƒhƒŒƒX‚̉ºˆÊ‚Sƒrƒbƒg‚ð‚O‚É‚µ‚½’l‚ðŠi”[‚µ‚Ü‚· +byPDA‚ª‚O‚Ìê‡T98-Next‚̓ZƒNƒ^ƒTƒCƒY‚©‚烃fƒBƒA‚ðŽ©“®”»•Ê‚µ‚Ü‚· + +T98-Next‚Í“ÁŽê“ǂݞ‚݃f[ƒ^‚Ìî•ñ‚ðƒZƒNƒ^ID‚æ‚è—D悵‚ÄŽg—p‚µ‚Ü‚· +‚±‚Ìî•ñ‚ðŽg—p‚·‚邱‚Ƃɂæ‚Á‚ÄREADDIAGNOSTIC‚ł̓ǂÝo‚µŒ‹‰Ê‚ðŒÂ•ʂŎw’è +‚Å‚«‚½‚èo—ˆ‚邿‚¤‚ɂȂè‚Ü‚· + +‚±‚ê‚çNFD_TRACK_ID1ˆÈ‰º‚Ìî•ñ‚ðdwTrackHead‚ÅŽ¦‚³‚ꂽ‰ñ”•ªŒJ‚è•Ô‚µ‚Ü‚· + + +yƒf[ƒ^•”z + +ƒtƒ@ƒCƒ‹‚Ìæ“ª‚©‚çƒwƒbƒ_•”‚ÌdwHeadSizeƒoƒCƒgˆÈ~‚©‚çƒf[ƒ^•”‚ƂȂè‚Ü‚·B +ƒf[ƒ^•”‚̓wƒbƒ_‚ÉŠi”[‚³‚ꂽ‡‚Ƀf[ƒ^‚ð˜A‘±‚É”z’u‚µ‚Ü‚·B + +