Want to learn Linux porting on an ARM platform [closed] - linux

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am looking to learn porting various flavors of Linux on ARM boards. I was about to buy TI's Panda board or Beagle board. I want to learn customizing Linux source code, compile it and port on one of these boards.
I was just curious if there are any other boards with a good community support than the TI ones that will be good for beginners.
Some of the other options I could find in the Internet are:
Snapdragon 8x60 mobile platform with Android
i.MX31 product development kit (very expensive)
Tegra 250 development board

First, building a kernel by yourself is really hard work, and build an embedded kernel is much much difficult. Maybe you can try to play with some prebuild kernel images, and then try to configure it by your own.
I have a BeagleBoard and at first I used these Ubuntu ARM ports, the link number 3 have the kernel image (you can install USB and Wi-Fi support really easy):
Install Ubuntu-ARM on the BeagleBoard
Ubuntu ARM ports
Ubuntu ARM kernel images
Or maybe, if you like Debian, here is some information about the ARM port installation:
Install embedded Debian on the BeagleBoard
ELinux BeagleBoard, embedded Debian information
Or if you know how to configure and build a kernel, or maybe if you have a little of Gentoo experience, you can test this:
Gentoo manual and kernel image on the BeagleBoard
Gentoo cross-development page information
Gentoo ARM handbook
Gentoo ARM port overlay (Git)
And if you have a PandaBoard, this guy have a lot of documentation on it:
Gentoo PandaBoard install howto
Gentoo ARM files and information
Gentoo PandaBoard files and information
Check the BeagleBoard wiki page and eLinux page, they have a lot of documentation about the board, NAND configuration, Linux distributions, devices, etc.
BeagleBoard page
eLinux BeagleBoard information
Or you can play with QEMU and configure an ARM virtual machine.

Related

Benefits of UNIX or UNIX variant on microcontroller?

This may be a foolish question but I've been searching around for some time and don't see a clear answer. I've seen several microcontrollers advertised as running Unix-like software (Linux, Ubuntu) for example, the BeagleBone Black and Arduino Yun. Can someone please explain to me the benefit of this? So far I've used a couple of microcontrollers like the Arduino Uno/Duo, Freescale FRDM and STM32 Discovery which either didn't have this feature or I was not aware of it. I'm starting to see it more and more on newer microcontrollers so I'd like to know what it brings to the table.
Full disclosure: I've had minimal exposure to UNIX and its variants so far so please talk slowly and use small words =)
Hope to hear from you,
Yusif Nurizade
You get complex drivers already included Linux for free (USB, internet protocols, storage media and file systems).
You can use lots of free software for the things not included in the kernel.
It is simpler to develop software on a full OS (easier to debug, look what is going on, change the configuration, etc etc).
The drawback is that the real-time capabilities are generally worse than for some small RTOS, and it needs more resources (a couple of megabytes memory).
In the heart of all Android and iphone is a Embedded Linux System. Without getting too deep
Linux + Java = Android
BSD Unix variant + C/C++/Object C = iOS
Now if you get deeper the above two statement can be argued for accuracy
All Android devices run on ARM based microprocessors. Beaglebone is one such open source hardware platform with can run Android as well as Embedded Linux distribution and even a Ubuntu.
Now (IMHO) Ubuntu is primarily for desktop and server application. Many of the popular computer server farms uses Ubuntu.
Now STM32 is a ARM based CORTEX-M micro control. Once again (IMHO) is mostly used for bare metal embedded applications. I have hard that FreeRTOS can be ported to TM4C123 ARM Cortex-M TM4C123.
Now the advantages of using Linux base micro controller architecture are
OS is free for the most part
Larger community of users
The industry is moving towards open source
Lot of free resources get up to speed
Disadvantage are
Learning curve is pretty steep
Expect to stumble and fall a few time
Below to two good resources to learn Beaglebone open source development
Beaglebone
Introduction to Beaglebone development by Derek Molloy of Dublin City University
HTH and good luck

how to cross compile CUPS on ARM in Linux environment? [duplicate]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I am interested in cross-compiling a Linux kernel for an ARM target on a x86 host. Are there some good practices you recommend? Which is the best cross-compile suite in your opinion?
Have you settled up a custom cross-compile environment? If yes, what advices do you have? Is it a good idea?
There are two approaches I've used for ARM/Linux tools. The easiest is to download a pre-built tool chain directly.
Pro: It just works and you can get on with the interesting part of your project
Con: You are stuck with whichever version of gcc/binutils/libc they picked
If the later matters to you, check out crosstool-ng. This project is a configuration tool similar to the Linux kernel configuration application. Set which versions of gcc, binutils, libc (GNU or uCLibc), threading, and Linux kernel to build and crosstool-ng does the rest (i.e. downloads the tar balls, configures the tools, and builds them).
Pro: You get exactly what you selected during the configuration
Con: You get exactly what you selected during the configuration
meaning you take on full responsibility for the choice of compiler/binutil/libc and their associated features/shortcomings/bugs. Also, as mentioned in the comments, there is some "pain" involved in selecting the versions of binutils, C library etc. as not all combinations necessarily work together or even build.
One hybrid approach might be to start with the pre-built tools and replace them later with a custom solution via crosstool-ng if necessary.
Update: The answer originally used the CodeSourcery tools as an example of a pre-built tool chain. The CodeSourcery tools for ARM were free to download from Mentor Graphics, but they are now called the Sourcery CodeBench and must be purchased from Mentor Graphics. Other options now include Linaro as well as distribution specific tools from Android, Ubuntu, and others.
I use the emdebian toolchain for compiling stuff for my ARM machines that isn't happy being compiled natively in the small resources available (/me glares at the kernel). The main package is gcc-4.X-arm-linux-gnueabi (X = 1,2,3), and provides appropriately suffixed gcc/cpp/ld/etc commands. I add this to my sources.list:
deb http://www.emdebian.org/debian/ unstable main
Of course, if you're not using Debian, this probably isn't so useful, but by gum it works well for me.
I've used scratchbox while experimenting with building apps for maemo (Nokia N810), which uses an ARM processor. Supposedly, scratchbox is not restricted to maemo development.
I've used crosstool on several targets. It's great as long as you want to build your toolchain from scratch.
Of course there are several pre built toolchains for arm as well, just google it -- too many to mention here.
1) In my opinion building your own toolchain works the best. You end up having tight control over everything, plus if you're new to embedded linux, it's a GREAT learning experience.
2) Don't go with a commercial toolchain. Even if you don't want to take the time to build your own, there are free alternatives out there.
If your company will spend the money, have them buy you a jtag debugger.
It will save you tons of time. and it allows you to easily learn and step through the kernel startup, etc..
I highly recommend using the Lauterbach jtag products... They work with a ton of targets and the software is cross platform. Their support is great as well.
If you can't get a jtag debugger and you're working in the kernel, use an VM to do that, usermode linux, vmware..etc.. your code will be debugged on x86.. porting it to your arm target will be a different story, but it's a cheaper way to iron out some bugs.
If you're porting a bootloader, use uboot. Of course, if you're using a reference platform, then you're probably better off using what they provide with the BSP.
I hope that helps.
Buildroot is a tool I've had reasonably good luck with for building a custom uClibc-based toolchain from scratch. It's very customizable, and not excessively particular about what distribution you happen to be running on.
Also, many of its existing users (ie. embedded router distros) are also targeting ARM.
If you're using Gentoo, getting a cross-compiling toolchain is as easy as
$ emerge crossdev
$ crossdev -t $ARCH-$VENDOR-$OS-$LIBC
where ARCH is arm or armeb, VENDOR is unknown or softfloat, OS is linux, and LIBC is gnu or uclibc.
If all you want is a compiler (and linker) for the kernel, the LIBC part is irrelevant, and you can use -s1/--stage1 to inform crossdev that you only need binutils and gcc.
This is what Eurotech uses for their Debian ARM distibution. You'll note that they don't recommend using a cross compiler if you can avoid it. Compiling on the target itself tends to be a more reliable way of getting outputs that you know will run.

Linux device driver development: what does it look like in 2012? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am running Ubuntu 12.04 and I assume that all the items I see listed when I run ls /dev are actually the device drivers for all the devices/hardware components connected to (or able to connect to) my machine. Is this correct? If not, where does Linux store all the device drivers?
What are drivers written in, C? C++? Assembler? What modern IDE/tech stack do device driver developers use?
No, you are not correct. /dev is a folder full of special device files, which represent device drivers. So when I do something to /dev/sda I am not working with the file of the SATA driver, but rather an interface to whatever SATA driver happens to be loaded. Device files are how drivers expose their devices to userspace (along with system calls that call drivers).
Usually drivers are stored in /lib/modules.
Drivers are written in C, unless you want to tripple your workload and write in assembly. There isn't a single line of C++ in the entire Linux kernel, for technical and political reasons (Linus Torvalds hates the sight of it).
IDE? I doubt any kernel developers use IDEs. Most of them just use Vim or EMACS. Then git to commit to the kernel source, and GDB/KDB for debugging. And whatever other command line tools are needed (eg. diff).

Virtual environment for Linux Kernel hacking [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 11 years ago.
This question is to practicing Linux kernel hackers:
Generally, it is best to test/play with linux kernel changes/hacks in a virtualized enviroment.
What virtual environment do you use for testing your hacks?
How do you make a minimalistic filesystem(with basic utils) to use with the environment. If you are using a readymade filesystem, what is that are you using?
Useful heuristics you do with your environment(like installing a new kernel, sharing files etc?
Please provide a step by step procedure to setup the environment, if possible.
A collection of this info doesnt seem available in web.
Thanks.
Different people use different set ups, I don't think there is one true answer.
I currently use VirtualBox as Hypervisor with a file system created with Buildroot.
Apart from other VMs (kvm, qemu, vmware etc.) you could also use User Mode Linux to much the same effect if your hacking is in the more "logical" layers of the kernel.
I'm currently using a Fedora14 VM running in QEMU/KVM on a Fedora14 host for my network driver development. I use a fairly standard install with the Software Development packages, plus whatever web or networking tools (e.g. wireshark) might be useful for the task. I typically set up a serial console on the VM and monitor it with minicom on the host - this helps me catch stack traces when I'm chasing a bug. I usually have my source and editing environment on the host machine with the files on an NFS file system that the VM mounts - this way I don't have to keep copying files to and from the VM. With the host running the same version kernel, I can compile the driver quickly on the multicore host and test it in the VM.

A Development Machine in VirtualBox - (Debian-min vs ArchLinux vs recommend-one) [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have few years of exp on linux, mainly ubuntu (dual-boot). Now i am shifting to windows, and installing linux in VirtualBox (PUEL). I am looking for a light-weight distro for development machine setup. Thought of using debian-unstable-minimum, and installing build-essentials, openbox(or a little more feature light-WM, ps recommend), ssh-server, ethereal, iptables, nmap(maybe), vim, python3. That is all what i can think of now mainly.
Options I can think of --
Debian-unstable minimum, and then using apt-get to do the rest. Is there also recommended version of ubuntu-lite. I read Ulite is not good, some-others are also not that good.
ArchLinux, reading a great deal about it. Wikipedia says it is mainly a binary-based distro, but everywhere on net/community only talk about its source-based approach. If it is binary I think I can have a quick setup. (For guest-OS-ArchLinux guys in VBox ) is your guest-additions working fine in archLinux.
FreeBSD 8, is it possible for minimum install. And recommended.
Recommendations for other i686 optimized linux, if any, or lets say i386 is also fine, as will only use it for coding.
For system admins -
I would like to know if ArchLinux keeps the potential to penetrate companies for production systems, and replace redhat/debian/bsd in servers for hosting apps/portals.
Addition: Just a thought- is there any distro which helps you to be a better programmer/developer/analyst, in terms of the way things should be done. I dont know if I am over-generalizing it :).
some-others
Checked crunchbang? If you are not particular about needing the power of apt-get, you can also check-out zenWalk or Vector.
My work machine is a 3Ghz 4G Windows 7 box, on which I am running a 1G Debian VM under VirtualBox, it is a bit slower when accessing the HD but it is perfectly usable. I installed off the usual ISO image, and used apt-get to get the rest. Basically, I don't think on even semi-modern hardware you will need to go for a cut-down install to get a good user experience, (unless you particularly want to) to run just one VM. It runs the full GNOME desktop, Emacs, half a dozen terminals, Iceweasel web browser and the OCaml and Haskell compilers just fine. Make sure you install the VirtualBox extensions, they make a big difference to the interactive experience.
FWIW I have never gotten FreeBSD to work properly under VirtualBox, perhaps if you need that you would be better off with VMware, which does.

Resources