[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [microblaze-uclinux] Petalinux kernel space vs user space
Thanks for the very thorough explanation. I won't be needing the new UIO
patch as I am developing in 2.4 but when I upgrade to 2.6 I might take you
up on it.
Thanks again,
A Bose
-----Original Message-----
From: owner-microblaze-uclinux@xxxxxxxxxxxxxx
[mailto:owner-microblaze-uclinux@xxxxxxxxxxxxxx] On Behalf Of John Williams
Sent: Thursday, May 01, 2008 6:40 PM
To: microblaze-uclinux@xxxxxxxxxxxxxx
Subject: Re: [microblaze-uclinux] Petalinux kernel space vs user space
Hi,
A. Bose wrote:
> I am a device driver that calls registers in my EDK design. I can access
> the registers in user space, so should I make it a user space driver as
> oppose to a kernel space one?
>
> This would make things easier as there would be no kernel space
> debugging and no ioctl to create.
>
> Are there any special convention that should be followed within petalinux?
On uClinux with noMMU, there's no physical prevention of accessing the
hardware directly. However, you have to be very careful because if you
have e.g. two instances of your program running, you will get conflicts
and un-debuggable errors.
Also, you cannot write interrupt handlers in userspace.
For this reason, I typically recommend writing a proper driver. It also
means that your driver will work if you decide you want to use the MMU.
direct access to HW from userspace requires some special tricks when
the MMU is enabled.
As of 2.6.23 (or thereabouts) there is a new UIO (userspace IO)
framework in the kernel. Google for linux uio to read about it.
You create a very lightweight kernel driver that detects the device and
registers the IO ports used (the register map), as well as specifiying
an interrupt handler. You then hook into this from userspace to write
your driver.
I recently backported thisinto PetaLinux 2.6.20, and it seems to be
working well (with some changes required for !MMU operation).
I will fold this into the next petalinux release. If you are keen to
try it let me know and I'll pull out a patch.
Regards,
John
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive :
http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.7/1408 - Release Date: 4/30/2008
6:10 PM
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.8/1413 - Release Date: 5/3/2008
11:22 AM
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/