Programmer
Programmer

Reputation: 8687

raspberry pi : writing Linux device driver

I have some basics knowledge on Linux (RHEL 5.4) Device Driver and Kernel internals and wish to gain expertise on same. I came to know of raspberry pi board.

My question is that the same code that I write on a Linux server will work there - is their architecture and concepts same. Kindly note that if it is not the same case then I need to buy a desktop PC otherwise for offline practicing purpose.

Note - I was unable to add raspberry pi group hence needed to remove the same and add the below ones.

Upvotes: 0

Views: 3265

Answers (3)

Subbu
Subbu

Reputation: 61

Yes it depends on Architecture and the same code compiled on x86 will not wrok on Pi. However, there are ways to get around it.

As mentioned in the above post, use a cross compile toolchain(that comes with its own libc) to comile your code (kernel/userspace) to try it out on R pi. Again doing this, you will still not be able to test your code. To do that get a VM tool like qemu. I am not sure if there is a qemu port for R pi but in general a ARM 11 (ARMv6) based qemu should do. The following link should get you going with initial kernel development on your PC without owning a R pi.

http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/

Cheers Subbu

Upvotes: 1

a.saurabh
a.saurabh

Reputation: 1231

You might need to cross compile your code for ARM arch. if you are using x86 machine on your Linux Server.You can cross compile your modules for ARM using GNU ARM toolchain and then run on Raspberry pi.

Upvotes: 0

Jeyaram
Jeyaram

Reputation: 9474

Is their architecture and concepts same??

I would like to clarify that Rasperry Pi is ARM based board. Mostly I guess your server is running on X86.

Device drivers meant for devices. Rasperry Pi should have the device which you are writing driver for. I suggest you to study the data sheet of rasperry pi and linux driver model.

Linux driver model is architexture independent only. so you need only some effort for porting your X86 driver to ARM. You need to concentrate on hardware part.

Upvotes: 0

Related Questions