mirror of https://github.com/ipxe/ipxe.git
[segment] Add "Requested memory not available" error message
prep_segment() can sometimes fail because an image requests memory that is already in use by gPXE. This will happen if e.g. undionly.kpxe is used to boot memtest86; the memtest86 image is an old-format kernel that needs to be loaded at 9000:0000, but this area of memory may well already be in use by the underlying PXE stack. Add a human-friendly error message, so that the cause is more immediately visible.pull/1/head
parent
edea441ad5
commit
f7d2168c8e
|
@ -115,5 +115,6 @@ struct errortab common_errors[] __errortab = {
|
||||||
{ ENOSPC, "No space left on device" },
|
{ ENOSPC, "No space left on device" },
|
||||||
{ ENOTSUP, "Not supported" },
|
{ ENOTSUP, "Not supported" },
|
||||||
{ EPERM, "Operation not permitted" },
|
{ EPERM, "Operation not permitted" },
|
||||||
|
{ ERANGE, "Out of range" },
|
||||||
{ ETIMEDOUT, "Connection timed out" },
|
{ ETIMEDOUT, "Connection timed out" },
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <gpxe/uaccess.h>
|
#include <gpxe/uaccess.h>
|
||||||
#include <gpxe/memmap.h>
|
#include <gpxe/memmap.h>
|
||||||
|
#include <gpxe/errortab.h>
|
||||||
#include <gpxe/segment.h>
|
#include <gpxe/segment.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,3 +73,13 @@ int prep_segment ( userptr_t segment, size_t filesz, size_t memsz ) {
|
||||||
start, mid, end );
|
start, mid, end );
|
||||||
return -ERANGE;
|
return -ERANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Segment-specific error messages
|
||||||
|
*
|
||||||
|
* This error happens sufficiently often to merit a user-friendly
|
||||||
|
* description.
|
||||||
|
*/
|
||||||
|
struct errortab segment_errors[] __errortab = {
|
||||||
|
{ ERANGE, "Requested memory not available" },
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue