Member-only story
Playing Naive — SSD Firmware Development — Part 11
With the basic knowledge and a basic framework built into the code base, we can start having some fun! Since my motivation for these articles is for knowledge share, I’d like to focus on the journey rather than the end goal. We’re going to jump right in and see how we can naively create a simple SSD firmware that allows a host to write and read data. We’ll discuss and address problems along the way, rather than trying to avoid them upfront.
Addressing Spaces
Recall from Part 3 that the host has an address space called the LBA space, where each LBA is some fixed number of bytes and LBA ranges from 0 to a maximum number of sectors for a given SSD (note that I will be using LBA and sector interchangeably). The SSD determines the LBA range that it supports and the host usually performs a query to retrieve this information. Within the HostComm project, we have implemented a CustomProtocol that supports custom protocol commands. This allows us to be less distracted from learning about standardized protocols such as SATA, SCSI, or NVMe for the moment. We can use our custom protocol to define a command that allows the host to retrieve the number of sectors our SSD will support. We’ll call this command GetDeviceInfo.
Our SSD device firmware has access to NAND for data storage. The NAND has its own…