# memmap in FreeBSD



## maneesh (Jul 4, 2013)

[size=-1][Duplicate thread removed -- mod][/size]

What is the memmap equivalent of Linux in Freebsd. FreeBSD?

In Linux memmap is used to reserve a portion of physical memory. This is used as a kernel boot argument. E.g.: memmap=2G$1G will reserve 1[ ]G_B_ memory above 2[ ]G_B_ in[ ] case *I* have 3[ ]G_B_ RAM. This 1[ ]G_B_ reserved memory is not visible to _the_ OS, however this 1[ ]G_B_ can be used u_s_ing iorema*.* How can _I_ reserve memory in Freebsd FreeBSD and later use it*,* i.e memmap and ioremap equivalent?


----------



## cpm@ (Jul 4, 2013)

Take a look at the hw.physmem parameter. For more details, see the loader(8)() man page.


----------



## maneesh (Jul 5, 2013)

I have 3 GB system memory and *I* have set hw.physmem=2G. 
`sysctl -a` shows*:*

```
hw.physmem: 2.12G
hw.usermem: 1.9G
hw.realmem: 2.15G
```

`devinfo -rv` shows*:*

```
ram0:
  0x00-0x9f3ff
  0x10000000-0xbfedffff
  0xbff00000-0xbfffffff
```

Here, looks like it is showing the full 3 GB mapping.

Now, how do *I* know which is that 1 GB available memory[]? Also, which function[](similar to ioremap) should *I* call to map the physical address to virtual address*?*


----------



## cpm@ (Jul 5, 2013)

As equivalent of linux's ioremap(), probably you want use the function pmap_mapdev(). Read http://lists.freebsd.org/pipermail/freebsd-hackers/2006-August/017606.html.

Please, to solve this kind of questions you can ask at the freebsd-hackers mailing list, where will help you gladly


----------

