I need to directly write to and read from physical memory for my research and the only way I can think of doing it is with a kernel module. I found this generic device driver called phram that I've been trying to use to map memory and then write to and read from it but I'm having trouble mapping more than ~1.5GB. In my 16GB system, I have the OS usage constrained to 500MB at 0x0. Here are my kernel parameters: mem=500M memmap=500M@0
. When I try to load the phram module with more than ~1.5GB like this:
sudo modprobe phram phram=test,500Mi,15Gi
I get this error message:
modprobe: ERROR: could not insert 'phram': Input/output error
And this in dmesg:
[ 247.303346] modprobe:1402 conflicting memory types 1f400000-3df400000 write-back<->write-combining
[ 247.303350] reserve_memtype failed [mem 0x1f400000-0x3df3fffff], track uncached-minus, req uncached-minus
[ 247.303352] ioremap reserve_memtype failed -16
[ 247.303376] phram: ioremap failed
[ 247.303393] phram: `test,500Mi,15Gi' invalid for parameter `phram'
I can't find any documentation on phram other than the source code. From what I have researched ioremap() (the mapping call in phram) shouldn't have a max size so I don't know where the issue could be. The dmesg output is a little too cryptic for me so if somebody could at least translate it that would also be a significant help.
Thanks!