[Etherboot-developers] mknbi-1.2-7rc3 released
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: <ke...@us...> - 2002-02-28 12:16:12
|
>Ah, ok I guess I was being lazy and assuming that the second segment >would be above 1MB. > >Ok, I didn't realise that ramdisk_max was a cap rather than the actual >top of memory. Makes sense. Will fix. Sorry, the last posting went to Etherboot-users by mistake, mystifying newbies no doubt, but I think I've got the code right now (famous last words). Latest release is in: http://etherboot.sf.net/mknbi-1.2-7rc3.tar.gz Here's the relevant segment: ... get_memsizes(); max = (setup->su_version >= 0x203) ? setup->ramdisk_max : 0x37FFFFFF; /* compute top of initrd only if user has not overridden it */ if (top_of_initrd == 0) { struct e820entry *e; /* look for highest E820_RAM that is under ramdisk_max strictly speaking we should also check that we have room for the ramdisk in the memory segment */ for (i = 0; i < meminfo.map_count; i++) { e = &meminfo.map[i]; if (e->type == E820_RAM && e->addr < max && (e->addr + e->size) > top_of_initrd) top_of_initrd = e->addr + e->size; } } if (top_of_initrd > max) top_of_initrd = max; /* Round down to next lower 4k boundary */ top_of_initrd &= ~0xFFF; printf("Top of initrd is %dk\n", top_of_initrd >> 10); ... and top_of_initrd measures bytes now. |