home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / ASBENC.ZIP / ASBENCH.TXT < prev    next >
Text File  |  1993-02-21  |  5KB  |  143 lines

  1. This is a SCSI benchmark test program under ASPI. It can measure Hard-Disk,
  2. MO-Disk, CD-ROM drive's performance.
  3.  
  4. All the part of this program are written by Borland C++ V3.1. Complete source
  5. files are included. By using its SCSI handling routine, you can write SCSI
  6. program very easily.
  7.  
  8.  
  9. How to use
  10. ~~~~~~~~~~
  11. This program uses ASPI function call to handling SCSI, so you must add
  12. adequate ASPI manager to your config.sys. For example, if you are using
  13. Adaptec AHA-1542B, you must add ASPI4DOS.sys to your config.sys.
  14.  
  15. To execute program, type "ASBENCH", then press <Enter> key. If your ASPI
  16. manager is working correctly, device select menu like below will appear.
  17.  
  18. -------------------------------------------------------------------------------
  19. ASPI SCSI benchmark test V0.2
  20.  copyright(c) by Tsuru-Zoh, Nov.23,1992
  21.  
  22. Target No.0 : HA#0 ID1  MAXTOR  LXT-535S        8.57  CCS1 Rigid
  23. Target No.1 : HA#0 ID2  MAXTOR  XT-8760S        B6B   CCS1 Rigid
  24. Target No.2 : HA#0 ID6  HITACHI CDR-3650/1650S  0003  CCS1 Removable
  25.  
  26. Enter target number ( 0 to 2 ) : 
  27. -------------------------------------------------------------------------------
  28.  
  29. The devices except HDD/MO/CD-ROM will not appear in this menu.
  30. Choose target number to test, then benchmark test will starts. For example,
  31. in this case if you want to test LXT-535S, press '0' and <Enter>. If you
  32. want to test CDR-3650, press '2' and <Enter>.
  33.  
  34.  
  35. This benchmark contains 6 tests. There are no data write operations in
  36. tests, so no data in device will be damaged.
  37.  
  38. 1: Test Unit Ready command overhead time
  39. 2: Seek command to Logical block 0 overhead time (no motion seek)
  40. 3: Sequential block seek command time
  41. 4: Random block seek command time
  42. 5: Sequential block read transfer rate
  43. 6: Random block read transfer rate
  44.  
  45. This program measures how many commands executed in 5 seconds. For example,
  46. the drive can execute Random Seek 350 times in 5 seconds, average random
  47. seek time is
  48.  5 / 350[sec] = 14[ms]
  49. If the drive can execute 120 times of 8192 bytes sequential read in 5
  50. seconds, average transfer rate is
  51.  8192 * 120 / 5 = 196 KB/s.
  52.  
  53. This program displays performance rate by Bar-Graph, this value is based
  54. on Hard Disk performance rates that I think it's average value. So if you
  55. measure MO-Disk or CD-ROM drive, its performance rate becomes "Poor" or
  56. "OK", but it's no problem. Performance rate chart is below.
  57.  
  58. Performance rate chart:
  59.                           Poor  |    OK    |   Good   |   Great   |   Superb
  60. Test Unit Ready command      >2.5ms>    >1.9ms>    >1.3ms>     >0.6ms>
  61. No Motion Seek command       >3.5ms>    >2.6ms>    >1.8ms>     >0.9ms>
  62. Sequential Seek              >10ms>     >7.5ms>      >5ms>     >2.5ms>
  63. Random Seek                  >40ms>     >30ms>      >20ms>      >10ms>
  64. Sequential Read            <400KB/s<    <800KB/s<  <1.2MB/s<   <1.6MB/s<
  65. Random Read                <300KB/s<    <600KB/s<  <900KB/s<   <1.2MB/s<
  66.  
  67. Please notice that these results includes ASPI manager and SCSI Host
  68. Adapter's overhead time. For example, Adaptec's AHA-1542B has 1.5 to 2ms
  69. of command overhead time.
  70.  
  71.  
  72. Known Bugs:
  73. ~~~~~~~~~~~
  74. Some of CD-ROM media contains several sector size (ex. 2048/2340Bytes).
  75. In that case, this program will be terminated by read error. If it occurred,
  76. please change CD-ROM media and try again.
  77.  
  78.  
  79.                       ü@TsuruZoh Tachibanaya    Nifty-Serve    ID : PEE00476
  80.                                                 Compuserve     ID : 74440,476
  81.  
  82. Freeware Licence
  83. ~~~~~~~~~~~~~~~~
  84. This program, program sources, associated files may be copied, used and
  85. posted on any BBS without charge or permission. The program, program
  86. sources, associated files may not be modified, sold, or used as part of
  87. a commercial package without permission of the author.
  88.  
  89.  
  90. Appendix: How to use aspiscsi.c
  91. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  92. Here is a sample program to use aspiscsi.c. It read 1 sector from
  93.  "Host adapter No.0, SCSI-ID 0, SCSI logical block address(LBA) 0"
  94. then dump it. If you save this program as "test.c", please compile it
  95. like below.
  96.  
  97. bcc test.c aspiscsi.c
  98.  
  99. If you want to get detailed specs about ASPI, please access Adaptec BBS
  100. (1-408-945-7727). There are document file of ASPI specs for DOS
  101. (ASPIDOS.txt) in their Data Library.
  102.  
  103.  
  104. -----------------------------------------------------------------------
  105. #include <stdio.h>
  106. #include "aspi.h"
  107.  
  108. #define HA_NO 0        // host adapter no. 0
  109. #define SCSI_ID 0    // target ID 0
  110. #define SCT_SIZE 512    // sector size is 512
  111.  
  112. unsigned char _far buffer[ 1024 ];
  113.  
  114. main()
  115. {
  116.     int i, j;
  117.  
  118.     // initialize ASPI handler
  119.     if( AspiInit() ){
  120.         return( -1 );
  121.     }
  122.  
  123.     // check target is ready or not
  124.     if( TestUnitReady( HA_NO, SCSI_ID ) ){
  125.         return( -1 );
  126.     }
  127.  
  128.     // read 1 sector from LBA=0L
  129.     if( ScsiRead( HA_NO, SCSI_ID, 0L, SCT_SIZE, 1, buffer ) ){
  130.         return( -1 );
  131.     }
  132.  
  133.     // dump data
  134.     for( i = 0; i < 512; i += 16 ){
  135.         for( j = 0; j < 16; j++ ){
  136.             printf( "%02x ", buffer[ i + j ] );
  137.         }
  138.         putchar( '\n' );
  139.     }
  140.     return( 0 );
  141. }
  142. -----------------------------------------------------------------------
  143.