Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move from microcontrollers to embedded linux?

As a kind of opposite to this question: "Is low-level embedded systems programming hard for software developers" I would like to ask for advice on moving from the low level embedded systems to programming for more advanced systems with OS, especially embedded Linux.

I have mostly worked with small microcontroller hardware and software, but now doing software only. My education also consists of hardware and embedded things mainly. I haven't had many programming courses and don't know much about software design or OO coding.

Now I have a big project in my hands that is going to be done in embedded Linux. I have major problems with designing things and keeping things manageable because I haven't really needed to do that before. Also making use of multitasking and blocking calls instead of running "parallel" task from main function is like another world.

What kind of experiences do you have on moving from low-level programming to bigger systems with OS (Linux)? What was hard and how did you solve it? What kind of mindset is needed?

Would it be worthwhile to learn C++ from zero or continue using plain C?

like image 592
Purple Tentacle Avatar asked Jun 02 '09 21:06

Purple Tentacle


People also ask

How do I become embedded Linux developer?

How to become an embedded Linux engineer? It requires a master's degree in the software field. Ideally, beginners must have at least a first experience in the field of embedded Linux development, which can be an internship or even personal or associative projects.

What is the difference between Linux and embedded Linux?

Embedded Linux, though utilizing the same Linux kernel, is quite different from the standard Linux OS. Embedded Linux is specifically customized for embedded systems. Therefore it is has a much smaller size, requires less processing power and has minimal features.

Can you run Linux on microcontroller?

Just as your laptop runs an operating system (Windows, Mac, or Linux), the Raspberry Pi runs a Linux operating system. Now, back to Microcontrollers. Microcontrollers can't run an operating system. Microcontrollers also don't have the same amount of computing power or resources as most single-board computers.

Is Linux good for embedded systems?

The advantages of embedded Linux over proprietary embedded operating systems include multiple suppliers for software, development and support; no royalties or licensing fees; a stable kernel; the ability to read, modify and redistribute the source code.


2 Answers

The main problems with using the Linux kernel to replace microcontroller systems is driving the devices you are interfacing with. For this you may have to write drivers. I would say stick with C as the language because you are going to want to keep the user-space as clean as possible. Look into the uclibc library for a leaner C standard library.

http://www.uclibc.org/

You may also find busybox useful. This provides many userspace utilities as a single binary.

http://www.busybox.net/

Then it is simply a matter of booting from some storage to a live system and running some controlling logic through init that interfaces with your hardware. If need be you can access the live system and run the busybox utilities. Really, the only difference is that the userspace is much leaner than in a normal distribution and you will be working 'closer' to the kernel in terms of objectives.

Also look into realtime linux.

http://www.realtimelinuxfoundation.org/

If you need some formal promise of task completion. I suspect the hardest bit will be booting/persistent storage and interfacing with your hardware if it is exotic. If you are unfamiliar with Linux booting then

http://www.cromwell-intl.com/unix/linux-boot.html

Might help.

In short, if you have not developed at a deep level for Linux, built your own distro, or have kernel experience then you might find the programming hard-going.

http://www.linuxdevices.com/ Might also help

Good Luck

like image 90
Aiden Bell Avatar answered Oct 23 '22 06:10

Aiden Bell


In order to work with Unix/Linux you should get into the Unix philosophy: http://www.faqs.org/docs/artu/ch01s06.html

I consider the whole book a quite interesting read: http://www.faqs.org/docs/artu/index.html

Here you can find a free Linux distro for embedded targets plus bootloader to get you started: http://www.denx.de/wiki/DULG/WebHome

like image 21
robert.berger Avatar answered Oct 23 '22 05:10

robert.berger