diff --git a/src/raspberrypi/devices/scsihd.cpp b/src/raspberrypi/devices/scsihd.cpp index c6eebd1e..46dfd619 100644 --- a/src/raspberrypi/devices/scsihd.cpp +++ b/src/raspberrypi/devices/scsihd.cpp @@ -87,8 +87,18 @@ void SCSIHD::Open(const Filepath& path) } // Set the default product name based on the drive capacity + int capacity; + string unit; + if (GetBlockCount() >> 11 >= 1) { + capacity = GetBlockCount() >> 11; + unit = "MB"; + } + else { + capacity = GetBlockCount() >> 1; + unit = "KB"; + } stringstream product; - product << DEFAULT_PRODUCT << " " << (GetBlockCount() >> 11) << " MB"; + product << DEFAULT_PRODUCT << " " << capacity << " " << unit; SetProduct(product.str(), false); Disk::Open(path);