aboutsummaryrefslogtreecommitdiffstats
path: root/memdisk
diff options
context:
space:
mode:
authorGene Cumm <gene.cumm@gmail.com>2011-02-06 22:59:53 -0500
committerGene Cumm <gene.cumm@gmail.com>2011-02-06 22:59:53 -0500
commite10b3d5c70245484868d85a18c331e410d8b1a2d (patch)
tree7d8af7fa503e9e198c06dfce0bce31f37dd7debb /memdisk
parent3bf596b7900af8c07231f5d316cf15b303fffb7a (diff)
downloadsyslinux-e10b3d5c70245484868d85a18c331e410d8b1a2d.tar.gz
syslinux-e10b3d5c70245484868d85a18c331e410d8b1a2d.tar.xz
syslinux-e10b3d5c70245484868d85a18c331e410d8b1a2d.zip
memdisk/setup: Change int15maxres to parse memory range lines
Only touch the ranges that are type 1 (available)
Diffstat (limited to 'memdisk')
-rw-r--r--memdisk/setup.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/memdisk/setup.c b/memdisk/setup.c
index 623c9cd0..75e84756 100644
--- a/memdisk/setup.c
+++ b/memdisk/setup.c
@@ -724,16 +724,21 @@ uint32_t getramtop(void)
void int15maxres(uint32_t restop)
{
uint32_t ramtop;
+ struct e820range *ep;
ramtop = getramtop();
- /* printf(" TOP RAM-%08x RES-%08x", ramtop, restop); */
- if (restop < ramtop) {
- /* printf(" (A)"); */
- insertrange(restop, (ramtop - restop), 3);
- parse_mem();
+ for (ep = ranges; ep->type != -1U; ep++) {
+ if (ep->type == 1) { /* Only if available */
+ if (ep->start >= restop) {
+ printf(" %08x -> 2\n", ep->start);
+ ep->type = 2;
+ } else if (ep[1].start > restop) {
+ printf(" +%08x =2; cut %08x\n", restop, ep->start);
+ insertrange(restop, (ep[1].start - restop), 2);
+ }
+ }
}
- ramtop = getramtop();
- /* printf(" NOW RAM-%08x\n", ramtop); */
+ parse_mem();
}
struct real_mode_args rm_args;