Skip to main content

Build Instructions

General Build Requirements

This chapter will cover how to get the Software Development Kit (SDK) source, build and install different components. Specific requirements and dependencies are listed for each component along with the install command. The Software-Enabled Flash™️ (SEF) SDK components and tools were designed to run on 32-bit or 64-bit systems and are endian agnostic.

NOTE: The build instructions below match how the SDK is built on Ubuntu™️ 20.04

Source Code

The SEF SDK will soon be available to clone from GitHub. The following command can be used to clone with SEF SDK:

$ git clone https://github.com/SoftwareEnabledFlash/SEF-SDK.git

Note: Pre-release distributions will be distributed as compressed tar images which may be extracted as follows:

$ tar -xzvf SEFSDK.tar.gz

Linux™️ Kernel

SEF SDK requires a modified Linux Kernel 5.19. This section covers how to download, modify, build and install the required kernel. To learn more about SEF Linux and how it works refer to SEF Linux™️ Driver Chapter.

Note: Cloning the Linux repository as part of the build will take several minutes.

Before getting started, ensure the following prerequisites have been installed:

  • libncurses-dev
  • gawk
  • flex
  • bison
  • openssl
  • libssl-dev
  • libudev-dev
  • dwarves
  • zstd
  • libelf-dev
  • libpci-dev
  • libiberty-dev
  • autoconf
  • dkms
  • bc

The following command can be used to install these dependencies:

$ sudo apt update
$ sudo apt install -y libncurses-dev gawk flex bison openssl \
libssl-dev dwarves zstd libelf-dev libpci-dev libiberty-dev \
autoconf dkms bc

Because this is a custom kernel, you may receive an error about a bad signature, which requires Secure Boot disabled in BIOS.

We provide a kioxia.config built from a server install of Ubuntu™️ 20.04’s config. However, you can create your own .config file with the ‘make menuconfig‘ command.

To build and install the SEF Linux, issue the following commands:

$ cd <path to SEF_SDK>/linux
$ ./apply_patch.sh
$ cd official-linux
$ cp ./arch/x86/configs/kioxia.config .config
$ make -j`nproc`
$ sudo make -j`nproc` INSTALL_MOD_STRIP=1 modules_install
$ sudo make install
$ sudo reboot now

SEF Driver

It is important to note that the SEF Driver and the Linux kernel must be built on the same system to ensure compatibility. The sef.ko kernel module requires a system running SEF Linux in order to access the SEF Unit. To learn more about SEF Driver and how it works refer to SEF Linux™️ Driver Chapter.

Note: If the driver fails to load with a message regarding unknown symbols, it is because nvme-core.ko and nvme_ko were not previously loaded by the system. Also, please check if your SEF Unit was properly installed using lspci command.

Before getting started, ensure the following prerequisites have been installed:

  • build-essential
  • libudev-dev
  • cmake

The following command can be used to install these dependencies:

$ sudo apt install -y build-essential libudev-dev cmake

To build and install the SEF Driver so that it will load across reboots, first build Linux, then issue the following commands:

$ cd <path to SEF_SDK>
$ export SEF_KERNEL_SRC=/<path to SEF_SDK>/linux/official-linux/
$ sudo SEF_KERNEL_SRC=${SEF_KERNEL_SRC} ./build.sh -o driver -i
$ sudo modprobe sef

SEF Library, Flash Translation Layer (FTL) and Command Line Interface (CLI)

The SEF SDK uses the cmake and make tool set in order to prepare, build, and install the SDK components. The Software Development Kit can be downloaded and installed in one easy step. The master SEF SDK project includes all the SDK modules.

To learn more about SEF Library, FTL, and CLI and how they work, refer to SEF Library Chapter, SEF Reference Flash Translation Layer (FTL) Chapter, Command Line Interface (CLI) Chapter respectively.

Before getting started, ensure the following prerequisites have been installed:

  • cmake
  • python3-dev (python3.6m or higher)

The following command can be used to install these dependencies:

$ sudo apt install -y cmake python3-dev

To build the SEF Library, FTL, and CLI, issue the following commands:

$ cd <path to SEF_SDK>
$ sudo ./build.sh -i

As part of the installation, the process will automatically install the CLI’s man page and auto-complete script.

FIO

To learn more about SEF FIO Engine and how it works refer to Flexible I/O Tester (FIO) Chapter.

In addition to the dependencies of FIO, ensure the following SEF prerequisites have been in- stalled:

  • SEF Reference FTL library
  • SEF library
  • Header and libraries for pthread

Before building FIO, it should be configured. The SEF Engine is enabled by default. To configure, build, and install FIO, issue the following commands:

$ cd <path to SEF_SDK>/fio
$ ./configure
$ make
$ sudo make install

SEF QEMU

Although QEMU can be used to test software that has not be changed to support SEF natively, it is not required to use or test SEF. To learn more about SEF QEMU and how it works refer to QEMU Chapter.

In addition to the dependencies of QEMU, ensure the following SEF prerequisites have been installed:

  • SEF Reference FTL library
  • SEF library
  • Header and libraries for pthread
  • git
  • libglib2.0-dev
  • libfdt-dev
  • libpixman-1-dev
  • zlib1g-dev
  • ninja-build
  • pkg-config

The following command can be used to install these dependencies:

$ sudo apt install -y git libpthread-stubs0-dev libglib2.0-dev \
libfdt-dev libpixman-1-dev zlib1g-dev ninja-build pkg-config

SEF QEMU supports an SEF-backed virtual block device, block NVMe device, ZNS NVMe device or FDP.

To build and install the SEF QEMU, issue the following commands:

$ cd <path to SEF_SDK>
$ sudo -v; ./build.sh -o qemu -e -i

NVME-CLI

Although NVME-CLI is a powerful tool that can be used to interact with and configure an SEF Unit, it is not required. To learn more about SEF NVME-CLI and how it works refer to NVMe-CLI Chapter.

Ensure the following prerequisites have been installed:

  • libjson-c-dev
  • pthread
  • meson
  • ninja-build

The following command can be used to install these dependencies:

$ sudo apt install -y meson ninja-build

To build and install the NVME-CLI, issue the following commands:

$ cd <path to SEF_SDK>/nvme-cli
$ ./apply_patch.sh
$ cd official-nvme
$ meson .build
$ ninja -C .build
$ sudo make install

Validating Installation

Once the kernel, driver, libraries, and applications are built and installed, the following sequence of commands can verify communications with an installed SEF Unit.

The following commands check if the SEF Unit can be detected by listing all SEF Units, create a Virtual Device, create a QoS Domain, configure the FTL, and runs a short FIO job. The script assumes the SEF Unit is installed at index 0. The commands use the --force / -f flag to force the actions without asking for confirmation and the --verbose / -V flag to use the verbose mode. To learn more about the commands being executed, read Command Line Interface (CLI) Chapter.

Note: The following instructions assume the driver has been loaded. Prerequisite: Should have an empty SEF Unit. Delete Virtual Devices following directions in Section Deleting Virtual Devices

$ sudo sef-cli list sef
SEF Unit Index Vendor FW Version HW Version Channels Dies
SEF Unit 0 KIOXIA 1LMSS528 1 8 192
SEF Unit Count 1


$ sudo sef-cli create virtual-device --sef-index 0 \
--virtual-device-id 1 --super-block 1:32 --force --verbose
Die Map:
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
The Virtual Devices for SEF Unit 0 was successfully created


$ sudo sef-cli create qos-domain --sef-index 0 --label \
"613006, 88877" --virtual-device-id 1 --force --defect-strategy \
"kPacked" --verbose --flash-capacity-percent 5
The QoS Domain 1 was successfully created


$ sudo sef-cli configure ftl --sef-index 0 --label "613006, 88877" \
--force --verbose
The QoS Domain 1 was successfully configured by SDK

$ sudo fio <path to SEF_SDK>/fio/official-fio/examples/sef.fio