Hi guys,
how to reserver a range of memory address (virtual address)
on a Solaris machine ?
Thanks
Yao
Hi guys,
how to reserver a range of memory address (virtual address)
on a Solaris machine ?
Thanks
Yao
>Hi guys,
>how to reserver a range of memory address (virtual address)
>on a Solaris machine ?
This is how it is done:
int fd = open("/dev/null", O_RDWR);
void *reserved =
mmap(NULL, 800 * 1024, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
close(fd);
The resulting program can be examined with /usr/proc/bin/pmap
with the -r flag to show the reserved mappings:
$ pmap -r 591
591: ./foo
00010000 8K read/exec /usr1/raf/foo
00020000 8K read/write/exec /usr1/raf/foo
FF180000 800K -
FF280000 664K read/exec /usr/lib/libc.so.1
FF334000 32K read/write/exec /usr/lib/libc.so.1
FF33C000 8K read/write/exec [ anon ]
FF380000 16K read/exec /usr/platform/sun4u/lib/libc_psr.so.1
FF3A0000 8K read/exec /usr/lib/libdl.so.1
FF3B0000 120K read/exec /usr/lib/ld.so.1
FF3DC000 16K read/write/exec /usr/lib/ld.so.1
FF3F0000 8192K read/write/exec [ stack ]
total 9872K
Roger Faulkner
> >Hi guys,
> >how to reserver a range of memory address (virtual address)
> >on a Solaris machine ?
> In Solaris 2.6 and later, you can open() and mmap() /dev/null
> to reserve address ranges. Such address ranges are "reserved"
> in the sense that the system will not map anything there when
> mmap() is used with a NULL requested address (thereby asking the
> system to pick an address for the mapping). You can later use
> mmap() with the reserved address specified to put something
> real in that place.
> This is how it is done:
> int fd = open("/dev/null", O_RDWR);
> void *reserved =
> mmap(NULL, 800 * 1024, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
> close(fd);
> The resulting program can be examined with /usr/proc/bin/pmap
> with the -r flag to show the reserved mappings:
> $ pmap -r 591
> 591: ./foo
> 00010000 8K read/exec /usr1/raf/foo
> 00020000 8K read/write/exec /usr1/raf/foo
> FF180000 800K -
> FF280000 664K read/exec /usr/lib/libc.so.1
> FF334000 32K read/write/exec /usr/lib/libc.so.1
> FF33C000 8K read/write/exec [ anon ]
> FF380000 16K read/exec /usr/platform/sun4u/lib/libc_psr.so.1
> FF3A0000 8K read/exec /usr/lib/libdl.so.1
> FF3B0000 120K read/exec /usr/lib/ld.so.1
> FF3DC000 16K read/write/exec /usr/lib/ld.so.1
> FF3F0000 8192K read/write/exec [ stack ]
> total 9872K
> Roger Faulkner
Also, addresses above 0xf0000000 (0xe0000000 on sun4d and x86 machines)
contain the operating system (inaccessible to user-level, but mapped
nevertheless for the convenience of the kernel) (except sun4u, see below).
sun4m and sun4d machines have no hole in the 32-bit address space.
sun4u (UltraSparc) in Solaris 7 has no hole in the 32-bit address
space and doesn't even reserve the space above 0xf0000000 (the top
page or two is reserved to guarantee at least one invalid address).
However, there is a hole in the sun4u memory management unit for
64-bit address spaces (you will never encounter it since the 64-bit
address space is so large but the hardware manuals specify it.
Roger Faulkner
1. How to Reserve Specific Memory Range In Driver?
Hello --
I'm developing a character device for Linux (Intel) that needs
to read and write to a specific range of RAM addresses in order to
communicate with a memory-mapped device (that does NOT use DMA).
Unfortunately, I cannot seem to find a kernel call that would allow me
to reserve the particular range of memory that I need, either be
reading the Kernel Hacker's Guide or by scanning over other drivers'
code. Could anyone direct me to such a function? Simply writing over
the data that is already in this memory range doesn't work very well.
=)
Any insight you might have on whether or not a device that needs access to
a certain memory range could still work as a dynamically loadable module
would also be great. What are the chances, for example, that if my
device is loaded as a module an hour after system start-up, that the desired
bit of memory could still be moved out of the way so that the module
could claim it?
Thanks!
-Chris
2. FreeBSD, IPSec Tunnel, ICMP Redirect error
3. Reserving virtual memory addresses
7. How to disclaim the content of a memory address range?????????
8. term server hardware: cyclades etc?
9. writing I/O to memory address range
11. How is shared memory address range determined
12. reserving an adress range for later mmap-ing
13. small memory machine, large reserved memory