²{¦b¤@ÁûµwºÐ®e¶q´X¥G³£¦b 80G ¥H¤W¡A³o»ò¤jªºµwºÐºÞ²z¤W¬O¤£¤Ó®e©ö¡C¤p¤ì°¸²ßºD¤W¬O§â¥L¤À¦¨¦n´XÓ¤À³Î¡A¦A¸Ë¤J¦n´XºØ§@·~¨t²Î¡A¦p DOS 6.20¡BWindows 98 SE¡BWindows XP¡BMandrake Linux ¨Ï¥Î¡C´¿¸g¦³¤@«×¡A¤]¦w¸Ë¹L OS/2 Warp T 3.0 ¨Ï¥Î¹L¡A¥i±¤¦]³nÅé¤Ó¤Ö¡A©Ò¥HµL©`¦a¦A«×¨Ï¥Î Windows §@·~¨t²Î¡C
¨CÓµwºÐ³Ì¦h¥i¥H¤À³Î¦¨¤TÓ¥Dn¤À³Î ( primary partition ) ¤Î¤@ÓÂX¥R¤À³Î ( extended partition )¡A¦ÓÂX¥R¤À³ÎÁÙ¥i¥H¦A¤À¦¨¼ÆÓÅÞ¿èµwºÐ¡C¥H DOS/Windows 9x/Me ªºÆ[ÂI¨Ó¬Ý¡A¨CÓ¥Dn¤À³Î´N¬O¤@ÓÅÞ¿èµwºÐ¡A¦A¥[¤WÂX¥R¤À³Î¤ºªºÅÞ¿èµwºÐ¡A³o¨ÇÅÞ¿èµwºÐ´N¬O±z¦b DOS/Windows ©Ò¬Ý¨£ªº C:¡BD:¡BE:¡K¡Kµ¥³o¨ÇµwºÐ¾÷¦WºÙ¡C
¨Ò¦p±z§âèè¶R¨ÓªºµwºÐ¸Ë¦b¹q¸£¤W¡A¥H Windows 98 SE ¶}¾÷¥úºÐ¶}¾÷¡A°õ¦æ FDISK «á¡A¥²©w·|¥ýn¨D«Ø¥ß¤@Ó¥Dn¤À³Î¡A¦pªG±zªº¥Dn¤À³Î¨Ã¤£¦û¦³©Ò¦³ªºµwºÐ®e¶q¡AFDISK ·|«Øij±z«Ø¥ßÂX¥R¤À³Î¡A«ÝÂX¥R¤À³Î«Ø¥ß¦n«á¡A·|¦An¨D±z«Ø¥ßÅÞ¿èµwºÐ ( ¦bÂX¥R¤À³ÎùتºÅÞ¿èµwºÐ¤]ºÙ¬°ÅÞ¿è¤À³Î )¡A¦pªG±z«Ø¥ß¦n¨âÓÅÞ¿èµwºÐ¡A¨º»ò±z´N¦³¤TÓÅÞ¿èµwºÐ¾÷¡A¦b¥Dn¤À³Îªº¬O C:¡A¥t¥~¨âÓ´N¬O¦bÂX¥R¤À³Îªº¨âÓÅÞ¿èµwºÐ¡A¤À§O¬O D:¡BE:¡C¦]¦¹±zÁöµM¥u¶R¤F¤@Áû¹êÅéµwºÐ¡A¦ý±z«o¦³ C:¡BD:¡BE: ¤TÓÅÞ¿èµwºÐ¡A
¤£¹L¥Î·L³nªº¤À³Î¤u¨ã¡A¦ü¥G¥u¯à«Ø¥ß¤@Ó¥Dn¤À³Î¡A³o¥i¯à¬O·L³n°Ó·~¤Wªº¦Ò¼{¡A©Ò¥H¥u¦³ÂǧU¨ä¥Lªº³nÅé¡A¨Ò¦p SPFDISK¡BOS/2 ªº±Ò°ÊºÞ²z©Î Linux ªº¤À³Î¤u¨ã¡A¤~¥i¥H«Ø¥ß¦hÓ¥Dn¤À³Î¡C¥»³¹¤Î¤U¤@³¹±Nn¤¶²Ð³o¨Ç¤À³Î°Ï»PÅÞ¿èµwºÐ¦b¹êÅéµwºÐ¤W¦p¦ó¦w±Æ¡C¥»³¹¥ý¤¶²ÐµwºÐªººc³y ( ¥]§t´X¦óµ²ºc»P LBA ÅÞ¿èºÏ°Ï )¡A¨Ã¹ê§@¤@ÓµwºÐºÏ°ÏÆ[¹îµ{¦¡¡A¥¦¥i¥HÆ[¬ÝµwºÐªº¨C¤@³¡¥÷¡A¤U¤@³¹¦A¤¶²Ð FAT Àɮרt²Î¡C
¤@ÁûµwºÐªº¥~Æ[«nªº¤¸¥ó¦³¹q·½´¡®y¡BIDE ±Æ½u¡B¸õ°w ( jumper¡A³]©w MASTER ©Î SLAVE )¡A¥H¤Î¤@¤ù¥]§t±K±K³Â³Â¹q¤l¤¸¥óªº¹q¸ôªO¡At³d±±¨îµwºÐ¹B§@¡C¦ÓÀx¦s¸ê®Æªº¦a¤è«h¬O¦bµwºÐ¤º³¡ªº¼Æ¤ù§t¦³ºÏ©Êª«½èªºª÷Äݶê§ÎªO¤W¡A³o¨Çª÷Äݶê§ÎªOºÙ¬°ºÏ½L ( platters )¡A¥¦Ì¬O¥Hª÷ÄݦXª÷©Î¨ä¥L°íµwª«½è©Ò»s¦¨ªº°òªO¡A¤W±¶î¤WºÏ©Êª«½è¥Î¥HÀx¦s¸ê®Æ¡C¼Æ¤ùºÏ½L¥H¤@ÓºÙ¬°¥D©Ó¶bªº¶b¤ß¡A¦w¸Ë©ó¤@Ó±K³¬µL¹Ð«Ç¤º¡A¥D©Ó¶b¤W³s±µ¹q°Ê¾÷¡A¥H°ª³t±a°ÊºÏ½L±ÛÂà¡C¤@¯ë¤@ӺϽL¦³¥¿¤Ï¨â±¡A¦U¦³¤@ÓºÏÀYt³dŪ¼g¡A¦Ü©ónŪ¼gºÏ½L¨ºÓ³¡¥÷¡A«h¬O¥ÑºÏÀY¶Ç°Ê²Õ¤ÎºÏ½LÂà°Ê¨ì¨ºùبM©w¡C½Ð°Ñ¾\¤U¹Ï¤¤ªº¤U¥b¹Ï¡G
¤@ӺϽL¥i¤À¬°¥¿¤Ï¨â±¡A¨C¤@±¤À¦¨³\¦h¤j¤j¤p¤pªº¦P¤ß¶ê¡A¨CÓ¦P¤ß¶ê³£ºÙ¬°¡yºÏy¡z( track )¡A¨CÓºÏy¤S¥i¤À¦¨³\¦h¤pªº©·§Î°Ï°ì¡AºÙ¬°¡yºÏ°Ï¡z( sector )¡C½Ð°Ñ¦Ò¹Ï¤¤¼Ð¦³¡y01(00)¡z¡B¡y02(01)¡z¡B¡y03(02)¡z¡K¡K¡y3F(3E)¡zµ¥¤Q¤»¶i¦ì¼Æ¦rªº©·§Î°Ï°ì¡A´N¬OºÏ°Ï¡A³o¨Ç¼Æ¦rªí¥ÜºÏ°Ï½s¸¹¡AºÏ°Ï½s¸¹¥Ñ¤@¶}©l¡A³o¸ò¤@¯ë¹q¸£ªº²ßºD¤£¦P¡C¦Ó¥Ñ¡y01¡z¡B¡y02¡z¡B¡y03¡z¡K¨ì¡y3F¡zµ¥ºÏ°Ï©Ò²Õ¦¨ªº¤@Ó¶ê¡A§Y¬°¤@ÓºÏy¡AºÏy¥Ñ³Ì¥~±¡A¤]´N¬O¥b®|³Ì¤jªººÏy¶}©l½s¸¹¡A©Ò¥H¥Ñ¡y01¡z¡B¡y02¡z¡B¡y03¡z¡K¨ì¡y3F¡zºÏ°Ï©Ò²Õ¦¨ªººÏyºÙ¬°²Ä¹sy¡C¤£¦PµwºÐªº¤@ÓºÏy©Ò§tªººÏ°Ï¼Æ¤£¦P¡A¨C¤@±ªººÏy¼Æ¤]¤£¬Û¦P¡A¤W±¥u¬OÁ|Ó¨Ò¤l¤è«K»¡©ú¦Ó¤w¡C¾¨ºÞ¨CÓµwºÐºÏ°Ï¡BºÏy¼Æ¦³¦h¦³¤Ö¡A¦ý¬O³£¬O±q³Ì¥~°éºÏyªº²Ä¤@¸¹ºÏ°Ï¶}©l°O¿ý¸ê®Æªº¡C
() ¤ººñ¦âªº¼ÆȬO¥t¤@ºØ¤è¦¡ªººÏ°Ï½s¸¹¡A¦¹ºØ½s¸¹¤è¦¡ºÙ¬° LBA ÅÞ¿èºÏ°Ï½s¸¹¡C¥¦¬O¥Ñ¹s¶}©l¤@ª½¨ì³Ì¤jºÏ°Ï¡A¤£¤ÀºÏy¡BºÏ±¡C
¤@¯ë¦Ó¨¥¡AµwºÐ¤j¬ù¥Ñ¨âөΨâÓ¥H¤WªººÏ½L²Õ¦¨¡A·í¬Y¤@±ªº¬YÓºÏy¤w°O¿ýº¡¸ê®Æ«á¡AÁÙ¦³·s¸ê®Æn¼g¤J®É¡A«o¤£¬O¼g¤J¦P¤@±ªº¤U¤@Ó¤º°éºÏy¡A¦Ó¬O¤U¤@±ªº¬Û¹ïÀ³ªººÏy¤W¡C¨Ò¦p¤W¹Ï¤¤²Ä¹sy²Ä¹s± ( ¤]´N¬O½s¸¹ 01¡ã3F ©Î LBA 00¡ã3E ºÏ°Ï©Ò²Õ¦¨ªººÏy ) ¤w¼gº¡¸ê®Æ«á¡AY¦³·s¸ê®Æ®É¡A¬O¼g¦b¨äI±ªººÏy¤W¡A§Y²Ä¹sy²Ä¤@±ªººÏ°Ï¤W¡A¤]´N¬O LBA ½s¸¹ 3F¡ã7D ªººÏ°Ï¤W ( ¦]¬°¦bI±¡A©Ò¥H¹Ï¤¤¨Ã¥¼ªí¥Ü¥X¨Ó )¡C¦P¼Ë¦a¡AY¬O³o¤@y¤]¤w¼gº¡¡A¨º»ò´N·|¼g¦b¤U¤@±iºÏ½Lªº¬Û¹ï¦ì¸m¤W¡A¤]´N¬O²Ä¹sy²Ä¤G±ªººÏ°Ï¤W ( LBA ½s¸¹ BD¡ãFB ©Ò²Õ¦¨ªººÏy¤W )¡C´N³o¼Ë¡A¨C¤@±ºÏ½L¤WªººÏy¥Ñ¤W©¹¤U¡A§Î¦¨³\¦h¥b®|¤j¤p¤£µ¥ªº°²·QªÅ¤ß¶ê¬W¡AºÙ¬°ºÏ¬W ( cylinder )¡A±z¥i¥H·Q¹³ºÏ¬W¬O³\¦hºÏyÅ|¦b¤@°_ªº°²·Q¶ê¬W¡A´N¹³¹Ï¤¤ªº¤W¥b¹Ï¡C
±z¤]³\·|°Ý¡G¡y¬°¤°»òn³o¼Ë¦w±Æ¡H¬°¦ó¤£¤@±¼g§¹¦A´«¥t¤@±©O¡H¡z¦]¬°¦pªG³o¼Ë¦w±Æªº¸Ü¡AÅܦ¨¤@ÓºÏy¼g§¹´N±oªá®É¶¡²¾°ÊºÏÀY¨ì¹j¾Àªº¤º°éºÏy¡A¦ÓºÏÀYªº²¾°Ê±o¾a¨B¶i¹q°Ê¾÷ªº¾÷±ñ²¾°Ê¡Anªá¸û¦hªº®É¶¡¡A©Ò¥H¤~³]p¦¨¨CºÏ¬W¼g§¹¡A¤~²¾¨ì¤U¤@ºÏ¬W¡C
©ó¬O§ÚÌ¥i¥H»¡¡AµwºÐŪ¼g®É¡A¥HºÏ¬W ( cylinder )¡BºÏÀY ( head )¡BºÏ°Ï ( sector ) ³o¤TӰѼƨӪí¥Ü©ÒŪ¼gªº¸ê®Æ¦ì©óµwºÐªº¨º¤@Ó¦ì¸m¡C³o´N¬O¦³¦Wªº C¡BH¡BS ªí¥Üªk¡C¤p¤ì°¸¾ã²z¦p¤U¡GºÏ¬W¥Ñ³Ì¥~±¶}©l¡A¥Ñ¹s¶}©l½s¸¹¤@ª½¨ì³Ì¤jºÏ¬W¡C¨CӺϬW¦A¤À¬°¦n´XÓºÏÀY¡A¦]¬°ºÏ½L¨C¤@±³£¦³¤@ÓºÏÀYt³dŪ¼g¡A©Ò¥H¥HºÏÀY¼Æ¥Nªí±¡AºÏÀY¤]¬O±q¹s¶}©l½s¸¹¡CºÏ¬W¤Wªº¨C¤@±¦A²Ó¤À¦¨¼ÆӺϰϡAºÏ°Ï¬O±q¤@¶}©l½s¸¹¡A³oÂI«Ü©_©Ç¡A»P¹q¸£¤Wªº²ßºD¤£¦P¡C¨CӺϰϳ£¥i¦s¤J 512 Ӧ줸²Õªº¸ê®Æ¡A³oÂI«o¬O¨CÁûµwºÐ³£¬O¦p¦¹¡C
¦Ó¦³¥t¤@ºØ½s¸¹¤è¦¡¡AºÙ¤§¬° LBA ÅÞ¿è½s¸¹¡AY¥H¦¹¤è¦¡½s¸¹¡A«h¬O¥HºÏ°Ï¬°³æ¦ì¡A¤£¤ÀºÏ¬W¡BºÏÀY¡A¦Ó¥Ñ 0 ¶}©l¡A¨Ì§Ç¥Ñ 0¡B1¡B2¡B3¡K¡K¤@ª½¨ì³Ì¤jºÏ°Ï¬°¤î¡CLBA ½s¸¹»P CHS ¤§¶¡ªº´«ºâ¡A¤U±·|´£¨ì¡C
©³¤Un¤¶²Ð§@·~¨t²Î¦p¦ó¨Ï¥ÎµwºÐ¡Cèè¶R¨ÓªºµwºÐ¥²©wn¸g¹L¤À³Î¡B®æ¦¡¤Æ¤§«á¤~¯à¦s©ñ¸ê®Æ¡C¦Ó³o¤À³Î«áªº¸ê®Æ°O¸üµÛ¨CÓ¤À³Î°Ï¤j¤p¡B¥Ñ¨ºÓºÏ¬W¨ì¨ºÓºÏ¬W¡A³£°O¿ý¦b¤@ÓºÙ¬°¤À³Îªí ( partition table )ªº¦a¤è¡A±z¥i¥H·Q¹³¤À³Îªí¬O«Ü«nªº¸ê®Æ¡A¦pªG·lÃa¤F¡A¤j·§´N§ä¤£µÛ±znªº¸ê®Æ¤F¡C³o»ò«nªº¸ê®Æ¡A¹q¸£·~¬É³W©w³£¦s©ñ©óµwºÐªº²Ä¹sºÏ¬W¡B²Ä¹sºÏÀY¡B²Ä¤@ºÏ°Ï¡A¤]´N¬O³Ì«e±ªººÏ°ÏùØ¡A³oӺϰϺ٬°¥D±Ò°Ê°O¿ý ( §Y MBR¡Amaster boot record )¡C¦b MBR ùØ°£¤F¤À³Îªí¥~¡AÁÙ¦³±Ò°Êµ{¦¡¡C«e±´£¹L¡A¨CӺϰϳ£¦û 512 Ӧ줸²Õ¡AMBR ºÏ°Ï¤¤ªº«e 446 Ӧ줸²Õ ( 0¡ã445 ) ¥Î¨Ó¦s©ñ±Ò°Ê¸ê®Æ»Pµ{¦¡¡A¦Ó±µ¤U¨Óªº 64 Ӧ줸²Õ´N¬O¤À³Îªí¡A³Ì«á¤@Ó¦r²Õ ( 2 Ӧ줸²Õ ) ¬O AA55H¡A§@¬°ÃѧO¤§¥Î¡C
¤À³Îªí¦@¦³ 64 Ӧ줸²Õ¡A«ê¦n¥i¥H´yz¥|Ó¤À³Î°Ïªº©Ê½è ( §Y¤TÓ¥Dn¤À³Î»P¤@ÓÂX¥R¤À³Î )¡A©Ò¥H¨CÓ¤À³Î¥Î 16 Ӧ줸²Õ¨Óªí¥Ü³oÓ¤À³Î°Ïªº©Ê½è¡A»¡©ú¦p¤U¡G
°¾²¾¦ì§} | ¤j¤p ( ¦ì¤¸²Õ ) |
¦W¡@¡@ºÙ | »¡¡@¡@©ú | ||||
00H | 1 | ±Ò°Êª¬ºA | 80H ªí¥Ü¥i±Ò°Ê 00H ªí¥Ü¤£¥i±Ò°Ê | ||||
01H | 1 | °_©lºÏÀY | ¡@ | ||||
02H | 2 | °_©lºÏ¬W»P °_©lºÏ°Ï¡@ |
°_©lºÏ°Ï¦û¥Î 6 Ӧ줸¡A¦Ó°_©lºÏ¬W¦û¥Î 10 Ӧ줸¡A¤À°t±¡§Î¬O¡G
| ||||
04H | 1 | Àɮרt²Î | 06H¡B0EH¡GFAT16 0BH¡B0CH¡GFAT32 05H¡B0FH¡GÂX¥R¤À³Î 07H¡GNTFS ©Î OS/2 HPFS ¨ä¾l°Ñ¾\Andries Brouwer ©Ò¼gªº Partition types | ||||
05H | 1 | µ²§ôºÏÀY | ¡@ | ||||
06H | 2 | µ²§ôºÏ¬W »PºÏ°Ï¡@ |
¦P°_©lºÏ¬W»PºÏ°Ï | ||||
08H | 4 | ¤À³Î°Ï¬Û ¹ï¦ì¸m¡@ |
¶ZÂ÷ MBR ªººÏ°Ï¼Æ¡A¥ç§Y¦¹¤À³Î¶}©lªº LBA ºÏ°Ï½s¸¹©ÎÁôÂÃºÏ°Ï¼Æ | ||||
0CH | 4 | ºÏ°Ï¼Æ | ¸Ó¤À³ÎºÏ°ÏÁ`¼Æ |
¬Y¨ÇÀɮרt²Î¡A¥Î¨âÓÃѧO½X¨Óªí¥Ü¡A¨Ò¦p 0BH¡B0CH ³£¬Oªí¥Ü FAT32¡A06H¡B0EH ³£ªí¥Ü FAT16¡A05H¡B0FH ³£ªí¥ÜÂX¥R¤À³Î¡A³o¬O²o¯A¨ìµwºÐ®e¶qªºÃö«Y¡C¦´ÁµwºÐ®e¶q¸û¤p¡A¥Î C¡BH¡BS ¨Ó©w§}ºÏ°Ï¨S¦³°ÝÃD¡A¦ý¬O·íµwºÐ®e¶q¶W¹L 8.4G ®É¡A´N¥²¶·¥Î LBA ©w§}ºÏ°Ï¡C0BH¡B06H¡B05H ¤À§Oªí¥Ü FAT32¡BFAT16¡BÂX¥R¤À³Îªº C¡BH¡BS ª©¡F¦Ó 0CH¡B0EH¡B0FH «hªí¥Ü¥Î LBA ©w§}ºÏ°Ï¡C( °Ñ¦Ò«á±ªº©µ¦ù INT 13H )
·í¥Î LBA ©w§}ºÏ°Ï®É¡A¤À³Îªí¤ºªº°_©l©Îµ²§ôºÏ¬W¡BºÏÀY¡BºÏ°Ï´N¨S¦³¥Î¤F¡A¥²¶·°Ñ¦Ò¤À³Î°Ï¬Û¹ï¦ì¸m¨º¤@Ä檺¼ÆÈ¡A¤~¯à§ä¨ì¯u¥¿ºÏ°Ï¡C
ÂX¥R¤À³Î¤º¥i¥H¤À¦¨³\¦hÅÞ¿èµwºÐ¡AºÝµøµwºÐ®e¶qªº¤j¤p¡A©Ò¥HµLªk¥Î©T©wªºªø«×°O¿ý¦UÓÅÞ¿èµwºÐªº°_©l¦ì¸m©Î¤j¤pµ¥µ¥¡A¦]¦¹¹q¸£·~¬Éªº°µªk¬O¥Î¼ÆÓºÙ¬°ÂX¥R¤À³Îªí ( extended partition table ) ªºªí®æ°O¿ý³o¨Ç¸ê®Æ¡C
ÂX¥R¤À³Î¤ºªº²Ä¤@ӺϰϤº§t²Ä¤@ÓÂX¥R¤À³Îªí¡A¦oªº®æ¦¡¤£¶È©M¤À³Îªí¬Û¦ü¡A¦Ó¥B¤]³£¬O¦s©ñ¦b±q¸ÓºÏ°Ïªº²Ä 446 Ӧ줸²Õ¶}©l¡A©¹«áºâ¡AÁ`¦@ 64 Ӧ줸²Õªº¸ê®ÆùØ¡C¦P¼Ë¤]¤À¦¨¥|µ¥¤À¡A¦ý¬O¥u¥Î¨ì«e±¨â¥÷¡A«á±¨â¥÷§¡¶ñ¤J¹s¡C²Ä¤@Ó 16 ¦ì¤¸²Õùر©Ò°O¸üªº¸ê®Æ¬O«ü³oÓÅÞ¿èµwºÐªº¸ê®Æ¡A¦Ó¥¦ªº°_©lºÏ¬W¡BºÏÀY¡BºÏ°Ï¡Aµ²§ôºÏ¬W¡BºÏÀY¡BºÏ°Ï©Î¬O¤À³Î°Ï¬Û¹ï¦ì¸m³£¬O¬Û¹ï©óÂX¥R¤À³Îªí©Ò¦b¦ì¸m¡A¨Ã«D¹êÅéµwºÐªº MBR¡C²Ä¤GÓ 16 ¦ì¤¸²ÕùØ©Ò°O¸üªº¸ê®Æ«h¬O«ü¤U¤@ÓÂX¥R¤À³Îªíªº¸ê®Æ¡A¦P¼Ëªº¡A¨ä°_©lºÏ¬W¡BºÏÀY¡BºÏ°Ï¡Aµ²§ôºÏ¬W¡BºÏÀY¡BºÏ°Ï©Î¬O¤À³Î°Ï¬Û¹ï¦ì¸m¤]³£¬O¬Û¹ï©ó«e¤@ÓÂX¥R¤À³Îªí©Ò¦b¦ì¸m¡C
¹³³o¼Ë¡A´N§Î¦¨¤@ÓÃ쪬ªºÂX¥R¤À³Îªí¡A¨CÓÂX¥R¤À³Îªíªº²Ä¤@Ó 16 ¦ì¤¸²Õªí¥Ü³oÓÅÞ¿èµwºÐªº¸ê®Æ¡A¦Ó²Ä¤GÓ 16 ¦ì¤¸²Õ«hªí¥Ü¤U¤@ÓÂX¥R¤À³Îªíªº¸ê®Æ¡C¦ý¬O¡A¦pªG¬O³Ì«á¤@ÓÅÞ¿èµwºÐªº¸Ü¡A¨º»ò¥u¥Î¨ì¤@¥÷¡A«á±¤T¥÷§¡¶ñ¤J¹s¡A¦]¦¹¥un¬O²Ä¤G¥÷¥þ³¡¬°¹s¡A¨t²Î´Nª¾¹D¤w¸g¬O³Ì«á¤@ÓÅÞ¿èµwºÐ¤F¡C
INT 13H ¬O BIOS ´£¨ÑªºªA°Èµ{¦¡¡A¥¦¬O¥Î¨Ó´£¨Ñ³nºÐ¡BµwºÐªA°È¤§¥Î¡A¨Ò¦p®æ¦¡¤Æ¡BŪ¨úµ¥µ¥¡K¡A¦´Á¤]¦³³\¦h¤H§Q¥Î INT 13H ®æ¦¡¤Æ¤£¥¿±`ºÏ°Ï/ºÏy¹F¨ì«OÅ@ªº¥Øªº¡C
¦´ÁµwºÐ¤£¤j¡A¬O¥H AH=02/INT 13H Ū¨úµwºÐ¤WºÏ°Ïªº¸ê®Æ¡CAL ªí¥Ü·QnŪ¨úªººÏ°Ï¼Æ¡A¤£¥i¬°¹s¡CDL ªí¥Ü·QnŪ¨úªºµwºÐ¾÷¦WºÙ¡A¦pªG¬O³nºÐ¡A0 ªí¥Ü A:¡A1 ªí¥Ü B:¡F¦pªG¬OµwºÐ¡A«h¥Î 80H ¥Nªí²Ä¤@Ó¹êÅéµwºÐ¡A81H ¥Nªí²Ä¤GÓ¹êÅéµwºÐ¡CES:BX «ü¦VŪ¨ú«áªº¸ê®Æ¦s©ó°O¾ÐÅé¦ó³B¡CDH ¬O«ü©ÒnŪ¨úªººÏÀY½s¸¹¡ACX ªí¥ÜºÏ¬W¤ÎºÏ°Ï½s¸¹¡ACL ¸û§Cªº 6 Ӧ줸¡A§Y 0¡ã5 ¦ì¤¸¡Aªí¥Ü©ÒnŪ¨úªººÏ°Ï½s¸¹¡A¦Ó¸û°ªªº¨âӦ줸¥H¤Î CH ªº¤KӦ줸¡A¦X°_¨Ó¦@ 10 Ӧ줸ªí¥ÜºÏ¬W½s¸¹ ( CH ªº¤KӦ줸¬OºÏ¬W½s¸¹ªº¸û§C¦ì¤¸¡ACL ªº 6¡B7 ¨âӦ줸¬OºÏ¬W½s¸¹ªº¸û°ª¦ì¤¸ )¡C½Ð°Ñ¦Ò¤U¹Ï¡G
¥Ñ¤W¹Ï¥iª¾¡A¥Î 10 Ӧ줸ªí¥ÜºÏ¬W½s¸¹¡A³Ì¦h¥i¥H¦³ 1024 ºØ½s¸¹ ( 210=1024 )¡A¨CÓ½s¸¹¥Nªí¤@ºÏ¬W¡A³o½s¸¹¥Ñ 0¡ã1023 ¦@ 1024 ӺϬW¡C¦P²z¡AºÏÀY³Ì¦h¥i¥H¦³ 0¡ã127 ¦@ 128 ºØ¡F¦ÓºÏ°Ï¨Ï¥Î 6 Ӧ줸¡A©Ò¥H¦³ 64 ºØ¿ï¾Ü¡A§Y 0¡ã63¡A¦ý¬OºÏ°Ï³£¥Ñ½s¸¹¤@¶}©l¡A©Ò¥HºÏ°Ï³Ì¦h¥u¦³ 1¡ã63 Ó¡A§Y 63 ӺϰϡCºî¦X¥H¤W»¡©ú¡JºÏ¬W³Ì¦h¬° 1024 Ó¡AºÏÀY³Ì¦h¬° 256 Ó¡AºÏ°Ï³Ì¦h¬° 63 Ó¡A¦Ó¨CºÏ°Ï³£©T©w¦³ 512 Ӧ줸²Õ¡A¦]¦¹¤@ÁûµwºÐ³Ì¦h¥u¯à®e¯Ç¡J
1024*256*63*512=8455716864
Ӧ줸²Õ¡A¥ç§Y 8.4 GB ( 8.4GB ¬O¥H 1G=109¨Óºâ¡A°²¦p¨Ì¹q¸£¤G¶i¦ìºâªk¡AÀ³¸Ó¬O 8455716864¡Ò1024¡Ò1024¡Ò1024=8¡A§Y 8GB )¡C·íµM¨ì¤F²{¦b ( ¥Á°ê 92 ¦~¥ª¥k¤§«á ) µwºÐ¤w¸g¶W¹L¦¹®e¶q¤F¡A©Ò¥H IBM »P·L³n¦@¦P»s©w·sªº INT 13H Extension ¤¤Â_ªA°Èµ{¦¡ ( ©µ¦ù INT 13H )¡A¥H¸Ñ¨M¦¹¤@°ÝÃD¡C
³oÓ·sªº©µ¦ù INT 13H §ï¥Î LBA ÅÞ¿è©w§}ªk ( Logical Block Addressing )¡A¤£¦A¥Î CHS °Ñ¼Æ¨Ó«ü©wŪ¨úªººÏ°Ï¡A¦Ó¥Î½u©ÊºÏ°Ï½s¸¹«ü©wºÏ°Ï¡Cªº INT 13H ¸ê®Æ¬Æ¦h¥B¤w¹L®É¡A©Ò¥H¤p¤ì°¸´N¤£°µ¤¶²Ð¡A¦¹³¹¬°¤F°t¦X¤jµwºÐ¡A©Ò¥H¤¶²Ð¤F©µ¦ù INT 13H ªº´XÓ¥\¯à¡A¨ä¾l¥i¬d¾\ Ralf Brown's Interrupt List¡C
º¥ýn¤¶²Ðªº¬OÀˬd BIOS ¬O§_¤ä´©©µ¦ù INT 13H¡A©I¥s«e AH=41H¡ABX=55AAH ªí¥ÜÀˬd¬O§_¤ä´©©µ¦ù INT 13H¡ADL ªí¥ÜµwºÐ¾÷½s¸¹¡A80H ªí¥Ü²Ä¤@³¡¹êÅéµwºÐ¾÷¡A81H ªí¥Ü²Ä¤G³¡¹êÅéµwºÐ¾÷¡Cªð¦^®É¡AY¶i¦ìºX¼Ð³Q³]©w¡Aªí¥Ü¤£¤ä´©¡FY¶i¦ìºX¼Ð³Q²M°£¡Aªí¥Ü¤ä´©©µ¦ù INT 13H¡AAH ÁÙªí¥Ü©µ¦ù INT 13H ªºª©¥»¡C
·í AH=42H ®Éªº¥\¯à¬O©µ¦ùŪ¨ú¡A¨Ï¥Î¦¹¥\¯à®É¡ADL ¬OµwºÐ½s¸¹¡A©M¤W±¤@¼Ë¡A±q 80H ¶}©l¡ADS:DI «ü¦V¤@ÓºÙ¬° disk address packet ªºµ²ºcÅé¡A¦¹µ²ºcÅ餺®e¬°¡J
disk_address_packet STRUC size_of_packet db ? ;¦¹µ²ºcÅé¤j¤p reserved db ? ;«O¯d¡A¥²³]¬° 0 number_of_block dw ? ;nŪ¨úªººÏ°Ï¼Æ buffer_offset dw ? ;Ū¨úºÏ°Ï«á¡A¸ê®Æ¦s©ñ°¾²¾¦ì§} buffer_segment dw ? ;¸ê®Æ¦s©ñªº¬q¦ì§} LBA_number dq ? ;«ü©wnŪ¨úªººÏ°Ï½s¸¹ flat_address dq ? ;«ü©w¥©Z¼Ò¦¡®É¡A¦s©ñ¦ì§} disk_address_packet ENDS
¦b©I¥s AH=42H ¥\¯à¤§«e¡A¥²¶·¥ý³]©w¦n disk address packet µ²ºcÅ餺ªº¦UÓÄæ¦ì¡Csize_of_packet Äæ¦ì¬Oµ²ºcÅé¤j¤p¡A¨ä¼ÆȤ£¬O 10H ´N¬O 18H¡AºÝµø buffer_offset¡Bbuffer_segment ¬O§_¥i¥Î¡C¦b 16 ¦ì¤¸§@·~¨t²Î¤¤³o¨âÓÄæ¦ì´N¬O¤@¯ë©ÒºD¥Îªº Segment:Offset ©w§}¤è¦¡¡A¦¹®É¤£¶·¥Î¨ì³Ì«á¤@ÓÄæ¦ì¡A©Ò¥H size_of_packet ¬° 10H Ӧ줸²Õ¡F¦ý¦pªG¦b¥©Z¼Ò¦¡¤§¤U¨Ï¥Î¡A«h buffer_offset¡Bbuffer_segment ³o¨âÓÄæ¦ì³£¬O 0FFFFH¡A¦Ó¦¹®É¦ì§}¶·¶ñ¤J³Ì«á¤@Ä檺 flat_address ¤º¡A¬G size_of_packet ¬° 18H Ӧ줸²Õ¡CLBA_number «h¬OnŪ¨úªººÏ°Ï½s¸¹¡A³oӺϰϽs¸¹¤]´N¬O LBA ÅÞ¿èºÏ°Ï½s¸¹¡A±q 0 ¶}©l¤@ª½¨ìµwºÐªº³Ì¤jºÏ°Ï¡A¨äpºâ¤è¦¡¬°
( ºÏ¬W½s¸¹*¨CºÏ¬WªººÏÀY¼Æ ¡Ï ºÏÀY½s¸¹ ) * ¨CyºÏ°Ï¼Æ ¡Ï ºÏ°Ï½s¸¹ ¡Ð 1
¦pªGªð¦^®É¡AY¶i¦ìºX¼Ð³Q²M°£¡Aªí¥ÜŪ¨ú¦¨¥\¡FY¶i¦ìºX¼Ð³Q³]©w¡Aªí¥ÜŪ¨ú¿ù»~¡A¦¹®É disk_address_packet µ²ºcÅ骺 number_of_block ·|³Q BIOS ³]©w¬°¹ê»ÚŪ¨úªººÏ°Ï¼Æ¡C
n¨ú±o¤@Áû¹êÅéµwºÐªº¸ê®Æ°Ñ¼Æ¡A¥i¥Î AH=48H ¥\¯à¡ADL ªí¥Ün¨ú±o¸ê®ÆªºµwºÐ½s¸¹¡ADS:SI «ü¦V¨ú±o¸ê®Æ«áªº¸ê®Æ¶ñ©ñ¦ì§}¡A¦¹¦ì§}¦s©ñ¤@ÓºÙ¬° drive parameter ªºµ²ºcÅé¡Cdrive_parameter µ²ºcÅéÄæ¦ì¦p¤U¡G
drive_parameter STRUC size_of_drive_parameter dw ? ;drive parameter ¤j¤p information_flags dw ? ; cylinder dd ? ;ºÏ¬WÁ`¼Æ head dd ? ;ºÏÀY¼Æ sector_per_track dd ? ;¨CyºÏ°Ï¼Æ total_sectors dq ? ;ºÏ°ÏÁ`¼Æ byte_per_sector dw ? ;¨CºÏ°Ï©Ò§t¦ì¤¸²Õ¼Æ drive_parameter ENDS
¦b©I¥s AH=48H ¥\¯à¤§«e¡A°£¤F¥²¶·¥ý«ü©w DL¡BDS:SI ¤§¥~¡AÁÙ±o¥ý³]©w drive_parameter µ²ºcÅ骺 size_of_drive_parameter Äæ¦ì¡A³oÓÄæ¦ìªº¼ÆȪí¥Ü drive_parameter µ²ºcÅ骺¤j¤p¡A¥i¥H¦³ 1AH¡B1EH¡B42H ¤TºØ¿ï¾Ü¡Aµø±z·QÀò±oªº¸ê®Æ¸ÔºÉµ{«×»P©µ¦ù INT 13H ªºª©¥»¨M©w¡A¤@¯ë¦Ó¨¥¡A1AH ¤j¬ù´N°÷¥Î¤F¡C°²¦p©I¥s¦¨¥\¡A¶i¦ìºX¼Ð·|³Q²M°£¡A¥B AH=0¡ADS:SI ©Ò«üªº drive parameter µ²ºcÅé·|¶ñ¤W¾A·íªº¼ÆÈ¡FY©I¥s¥¢±Ñ¡A¶i¦ìºX¼Ð·|³Q³]©w¡AAH ¤º·|³Q¶ñ¤J¿ù»~¥N½X¡C
¬JµMÁA¸Ñ¤FµwºÐºc³y¡AºÏ¬W¡BºÏÀY¡BºÏ°Ï¹º¤À¡A¥H¤Î¥Î©µ¦ù INT 13H Ū¨úºÏ°Ïªº¤èªk¡A¤£¼g¦Û¦æÓµ{¦¡¨ÓÆ[¹îµwºÐ¤¤ÂäF¨º¨Ç¤º®e¡A´N¦³ÂI¨à¹ï¤£°_¦Û¤vªº¤j¸£¡C©³¤U³oÓµ{¦¡ºÙ¬° HDSV2 ( Hard Disk Sector Viewer ²Ä 0.30 ª© )¡A°õ¦æ«áµe±¦p¤U¡G
HDSV2.COM ¨Ï¥Î©µ¦ù INT 13H¡A²{¤µ¹q¸£ªº BIOS ´X¥G³£¤ä´©¤F¡A©Ò¥H¦b Win 9x/Me ©Î DOS ¨t²Î³£À³¸Ó¥i¥H¨Ï¥Î¡A¦ý¬O¦b Win 2K/XP ¨t²ÎùØ¡A¸T¤î§C¶¥©I¥s¡A©Ò¥HµLªk¨Ï¥Î¡C( ¤p¤ì°¸¦b DOS 6.20 ¤Î Win 98SE ¨Ï¥Î¹L¡A¨S¦³°ÝÃD¡A¦b DOS ¤¤±o¥ý°õ¦æ¤¤¤å¨t²Î¡A§_«h¬Ý¤£¨£¤¤¤å¦r¡F¦ý¦b Win XP ùتº½TµLªk¨Ï¥Î )
HDSV2.ASM ·|¥Î¨ì¤@¨Çµ²ºcÅé¡A³o¨Çµ²ºcÅ餣ÀHµ{¦¡§ïÅÜ¡A¤]¥i¥[¤J MYASMINC.INC ¤º¡G
hdi struc hd_info_size dw ? ;µwºÐ¸ê°Tµ²ºcÅé¤j¤p hd_info_flag dw ? ;information flags total_cylinder dd ? ;ºÏ¬WÁ`¼Æ head_p_cylinder dd ? ;ºÏÀY¼Æ sector_p_track dd ? ;¨Cy©Ò§tºÏ°Ï¼Æ total_sector dq ? ;ºÏ°ÏÁ`¼Æ byte_p_sector dw ? ;¨CºÏ°Ï©Ò§t¦ì¤¸²Õ¼Æ hdi ends hdpkt struc ;Hard Disk Packet size_hdpkt db ? ;Ū¨ú/¼g¤J±±¨î°Ï¶ô¤j¤p reserved db ? ;«O¯d¡A¥²¶·¬°¹s sector_to_trans dw ? ;Ū¨ú/¼g¤JºÏ°Ï¼Æ buffer_offset dw ? ;Ū¨ú/¼g¤J®Éªº°O¾ÐÅé°¾²¾¦ì§} buffer_segment dw ? ;Ū¨ú/¼g¤J®Éªº°O¾ÐÅé°Ï¬q¦ì§} sector_sn_l dd ? ;±ýŪ¨ú/¼g¤Jªº°_©lºÏ°Ï½s¸¹¡A§CÂù¦r²Õ sector_sn_h dd ? ;±ýŪ¨ú/¼g¤Jªº°_©lºÏ°Ï½s¸¹¡A°ªÂù¦r²Õ hdpkt ends chs struc cylinder dd ? head dd ? sector dd ? chs ends
¤U±¬O HDSV2.ASM ªº¤º®e¡G
;µwºÐ¤¤¥ô·NºÏ°ÏÆ[¹îµ{¦¡¡C ;§Q¥Î°ïÅ|¶Ç»¼°Ñ¼Æ©I¥s°Æµ{¦¡¡C ;²ÕĶ¤èªk¡G ML HDSV2.ASM ;±o¨ì HDSV2.COM¡AÁ`ªø«×¦@ 1902 ¦ì¤¸²Õ .model tiny,stdcall .386 include myasminc.inc includelib myasmlib.lib input_color equ yellow_on_black normal_color equ lime_on_black title_color equ yellow_on_navy software_color equ white_on_black driver_color equ aqua_on_black ;*********************************************************** code segment para public 'code' use16 assume cs:code,ds:code org 100h start: jmp begin ;----------------------------------------------------------- msg00 db 'Ū¨ú¿ù»~$' msg01 db 'Hard Disk Sector Viewer v.0.30$' ;HDSV 0.10 ª©¬O§â©Ò¦³°Æµ{¦¡³£¥]§t¦b¤@Ó HDSV.ASM ì©l½X¤¤¡A¥B¥H¼È¦s¾¹¶Ç»¼°Ñ¼Æ ;HDSV 0.20 ª©¬O§â¤@¨Ç°Æµ{¦¡©ñ¦b MYASMLIB.LIB ùØ¡A²ÕĶ¦¨ HDSV1.COM¡C msg02 db 'Esc=Â÷¶} D=µwºÐ¾÷ M=MBR ',18h,19h,'=Åã¥ÜºÏ°Ï«e/«á¥bӺϰÏ$' msg03 db '¹êÅéµwºÐ¡G0 ºÏ¬W¡G000000 ºÏÀY¡G00 ºÏ°Ï¡G00 LBA ºÏ°Ï¡G00000000$' msg04 db ' 0 1 2 3 4 5 6 7 8 9 A B C D E F ' db '0123456789ABCDEF$' msg05 db '¨S¦³¹êÅéµwºÐ$' msg06 db 'C=ºÏ¬W H=ºÏÀY S=ºÏ°Ï L=LBA ºÏ°Ï PageUp/PageDn=¤W/¤U¤@ºÏ°Ï' msg07 db '$' msg08 db '¿é¤JºÏÀY¡]00¡ã00¡^¡G$' msg09 db '¿é¤JºÏ¬W¡]00¡ã000000¡^¡G$' msg0a db '¿é¤JºÏ°Ï¡]01¡ã00¡^¡G$' msg0b db '¿é¤J¹êÅéµwºÐ¡}0¡ã0¡^¡G$' msg0c db '¿é¤J LBA ½s¸¹¡}00¡ã00000000¡^¡G$' ;055 n_hd db ? ;¹êÅéµwºÐ¾÷¼Æ¥Ø harddisk db 80h ;²Ä¹s¥x¹êÅéµwºÐ¾÷ hd_info hdi <1ah,?,?,?,?,?,?> ;ºÏºÐ¾÷¸ê°T¡A§tÁ`ºÏ¬W¡BºÏy¡BºÏ°Ï hd_read_pkt hdpkt <10h,0,1,?,?,?,?> ;Ū¨úµwºÐ®Éªº°Ñ¼Æ chs_sn chs <0,0,1> ;¥¿Åã¥Ü©ó¿Ã¹õ¤Wªº CHS ;----------------------------------------------------------- al_to_ascii proc near push ax ;³B²z AL ®É¡A¥ý³B²z¸û°ªªº¥|Ӧ줸¡A¬G¤]¥ý shr al,4 ;§â¸û§Cªº¥|Ӧ줸¦s¤J°ïÅ|¡CµM«á¸û§â°ªªº 4 call ax2as1 ;Ӧ줸²¾¨ì¸û§Cªº¥|Ӧ줸¡C pop ax ;§â³o¥|Ӧ줸´«¦¨ ASCII ½Xªº¼Æ¦r©Î 'A'¡ã'F' and al,0fh ;¥Ñ°ïÅ|¨ú¦^ AL ªº¸û§C¥|¦ì¤¸¡A¨Ì¦P¼Ë¨BÆJ³B²z ax2as1: add al,'0' ;³o¥|Ӧ줸 cmp al,'9' jbe ax2as2 add al,7 ax2as2: stosb ret al_to_ascii endp ;----------------------------------------------------------- ;§â AX ¤ºªº¤Q¤»¶i¦ì¼ÆÅܦ¨ ASCII ¦r¤¸¡A¦s©ó DI ©Ò«ü¦ì§} ax_to_ascii proc near push ax ;§â AX ©î¦¨ AH¡BAL¡A¨âµ¥¤À¡A¥ý³B²z AH¡A¦A mov al,ah ;³B²z AL¡A¬G¥ý§â AL ¦s¤J°ïÅ|¡A¥O AL=AH call al_to_ascii pop ax ;¥Ñ°ïÅ|¨ú¦^ AL call al_to_ascii ret ax_to_ascii endp ;----------------------------------------------------------- ;¦L¥X¤@¶¡A¦@ 256 Ӧ줸²ÕªººÏ°Ï¸ê®Æ¡A§Y¥bӺϰϪº¸ê®Æ ;¿é¤J¡GSI=ºÏ°Ï¸ê®Æ¶}©l¦ì§} ; BX=¦L¥X¨º¤@¥bªººÏ°Ï¸ê®Æ¡A0 ªí¥Ü«e¥b³¡¡A100H ªí¥Ü«á¥b³¡ ;¿é¥X¡GBX=100H¡Ðªí¥Ü«e¥b³¡¡F200H¡Ðªí¥Ü«á¥b³¡ print_sector_data proc near ;¦b¡y¹êÅéµwºÐ¡G0 ºÏ¬W¡G000000 ºÏÀY¡G00 ºÏ°Ï¡G00¡K¡K¡z¦r¦ê¶ñ¤W ;¾A·íªº¹êÅéµwºÐ¡BºÏ¬W¡BºÏÀY¡BºÏ°Ï¡BLBA ºÏ°Ï½s¸¹ mov al,harddisk mov di,offset msg03+10 sub al,50h ;¶ñ¤J¹êÅéµwºÐ stosb add di,8 mov eax,chs_sn.cylinder push ax shr eax,16 call al_to_ascii ;¶ñ¤JºÏ¬W¸û°ª¥|¦ì¼Æ pop ax call ax_to_ascii ;¶ñ¤JºÏ¬W¸û§C¥|¦ì¼Æ add di,8 mov eax,chs_sn.head call al_to_ascii ;¶ñ¤JºÏÀY add di,8 mov eax,chs_sn.sector call al_to_ascii ;¶ñ¤JºÏ°Ï add di,13 mov eax,hd_read_pkt.sector_sn_l push ax shr eax,16 call ax_to_ascii ;¶ñ¤J¸û°ªªº¥|¦ì LBA ºÏ°Ï½s¸¹ pop ax call ax_to_ascii ;¶ñ¤J¸û§Cªº¥|¦ì LBA ºÏ°Ï½s¸¹ invoke print_string,offset msg03,driver_color,500h invoke print_string,offset msg04,title_color,609h ;¦L¥X¨C¤@¦C¡AÁ`¦@n¦L¥X 16 ¦C¡C¨C¦C¥i¤À¬°¤T³¡¤À¡G°¾²¾¦ì§}¡B¦ì¤¸²Õ¸ê®Æ¡BASCII ¦r¤¸ mov dh,7h ;DH=²Ä´X¦C add si,bx ;SI=n¦L¥Xªº¦ì¤¸²Õ¸ê®Æ¦ì§} nxt_r: mov dl,3h ;DL=²Ä´X¦æ¡A¨C¦C³£±q²Ä 3 ¦æ¶}©l mov ax,bx invoke print_ax,title_color,dx ;¦L¥X°¾²¾¦ì§} inc dl inc dl nxt_by: lodsb invoke print_al,normal_color,dx;¦L¥X¦¹¦Cªº¤@Ӧ줸²Õ¸ê®Æ mov ax,si mov cl,' ' and al,0fh ;Y¦ì§}ªº¸û§C 8 ¦ì¤¸§¡¬°¹s¡Aªí¥Ü¦¹¦C¤wµ²§ô jz pt_asc ;¤U¨BÀ³¦L¥X ASCII ¦r¤¸ cmp al,8 ;Y¦¹¦C¤w¸g¦L¥X 8 Ӧ줸²Õ®É jne pt_chr ;¥²¶·¦L¥X '-'¡A§_«h¦L¥XªÅ¥Õ mov cl,'-' pt_chr: invoke print_char,cl,normal_color,dx jmp nxt_by ;¦L¥X ASCII ¦r¤¸ pt_asc: mov cx,10h ;¨C¦C 16 Ó ASCII ¦r¤¸ add dl,3 ;¶¡¹j¦ì¤¸²Õ¸ê®Æ¤T¦æ sub si,cx ;¨Ï¦ì§}«ü¦V¦¹¦C¶}©l³B nxt_pt: lodsb invoke print_char,al,normal_color,dx loop nxt_pt inc dh add bx,10h cmp dh,17h ;Y¦L¨ì¿Ã¹õ²Ä 17H ¦æ¡Aªí¥Ü¾ã¶¤wÅã¥Ü§¹²¦ jne nxt_r ret print_sector_data endp ;----------------------------------------------------------- ;Âà´«µwºÐªººÏ¬W¡BºÏÀY¡BºÏ°ÏÅܦ¨¹êÅéµwºÐªº LBA ºÏ°Ï½s¸¹ ;¤½¦¡¡GLBA ºÏ°Ï½s¸¹= ( ºÏ¬W * ºÏÀYÁ`¼Æ + ºÏÀY )* ¨CyºÏ°Ï¼Æ + ºÏ°Ï - 1 ;¿é¤J¡Gchs_sn ;¿é¥X¡GEDX:EAX¡ÐLBA ºÏ°Ï½s¸¹ ; hd_read_pkt.sector_sn_h:hd_read_pkt.sector_sn_l get_lba_sector proc near sub edx,edx mov ecx,edx mov eax,chs_sn.cylinder mul hd_info.head_p_cylinder add eax,chs_sn.head adc edx,ecx mul hd_info.sector_p_track add eax,chs_sn.sector adc edx,ecx dec eax sbb edx,ecx mov hd_read_pkt.sector_sn_l,eax mov hd_read_pkt.sector_sn_h,edx ret get_lba_sector endp ;----------------------------------------------------------- ;·í¿é¤J§¹¦¨«á¡A²M°£¿Ã¹õ¤W¡y¿é¤J¡K¡z¦r¦ê clear_message proc near invoke print_string,offset msg07,normal_color,1700h ret clear_message endp ;----------------------------------------------------------- ;Åܧó¹êÅéµwºÐ¾÷½s¸¹ ;¿é¥X¡GCY¡Ð¨Ï¥ÎªÌ¨ú®ø¿é¤J ; NC¡Ð¨Ï¥ÎªÌ¥¿½T¿é¤J¡Achs_sn ¤Î ; hd_rd.sector_sn_h:hd_rd.sector_sn_l ¤º®e·|«ü¦V MBR change_hd proc near mov al,n_hd mov di,offset msg0b+11h add al,30h ;pºâ³Ì¤j¹êÅéµwºÐ¾÷½s¸¹ dec al ;AL=³Ì¤j¹êÅéµwºÐ¾÷½s¸¹ stosb invoke print_string,offset msg0b,input_color,1700h invoke input,1,10h,input_color,dx jc ch0 ;Y CY¡Aªí¥Ü¨Ï¥ÎªÌ«ö¤U Esc Áä cmp al,n_hd ;¨Ï¥ÎªÌ¿é¤J¤§¹êÅéµwºÐ¼Ð¸¹¬O§_¶W¹L½d³ò jae change_hd ;Y¶W¹L½d³ò¡A«h¸õ¨ì change_hd: add al,80h ;Y¨S¶W¹L½d³ò¡A«h§ïÅܹêÅéµwºÐ¾÷½s¸¹ mov harddisk,al sub eax,eax mov chs_sn.cylinder,eax mov chs_sn.head,eax ;ÅܧóµwºÐ¾÷«á¡A¥i¯à¦]ºÏ¬W½s¸¹©Î®e¶q¸û¤p inc eax ;³y¦¨Åª¨ú¿ù»~¡A¬G chs_sn ¦Û°Ê´«¦¨ MBR mov chs_sn.sector,eax clc ch0: ret change_hd endp ;----------------------------------------------------------- ;ÅܧóºÏ¬W ;¿é¥X¡GCY¡Ð¨Ï¥ÎªÌ¨ú®ø¿é¤J ; NC¡Ð¨Ï¥ÎªÌ¥¿½T¿é¤J¡Achs_sn ¤Î ; hd_rd.sector_sn_h:hd_rd.sector_sn_l ¤º®e·|ÀH¤§Åܧó change_cylinder proc near mov eax,hd_info.total_cylinder dec eax push ax mov di,offset msg09+14 shr eax,16 call al_to_ascii pop ax call ax_to_ascii invoke print_string,offset msg09,input_color,1700h invoke input,8,10h,input_color,dx jc cc0 cmp eax,hd_info.total_cylinder jae change_cylinder mov chs_sn.cylinder,eax clc cc0: ret change_cylinder endp ;----------------------------------------------------------- ;ÅܧóºÏÀY ;¿é¥X¡GCY¡Ð¨Ï¥ÎªÌ¨ú®ø¿é¤J ; NC¡Ð¨Ï¥ÎªÌ¥¿½T¿é¤J¡Achs_sn ¤Î ; hd_rd.sector_sn_h:hd_rd.sector_sn_l ¤º®e·|ÀH¤§Åܧó change_head proc near mov eax,hd_info.head_p_cylinder mov di,offset msg08+14 dec ax call al_to_ascii invoke print_string,offset msg08,input_color,1700h invoke input,2,10h,input_color,dx jc ch0 cmp eax,hd_info.head_p_cylinder jae change_head mov chs_sn.head,eax clc ch0: ret change_head endp ;----------------------------------------------------------- ;ÅܧóºÏ°Ï ;¿é¥X¡GCY¡Ð¨Ï¥ÎªÌ¨ú®ø¿é¤J ; NC¡Ð¨Ï¥ÎªÌ¥¿½T¿é¤J¡Achs_sn ¤Î ; hd_rd.sector_sn_h:hd_rd.sector_sn_l ¤º®e·|ÀH¤§Åܧó change_sector proc near mov di,offset msg0a+14 mov eax,hd_info.sector_p_track call al_to_ascii invoke print_string,offset msg0a,input_color,1700h invoke input,2,10h,input_color,dx jc cs0 or eax,eax jz change_sector cmp eax,hd_info.sector_p_track ja change_sector mov chs_sn.sector,eax clc cs0: ret change_sector endp ;----------------------------------------------------------- ;Åܧó LBA ºÏ°Ï½s¸¹ ;¿é¥X¡GCY¡Ð¨Ï¥ÎªÌ¨ú®ø¿é¤J ; NC¡Ð¨Ï¥ÎªÌ¥¿½T¿é¤J¡Achs_sn ¤Î ; hd_rd.sector_sn_h:hd_rd.sector_sn_l ¤º®e·|ÀH¤§Åܧó change_lba proc near mov si,offset hd_info.total_sector lodsd dec eax mov ecx,eax shr eax,16 mov di,offset msg0c+19 call ax_to_ascii mov eax,ecx call ax_to_ascii invoke print_string,offset msg0c,input_color,1700h invoke input,8,10h,input_color,dx jc cl0 cmp eax,dword ptr hd_info.total_sector jae change_lba mov hd_read_pkt.sector_sn_l,eax ;Âà´« LBA ºÏ°Ï½s¸¹ ( ¦s©ó EDX ) Åܦ¨ CHS °Ñ¼Æ ( ¦s©ó chs_sn ) ;¤½¦¡¡GLBA ºÏ°Ï½s¸¹= ( ºÏ¬W * ºÏÀYÁ`¼Æ + ºÏÀY )* ¨CyºÏ°Ï¼Æ + ºÏ°Ï - 1 sub edx,edx div hd_info.sector_p_track inc edx mov chs_sn.sector,edx sub edx,edx div hd_info.head_p_cylinder mov chs_sn.head,edx mov chs_sn.cylinder,eax clc cl0: ret change_lba endp ;----------------------------------------------------------- ;©ó 40:75 ³B¨ú±o¹êÅéµwºÐ¾÷Ó¼Æ begin: mov bx,40h mov es,bx mov si,75h mov bl,es:[si] mov si,offset msg05 ;YµL¹êÅéµwºÐ¡A«h¸õ¨ì exit1 ³B cmp bl,0 jz exit1 mov ax,cs mov es,ax mov n_hd,bl mov ax,600h ;²M°£¿Ã¹õ mov bh,normal_color sub cx,cx mov dx,184fh int 10h ;¦L¥X³nÅé¦W¡B«öÁ仡©ú invoke print_string,offset msg01,software_color,24 invoke print_string,offset msg02,normal_color,200h invoke print_string,offset msg06,normal_color,300h ;pºâµ{¦¡µ²§ô¦ì§}¡Aקï§@¬°Åª¨úºÏ°Ï¸ê®Æ«áªº¦s©ñ¦ì§} sub eax,eax mov hd_read_pkt.buffer_offset,900h mov hd_read_pkt.buffer_segment,ds mov hd_read_pkt.sector_sn_l,eax mov hd_read_pkt.sector_sn_h,eax cld ;Ū¨ú¹êÅéµwºÐ¸ê®Æ¡A¨Ã¦s©ó hd_info µ²ºcÅé read0: mov dl,harddisk mov ah,48h mov si,offset hd_info int 13h jnc read1 exit0: mov si,offset msg00 exit1: invoke print_string,si,normal_color,1700h exit2: mov ax,4c00h int 21h ;¨Ì¾Ú hd_read_pkt ¤ºªº LBA ÅÞ¿èºÏ°Ï½s¸¹¡AŪ¨ú¹êÅéµwºÐ¤W¤@ӺϰϪº¸ê®Æ read1: mov dl,harddisk mov ah,42h mov si,offset hd_read_pkt int 13h jc exit0 ;¦b¿Ã¹õ¤WÅã¥Ü 256 Ӧ줸²Õªº¸ê®Æ psd0: sub ebx,ebx psd1: mov si,hd_read_pkt.buffer_offset call print_sector_data ;µ¥«Ý¨Ï¥ÎªÌ¿é¤J«öÁä ;ª`·N¡IBX ¤º¤§È¥²¶·«O¦s¡A¦]¬°µ{¦¡¥H DS:hd_read_pkt.buffer_offset[BX] ;«ü¦VºÏ°Ï¸ê®Æ¦ì§}¡A°£¤F·|§ïÅÜ LBA ÅÞ¿èºÏ°Ï½s¸¹ªº¥\¯à¡A¨Ò¦p§ïÅܺϬW¡BºÏÀYµ¥ ;¥²¶·«·sŪ¨ú¾ãӺϰϥ~¡A¥i¤£¥²«O¦s BX¡A¨ä¾l¥\¯à¨Ò¦p¤W/¤UÁ䶷«O¦s BX¡C getkey: call clear_message ;²M°£¡y¿é¤J¡K¡z¦r¦ê sub ecx,ecx mov ah,ch int 16h cmp ah,01 je exit2 cmp ah,51h je pagedn cmp ah,49h je pageup cmp ah,20h je d_key cmp ah,32h je m_key cmp ah,2eh je c_key cmp ah,23h je h_key cmp ah,1fh je s_key cmp ah,26h je l_key cmp ah,48h je up_key cmp ah,50h jne getkey ;Y BX=100H¡Aªí¥Üèè¤wÅã¥Ü 0¡ã0FFH ªº¸ê®Æ¡A¦¹¨èY¨Ï¥ÎªÌ«ö¤U¦V¤W/¤UÁä¡Aªí¥Ü ;±NÅã¥Ü 100H¡ã1FFH ªº¸ê®Æ¡A¦Ó BX ¤w«ü¦V 100H¡A¬Gª½±µÅã¥Ü§Y¥i¡CY BX=200H¡A ;«hªí¥Ü¤wÅã¥Ü«á 100H ªº¸ê®Æ¡A¦¹®É¨Ï¥ÎªÌ¦A«ö¤U¦V¤W/¤UÁä¡ABX À³±q¹s¶}©lÅã¥Ü up_key: cmp bx,100h jz psd1 jmp psd0 ;«ö¤U PageDown Áä®É¡A¥ýÀˬd chs_sn.sector ¬O§_¤w¨ì¨CºÏÀYªº³Ì«á¤@ºÏ°Ï¡AY¤£¬O ;ªº¸Ü±N¨ä¥[¤@´N§¹¦¨¤F¡AY¬Oªº¸Ün¦Ò¼{ºÏ°Ï¡y¶i¦ì¡z¦¨¤U¤@ºÏÀYµ¥°ÝÃD pagedn: mov edx,chs_sn.sector cmp edx,hd_info.sector_p_track jb pgdn3 ;Y¤£¬Oªº¸Ü¡A¸õ¨ì pgdn3 mov edx,chs_sn.head ;Y¤w¸g¬O³Ì«á¤@ºÏ°Ï®É¡A«h¦AÀË mov eax,hd_info.head_p_cylinder ;Àˬd chs_sn.head ¬O§_¨ì¨CºÏ inc edx ;¬Wªº³Ì«á¤@ºÏÀY dec eax cmp edx,eax ja pgdn2 ;Y¤w¸g¬O³Ì«á¤@ºÏÀYªº¸Ü¡A¸õ¨ì pgdn2 §_«h inc chs_sn.head ;chs_sn.head ¼W¤@¡A¥B¥O chs_sn.sector=1 pgdn1: mov chs_sn.sector,1 jmp short pgdn4 pgdn2: mov edx,chs_sn.cylinder mov eax,hd_info.total_cylinder inc edx dec eax ;Àˬd chs_sn.cylinder ¬O§_ cmp edx,eax ;¤w¨ì³Ì«á¤@ºÏ¬W ja getkey ;Y¤w¸g¨ì³Ì«á¤@ºÏ¬W¡A«h¸õ¨ì getkey mov chs_sn.cylinder,edx ;Y¤£¬O³Ì«áºÏ¬W¡A«h chs_sn.cylinder mov chs_sn.head,ecx ;¼W¥[¤@¡Bchs_sn.head Åܬ°¹s¡A¥B¥O jmp pgdn1 ;chs_sn.sector µ¥©ó 1 pgdn3: inc chs_sn.sector pgdn4: call get_lba_sector ;¨Ì¾Ú·s¿é¤Jªº chs_sn¡A¨D¥X LBA ÅÞ¿è jmp read1 ;ºÏ°Ï½s¸¹¡A¦AŪ¨ú¸ÓÅÞ¿èºÏ°Ï ;«ö¤U PageUp Áä®É¡A¥ýÀˬd chs_sn.sector ¬O§_¬°¤@¡AY¤£¬°¤@¡A«h±N¨ä´î¤@´N§¹¦¨¤F ;Y¬°¤@¡A«h¥²¶·¨ì¤W¤@ºÏÀY¡An¦Ò¼{¡yɦì¡zªº°ÝÃD pageup: cmp chs_sn.sector,1 ja pgup1 cmp chs_sn.head,ecx ;Y¬°¤@¡A«hÄ~ÄòÀˬd chs_sn.head ¬O§_¬°¹s¡A ja pgup2 ;Y¤£¬°¹s¡A«h¸õ¨ì pgdn2 cmp chs_sn.cylinder,ecx ;Y¬°¹s¡A«hÀˬd chs_sn.cylinder ¬O§_¬° je getkey ;¹s¡AY¬°¹s¡Aªí¥Ü¤w¨ì MBR¡A¬G«h¤£°Ê§@ mov edx,hd_info.head_p_cylinder dec chs_sn.cylinder ;Y¤£¬°¹s¡A«h¨Ï chs_sn.cylinder ´î¤@¡B dec edx ;chs_sn.head Åܬ°³Ì¤jºÏÀY½s¸¹¡Bchs_sn.sector mov chs_sn.head,edx ;Åܬ°³Ì¤jºÏ°Ï½s¸¹ jmp short pgup3 pgup1: dec chs_sn.sector jmp pgdn4 pgup2: dec chs_sn.head pgup3: mov edx,hd_info.sector_p_track mov chs_sn.sector,edx jmp pgdn4 m_key: mov chs_sn.cylinder,ecx mov chs_sn.head,ecx inc ecx mov chs_sn.sector,ecx jmp pgdn4 c_key: call change_cylinder c_key1: jc getkey ;Y CY¡Aªí¥Ü¨Ï¥ÎªÌ¨ú®ø¿é¤J jmp pgdn4 h_key: call change_head jmp c_key1 s_key: call change_sector jmp c_key1 l_key: call change_lba jmp c_key1 d_key: call change_hd jc getkey call get_lba_sector jmp read0 ;----------------------------------------------------------- code ends ;*********************************************************** end start
³oÓµ{¦¡ÁöµM¬ù¥|¦Ê¤»¤Q¦æ¡A¦ý¬OÅÞ¿è¤W«D±`²³æ¡A¨S¤°»ò½ÆÂøªººtºâªk¡C¤p¤ì°¸¶È´N´XÓ«ÂI»¡©ú¡C
°õ¦æ HDSV2 «á¡ACPU ¥Ñµ{¦¡ start: ¼Ð°O¶}©l°õ¦æ¡Cº¥ý·|°µ¥²nªºÀˬd¡A¨Ò¦p¹êÅéµwºÐӼơAµM«á¦L¥X«öÁ䪺¨Ï¥Î»¡©ú¡A±µ¤U¨ÓŪ¨ú²Ä¹sÁû¹êÅéµwºÐªº MBR ºÏ°Ï¡AÅã¥Ü¦¹ºÏ°Ïªº«e 256 Ӧ줸²Õ©ó¿Ã¹õ¤W¡AµM«á©I¥s INT 16H/AH=00H µ¥«Ý¨Ï¥ÎªÌ¿é¤J«ü¥O¡C
HDSV2.COM ©Ò¯à¥Îªº«ü¥O¤£¦h¡A¤jP¤À¦¨¤TºØ¡G
©I¥s INT 16H/AH=00H ¨ú±o¨Ï¥ÎªÌ«öÁä¿é¤J«ü¥O«á¡A§PÂ_¨Ï¥ÎªÌ«ö¤F¤°»òÁä¡AµM«á¨Ì¾Ú«öÁä°õ¦æ¨Ï¥ÎªÌªº·N§Ó¸õ¨ì¬Û¹ïªº¥\¯à¥h°õ¦æ¡C
¦b IBM PC ¤Î¨ä¬Û®e¾÷ºØ¡Aµ´¹ï¦ì§} 0040:0000 ¶}©lªº¤@¶ô¬ù 250 Ӧ줸²Õªº°O¾ÐÅ餤¡A¦s¦³ BIOS ·|¨Ï¥Î¨ìªº¤@¨Ç¸ê®Æ¡A¤@¯ëºÙ¬° BIOS ¸ê®Æ°Ï ( BIOS data area )¡C³o¶ô°Ï°ìªº¸ê®Æ¥]§t RS232 °ð¦ì§}¡BLTP °ð¦ì§}µ¥µ¥¡A¦Ó 0040:0075 ³Bªº¤@Ӧ줸²Õ¡Aªí¥Ü¹êÅéµwºÐӼơC
¦bì©l½X begin: ¼Ð°O¤§«á¤£»·³B¡A¦³¤@¬õ¦â¤Q¤»¶i¦ì¼ÆÈ¡A900H¡A¥¦¬O HDSV2.COM ©ÒŪ¤JªººÏ°Ï¸ê®Æ¦s©ñ³B¡CHDSV2.COM ¨C¦¸¶ÈŪ¨ú¤@ӺϰϡA¤@ӺϰϦ³ 512 Ӧ줸²Õ¡Aºâ¬O«Ü¤jªº¸ê®Æ¡A¥»¨Ó¤]¥i¥H©ñ¦b¦ì§} 100H ¤§«á»P¨ä¥L¸ê®Æ©ñ¦b¤@°_¡C¦ý³o¼Ëªº¸Ü¡A·|¨Ï°õ¦æÀÉÀþ¶¡¿±µÈ 512 Ӧ줸²Õ¡A¨Ã«D¦nªº°µªk¡C³Ì¦nªº°µªk¬O¦V¨t²Î°t¸m¤@¶ô°O¾ÐÅé¡A¦ý¬On¦³¸û¦hªºI´ºª¾ÃÑ¡C¦¹³B¤p¤ì°¸±Ä¥Î¥t¤@ºØ°µªk¡A§â¥¦©ñ¦bµ{¦¡½X«á±¡C
²³©Ò©Pª¾¡A*.COM Àɦ³ 64KB ¤j¤p¡A¦Ó HDSV2.COM ¶È¦û 1902 ¦ì¤¸²Õ ( ¤£¨ì 2KB¡A¼K¼K¡A³o«K¬O²Õ¦X»y¨¥ªº¦n³B¤F )¡A©Ò¥H¦b³o¤@°Ï¬q¤¤¡A¨ä¹ê´N¦³³\¦hªÅ¶¡¬O®ö¶O¤F¡C¦]¦¹¤p¤ì°¸§â¥¦©ñ¦bµ{¦¡½X¤§«á¡A¤@¯ë±¡§Î¬O¤£·|³y¦¨°ÝÃD¡C
¦ý¬O¦b¼¶¼gµ{¦¡®É¨Ã¤£ª¾¹Dµ{¦¡¦³¦h¤j¡An¦p¦óª¾¹D³]¬° 900H¡H¨ä¹ê³oÓ°ÝÃD«Ü²³æ¡A¥un¦b¼¶¼g®É¥ý¥ô·N°²³]¤@È¡A«Ý²ÕĶ¦¨¥\¤§«á´Nª¾¹Dµ{¦¡¦³¦h¤j¤F¡C¦ýnª`·N¡ACOM °õ¦æÀɸü¤J°O¾ÐÅé®É¡A¬O©ñ¦b¥Ñ¦ì§} 100H ¶}©l¡A¦]¦¹ÁÙ±o¥[¤W 100H ¤~¦æ¡A¦]¦¹¬° 1902D¡Ï100H¡×86EH¡AµM«á¤p¤ì°¸¦A¨úÓ¾ã¼ÆÅܦ¨ 900H¡C·íµM±z©ñ¦b 64KB ¤ºµ{¦¡½X¤§«áªº¥ô¤@³B¤]¦æ¡A¦ý¤£n¤Ó«á±¡A¥H§KÂл\¤F°ïÅ|¡C
chs_sn µ²ºcÅé¬O©w¸q²{¦b¦b¿Ã¹õ¤W©ÒÅã¥ÜªººÏ¬W¡BºÏÀY¡BºÏ°Ï½s¸¹¡A³o¬O¬°¤F¨Ï¥ÎªÌ«ö¤U PageDown¡BPageUp¡BM Áä®É¯à°÷«Ü¤è«Kªº¸õ¨ì¤W¤@Ó¡B¤U¤@Ó¡BMBR ºÏ°Ï¡A©ÎªÌ¨Ï¥ÎªÌ«ö¤U C¡BH¡BS Áä®É¤]¯à«Ü§Öªº×§ïºÏ¬W¡BºÏÀY¡BºÏ°Ï½s¸¹¡C¨Ò¦p¨Ï¥ÎªÌ«ö¤U PageDown Áä®É¡A¥ýÀˬd¬O§_¤w¸g¬O¨CºÏÀYªº³Ì«á¤@ºÏ°Ï¤F¡A¦pªG¤£¬Oªº¸Ü¥un chs_sn.sector ¼W¥[¤@´N¥i¥H¤F¡F¦pªG¤w¸g¬O¨CºÏÀYªº³Ì«á¤@ºÏ°Ïªº¸Ü¡A´N·|¥ÑºÏ°Ï¡y¶i¦ì¡z¤@¨ìºÏÀY½s¸¹¡A¦P®ÉºÏ°Ï½s¸¹Åܦ¨¤@¡A¦P¼Ëªº¡A¤]¸ûÀˬdºÏÀY½s¸¹¬O¤£¬O¤w¸g¬O³Ì¤j¤F¡A¦pªG¬O¡A¨º»ò¤]n¡y¶i¦ì¡z¨ìºÏ¬W¡C
hd_read_pkt ¬O°t¦X©µ¦ù INT 13H/AH=42H Ū¨úºÏ°Ï¥\¯àªºµ²ºcÅé¡C¦p«e©Òz¡A©µ¦ùŪ¨ú©Î¼g¤J¥\¯à¡A¤w¸g¤£¥ÎºÏ¬W¡BºÏÀY¡BºÏ°Ï³o¤TӰѼƩw¦ìºÏ°Ï¤F¡A§ï¥Î LBA ÅÞ¿èºÏ°Ï½s¸¹¡A³o LBA ÅÞ¿èºÏ°Ï½s¸¹´N©ñ¦b hd_read_pkt µ²ºcÅ骺 sector_sn_l ©M sector_sn_h Äæ¦ìùØ¡CLBA ÅÞ¿èºÏ°Ï½s¸¹¦@¦³ 64 ¦ì¤¸¡A¦ý¬O 80386¡ãPentium IV ¥u¦³ 32 ¦ì¤¸¼È¦s¾¹¥i¨Ñ¨Ï¥Î¡A¨ä«ü¥O¶°¤]¥u¯à²¾°Ê 32 ¦ì¤¸ªº¸ê®Æ¡A©Ò¥H¤p¤ì°¸§â¥¦¤À¬°¸û§Cªº 32 ¦ì¤¸¡Asector_sn_l¡A©M¸û°ªªº 32 ¦ì¤¸¡Asector_sn_h¡A¨âÄæ¡C
¦bÅÞ¿è¤W CHS °Ñ¼Æ¥²¶·©Mªí¥Ü LBA ÅÞ¿èºÏ°Ï½s¸¹ªº hd_read_pkt.sector_sn_l¡Bhd_read_pkt.sector_sn_h ¤¬¬Û°t¦X¡A§Úªº·N«ä¬O¥un chs_sn ¤ºªº¥ô¦ó¤@Äæ§ïÅܤF¡Asector_sn_l ©M sector_sn_h ¤]nÀH¤§ÅÜ°Ê¡A³oӰʧ@¥Ñ©I¥s get_lba_sector °Æµ{¦¡§¹¦¨¡C´«¥y¸Ü»¡¡Aget_lba_sector °Æµ{¦¡ªº¤u§@´N¬O§â chs_sn Âà´«¦¨ LBA ºÏ°Ï½s¸¹¡C
¨Ï¥ÎªÌ«ö¤U PageUp¡BPageDown¡BM¡BC¡BH¡BS µ¥¤»Á䪺«e¤TÁä®É¡AHDSV2.COM ·|¦Û¦æºâ¥X¾A·íºÏ¬W¡BºÏÀY©ÎºÏ°Ï½s¸¹¡F¦Ó¨Ï¥ÎªÌ«ö¤U«á¤TÁä®É¡AHDSV2.COM ·|¥X²{°T®§n¨D¨Ï¥ÎªÌ¿é¤J¾A·íºÏ¬W¡BºÏÀY©ÎºÏ°Ï½s¸¹¡A¤£½×«e¤TÁä©Î«á¤TÁä¡A§¹¦¨«á HDSV2.COM ³£·|§ïÅÜ chs_sn¡A³o®É·íµM¤]¤@©wn¨Ï hd_read_pkt ¤ºªº sector_sn_l ©M sector_sn_h «O«ù©M chs_sn ¤@P¤~¦æ¡A©Ò¥H³o¨Ç¥\¯à³Ì«á³£·|©I¥s get_lba_sector °Æµ{¦¡¡A¤]´N¬O¦b§ïÅܺϬW¥\¯àªº pgdn4: ¼Ð°O³B¡C
·Ó²z¨Ó»¡¡A³o¤»Ó¥\¯à³£À³¸Ó©I¥s get_lba_sector °Æµ{¦¡¡A¤£¹L§Ú̦bì©l½X¤¤¥u»Ý¼g¤@¦¸§Y¥i¡A¨ä¾l¤¦¸¥i¥Ñ¸õÅD«ü¥O¡A¸õ¨ì pagn4: ³B°õ¦æ¡A³o¬O¬°¤FÁY¤pµ{¦¡½Xªº½t¬G¡C¤£¶È¦p¦¹¡AHDSV2.COM ÁÙn²M°£n¨D¨Ï¥ÎªÌ¿é¤Jªº°T®§¡A³s³oÓ¤]¥i¥H¸`¬Ù¤@¨Ç¡C³o«K¬O¥Î²Õ¦X»y¨¥ªº¦n³B¡C
³Ì«á´£¤@´£ al_to_ascii °Æµ{¦¡©Ò¥Îªº§Þ¥©¡Cal_to_ascii °Æµ{¦¡¬O¥Î¨Ó§â AL ¤ºªº¤Q¤»¶i¦ì¼ÆÅܦ¨ ASCII ¦r¤¸¡A¦s©ó DI ©Ò«ü¦ì§}¡C¦]¬°¤Q¤»¶i¦ì¨C¦ì¼Æ¥²¶·¥Î 4 ¦ì¤¸ªí¥Ü¡AAL ¦@¦³ 8 ¦ì¤¸ªø¡A¬G»Ýn 2 Ӧ줸²Õ¦s©ñ ( ASCII ½X¨CÓ¦r¤¸¦û¥Î 8 ¦ì¤¸ )¡C¨Ò¦p AL=1B¡ADI=0200 ªº¸Ü¡A°õ¦æ§¹³oӰƵ{¦¡¡A°O¾ÐÅé ES:0200 ³BÀ³¸Ó·|Åܦ¨
ES:0200 42 31
±z¥i¬d¬d ASCII ªí¡A¤Q¤»¶i¦ìªº 31H ¨â¼ÆÈ¥Nªí¡y1¡z³oÓªü©Ô§B¼Æ¦r¡A42H ¥Nªí^¤å¦r¥À¡yB¡z¡C¦]¬° AL ¼È¦s¾¹¤¤ 1 ¬O¸û°ªªº¥|¦ì¤¸¡AB ¬O¸û§Cªº¤K¦ì¤¸¡A¬G¶ñ¨ì°O¾ÐÅ餤®É¡A¥Ñ§C¦ì§}¨ì°ª¦ì§}¨Ì¦¸¶ñ¤J¡yB¡z¡B¡y1¡z¡C
³B²z AL ³o 8 Ӧ줸¡A¨C¥|Ӧ줸³£¥²¶·°µ¦P¼Ëªº¨Æ¡A´N¬O¥ý¥[¤W 30H¡A¦AÀˬd¬O§_¶W¹L 39H¡AY¶W¹Lªí¥Ü¬O^¤å¦r¥À¡AÁÙn¦A¥[¤W 7H¡C³oºØ«½Æªº¨Æ±¡¡AÀ³¸Ó¼gӰƵ{¦¡¨Ó°µ¡A¦ý¬O±z¥i¥Hµo²{³oӰƵ{¦¡´N¬O±q ax2as1: ¼Ð°O¨ì ax2as2: ¼Ð°O³B¡A³ºµM¬Oª½±µ¡y´O¡z¦b al_to_ascii °Æµ{¦¡ùØ¡A³o¼Ë°µ¬O³Q¤¹³\ªº¡A¦]¬°¹ê»Ú¤W¡A°Æµ{¦¡ªº¶i¤JÂI¤]¬O¤@ºØ¼Ð°O¡C³o¼Ë°µ¥i´î¤Öì©l½Xªø«×¡C
¬J¤w¦³¤FÆ[¹îºÏ°Ïªº§Q¾¹¡AHDSV2.COM¡A§ÚÌ´N¨ÓÆ[¹îµwºÐ¤¤¨CÓ¤À³Î°Ï¤§¶¡ªºÃö«Y¡Cº¥ý¡A§Ú¥ý¤jP¤¶²Ð¦b FAT16/32 ¤À³Î°Ïùئ³¨º¨Ç«nªº³¡¥÷¡A¤U¤@³¹¦A¸Ô²Ó»¡©ú¡C»¡§¹ FAT16/32 ¤À³Î°Ïªº·§²¤³¡¥÷¤§«á¡A¦A¥Î HDSV2.COM Æ[¹î¤p¤ì°¸ªº¤@Áû 80GB µwºÐ¤¤¡A¤À³Î°Ï¤§¶¡¦p¦ó¹º¤À¡C
¦bµwºÐ¤Wªº FAT16 »P FAT32 ¤À³Î°Ï©M³nºÐµ²ºc¦³Ãþ¦ü¤§³B¡A³£¦³¤@ÓºÙ¬°±Ò°ÊºÏ°Ïªº¯S®íºÏ°Ï¡A¦ý¤£¦Pªº¦a¤è¬O³nºÐ¤ù¤Wªº±Ò°ÊºÏ°Ï¥²©w¦bÅÞ¿è½s¸¹²Ä¹sºÏ°Ï¡A¦ÓµwºÐ¤Wªº±Ò°ÊºÏ°Ï«o¤£¬O¦b²Ä¹s¸¹ LBA ÅÞ¿èºÏ°Ï¡C
«e±´£¹L¡AµwºÐªº²Ä¹s¸¹ LBA ÅÞ¿èºÏ°Ï¬O MBR¡A¨º»òµwºÐ¤Wªº±Ò°ÊºÏ°Ï¦b¨ºùØ©O¡H³oÓ°ÝÃDÀ³¸Ó³o¼Ë¦^µª¡A µwºÐ¤W¥i¥H¦³¼ÆÓ¤À³Î°Ï¡A°²¦p¬O FAT16 ©Î FAT32 ¤À³Î°Ïªº¸Ü¡A¨CÓ¤À³Î°Ï¨Ì§Ç¥i¤À¬°¥|³¡¥÷¡G«O¯dºÏ°Ï¡BFAT¡B®Ú¥Ø¿ý¥H¤Î¸ê®ÆºÏ°Ï¥|³¡¥÷¡A¦Ó±Ò°ÊºÏ°Ï¥²©w¦b«O¯dºÏ°Ïªº²Ä¤@ӺϰϡC²Ä¤@Ó¥Dn¤À³Î¤§«e¡A¤@¯ë·|«O¯dY¤zºÏ°Ï¡A³o¨ÇºÏ°Ï´N¬O²Ä¹sºÏ¬W¤Wªº²Ä¹s±©Ò¦³ºÏ°Ï¡A³o¨ÇºÏ°Ïªº²Ä¤@ӺϰϴN¬O MBR¡A¨ä¥L³Q«O¯dªººÏ°Ï¤@¯ë¬Oµ¹±Ò°ÊºÞ²zµ{¦¡©Î¬O§@¬°¯S®í¥Î³~ ( ¯f¬r¤]±`§Q¥Î³o¶ô°Ï°ì¬°«D§@¤ï )¡C³o¨ÇºÏ°Ï¤@¯ë¨Ï¥Î DOS ¤¤Â_ªA°Èµ{¦¡¬OµLªk¨£¨ìªº¡A¬GºÙ¬°ÁôÂÃºÏ°Ï ( ¦ý¬O¥Î BIOS ªº INT 13H ¥i¥H¦s¨ú)¡C
¦bÁôÂúϰϤ§«á¡A´N¬O²Ä¤@Ó¥Dn¤À³Î¤F¡A¦Ó²Ä¤@Ó¥Dn¤À³Î°Ïªº²Ä¤@ӺϰϴN¬O±Ò°ÊºÏ°Ï¤F¡A©Ò¥H°²¦pª¾¹DÁôÂúϰϼƴN§ä±oµÛ²Ä¤@Ó¥Dn¤À³Îªº±Ò°ÊºÏ°Ï¡C¨º»ò«ç»òª¾¹DÁôÂ꺺ϰϦ³¦h¤Ö©O¡Hì¨Ó¦b¤À³Îªíªº¡y¤À³Î°Ï¬Û¹ï¦ì¸m¡z³B ( °Ñ¦Ò«e±ªº»¡©ú )¡A·|°O¸üµÛ¸Ó¤À³Î°Ïªº±Ò°ÊºÏ°Ï¶ZÂ÷ MBR ¦³¦h¤ÖӺϰϡA³o¨ÇºÏ°Ïªº¼Æ¥Ø´N¬OÁôÂúϰϪº¼Æ¥Ø¡C
¦P¼Ëªº¡A²Ä¤GÓ¥Dn¤À³Î»P²Ä¤TÓ¥Dn¤À³Îªº±Ò°ÊºÏ°Ï¡A¤]¬O¦b¸Ó¤À³Îªº³Ì«e±ºÏ°Ï¡C©Ò¥H¥un§ä¨ì¤À³Îªíªº¡y¤À³Î°Ï¬Û¹ï¦ì¸m¡z´N¯à§ä¨ì²Ä¤G¡B¤TÓ¥Dn ¤À³Îªº±Ò°ÊºÏ°Ï¡C¥H¥t¤@ÓÆ[ÂI¨Ó¬Ý¡A°²¦p¥Î DOS ¤¤Â_ªA°Èµ{¦¡Åª¨ú²Ä¤GÓ¥Dn¤À³ÎºÏ°Ï®É ( ¨Ò¦p¥Î INT 25H ©Î AX=7305H/INT 21H )¡A¥²©wµLªk«ü©wÅÞ¿èºÏ°Ï¦Ó¯àŪ¨ì²Ä¤@Ó¤À³Î°ÏªºÅÞ¿èºÏ°Ï¡A©Ò¥H¹ï²Ä¤GÓ¤À³Î¨Ó»¡¡A²Ä¤@Ó¤À³Îªº©Ò¦³ºÏ°Ï³£¬OÁôÂ꺺ϰϡC¦P²z¡A¹ï²Ä¤TÓ¤À³Î¨Ó»¡¡A²Ä¤@Ó¤À³Î»P²Ä¤GÓ¤À³Îªº©Ò¦³ºÏ°Ï¤]³£¬OÁôÂ꺺ϰϡC
¤@Ó FAT16 ©Î FAT32 ¤À³Îªº²Ä¤@ӺϰϬO±Ò°ÊºÏ°Ï¡A¦pªG¬O FAT16 ¤À³Îªº¸Ü¡Aºò±µµÛ±Ò°ÊºÏ°Ï¤§«á¬O¨âÓ FAT¡A¦pªG¬O FAT32 ¤À³Îªº¸Ü¡A¦b¨âÓ FAT ¤§«eÁÙ¦³Y¤z±Ò°Ê³Æ¥÷µ¥ºÏ°Ï¡Aºò±µµÛªº¤~¬O FAT¡C±µµÛ FAT ªº¬O®Ú¥Ø¿ý¡A®Ú¥Ø¿ý¤§«á´N¬O¸ê®ÆºÏ°Ï¤F¡Cºî¦X¥H¤Wªº»¡©ú¡A¤p¤ì°¸ªþ¤W©³¤Uªº¹Ï¤ù¡A»¡©ú¤@ÓµwºÐ¸g¹L¤À³Î«áªº¤À¥¬±¡§Î¡C°²³]³oÓµwºÐ³Q¤À¦¨¨âÓ¥Dn¤À³Î»P¤@ÓÂX¥R¤À³Î¡A¦ÓÂX¥R¤À³Î¦AÄ~Äò¤À¦¨¨âÓÅÞ¿èµwºÐ¡A¦Ó³o¨ÇÅÞ¿èµwºÐ³£³Q®æ¦¡¤Æ¦¨ FAT16 ©Î¬O FAT32 Àɮ׮榡¡A¨º»ò¨CÓ¤À³Î°Ï»PÅÞ¿èµwºÐ¤ºªºµ²ºcÀ³¸Ó¦p¤U¹Ï¤À¥¬¡G
¨Ì·Ó¤W¹Ï¡AÂX¥R¤À³Î¤ºªº²Ä¤@ӺϰϤº§tÂX¥R¤À³Îªí¡AÂX¥R¤À³Îªí¤º¦³«ü¦V¤U¤@ÓÂX¥R¤À³Îªí¤ÎÅÞ¿èµwºÐªº¸ê®Æ¡A¦Ó¨CÓÂX¥R¤À³Îªí¤§«á»PÅÞ¿èµwºÐ¤§«e¡A¤]¦³¼ÆÓÁôÂúϰϡC³oºØ±¡§Î¡A¸ò²Ä¤@Ó¥Dn¤À³Î¬Û¦P¡C©Î³\§ÚÌ¥i¥H³o¼Ë¬Ý¡A¨CÓÅÞ¿èµwºÐ´N¹³¨ãÅé¦Ó·Lªº¹êÅéµwºÐ¡A©Ò¥H¤À³Îªí ( §ó¥¿½Tªº»¡¬OÂX¥R¤À³Îªí ) ©M±Ò°ÊºÏ°Ï¤§¶¡¦³ÁôÂúϰϡC
©³¤U¬O¤p¤ì°¸¥Î HDSV2.COM Æ[¹î¤@Áû Western Digital 80GB ( «¬¸¹ WD800BB ) ªºµwºÐ¡A³oÁûµwºÐ¦³¤TÓ¥Dn¤À³Î¤Î¤@ÓÂX¥R¤À³Î¡A³o¤TÓ¥Dn¤À³Î¤À§O¬O¦w¸Ë DOS 6.20¡BWin 98 SE ¤Î Win XP¡AÀɮרt²Î¤À§O¬O FAT16¡BFAT32¡BNTFS¡CÂX¥R¤À³Î¦A²Ó¤À¦¨¨âÓ 16GB ªº FAT32¡B¤@Ó 20GB ªº NTFS¡B2 Ó¦w¸Ë Mandrake Linux ªº Ext2 ¤Î¤@Ó Linux SWAP¡AÁ`¦@ 5 ÓÅÞ¿èµwºÐ¡Cº¥ýÆ[¹î³oÓµwºÐªº MBR¡A¦b MBR ªº¦ì§} 1BEH¡ã1FDH¡A³o 64 Ӧ줸²Õ´N¬O¤À³Îªí ( µµ½u®Ø°_ªº°Ï°ì )¡G
ª`·N¨ì¦ì§} 1C6H ¶}©lªºÂù¦r²Õ¬O 3FH ( ¥Õ®Ø®Ø°_¤§³B )¡A¦¹Äæ¦ì¬O¡y¤À³Î°Ï¬Û¹ï¦ì¸m¡z¡A´Nªí¥Ü²Ä¤@Ó¤À³Î¤§«eªº 3FH ӺϰϬOÁôÂ꺡A¦¹®É±zY§ïÅÜ LBA ÅÞ¿èºÏ°Ï¨ì 3FH ( «ö¤U¡yL¡zÁä¡A¦A¿é¤J¡y3F¡z¤Î Enter Áä )¡A¦p¤U¹Ï¤G¡A±z´N¯à°÷¬Ý¨ì²Ä¤@Ó¤À³Îªº±Ò°ÊºÏ°Ï¤F¡Aª`·N¨ì¹Ï¤¤ªº¡yLBA ºÏ°Ï¡z¤w¸gÅܦ¨ 3FH ¤F¡C¤U¹Ï¤G´N¬O²Ä¤@Ó¤À³Îªº±Ò°ÊºÏ°Ï¡A¤]´N¬O DOS 6.20 ªº±Ò°ÊºÏ°Ï¡G
¦pªG·Q§ä²Ä¤G¥Dn¤À³Î°Ïªº±Ò°ÊºÏ°Ï¡A¥i¥ý¨ì¤À³Îªíªº²Ä¤GÄ檺¡y¤À³Î°Ï¬Û¹ï¦ì¸m¡z¡A½Ð°Ñ¦Ò¹Ï¤@¤¤¤À³Îªíªº²Ä¤GÓ¤À³Îªº¡y¤À³Î°Ï¬Û¹ï¦ì¸m¡zªºÂù¦r²Õ¬° 1F6080H ( §Y¥Õ®Ø¤§¤UªºÂù¦r²Õ )¡A´Nªí¥Ü³oÓµwºÐªº²Ä¤GÓ¥Dn¤À³Î¦b²Ä 1F6080H Ó½s¸¹ªºÅÞ¿èºÏ°Ï¡A§ïÅÜ HDSV ¤¤ªº¡yLBA ºÏ°Ï¡z¬°²Ä 1F6080H ÓÅÞ¿èºÏ°Ï´N¥i¥H§ä¨ì Win 98 SE ªº±Ò°ÊºÏ°Ï¡A¦p¤U¹Ï¤T¡G
¦Ü©óÂX¥R¤À³Î°Ï¤º¥i¥H¦³¼ÆÓÅÞ¿è¤À³Î¡A¦Ó³o¨ÇÅÞ¿è¤À³Î¦U¦Û¥Nªí¤@ÓÅÞ¿èµwºÐ¡AnÆ[¹îÂX¥R¤À³Î±o¥ý§ä¨ìÂX¥R¤À³Î°_©lºÏ°Ï¡A½Ð¬Ý¹Ï¤@ªº¤À³Îªí³Ì«á¤@Äæ¡A±z´N·|µo²{ÂX¥R¤À³Î¶}©lªºÅÞ¿èºÏ°Ï¬O 1966DFAH ( ²LÂŮخذ_¤§³B )¡A§ïÅÜ¡yLBA ºÏ°Ï¡z¨ì³oÓÅÞ¿èºÏ°Ï¡A¨Ã«ö¦V¤UÁäÆ[¹î«á 256 Ӧ줸²Õ¡A¦p¤U¹Ï¥|¡G
ªGµM¦p«e³¹©Òz¡AÂX¥R¤À³Îªí¥u¦û¨âÓÄæ¦ì¡A²Ä¤@Ó¬O¦b¦¹¤À³ÎªºÅÞ¿èµwºÐ©Ò¦b¦ì¸m¡A¦¹¦ì¸m¬O¬Û¹ï©óÂX¥R¤À³Î¶}©l¤§³B ( ¤Î¬õ®Ø®Ø°_¤§³B )¡A©Ò¥H²Ä¤@ÓÅÞ¿èµwºÐ¶}©l©ó¦¹ÂX¥R¤À³Îªí¤§«áªº 3FH ºÏ°Ï³B¡A©Ò¥H³oÓÅÞ¿èµwºÐªº±Ò°ÊºÏ°Ï¬O¦b LBA ²Ä 1966DFAH¡Ï3FH ÓÅÞ¿èºÏ°Ï¤§³B¡A¥ç§Y²Ä 1966E39H¡A§ïÅÜ¡yLBA ºÏ°Ï¡z¨ì³oÓÅÞ¿èºÏ°Ï´N¥i¥HÆ[¹î¨ì³oÓÅÞ¿èµwºÐªº±Ò°ÊºÏ°Ï¡G
¦pªGn§ä²Ä¤GÓÅÞ¿è¤À³Î¡A´N¥²¶·¦^¨ì²Ä¤@ÓÂX¥R¤À³Îªíªº²Ä¤GÄ檺¡y¤À³Î°Ï¬Û¹ï¦ì¸m¡z¡A¥ç§Y¹Ï¥|¤¤ÂŮخذ_¤§³B¡C´«¥y¸Ü»¡¡A²Ä¤GÓÅÞ¿è¤À³Î¶}©l©ó²Ä¤@ÓÂX¥R¤À³Îªí¤§«áªº 1F1DD2FH ¤§³B¡A©Ò¥H²Ä¤GÓÅÞ¿è¤À³Î¶}©l©ó 1966DFAH¡Ï1F1DD2FH¡A¤]´N¬O 3884B29H¡AÆ[¹î³oÓ LBA ÅÞ¿èºÏ°Ïªº«á 256 Ӧ줸²Õ ( «ö¦V¤UÁä )¡G
´N¥i¥H§ä¨ì²Ä¤GÓÅÞ¿èµwºÐªº±Ò°ÊºÏ°Ï¬O¦b 3884B68H ( §Y 3884B29H¡Ï3FH¡A3FH ¬°¦Ç¦â®Ø®Ø®Ø°_¤§³B )¡A¨ä¾lÅÞ¿è¤À³Î¥i·Ó¦¹¨BÆJ«½Æ¡A´N¤£¦A´yz¤F¡C
¦³¤F HDSV2.COM «á¡A±z¥i¥HÆ[¹î±z¦ÛӨ઺µwºÐ¨ì©³ÂäF¨º¨ÇªF¦è¡A¦Ñ¹ê§i¶D§A¡A§ÚÁÙµo²{µwºÐùØÂæïǫ¯ªº¦a¤èÁÙ¯u¤£¤Ö¡C