dev: IDE Disk: Handle bad IDE image size
Handle bad IDE disk image size 0. When image size is 0, gem5 will cause an exception with log "Floating point exception (core dumped)". Committed by: Nilay Vaish <nilay@cs.wisc.edu>
This commit is contained in:
parent
8dfa45e03c
commit
58ec70444d
1 changed files with 2 additions and 0 deletions
|
@ -90,6 +90,8 @@ IdeDisk::IdeDisk(const Params *p)
|
|||
} else {
|
||||
if (lba_size >= 63)
|
||||
sectors = 63;
|
||||
else if (lba_size == 0)
|
||||
panic("Bad IDE image size: 0\n");
|
||||
else
|
||||
sectors = lba_size;
|
||||
|
||||
|
|
Loading…
Reference in a new issue