home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l440 / 2.ddi / CHAP8 / DISK.SCR < prev    next >
Encoding:
Text File  |  1990-09-26  |  4.9 KB  |  137 lines

  1. ;   DISK.SCR
  2. ;   This script relates DOS disk calls to the hard disk
  3. ;   BIOS calls involved.
  4. ;
  5.  
  6. ; DOS 4+/Compaq DOS 3.31+ >32M partition
  7. structure big fields
  8.     sector (dword,hex)
  9.     num (word,hex)
  10.     addr (dword,ptr)
  11.  
  12. intercept 21h
  13.     function 32h
  14.         on_entry output "2132: Get DPB drive " dl
  15.     function 40h
  16.         ; hook Write just to see messages (e.g., from FORMAT)
  17.         on_entry if (bx == 1)   ; stdout
  18.             output (ds:dx->byte,asciiz,cx)
  19.     function 44h
  20.         subfunction 09h
  21.             on_entry output "214409: IOCTL drive " bl " Remote? "
  22.         subfunction 0dh
  23.             on_entry output "21440D: IOCTL drive " bl 
  24.                 if (cl == 40h) sameline " [40: Set Device Parameters]"
  25.                 if (cl == 42h) sameline " [42: Format and Verify Track]"
  26.                 if (cl == 60h) sameline " [60: Get Device Parameters]"
  27.         subfunction 0fh
  28.             on_entry output "21440F: IOCTL Set Logical Drive " bl 
  29.             on_exit if (cflag == 0) sameline " ==> " al
  30.     function 60h
  31.         on_entry output "2160: Canon " (ds:si->byte,asciiz,32) " ==> "
  32.         on_exit sameline (es:di->byte,asciiz,32)
  33.  
  34. intercept 25h
  35.     on_entry 
  36.         output "25: Abs Disk Read drv " al ", at sectr "
  37.         if (cx == 0FFFFh)
  38.             sameline (ds:bx->big.sector->dword) ", " 
  39.                      (ds:bx->big.num->word) " sctrs"
  40.         if (cx != 0FFFFh)
  41.             sameline dx ", " cx " sctrs"
  42.     on_exit if (cflag==1) sameline " [fail]"
  43.  
  44. intercept 26h
  45.     on_entry
  46.         output "26: Abs Disk Write drv " al ", at sectr "
  47.         if (cx == 0FFFFh)
  48.             sameline (ds:bx->big.sector->dword) ", " 
  49.                      (ds:bx->big.num->word) " sctrs"
  50.         if (cx != 0FFFFh)
  51.             sameline dx ", " cx " sctrs"
  52.     on_exit if (cflag==1) sameline " [fail]"
  53.  
  54. intercept 13h
  55.     function 0 on_entry output "1300: Recalibrate drive " dl
  56.     function 1 on_exit output "1301: Disk system status " al 
  57.     function 2
  58.         on_entry
  59.             output "1302: Read " al " sctrs: drv " dl ", head " dh 
  60.                 ", sctr " cl ", trk " ch 
  61.         on_exit if (cflag==1)
  62.             sameline " - FAILED (" ah ")"
  63.     function 3
  64.         on_entry
  65.             output "1303: Write " al " sctrs: drv " dl ", head " dh 
  66.                 ", sctr " cl ", trk " ch 
  67.         on_exit if (cflag==1)
  68.             sameline " - FAILED (" ah ")"
  69.     function 4
  70.         on_entry
  71.             output "1304: Verify " al " sctrs: drv " dl ", head " dh 
  72.                 ", sctr " cl ", trk " ch
  73.         on_exit if (cflag==1)
  74.             sameline " - FAILED (" ah ")"
  75.     function 5
  76.         on_entry
  77.             output "1305: Format " al " sctrs: drv " dl ", head " dh 
  78.                 ", sctr " cl ", trk " ch
  79.         on_exit if (cflag==1)
  80.             sameline " - FAILED (" ah ")"
  81.     function 8
  82.         on_entry
  83.             output "1308: Get drive params for " dl
  84.         on_exit
  85.             if (cflag==1) sameline " - FAILED (" ah ")"
  86.             if (cflag==0)
  87.                 output "Type " bl ", " dl " drvs, max head " dh 
  88.                     ", max sctr " cl ", max cyls " ch
  89.     function 0ch
  90.         on_entry output "130C: Seek to cyl " ch ", drv " dl ", head " dh
  91.         on_exit if (cflag==1) sameline " - FAILED (" ah ")"
  92.     function 0dh
  93.         on_entry output "130D: Alternate reset drive " dl
  94.         on_exit if (cflag==1) sameline " - FAILED (" ah ")"
  95.     function 10h
  96.         on_entry output "1310: Test drive " dl
  97.         on_exit sameline " - status " ah
  98.     function 15h
  99.         on_entry output "1315: Get type drv " dl
  100.         on_exit
  101.             sameline ": "
  102.             if (ah==0) sameline "No disk present"
  103.             if (ah==1) sameline "Floppy - Not changed"
  104.             if (ah==2) sameline "Floppy - changed"
  105.             if (ah==3) sameline "Fixed disk"
  106.         on_exit
  107.             sameline " : sctrs " cx dx
  108.     function 16h
  109.         on_entry output "1316: Get media change drv " dl ": "
  110.         on_exit
  111.             if (ah==0) sameline "Unchanged"
  112.             if (ah==6) sameline "Changed"
  113.     function 17h
  114.         on_entry
  115.             output "1317: Set type drv " dl ": "
  116.             if (al==0) sameline "no disk"
  117.             if (al==1) sameline "reg disk in reg drv"
  118.             if (al==2) sameline "reg disk in high dens. drv"
  119.             if (al==3) sameline "high dens. disk in high dens. drv"
  120.             if (al==4) sameline "720k disk in 720k drv"
  121.             if (al==5) sameline "720k disk in 1.44M drv"
  122.             if (al==6) sameline "1.44M disk in 1.44M drv"
  123.     function 18h
  124.         on_entry
  125.             output "1318: Set media type drv " dl ": sctrs/trk " cl 
  126.                 ", trks " ch ": "
  127.         on_exit
  128.             if (ah==0) sameline "OK"
  129.             if (ah==1) sameline "Not available"
  130.             if (ah==0ch) sameline "Not supported"
  131.             if (ah==80h) sameline "No disk in drive"
  132.  
  133. run "%1 %2 %3 %4"
  134. report "disk.out"
  135. report ""
  136. stop
  137.