linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Roskin <plroskin@gmail.com>
To: linux-mm@kvack.org
Subject: Allocating mock memory resources
Date: Sat, 15 Apr 2017 23:31:06 -0700	[thread overview]
Message-ID: <CAN_72e3WpZXP3kGPeWjEpsfigGjnURLFTVsUf_P7ozzT8cN+bA@mail.gmail.com> (raw)

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>

             reply	other threads:[~2017-04-16  6:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-16  6:31 Pavel Roskin [this message]
2017-04-21 19:02 ` Pavel Roskin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAN_72e3WpZXP3kGPeWjEpsfigGjnURLFTVsUf_P7ozzT8cN+bA@mail.gmail.com \
    --to=plroskin@gmail.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox