¥úºÐ¾÷¦b 1990 ¦~¥N¤¤´Á´N¤w¸g¦¨¬°¹q¸£ªº¼Ð·Ç°t³Æ¡A¦ý¬O«o«Ü¤Ö¦³¤H´£¤Î¦³Ãö¥úºÐªºµ{¦¡»s§@¡A§Ú·Qì¦]¤£¥~¨âÓ¡A¤å¥ó¨ú±o¤£©ö¤Î¹L©ó½ÆÂø¡A¤p¤ì°¸°Ñ¦ÒªQ±^¤½¥q©Ò¥Xª©ªL¯®»ö½sµÛªº ¡yCD-ROM¡NÁnÅQ¥d¡N¸ê°T¦w¥þµ¥¨ç¼Æ®w³]p¡z¤@®Ñ¤Î²Ä¤Tªi²Ä 142¡N143 ´Á»¯¤å§Ó©Ò¼gªº¡yDOS ¤Uªº CD-AUDIO ¼½µµ{¦¡¡z¤@¤å¥H¤Î¤¤¤s¬üÄR¤§®qºëµØ°Ï¥úºÐÅX°Êì©l»¡©ú¤å¥óµ¥¤åÄm¡Aµo²{´X¥G¥H C »y¨¥¼¶¼g³o¨Çµ{¦¡¡A¬G¤p¤ì°¸·Q¥H³o¤@³¹¥H¤Î¤U¤@³¹µ¥¨â³¹ªº½g´T²³æ¤¶²Ð¦p¦ó¥H²Õ¦X»y¨¥¼½©ñµ¼Ö¥úºÐ¤Î±±¨î¥úºÐ¾÷¡C
¦b MS DOS ªºÀô¹ÒùØ¡An¨Ï¥Î¥úºÐ¥²¶·¦b CONFIG.SYS Àɮפ¤¥[¤J¥úºÐªºÅX°Êµ{¦¡¡A³oÓÅX°Êµ{¦¡³q±`¬O¥Ñ¼t°Ó´£¨Ñ¡A¬G¦WºÙ¤£¤Ó¬Û¦P¡A±z¥²¶·¬Ý¬Ý¼t°Óªº¨Ï¥Î»¡©ú®Ñ¡A¤£¹L¦]¬°¥úºÐ¾÷¤w¸g¬Û·í´¶¹M¤F¡A©Ò¥H¦U¼t°ÓªºÅX°Êµ{¦¡´X¥G³£¯à¬Û³q¡A¤p¤ì°¸¦b CONFIG.SYS ùتº¬O¡G
DEVICE=C:\AOATAPI.SYS /D:IDECD00 /P:170,15
°£¤F¦b CONFIG.SYS ùØn¦³ÅX°Êµ{¦¡¥~¡A¦b AUTOEXEC.BAT ÁÙn¦³ Microsoft ©Ò´£¨Ñªºµ{¦¡¿ë»{¡G
C:\DOS\MSCDEX /D:IDECD00 /L:M
nª`·Nªº¬O¡A³o¨âÓµ{¦¡ªº°Ñ¼Æ¡y/D:¡z«á±±µªº¤å¦r¥²¶·¬Û¦P¡A¡y/L:¡z«á±±µªº¬O¥úºÐ¾÷ªº½s¸¹¡A¦pªG¦¨¥\¡A¨º¦b DOS ©³¤Uªº¥úºÐ¾÷¼Ð¸¹´N¬O¡yM:¡z(´N¦n¹³³nºÐ¾÷¬O A: ¤@¼Ë)¡C
¦b²Õ¦X»y¨¥¤¤¨Ï¥Î¥úºÐ¡An©I¥s INT 2FH ¤¤Â_¡CINT 2FH ¤]¬OÄÝ©ó DOS ªA°Èµ{¦¡¡A¦ý¥¦¬O¥ÑÅX°Êµ{¦¡©Ò´£¨Ñªº¡A¹³ºô¸ô¡N¥úºÐ¾÷¡C¦]¬° INT 2FH ´£¨Ñ³\¦hºØ³]³ÆªºªA°Èµ{¦¡¡A¦]¦¹¨Ï¥Î¤W¸û¬°½ÆÂø¡A©³¤U¶È´N¥úºÐ¾÷ªº³¡¥÷»¡©ú¡C
·ín¨Ï¥Î¥úºÐ¾÷®É¡A²Ä¤@¨B´N¬OnÀˬd¥úºÐ¾÷¬O§_¦s¦b¡A±`¥ÎªºÀˬd¤è¦¡´N¬O¥Î INT 2FH ¤¤Â_¡C¦p¦P INT 21H ¤@¼Ë¡A INT 2FH ¤¤Â_¤]§â¤£¦Pªº¥\¯à©ñ¤J AH ¼È¦s¾¹¤¤¡A¦p¦³§ó²Ó¤Àªº¡y¤l¡z¥\¯à´N©ñ¤J AL ¤¤¡C¦b¦¹Àˬd¥úºÐ¾÷¥Î
mov ax,1500h mov bx,0000 int 2fh
ªð¦^®É¡A¦pªG¦³¦w¸Ë¦n¥úºÐ¾÷«h BX ·|¦s¦³¥úºÐ¾÷¼Æ (¤£ºÞ±zªº¥úºÐ¾÷¬O IDE ¬É±©Î SCSI ¬É±¡A¦¹³B BX ¬O¥úºÐ¾÷Á`¼Æ)¡A¦Ó CX ·|¦s¦³²Ä¤@¥x¥úºÐ¾÷ªº½s¸¹¡A¦pªG²Ä¤@¥x¥úºÐ¾÷¬O A: «h CX ¬°¹s¡F¦pªG²Ä¤@¥x¥úºÐ¾÷¬O B: «h CX ¬°¤@¡A¨Ì¦¹Ãþ±À¡C¦pªG±z¨S¸Ë¥úºÐ¾÷¡A«h BX µ¥©ó¹s¡C
¥ý»¡§â¥úºÐ¾÷ªº¦«½L¥´¶}¡Cn§â¥úºÐ¾÷ªº¦«½L¥´¶}¡A¥²¶·¥ý³]©w¤@ÓºÙ¬° device driver request header (ÅX°Ê¸Ë¸m½Ð¨DªíÀY) ªºµ²ºcÅé¡C³oÓµ²ºcÅ骺Äæ¦ì¦p¤U¡G
¦ì§} | ªø«× | ·N¸q |
00 | BYTE | µ²ºcÅéªø«×¡A¥H¦ì¤¸²Õ¬°³æ¦ì |
01 | BYTE | subunit¡A³]¬° 0 §Y¥i |
02 | BYTE | ©R¥O½X¡A°Ñ¦Ò¦¹³B |
03 | WORD | ¥Ñ INT 2FH ªð¦^®Éªºª¬ºA¡A°Ñ¦Ò¦¹³B |
05 | DWORD | «O¯d¡A§¡³]¬° 0 |
09 | DWORD | «O¯d¡A§¡³]¬° 0 |
³oÓ device driver request header ·|ÀHµÛ©I¥s¥\¯à¦Ó¦³©Ò¤p´T«×ÅÜ°Ê¡A¦ý¬O¤W±³o 13 Ӧ줸²Õ©Ò¥Nªíªº·N¸q¬O¤£·|Åܰʪº¡C
¶}±Ò¥úºÐ¦«½L¡A¬Û·í©ó¹q¸£¥D¾÷ªO¹ï¥úºÐ¾÷¿é¥X±±¨î©R¥O¡A¤]¥i¥H¬Ý¦¨±N±±¨î©R¥Oªº¸ê®Æ¶Ç°eµ¹¥úºÐ¾÷¡C°Ñ¦Òµù¤@±oª¾©R¥O½X¬° 0CH¡A·N«ä¬O IOCTL OUTPUT¡C¦n¤F¡A·í¥úºÐ¾÷¦¬¨ì³oÓ device driver request header ¤§«á¡A¥Ñ©R¥O½X¡A0CH¡Aª¾¹Dn±µ¦¬¥Ñ¥D¾÷ªO¨Ó«ü¥O¤F¡A¦Ó³o¨Ç«ü¥O¬O¤°»ò©O¡Hì¨Ó³oÓ device driver request header ÁÙ¦³¤U¥b³¡¡A³o¤U¥b³¡±`·|ÀH¥\¯à¤£¦P¡A¦Ó¦³©ÒÅÜ°Ê¡C¶}±Ò¥úºÐ¾÷¦«½L¤U¥b³¡®æ¦¡¦p¤U¡G
¦ì§} | ªø«× | ·N¸q |
0D | BYTE | ¥H«eºÙ´CÅé´yz¤l (media descriptor)¡A¦ý¤w§ïºÙ¦ì§} ¼Ò¦¡ (address mode)¡A¦¹³B³]¬° 0 §Y¥i |
0E | DWORD | ¶Ç°e¦ì§}¡A°Ï¬q¦ì§}¤Î°¾²¾¦ì§} |
12 | WORD | ©I¥s®É¡A¬°¶Ç°e¦ì¤¸²Õ¼Æ ªð¦^®É¡A¬°¹ê»Ú¶Ç°e¦ì¤¸²Õ¼Æ |
¦b device driver request header µ²ºcÅ骺 0EH ¶}©lªº¨â¦r²Õ©Ò«üªº¦ì§}³B¦³n¥úºÐ¾÷°õ¦æªº©R¥O¸ê®Æ¡A¦Ón¶Ç°eªº¸ê®Æ¥i¥H¦³³\¦hºØ¡A°Ñ¦Òµù¤Tªí®æ±oª¾¬° 0 ´N¬O¨Ï¥úºÐ¾÷¦«½L¶}±Ò¡A¦Ó¥B¥u¦³¤@Ӧ줸²Õ¡A©Ò¥H¨Ï device driver request header ªº²Ä 12H ¶}©lªº¦r²Õ¬° 1¡Aªí¥Ü©R¥Oªø«×¥u¦³¤@Ӧ줸²Õ¡C¦¹¥~ÁÙ±o§ä¤@¶ô°O¾ÐÅé¡A¨äªø«×¬° 1 Ӧ줸²Õ¡A¥B¸Ó°O¾ÐÅé¼ÆȬ° 0 (¨Æ¹ê¤W IOCTL OUTPUT ¦³³\¦h©R¥O¸ê®Æ¡A½Ð°Ñ¦Òµù¤T)¡C³Ì«ápºâ device driver request header Á`ªø«×¬° 13H¡A©ñ¤J¦¹µ²ºcÅ骺²Ä¹sӦ줸²Õ¡C
§â device driver request header ³£³]¦n¤§«á¡A¦A¨Ó¨Ï ES:BX «ü¦V device driver request header µ²ºcÅé¡An¶}±Ò¦«½Lªº¥úºÐ¾÷½s¸¹©ñ¦b CX ùØ¡A0 ªí¥Ü A:¡A1 ªí¥Ü B:¡A2 ªí¥Ü C:¡C¦A§â AX ³]©w¬° 1510H ªí¥Ü±N¥\¯à½Ð¨D¶Ç°eµ¹¸Ë¸m¡A³Ì«á©I¥s INT 2FH ¤¤Â_¡C¤U±µ{¦¡²ÕĶ«á¡AÂà´«¦¨ *.COM ÀÉ¡A¥i¥H§â¥úºÐ¾÷ªº¦«½L¥´¶}¡A
ddrh struc ;¦ì§}---·N-----¸q------- len db ? ; 00 device driver request header ªø«× subunit db ? ; 01 subunit¡A0 command db ? ; 02 ©R¥O½X status dw ? ; 03 ªð¦^ª¬ºA revers1 dd ? ; 05 «O¯d¡A0 revers2 dd ? ; 09 «O¯d¡A0 media db ? ; 0D ´CÅé´yz¤l¡A0 trn_off dw ? ; 0E ¶Ç°e¸ê®Æ¦ì§}¡A°¾²¾¦ì§} trn_seg dw ? ; °Ï¬q¦ì§} len_tr dw ? ; 12 ¶Ç°e¸ê®Æªø«× ddrh ends ;*************************************** code segment assume cs:code,ds:code org 100h ;--------------------------------------- start: jmp begin eject ddrh <13h,0,0ch,?,0,0,0,offset cd_ejt,?,1> cd_ejt db 0 ;¶}±Ò¥úºÐ¦«½Lªº©R¥O½X cd_rom dw ? ;¥úºÐ¾÷½s¸¹ begin: mov ax,1500h sub bx,bx int 2fh mov cd_rom,cx mov ax,cs mov eject.trn_seg,ax mov ax,1510h mov cx,cd_rom mov bx,offset eject int 2fh int 20h ;--------------------------------------- code ends ;*************************************** end start
n¨Ï¥úºÐ¾÷¦«½LÃö¤W¡Adevice driver request header ©Ò¶ñ¤Jªº¼ÆȬۦü¡A¥u¦³¶Ç°eªº©R¥O¤£¦P¡AÃö¤W¦«½Lªº©R¥Oªø«×¤]¬O¤@Ӧ줸²Õ¡A¦ý¸Ó©R¥O¸ê®Æ¬° 5¡C(µù¤T)
¥úºÐ¾÷¦«½LÂê¤Wªº·N«ä¬O¨Ï¥úºÐ¾÷±ªOªº EJECT «öÁ䥢®Ä¡A¤]´N¬O«ö¤U³oÓ«ö¶s¥úºÐ¾÷¤´¥´¤£¶}¡A¶}Âê´N¬O¸Ñ°£³oÓ¥\¯à¡Cn¨Ï¥úºÐ¾÷Âê¤W¤]¬On¥Î device driver request header¡A©R¥O½X¤]¬O 0CH¡A¦ý¬O¶Ç°eªº©R¥O¸ê®Æ¬O 01¡A01 ¨âӦ줸²Õ¡F¦Ó¶}Âê«h¬O¶Ç°e©R¥O¸ê®Æ 01¡A00 ¨âӦ줸²Õ¡A¨£µù¤T¡A©R¥O¸ê®Æ½s¸¹ 1 ªº³¡¥÷¡C
device driver request header ªº²Ä 12H ¦ì¤¸²Õ¶}©lªº¤@Ó¦r²Õ¬O©R¥O¸ê®Æªø«×¡A¥²¶·³]¬° 02¡F¦Ó²Ä 0EH ¦ì¤¸²Õ¶}©lªº¨âÓ¦r²Õ¤À§O«ü¦V¶Ç°e©R¥O¸ê®Æ¦ì§}¡F²Ä 02H ¶}©lªº¤@Ӧ줸²Õ¬O©R¥O½X 0CH¡C±N³o¨Ç³]¦n¤§«á¡ACX ³]©w¥úºÐ¾÷½s¸¹¡AAX ³]¬° 1510H¡AES:BX «ü¦V device driver request header¡A¦A©I¥s INT 2FH §Y¥i¡C¤U±µ{¦¡¥i¥H§â¥úºÐ¾÷Âê¤W¡G
ddrh struc ;¦ì§}---·N-----¸q------- len db ? ; 00 device driver request header ªø«× subunit db ? ; 01 subunit¡A0 command db ? ; 02 ©R¥O½X status dw ? ; 03 ªð¦^ª¬ºA revers1 dd ? ; 05 «O¯d¡A0 revers2 dd ? ; 09 «O¯d¡A0 media db ? ; 0D ´CÅé´yz¤l¡A0 trn_off dw ? ; 0E ¶Ç°e¸ê®Æ¦ì§}¡A°¾²¾¦ì§} trn_seg dw ? ; °Ï¬q¦ì§} len_tr dw ? ; 12 ¶Ç°e¸ê®Æªø«× ddrh ends ;*************************************** code segment assume cs:code,ds:code org 100h ;--------------------------------------- start: jmp begin lock_rq ddrh <13h,0,0ch,?,0,0,0,offset cd_lock,?,2> cd_lock db 1,1 ;Âê¤W¥úºÐ¦«½Lªº©R¥O¸ê®Æ cd_rom dw ? ;¥úºÐ¾÷½s¸¹ begin: mov ax,1500h sub bx,bx int 2fh mov cd_rom,cx mov ax,cs mov lock_rq.trn_seg,ax mov ax,1510h mov cx,cd_rom mov bx,offset lock_rq int 2fh int 20h ;--------------------------------------- code ends ;*************************************** end start
©R¥O½X | »¡¡@¡@¡@¡@¡@©ú | ||
¤Q¤»¶i¦ì | ¤Q¶i¦ì | ||
00 | 0 | INIT | |
01 | 1 | MEDIA CHECK (block devices) | |
02 | 2 | BUILD BPB (block devices) | |
03 | 3 | IOCTL INPUT | |
04 | 4 | INPUT | |
05 | 5 | NONDESTRUCTIVE INPUT, NO WAIT (character devices) | |
06 | 6 | INPUT STATUS (character devices) | |
07 | 7 | INPUT FLUSH (character devices) | |
08 | 8 | OUTPUT | |
09 | 9 | OUTPUT WITH VERIFY | |
0A | 10 | OUTPUT STATUS (character devices) | |
0B | 11 | OUTPUT FLUSH (character devices) | |
0C | 12 | IOCTL OUTPUT | |
0D | 13 | (DOS 3.0+) DEVICE OPEN | |
0E | 14 | (DOS 3.0+) DEVICE CLOSE | |
0F | 15 | (DOS 3.0+) REMOVABLE MEDIA (block devices) | |
10 | 16 | (DOS 3.0+) OUTPUT UNTIL BUSY (character devices) | |
11 | 17 | (European MS-DOS 4.0) STOP OUTPUT (console screen drivers only) | |
12 | 18 | (European MS-DOS 4.0) RESTART OUTPUT (console screen drivers only) | |
13 | 19 | (DOS 3.2+) GENERIC IOCTL | |
14 | 20 | (DOS 4.0, KKCFUNC) DEVICE RESTORE (character device) | |
15 | 21 | (European MS-DOS 4.0) RESET UNCERTAIN MEDIA FLAG | |
16 | 22 | (DOS 4.0) unknown??? | |
17 | 23 | (DOS 3.2+) GET LOGICAL DEVICE | |
18 | 24 | (DOS 3.2+) SET LOGICAL DEVICE | |
19 | 25 | (DOS 5.0+) CHECK GENERIC IOCTL SUPPORT | |
80 | 128 | (CD-ROM,DRFAT32) READ LONG | |
81 | 129 | (CD-ROM) reserved | |
82 | 130 | (CD-ROM,DRFAT32) READ LONG PREFETCH | |
83 | 131 | (CD-ROM,DRFAT32) SEEK | |
84 | 132 | (CD-ROM) PLAY AUDIO | |
85 | 133 | (CD-ROM) STOP AUDIO | |
86 | 134 | (CD-ROM,DRFAT32) WRITE LONG | |
87 | 135 | (CD-ROM,DRFAT32) WRITE LONG VERIFY | |
88 | 136 | (CD-ROM) RESUME AUDIO |
¦ì¤¸ | »¡¡@¡@©ú |
0F | ¦pªG¿ù»~¡A¦¹¦ì¤¸³]¬°¤@¡A§_«h¬°¹s |
0E-0B | «O¯d¡A§¡¬°¹s |
0A | ¬Y¨Ç©I¥sÅX°Êµ{¦¡«á¡A¥Ñ DOS ³]©w |
09 | ¦£¸L®É³]¬°¤@ |
08 | ©I¥s§¹¦¨ |
¦pªG¦ì¤¸ 0F ¬°¤@®É¡A07-00 ¦ì¤¸¬°¿ù»~½X | |
07 | ¥¼ª¾ªº´CÅé |
06 | ´M§ä¿ù»~ |
05 | ¿ù»~ªº¥\¯à½Ð¨D |
04 | CRC ¿ù»~ |
03 | ¥¼ª¾©R¥O |
02 | ©|¥¼·Ç³Æ¦n |
01 | ¥¼ª¾ unit |
00 | ¼g¤J«OÅ@¿ù»~ |
©R¥O¸ê®Æ½s¸¹ | ©R¥O¸ê®Æªø«× | »¡¡@¡@©ú |
0 | 1 | ¶}±Ò¥úºÐ¾÷¦«½L |
1 | 2 | Âê¤W©Î¶}Âê¥úºÐ¾÷¦«½L |
2 | 1 | «¸m¥úºÐ¾÷ |
3 | 9 | µÀW±±¨î |
4 | ? | ? |
5 | 1 | Ãö¤W¥úºÐ¾÷¦«½L |