UMSC Sample Software
CONTENTS
LINKS
Code | コマンド名 | コマンドの動作 | 備考 |
---|---|---|---|
12 | INQUIRY | ドライブに関する情報をホストに伝える | |
25 | READ CAPACITY | メディアのセクタに関する情報をホストに伝える | |
28 | READ(10) | 指定された読み出しセクタから、指定セクタ量のデータを読み出す | |
2A | WRITE(10) | 指定された書き込みセクタから、指定セクタ量のデータを書き込む | |
03 | REQUEST SENSE | 前のコマンドでエラーが発生した時どのようなエラーが発生したかをホストに伝える | |
1A | MODE SENSE(10) | ドライブの状態をホストに伝える | |
1E | PREVENT ALLOW MEDIUM REMOVAL | メディアの着脱を禁止/許可します | 常に正常終了する |
00 | TEST UNIT READY | メディアが使用可能か否かを調べる | 常に正常終了する |
2F | VERIFY(10) | メディア上のデータにアクセス可能を確かめる | 常に正常終了する |
/* set initial MBR partition table1 and EOF in sector 1 */ while (readCounter <= 65) { botDataGVar.byteVal[(readCounter + 446)] = mbrData->byteVal[readCounter]; readCounter++; } readCounter = 0; /* set initial PBR data in sector 20 */ while (readCounter <= 62) { botDataGVar.byteVal[(readCounter + 16384)] = pbrData->byteVal[readCounter]; readCounter++; }
typedef union MBRDataType { /* MBR */ unsigned char byteVal[532]; struct mbrMeaningType { unsigned char bsl[446]; unsigned char pt1[16]; unsigned char pt2[16]; unsigned char pt3[16]; unsigned char pt4[16]; unsigned char chknum[2]; } mbrMeaningType; } MBRDataType; typedef union PBRDataType { /* PBR */ unsigned char byteVal[62]; struct pbrMeaningType { unsigned char jump[3]; /*Jump command to IPL */ unsigned char dummy[8]; /*name */ unsigned char bytePerSector[2]; /*byte numbers per one sector*/ unsigned char sectorPerClaster; /*sector numbers per one claster*/ unsigned char reserveSectorNum[2]; /*reserved sector numbers */ unsigned char fat; /*FAT numbers */ unsigned char root[2]; /*entry numbers */ unsigned char allSector[2]; /*all sector numbers */ unsigned char mediaDiscripter; /*media descriptor */ unsigned char sectorPerFat[2]; /*sector numbers per one FAT*/ unsigned char sectorPerTrak[2]; /*sector numbers per one track*/ unsigned char head[2]; /*head numbers */ unsigned char hideSector[4]; /*hide sector numbers */ unsigned char allSectorLarge[4]; /*hide sector numbers */ unsigned char dummy2[18]; unsigned char reserve[8]; } pbrMeaningType; } PBRDataType;
/* MBR partition table 1 and EOF */ const MBRDataType mbrData[] = { 0x80,0x00,0x00,0x00,PARTITION_TYPE 0x00,0x00,0x00,0x20,0x00,0x00,0x00,PARTITION_ALL_SECTORS /*Prt1*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*Prt2 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*Prt3 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /*Prt4 */ 0x55,0xAA /*EOF*/ }; /* PBR */ const PBRDataType pbrData[] = { 0xEB,0x3C,0x90, 0x29,0x7B,0x27,0x60,0x6A,0x49,0x48,0x43, 0x00,0x02, FAT_SECTORS_PER_CLUSTER // 1 Byte 0x01,0x00, 0x02, FAT_ROOT_ENTRIES // 2 Byte FAT_ALL_SECTORS_SMALL // 2 Byte 0xF8, FAT_SECTORS_PER_FAT // 2 Byte 0x3F,0x00, 0xFF,0x00, 0x20,0x00,0x00,0x00, FAT_ALL_SECTORS_LARGE // 4 Byte 0x80, 0x00, 0x29, 0x00,0x00,0x00,0x00, FAT_VOLUME_LABEL // 11 Byte FAT_SYSTEM_ID // 8 Byte 0x00,0x00 };