Subject: Re: allocating physical memory
To: Johan Danielsson <>
From: Matthias Drochner <>
List: tech-kern
Date: 07/20/1999 11:11:52 said:
> I want to read some data that the BIOS (this is on a peecee) has put
> into physical memory.

Here is what my experimental pnpbios code does:

static caddr_t
mapit(addr, len, prot)
	u_long addr, len;
	int prot;
	u_long startpa, pa, endpa;
	vaddr_t startva, va;

	pa = startpa = i386_trunc_page(addr);
	endpa = i386_round_page(addr + len);

	va = startva = uvm_km_valloc(kernel_map, endpa - startpa);
	if (!startva)
		return (0);
	for (; pa < endpa; pa += NBPG, va += NBPG)
		pmap_kenter_pa(va, pa, prot);

	return ((caddr_t)(startva + (addr - startpa)));

best regards