linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Allocating mock memory resources
@ 2017-04-16  6:31 Pavel Roskin
  2017-04-21 19:02 ` Pavel Roskin
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Roskin @ 2017-04-16  6:31 UTC (permalink / raw)
  To: linux-mm

Hello!

I'm working on a device driver for hardware that is being developed.
I'm coding against the specification and hoping for the best. It would
be very handy to have a mock implementation of the hardware so I could
test the driver against it. In the end, it would be an integration
test for the driver, which could be useful even after the hardware
arrives. For example, I could emulate hardware failures and see how
the driver reacts. Moreover, a driver test framework would be useful
for others.

One issue I'm facing is creating resources for the device. Luckily,
the driver only needs memory resources. It should be simple to
allocate such resources in system RAM, but I could not find a good way
to do it. Either the resource allocation fails, or the kernel panics
right away, or it panics when I run "cat /proc/iomem"

I ended up limiting the memory available to the kernel using the
"mem=" directive and hardcoding the address pointing to RAM beyond
what the kernel uses. I would prefer to have an approach that doesn't
require changes to the kernel command line. It there a safe way to
allocate a memory resource in system RAM?

-- 
Regards,
Pavel Roskin

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-21 19:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-16  6:31 Allocating mock memory resources Pavel Roskin
2017-04-21 19:02 ` Pavel Roskin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox