This is BSD licenced code from the Cosmos-plus-OpenSSD project