I would like to learn Linux porting on boards.
I would be experimenting this on raspberry pi boards with linux_4.9 (DT Enabled).
What are minimum requirements to call board's init_machine up ?
How will I debug this code flow before configuring early printk.?
Any help will be appreciated.
Thanks .!!
Related
I am trying to read the LDD book by Jonathan Corbet, Greg Kroah-Hartman, Alessandro Rubini and implement the sample modules. So to begin with, I tried setting up a development system. Installed Ubuntu 16.04 Xenial. Now, I just created a directory and wrote the hello_world module with a Makefile. Got it built and run it, verified the dmesg logs.
Is that all the development setup? I searched online and found articles where they are asking to download and compile the kernel, use a VM to boot the kernel. What is the reason? Or what am I missing?
Is there any better article which clarifies this?
Thanks
hago
You can try one more way:
If you have native windows, install virtual machine software such as
Virtual box. Get your favourite Linux distribution (no bias, just
an example - Ubuntu) and install it through Virtual box.
Get the latest kernel (or of your choice) from kernel.org.
Choose the platform you want to build this kernel for. E.g arm64 or x86.
In case you do not have real boards (e.g RPi for arm variant), you can use qemu-arm64 or qemu-x86 to run your compiled kernel. This is also a good option when users do not have the boards.
Another good use case for using qemu for the newbie kernel developers is even they write some modules which crashes, then the qemu instance is crashed so no harm.
I think using qemu is a good option for people who starts to learn kernel programming and also want to try writing some of their modules and do not intend to purchase hardware at this point of time.
It depends on your target. For your case, you have made a kernel driver for your computer (it run Linux kernel).
But if you want to develop a Kernel driver for another target like Rasberry Pi, ARM board, X86-X64 board, ... you must learn to compile, edit Kernel config, boot Kernel image, ... because each target has different kernel versions.
You can refer to this training for more detail: https://bootlin.com/training/embedded-linux/
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.
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
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.
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.
I have Toradex Colibri t20 embedded board Linux image (U boot,kernel,roofs). Colibri t20 is based on tegra2 arm-cortex-a9 processor. I want to run this Linux kernel in Qemu emulator.How can i boot with qemu?
qemu-system-arm can run u-boot and kernel SW, only when it has support for the board that those SW were configured/built for.
ARM's versatilepb and vexpress-a9 are supported. There are good tutorials out there for using those boards, Balau on kernel, also Kumar
Bare metal simulation is less ambitious. There, roughly speaking, QEMU only has to emulate the processor. Check out Balau on bare metal. Quick search shows maybe there is support in progress for Tegra2.
I'd suggest installing current packages on your host, see what machines and cpus are supported. Not sure of the following syntax detail, but something like
qemu-system-arm -M ?
is the way to get the list of supported machines.
I want to learn Linux device driver development.
Positives:
I have developed small drivers on WinCE and worked on SPI, i2c interface from application i.e. opening, reading and writing driver.
I'm good in operating system and data structures.
Negatives:
I have never worked on Linux.
My background is not embedded system.
How should I proceed to learn Linux device driver development?
EDIT: any book reference would be appreciable thanks
Linux Device Drivers, Third Edition : http://lwn.net/Kernel/LDD3/ should help you along.
THE FOLLOWING LINKS WILL HELP TO START LEARNING DEVICE DRIVERS
http://www.freesoftwaremagazine.com/articles/drivers_linux
http://lwn.net/Articles/driver-porting/
I have used ATI Stream SDK on windows XP SP3 and implemented one algorithm on GPU. But Now I am interested in scaling this algorithm on multiple GPUs on mutiple machines I switched to UBUNTU to use MPI ( To send messages ).
I googled this but I got references for installation on SLES and RHEL but I am looking for UBUNTU 9.04.
Thanks
GG
AMD is switching to OpenCL based API soon. May be it will be worthwhile holding your horses till the OpenCL API stabilizes. Cuda is far ahead of the curve in terms of GPU usability, there is a nice project called MAGMA which is bringing together the LAPACK library for joint CPU-GPU usage.
I know of people who are using the ATI Stream SDK and ACML-GPU on Ubuntu without any special problems -- that is, no problems that they wouldn't have on any other Linux distro.
If you can get the Catalyst drivers installed correctly (which in this case will probably mean compiling your kernel modules) and your X windows configured correctly (especially DRI module, and there are security issues if you want Stream to work with remote access) it should work.
I'm tempted to ask/comment how you plan to share GPUs between multiple MPI processes, but that's probably wandering off-topic.