--- 2.3.17-pre1/arch/i386/mm/init.c Wed Sep 1 09:29:44 1999 +++ 2.3.17-pre1-d117/arch/i386/mm/init.c Sat Sep 4 17:50:38 1999 @@ -375,7 +375,7 @@ int datapages = 0; int initpages = 0; unsigned long tmp; - unsigned long addr; + unsigned long addr, size; int i, avail; end_mem &= PAGE_MASK; @@ -415,14 +415,17 @@ for (avail = i = 0; i < e820.nr_map; i++) { if (e820.map[i].type != 1) /* not usable memory */ continue; + + /* honour page alignment */ + addr = e820.map[i].addr; + size = e820.map[i].size; + size -= PAGE_ALIGN(addr) - addr; + addr = PAGE_ALIGN(addr) + PAGE_OFFSET; + size >>= PAGE_SHIFT; + printk("memory region: %luk @ %08lx\n", - ((long)(e820.map[i].size)) / 1024, - (long)(e820.map[i].addr) ); - for (addr=PAGE_ALIGN(((long)(e820.map[i].addr)))+PAGE_OFFSET, - tmp = 0; - tmp < (unsigned long)(e820.map[i].size); - tmp += PAGE_SIZE, - addr += PAGE_SIZE) { + size << (PAGE_SHIFT-10), addr); + for (tmp = 0; tmp < size; tmp++, addr += PAGE_SIZE) { /* this little bit of grossness is for dealing * with memory borrowing for system bookkeeping