292,293c292
< 	unsigned long reserved_end;
< 	unsigned long mapstart = ~0UL;
---
> 	unsigned long mapstart;
299,300c298,299
< 	 * not selected. Once that done we can determine the low bound
< 	 * of usable memory.
---
> 	 * not selected. Once that done we can determine a safe location 
> 	 * for the map for bootmem. 
302c301
< 	reserved_end = max(init_initrd(), PFN_UP(__pa_symbol(&_end)));
---
> 	mapstart = max(init_initrd(), PFN_UP(__pa_symbol(&_end)));
312c311
< 	 * Find the highest page frame number we have available.
---
> 	 * Find Lowest and Highest page frame numbers of RAM Regions.
328,332d326
< 		if (end <= reserved_end)
< 			continue;
< 		if (start >= mapstart)
< 			continue;
< 		mapstart = max(reserved_end, start);
334a329
> 	/* Validity checks */
345a341,347
> 		/* makes more sense to set:
> 		min_low_pfn = ARCH_PFN_OFFSET;
> 		 * here instead of below, but I'm concerned 
> 		 * it was done for a reason. needs more analysis. 
> 		 * revisit when this function is rewritten for 
> 		 * multiple nodes on 32bit machines. 
> 		 */
349,351d350
< 	/*
< 	 * Determine low and high memory ranges
< 	 */
365,366c364,366
< 
< 
---
> 	/*
> 	 * Add active ranges to early_node_map
> 	 */
382,385d381
< 
< 		/*
< 		 * ... finally, is the area going away?
< 		 */
394c390
< 	 * Register fully available low RAM pages with the bootmem allocator.
---
> 	 * Free fully available low RAM pages with the bootmem allocator.
400c396
< 		 * Reserve usable memory.
---
> 		 * Free only usable memory.
407a404
> 
414,415d410
< 		if (start < reserved_end)
< 			start = reserved_end;
418,421d412
< 
< 		/*
< 		 * ... finally, is the area going away?
< 		 */
428d418
< 		memory_present(0, start, end);
436a427,431
> 	 * Reserve kernel memory.
> 	 */
> 	reserve_bootmem(__pa(&_text), (unsigned long)&_end - (unsigned long)&_text);
> 
> 	/*
443a439,454
> 	/* call memory present for all the ram */
> 	for (i = 0; i < boot_mem_map.nr_map; i++) {
> 		unsigned long start, end;
> 
> 		/*
> 		 * memory present only usable memory.
> 		 */
> 		if (boot_mem_map.map[i].type != BOOT_MEM_RAM)
> 			continue;
> 
> 		start = PFN_UP(boot_mem_map.map[i].addr);
> 		end   = PFN_DOWN(boot_mem_map.map[i].addr
> 				    + boot_mem_map.map[i].size);
> 
> 		memory_present(0, start, end);
> 	}
