DriveMaster Scripts

DriveMaster scripts are run under a built-in script interpreter and the script programming language uses control syntax similar to C Language. User can copy and paste the sample scripts to DriveMaster 2010 Script Window and run it.

 
 
//Sample 1 -- READ/WRITE & Data Compare 
cls                                                   //clear log window
prns "Sample script for Read/Write with data compare" //print string to log
prnsr "Script Start "; time                           //start time
g0=1000                                               //initialize variable    
v0=2000
k0=255
setf 03h,0ch                                          //set PIO mode       
wsec v0, k0                                           //issue WRITE SECTOR with LBA=2000, count=255
rsec v0, k0                                           //issue READ SECTOR
cmp                                                   //compare data
 
 

 

 
 
//Sample 2 -- NCQ Commands 
upd on 
echo off 
logoff 

v0 = 1000h                                            //LBA 
v1 = 10                                               //sector count 
v2 = 1                                                //Tag Num used by FPDMA Write 
v3 = 2                                                //Tag Num used by FPDMA Read 

Fillset "Write", v1*512, 100000h*V2                   //Set to fill (v1*512) Bytes' Data to write buffer from offset (100000h*v2) 
                                                      //Note: the current offset is associated with Tag Num (v2) used by FPDMA Write 
                                                      //By default, DM allocates maximal 100000h bytes' for each Tag. 
PATI "Write"                                          //Fill BYTE incremental data pattern to write buffer 
WDMA_NCQ v0, v1, v2                                   //Issue FPDMA Write command with LBA = v0, Sector Count = v1, Tag Num = v2 
RDMA_NCQ v0, v1, v3                                   //Issue FPDMA Read command with LBA = v0, Sector Count = v1, Tag Num = v3 
QEND                                                  //Wait for all the outstanding FPDMA commands being finished 
PATZ "Write"                                          //Fill ZERO data pattern to write buffer 

v4 = v3*100000h+v1*512                                //calculate the View Size of buffer 
SetViewSize "Read", v4                                //set Read buffer to the appropriate view size 
SetViewSize "Write", v4                               //set Write buffer to the appropriate view size 

Fillset "Write", v1*512, 100000h*v3                   //Set to fill (v1*512) Bytes' Data to write buffer from offset (100000h*v3) 
                                                      //Note: the current offset is associated with Tag Num (v3) used by FPDMA Read 
PATI "Write"                                          //Fill BYTE incremental data pattern to write buffer 
Cmpset 1, v3*100000h, v1*512                          //set to compare (v1*512) Bytes' Data from offset (100000h*v3) 
cmp 

upd off 
echo on 
log2