sim: add validation to make sure there is memory where we're loading the kernel
This commit is contained in:
parent
3742b19b36
commit
3f5ee1cf8c
1 changed files with 7 additions and 0 deletions
|
@ -266,6 +266,13 @@ System::initState()
|
|||
* Load the kernel code into memory
|
||||
*/
|
||||
if (params()->kernel != "") {
|
||||
// Validate kernel mapping before loading binary
|
||||
if (!(isMemAddr(kernelStart & loadAddrMask) &&
|
||||
isMemAddr(kernelEnd & loadAddrMask))) {
|
||||
fatal("Kernel is mapped to invalid location (not memory). "
|
||||
"kernelStart 0x(%x) - kernelEnd 0x(%x)\n", kernelStart,
|
||||
kernelEnd);
|
||||
}
|
||||
// Load program sections into memory
|
||||
kernel->loadSections(physProxy, loadAddrMask);
|
||||
|
||||
|
|
Loading…
Reference in a new issue