The goal of StorKit is to take away the burden of understanding storage protocol and spend resource writing a lot of code to manage storage in your system. StorKit consists of the following key software layers:

OS abstraction: This layer provides the abstraction for OS storage protocols. It is the wrap-around over system storage I/O. It manages the logic and interaction with system storage I/O. It manages request and response buffers, interprets raw response from OS I/O layer and provides actionable data to application.

Hardware abstraction: abstracts your application from different type of storage interfaces (NVMe, SATA, SCSI).

Delegates: Functions that simplify further how your application interact with storage. By using StorKit delegates, your application can interact with storage in just a few lines of code, all logic is handled by StorKit delegates. The following delegates are available: Core delegate, security delegate, and test delegate.

StorKit delegate are C++ function calls. These function calls are block functions call. When your application calls these methods, it will be block until the system IO layer respond. In case of error, StorKit layer will timeout and return with an error code. Returned data are interpreted by StorKit and your application can just retrieve the data it needs. No need for your application to understand raw data buffers and parse through them. The figure below gives an overview of the software architecture.

 

Building Your Application Using StorKit

Below are the typical steps for your application to use StorKit:

Step 1: Scan for storage attached to the system and save them to a list. Use SKStorageDeviceUtil to perform this step; the step will return a list of Storage Objects.

Step 2: Use SKDelegateFactory to attach one or multiple StorKit delegates to a Storage Object. Currently, available delegates are: Core Delegate, Security Delegate, and Test Delegate.

Step 3: Use functions in delegates to interact with storage. See the list of available functions in the API Section.

There are sample applications that you can use as reference to jump start development of your application. All sample applications are implemented with these above three fundamental steps.

The following section describes key information when programming with StorKit:

  • How to address a storage device: Each storage is addressed by its “logical storage path” parameter. This parameter is unique for each storage device at a time in the system. Software uses this parameter to specify a storage that with it wants to interact. If a storage device is removed from the system, then reinserted, there is no guarantee that it will get the same logical path as it had last time it was in the system; hence, the software needs to refresh and use the new logical path. Example of storage paths are /dev/sda on Linux, and \\.\PhysicalDrive0 on Windows.
  • Root or administrative privilege: StorKit interacts or accesses storage directly via the system storage I/O channel; it needs root or administrator privilege. The software you build with StorKit will need to have administrator privilege at run time.
  • Function calls are block: System storage I/O calls are block function calls. Hence, when a function invokes StorKit’s function, the function will be block until system I/O return.

 

Supported Interfaces

Interface Availability
SATA Currently Available
PATA Currently Available
USB Currently Available
NVMe Q4 2019
eMMC Available upon request.

 

Supported OS and Tool Chain

OS Availability Tool Chain
Windows 10 Currently Available QT Creator version 5.11 or higher
Compiler MinGW C++ 5.3.0
Linux – Ubuntu 16.04 64-bit Currently Available g++ version 5.4.0.
Contact Virtium for different version of g++
Embedded Linux – Yocto Currently Available Yocto, NXP ARM i.MX
Raspberry PI
Embedded Linux – OpenWRT Under Development Under Development

Setup

The following sections describe how to setup the build environment to compile StorKit as part of your software. StorKit supports QT and standard g++ builds at the present time. Please contact Virtium if your application environment is Microsoft Visual Studio or something else.

 

Windows 10

  • Qt and Qt Creator version 5.11 or higher – download link at https://www.qt.io/.
  • Compiler: MinGW C++ 5.3.0 (included in Qt installer by default)

 

Linux – Ubuntu 16.04 64-bit

  • gcc: sudo apt-get install gcc.
  • g++: sudo apt-get install g++.
  • Make (optional): sudo apt-get install make.

Note: StorKit is compiled with g++ version 5.4.0. Please contact Virtium if you need to compile on a different version of g++

 

Build Configuration

 

Windows 10

Create New C++ Project
  1. Select File/New File or Project
  2. Pick Qt Console Application
  3. Click Choose… and pick a project name and MinGW compiler
  4. You will now see the create application.
Import StorKit Library

To specify a storage library to your project, please edit Project_name.pro using the following lines as shown below:

Change to StorKit:

# please select the package path
STORKIT_PATH = path_to_storage_package

STORAGE_API = $$STORKIT_PATH/STORKIT-storageapi/lib
TEST_DELEGATE = $$STORKIT_PATH/STORKIT-testdelegate/lib

win32:LIBS += \
-L$$TEST_DELEGATE/win32/ -lSTORKIT-TestDelegate \
-L$$TEST_DELEGATE/win32/ -lSTORKIT-StorageApi

else:unix:LIBS += \
-L$$TEST_DELEGATE/unix/ -lSTORKIT-TestDelegate \
-L$$TEST_DELEGATE/unix/ -lSTORKIT-StorageApi

INCLUDEPATH += \
$$STORAGE_API/include \

 

Linux – Ubuntu 16.04 64-bit Setup

  1. Copy StorKit-Release to your local build library directory.
  2. Modify your makefile to include StorKit’s include and libraries. See the example below.

 

Change to StorKit:

# Dependencies include

STORKIT_DELEGATE  = ../

CFLAGS      = -I$( STORKIT_DELEGATE)lib/include -I$( STORKIT_DELEGATE)lib/include/core -I$( STORKIT_DELEGATE)lib/include/common \
-I$( STORKIT_DELEGATE)lib/include/core/linux -I$(
STORKIT_DELEGATE)lib/include

# Link storage-api library

LIBS                    += -lm -ldl -pthread -lrt -lpthread
LIBS                    += -L./$( STORKIT_DELEGATE)lib/unix -lSTORKIT-CoreDelegate
LIBS                    += -L./$(TESTDELEGATE)/unix -lSTORKIT-TestDelegate
LIBS                    += -L./$( STORKIT_DELEGATE)/unix -lSTORKIT-SecurityDelegate
LIBS                    += -L./$( STORKIT_DELEGATE)lib/unix -lSTORKIT-StorageApi