Article: KB-035

The easiest way to start is to download the Linux version of the API. Use an Ubuntu PC and download this package, StorKit_API_Linux_20200908.7z.

If your system is ARM CPU or Embedded Linux (Yocto, OpenWRT), we will compile the software tool for your environment.

Quickstart

  1. Start with an Ubuntu computer
  2. Install g++ compiler on your system if it is not already installed.
  3. Extract StorKit_API_Linux_20200908.7z, using command tar -xvf StorKit_API_Linux_20200908.7z.
  4. Under each directory. there are sample code and makefile.
  5. Type make to compile
  6. These samples are a fully functional sample software built on top of our StorKit API. It will take minimum coding to create a similar test for your environment.

Other Supported Compilers

Linux

  • g++ version 5.4.0.

Windows

  • QT Creator version 5.11 or higher.
  • Compiler MinGW C++ 5.3.0

Embedded Linux (Yocto, OpenWRT) on ARM and Raspberry PI

  • Contact us to provide information about the development environment

Quick API reference

The delegate tables below are only for quick references. Please request the full API documentation for returned codes and detailed information.

Download the API documentation

Core Delegate

  Functions Description
Common Common functions that are used at the beginning of every operation
Scan Device

SKStorageDeviceUtils::scanDevices

Scan for storage devices. This is the first function that every application will do. This function returns a list of storages that it can detect and communicate with.
Read device identify

SKCCoreDelegate::identifyDevice

This function is to retrieve device identify information, which provides information about what device this is, serial number, supported features and current settings
vtView Normal sequence to collect log is shown below
Setup “vtView logging” conditions. Set values for this structure SKCLogSetting Setup to collect vtView data:

·       Drive(s) to collect

·       How long to collect

·       Collection frequency

·       Log file name

Start logging vtView data

SKCCoreDelegate::startLogging

Start the logging process. The logging will be started and based on the “vtView logging” conditions
Log SMART attributes on demand.

SKCCoreDelegate::addLogLine

This function is to read current SMART attributes and add to the log immediately.

This is useful when we need to capture current values of SMART attributes due to a specific circumstance in the system.

Stop logging vtView data

SKCCoreDelegate::stopLogging

Stop vtView logging. Stop logging is necessary to start the analysis. The current log file is closed.
vtView Analyze data and get life span information
Load log data

SKCCoreDelegate::loadLogData

Load vtView log data into memory and prepare for analysis
Perform analysis and get vtView result

SKCCoreDelegate::getUsageStatistics

Instruct StorKit to perform analysis on vtView log file and return results.
Retrieve power off data retention estimates

SKCCoreDelegate::getPowerOffDataRetentionEstimate

Retrieve estimates on data retention from the current time. It is particularly useful to print label for SSD regarding data retention during power off.

Power off data retention on SSD is limited and based on NAND erase count information.

Release log data. It is necessary to call this function.

SKCCoreDelegate::releaseLogData

This function is the trigger for StorKit to release all memory allocated when it loaded vtView log into memory for the analysis.
Others More useful functions for software or production tool
Read SMART attributes

SKCCoreDelegate::readSmart

Retrieve SMART attributes from the device. This function reads the raw data, then interprets the data for your application to consume.
Save current state

SKCCoreDelegate::saveCurrentState

Save current state of the device: identify device and current settings, current value of SMART attribute.

This function is to save state of the device before a test and after a test or save the state as part of your production flow.

Is Virtium SSD?

SKCCoreDelegate::isVirtiumDevice

StorKit can only calculate vtView results accurately with Virtium’s SSD. This function help distinguish Virtium device from other vendors.
Export identify device information in binary format.

SKCCoreDelegate::exportIdentifyBinary (file)

Export identify device information of an SSD to a file in binary format.

It is useful when we need to compare features and settings of two firmware versions or two SSD. Use this with function SKCCoreDelegate::compareIdentify

Security Delegate

  Functions Description
Common Common functions that are used at the beginning of every operation
Scan Device

SKStorageDeviceUtils::scanDevices

Scan for storage devices. This is the first function that every application will do. This function returns a list of storages that it can detect and communicate with.
Read device identify

SKCCoreDelegate::identifyDevice

This function is to retrieve device identify information, which provides information about what device this is, serial number, supported features and current settings
Standard Standard ATA security function
Is the security feature set supported?

SKSSecurityDelegate::isSecurityFeatureSetSupported

Determine if security feature set is supported.

If security feature set is supported, continue with security operation.

If security feature is not supported, it means set password, sanitize and secured erase are not supported.

Is security enabled?

SKSSecurityDelegate::isSecurityEnabled

If security feature set is supported and enabled, sanitize and secured erase are supported and ready.

If security feature set is supported and not enabled, enable security by setting master or user password.

Is security frozen?

SKSSecurityDelegate::isSecurityFrozen

System OS enables security frozen sometimes to protect data on SSD from external attack. This function returns current value of the security state (frozen or not frozen).

If the state is frozen, follow ATA procedure in ATA specification to unfreeze the drive before security feature can be executed.

Is security locked?

SKSSecurityDelegate::isSecurityLocked

Sanitize Sanitize feature set
Is the sanitize feature supported?

SKSSecurityDelegate::isSanitizeSetSupported

Determine if sanitize feature is supported?
Is sanitize by Block Erase supported?

SKSSecurityDelegate::isSanitizeBlockEraseSupported

Determine if sanitize by block erase is supported. Security must also be enabled and unfrozen to sanitize to work.
Sanitize by Block Erase

SKSSecurityDelegate::sanitizeBlockErase

Instruct SSD to start sanitizing process by issuing physical erase of NAND blocks.
Is sanitize by Crypto Scramble supported?

SKSSecurityDelegate::isSanitizeCryptoScrambleSupported

Determine if sanitize by crypto scramble is supported. Security must also be enabled and unfrozen to sanitize to work.
Sanitize by Crypto Scramble

SKSSecurityDelegate::sanitizeCryptoScramble

Instruct SSD to start sanitizing process by changing crypto scramble key. Data will be scrambled but physical NAND are not erased.
Is sanitize by overwriting supported?

SKSSecurityDelegate::isSanitizeOverwriteSupported

Determine if sanitize by overwrite is supported.
Secure Erase Secure Erase functions
Initiate secure erase the device

SKSSecurityDelegate::secureErase

Initiate secure erase process on the device. Application can specify erase mode when invoke this function to perform secure erase.
TCG OPAL TCG OPAL functions
Is TCG OPAL supported?

SKSSecurityDelegate::isOpal20Supported

Determine if the device supports TCG OPAL security feature.
Is TCG OPAL feature initialized?

SKSSecurityDelegate::isOpalDeviceInitialized

To use TCG OPAL feature, it must be initialized. This function will check if it is initialized.
Setup TCG OPAL

SKSSecurityDelegate::initialSetup

Setup SID password for TCG OPAL.
Is PSID revert supported?

SKSSecurityDelegate::isPSIDRevertSupported

Determine if PSID revert is supported.
Initiate PSID revert.

SKSSecurityDelegate::psidRevert

Initiate PSID revert for the device.
Military Erase Will be released upon request

Test Delegate

  Functions Description
Common Common functions that are used at the beginning of every operation
Scan Device

SKStorageDeviceUtils::scanDevices

Scan for storage devices. This is the first function that every application will do. This function returns a list of storages that it can detect and communicate with.
Read device identify

SKCCoreDelegate::identifyDevice

This function is to retrieve device identify information, which provides information about what device this is, serial number, supported features and current settings
Base Fundamental test functions
Write LBA

SKTTestDelegate::writeLBA

This function writes directly to storage device without the interference of the file system.

It is useful to test and debug storage device or measure response time from storage device.

Note: Only attempt this on blank storage or you know what you are doing with storage test and understanding how file system works.

Read LBA

SKTTestDelegate::readLBA

This function reads directly from storage device without the interference of the file system.
Sequential write test

SKTTestDelegate::sequentialWritePerformanceTest

This function performs a sequential write test on the storage device and return performance data. The performance data is calculated based on the amount data written and duration of the test.
Sequential read test

SKTTestDelegate::sequentialReadPerformanceTest

This function performs a sequential read test on the storage device and return performance data. The performance data is calculated based on the amount data read and duration of the test.
Random write test

SKTTestDelegate::randomWritePerformanceTest

This function performs a random write test on the storage device and return performance data. The performance data is calculated based on the amount data written and duration of the test.
Random read test

SKTTestDelegate::randomReadPerformanceTest

This function performs a random read test on the storage device and return performance data. The performance data is calculated based on the amount data read and duration of the test.
Plus More advanced test functions
Sequential write with unique pattern

SKTTestDelegate::sequentialWriteWithUniquePatterns

This function writes unique data pattern for each LBA. The data is written in way that it can be read and verified later without a need to store data in memory for verification.

The writes are sequential.

Random write with unique pattern

SKTTestDelegate::randomWriteWithUniquePatterns

This function writes unique data pattern for each LBA. The data is written in way that it can be read and verified later without a need to store data in memory for verification.

The writes are random.

Verify data integrity

SKTTestDelegate::verifyPreviousSequentialWriteData

SKTTestDelegate::verifyPreviousRandomWriteData

This function works in conjunction with “sequential write with unique pattern” or “random write with unique pattern.”

It reads data from the drive and use the information in the data itself to verify whether the data is OK or corrupted.