atahd: break long lines.

This commit is contained in:
Maxim Poliakovski 2024-03-29 12:46:57 +01:00
parent 155b8cdad9
commit 71dabf5334
2 changed files with 11 additions and 5 deletions

View File

@ -63,14 +63,16 @@ int AtaHardDisk::device_postinit() {
void AtaHardDisk::insert_image(std::string filename) { void AtaHardDisk::insert_image(std::string filename) {
if (!this->hdd_img.open(filename)) { if (!this->hdd_img.open(filename)) {
ABORT_F("%s: could not open image file \"%s\"", this->name.c_str(), filename.c_str()); ABORT_F("%s: could not open image file \"%s\"", this->name.c_str(),
filename.c_str());
} }
this->img_size = this->hdd_img.size(); this->img_size = this->hdd_img.size();
uint64_t sectors = this->hdd_img.size() / ATA_HD_SEC_SIZE; uint64_t sectors = this->hdd_img.size() / ATA_HD_SEC_SIZE;
this->total_sectors = (uint32_t)sectors; this->total_sectors = (uint32_t)sectors;
if (sectors != this->total_sectors) { if (sectors != this->total_sectors) {
ABORT_F("%s: image file \"%s\" is too big", this->name.c_str(), filename.c_str()); ABORT_F("%s: image file \"%s\" is too big", this->name.c_str(),
filename.c_str());
} }
this->calc_chs_params(); this->calc_chs_params();
} }

View File

@ -30,9 +30,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <string> #include <string>
#define ATA_HD_SEC_SIZE 512 #define ATA_HD_SEC_SIZE 512
#define ATA_BIOS_LIMIT 16514064 // C:16383 x H:16 x S:63 = C:1032 x H:254 x S:63 = 8063.5078125 MiB = 8.46 GB
#define REAL_CHS_LIMIT 267382800 // C:65535 x H:16 x S:255 = 127.498 GiB = 136.900 GB = largest identify // C:16383 x H:16 x S:63 = C:1032 x H:254 x S:63 = 8063.5078125 MiB = 8.46 GB
#define CHS_LIMIT 267386880 // C:65536 x H:16 x S:255 = 127.500 GiB = 136.902 GB = largest address #define ATA_BIOS_LIMIT 16514064
// C:65535 x H:16 x S:255 = 127.498 GiB = 136.900 GB = largest identify
#define REAL_CHS_LIMIT 267382800
// C:65536 x H:16 x S:255 = 127.500 GiB = 136.902 GB = largest address
#define CHS_LIMIT 267386880
class AtaHardDisk : public AtaBaseDevice class AtaHardDisk : public AtaBaseDevice
{ {