Live data from Hacker News

So you want to build an embedded Linux system? (2020)

jaycarlson.net

71–80 of 80 posts

Re: So you want to build an embedded Linux system? (2020)

#71

Earlier quoted context omitted.

Even if you dont work with it anymore and call it legacy, its still a real thing, and its a bad idea to re-use the word to mean something else.

The question is then, should we start calling modern Intel CPUs microcontrollers? That's bound to cause even more confusion. If anything, the things people today refer to as microcontrollers have more to do with your legacy microprocessor than they have with a high end CPU or SoC. What's the right term to use?

At least don't redefine "Microprocessor" in a way that it does not include the 8086, the one that made the it popular. Its nonsensical.

Re: So you want to build an embedded Linux system? (2020)

#73

Why to build Linux you always have to start with Linux, is there anyone who bootrapped it from freebsd or any other OS, minimalistic systems like https://niedzejkob.p4.team/bootstrap/ , etc?

good question, arch build scripts require very miniminal dependencies, I wouldn't be surprised if it's very easy to install from a BSD

https://github.com/archlinux/arch-install-scripts

Re: So you want to build an embedded Linux system? (2020)

#74
post #7

I have issues with the section "Microcontroller vs Microprocessor: Differences" Microprocessors are just the CPU, usually with the system bus wired out. Microcontrollers are combined systems, which include a processor and usually some kind of firmware storage and RAM. You can usually differentiate them by whether their pins are address/data lines or gpio-like. > microprocessors have a memory management unit The 8086…

Microprocessors in the traditional sense no longer exist. All modern microprocessors are actually SoCs (yes, even Intel ones at least to a partial extent). And all microcontrollers are SoCs by strict definition, but we don't usually call them that. So really the more practical terminology difference should be SoC vs. microcontroller.

Agreed. To add to that - I think what Jay was trying to highlight is the difference between chips that can generally run Linux (which generally requires an MMU) and those that run an RTOS. Is this an exact line of demarcation with no blurry edges? No. But it seems to work for me. Maybe a better way to think of this is - does the system have external DRAM (if so run linux) or not - if so run RTOS.

Our of curiosity - does anyone still sell a (by strict definition) a true "micro-processor"?

Re: So you want to build an embedded Linux system? (2020)

#75
post #65

Earlier quoted context omitted.

There is a learning curve, but when crossed, it’s a beautiful system.

same could be said to gentoo, from experience over 2 decades and at least 5 projects involved yocto(back then it was openembedded), for the same project, yocto will take 5x more time/efforts per my measurement. yes adding stuff is fine, building is the slowest but I can wait, however if something went wrong, be prepared to debug openembdded/yocto-itself for days, this does not exist in other alternatives: you debug y…

Buildroot is definitely much simpler, and more limited. That's a plus and a negative, depending on what you're doing with it.

Do you have one board that you need to bring up in isolation? Buildroot is great. It's easy and fast. Do you want to share configuration across multiple designs? Buildroot hits its limits pretty quickly there. And Yocto really starts to shine.

I worked at a company that used Buildroot to support 20 different boards, all in the same repo. The boards shared some level of common configuration across the whole repo, and groups of boards also shared some common configuration.

The entire thing was managed by the C preprocessor as a pre-Buildroot step, and it was a gordian knot of emergent complexity.

The catch is that Buildroot doesn't give you any tools to enable shared configuration, none at all. Buildroot doesn't know how to share build-products across multiple images, and doesn't even know how to _build_ multiple images or keep them separate without having to clean your workdir. It doesn't even track file dependencies, let alone configuration dependencies. It's terrible at knowing when a package is stale.

Yocto is much, much better than Buildroot for handling these kinds of use cases. Images are just recipes, like any other kind of recipe. You can build 8 different images by just asking for each of them by name. Yocto won't rebuild anything that can be shared, and your images can be subclasses of each other which just add or remove a few packages or a bit of configuration.

Yocto is also better at tracking/managing customizations. In Yocto, it's easy to express something like "use the upstream OpenSSH recipe, but do something custom for the config step, and add an extra post-build step, and add these 3 patches, but only add patch 3 on some designs, etc".

In Buildroot, you have to do this in a global namespace using macro-processing in GNU Make. You have no control over the parse order of included Makefiles relative to the upstream files. It's messy and difficult to modify anything, and you have to understand each recipe's quirks and hooks. And the only programming language you have is GNU Make.

In Yocto, there is an inheritance system that lets you use .bbappend files to override the behavior of any recipe you want. You can also stack multiple append files across different layers. If you need something exotic, you can express it as parse-time Python. Yocto is more complex up-front, but it pays off IMO.

Re: So you want to build an embedded Linux system? (2020)

#76

Earlier quoted context omitted.

Microprocessors in the traditional sense no longer exist. All modern microprocessors are actually SoCs (yes, even Intel ones at least to a partial extent). And all microcontrollers are SoCs by strict definition, but we don't usually call them that. So really the more practical terminology difference should be SoC vs. microcontroller.

Agreed. To add to that - I think what Jay was trying to highlight is the difference between chips that can generally run Linux (which generally requires an MMU) and those that run an RTOS. Is this an exact line of demarcation with no blurry edges? No. But it seems to work for me. Maybe a better way to think of this is - does the system have external DRAM (if so run linux) or not - if so run RTOS. Our of curiosity - d…

The most recently sold micro-processors used in a mass market product that come to mind are the CPUs of the Wii/PS3/Xbox 360 era consoles (in particular the PPC750CL in the Wii is a pure CPU). The Wii U then glued three of those together into a three-core die, so if you're willing to consider just the CPU die and not the entire MCM, that one was also a pure CPU.

Digi-Key still shows the 750CL in stock, but it's obviously an obsolete product at this point.

Re: So you want to build an embedded Linux system? (2020)

#77
post #67

Earlier quoted context omitted.

Lots of good replies on that thread. I have been doing embedded development for 30 years, and Yocto is the best build system that I have used for managing large embedded systems. If you need to professionally manage multiple distributions across menagerie of different host and target machines, there simply is no other meaningful choice that operates at its scale. I first encountered BitBake before either the OpenEmbe…

>I have been doing embedded development for 30 years What's your take on the various *BSD distros in the embedded space? A lot of BSD proponents like to talk about the stability and minimalism (a proxy for resource-efficiency I guess) of BSD in comparison to Linux. Is there any reason to reach for BSD in an embedded application these days?

The BSDs fall into the class of server/desktop systems. They would be a great choice for certain classes of products (e.g. routers) where there exists strong feature alignment, but not something I would consider suitable for producing my usual minimal custom embedded systems.

Generally, esoteric hardware support also will be better in Linux, so BSD would likely require porting or writing more drivers when bringing up a custom board.

That said, BSDs have not my strongest area, so I would be curious to see others’ experiences and opinions.

Re: So you want to build an embedded Linux system? (2020)

#78
post #75

Earlier quoted context omitted.

same could be said to gentoo, from experience over 2 decades and at least 5 projects involved yocto(back then it was openembedded), for the same project, yocto will take 5x more time/efforts per my measurement. yes adding stuff is fine, building is the slowest but I can wait, however if something went wrong, be prepared to debug openembdded/yocto-itself for days, this does not exist in other alternatives: you debug y…

Buildroot is definitely much simpler, and more limited. That's a plus and a negative, depending on what you're doing with it. Do you have one board that you need to bring up in isolation? Buildroot is great. It's easy and fast. Do you want to share configuration across multiple designs? Buildroot hits its limits pretty quickly there. And Yocto really starts to shine. I worked at a company that used Buildroot to suppo…

As I said, to deal with multiple boards or vendors yocto might worth the pain, but the majority of users do not do 20 boards in parallel.

network gears, go openwrt, general spi-flash based boards, buildroot it, anything with a SD card and 256MB+ RAM, just use debian, if you're a BSP vendor like windriver, take on yocto then(which is why Intel 'owned' Yocto when they also bought windriver then)

Re: So you want to build an embedded Linux system? (2020)

#79

Why to build Linux you always have to start with Linux, is there anyone who bootrapped it from freebsd or any other OS, minimalistic systems like https://niedzejkob.p4.team/bootstrap/ , etc?

good question, arch build scripts require very miniminal dependencies, I wouldn't be surprised if it's very easy to install from a BSD https://github.com/archlinux/arch-install-scripts

Comparing to https://github.com/fosslinux/live-bootstrap your pseudo minimalistic arch pacstrap or Debian debootstrap are over fat of binary seeds and still you cannot get rid of Linux env in building the crusial packages.
Post reply on HN