拥有 Linux 思维框架对成为一名更好的嵌入式程序员有帮助吗?
我想知道 - 了解Linux 生活方式或 Linux 架构是否能够为嵌入式设备上的编程提供更好的思路,尤其是当它们具有某种操作系统时。
只是想确保我没有错过重要的事情:)
注意:
我有 Windows 背景,可以用 C 和 C++ 编程。
充满热情并最终想开始嵌入式编程。我想从在家做典型的业余爱好者项目开始。
如果有人也能评论 BeagleBoard 作为我的起点,那就太好了。
was wondering - if knowing The Linux way of life or the Linux architecture, would give a better frame of mind for programming on embedded devices especially when they have some kind of OS in them.
Just want to be sure that I did not miss a major thing :)
Note:
I come from a windows background, can program in C and C++.
Passionate and finally want to get started into Embedded programming. I would like to start by doing typical hobbyists project at home.
It would be nice if anyone would also comment on BeagleBoard as a starting point for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
“嵌入式”是一个模糊的词。有两类:
实时嵌入式系统:微控制器/微处理器应用程序在低抽象级别上直接与硬件进行密切通信。典型应用是控制系统/自动化、工业、汽车、医疗技术、家用电子产品、数据/电信通信等。
还有一些蓬松的嵌入式系统:各种笔记本电脑、嵌入式Linux、嵌入式Windows、电话和虚假操作系统,等等涉及互联网、人机界面等。从事
这两类工作的人都会坚定地说他们正在使用嵌入式系统,而后者通常只是在做另一种风格的桌面应用程序。根据您的目标类别,Linux 可能是也可能不是优点。例如,电信部门就与这两个类别重叠,即使对于不复杂的应用程序,他们也经常使用嵌入式 Linux。
无论哪种情况,*nix 都可以用作开发平台,因此了解它不会有什么坏处。
"Embedded" is a fuzzy word. There are two categories:
There are realtime embedded systems: microcontroller/microprocessor applications that are intimately communicating directly with the hardware on a low abstraction level. Typical applications are control systems/automation, industrial, automotive, medtech, household electronics, data/telecom communications etc.
And then there are fluffy embedded systems: various laptop:ish computers, embedded linux, embedded windows, phones and phoney operative systems, anything involving internet, human-machine intefaces etc.
People working in both categories will firmly state that they are working with embedded systems, while the latter kind are often just doing another flavour of desktop applications. Depending on which category you are aiming for, Linux may or may not be a merit. The telecom branch for example, overlaps both of these categories, and they are often using embedded Linux even for non-fluffy applications.
In either case, *nix may be used as the development platform, so knowing it won't hurt.
是和不是。大多数情况下是的。
Lundin 正确地描述了“嵌入式的两个世界”(尽管它们之间的界限非常模糊)。
如果您正在为“更高的嵌入式”编写,例如 Android 或运行 Linux 的其他设备,那么 Linux 的专业知识肯定会有很大帮助。您仍然需要了解一些“基本知识”,并且当您在 C 中看到类似
&=~
运算符时不要害怕,但是要了解 Linux - 旧的 Linux,您在其中进行配置通过编辑/etc
中的文件来编辑东西,您可以在其中编译自己的内核以供日常使用,您可以在其中从 tarball 构建软件,这就是有帮助的。了解现代 Linux - Gnome、gconf-editor、Synaptic 等不会有太大帮助。接下来,如果您正在对没有操作系统的设备进行编程,在中间区域 - 足够快且足够强大来运行 C 程序,但不是操作系统,您仍然需要 Linux。因为交叉编译。你不需要真正的Linux。 Cygwin 对此没问题。 MinGW 可能就足够了。尽管如此,您可能仍需要能够构建自己的交叉编译器(基于 GCC)、链接器、调试器、制作工具以及 IDE 的其余“主干”。除非你的芯片供应商很棒并且提供了完整的IDE工具链。
只有当您喜欢微型处理器时,您才不需要 Linux。像汽车防盗器遥控器、圣诞灯闪烁器、汽车轮胎压力传感器、电池电量监视器这样的东西 - 可以有 16 字节 RAM、1KB EEPROM 和 CPU 的其余部分来匹配的东西,您将需要使用与该 CPU 配合使用的 IDE ,没有操作系统,没有 C 编译器,没有任何与 Linux 相近的东西 - IDE 很可能是基于 Windows 的。
Yes and no. Mostly yes.
Lundin correctly described the "two worlds of embedded" (although the border between them is very fuzzy).
If you're writing for "higher embedded", like Android, or other devices that run Linux, then definitely expert knowledge of Linux will be of much help. You still need to know some "bare bones" and don't get scared when you see the likes of
&=~
operator in C, but knowing Linux - the Linux of the old, where you configured stuff by editing files in/etc
, where you compiled your own kernels for everyday use, where you would build software from tarballs, that's what helps. Knowing modern Linux - Gnome, gconf-editor, Synaptic and the likes will not be of much help.Then next, if you're programming devices without OS, in the middle area - fast and strong enough to run C programs, but not the OS, you still need Linux. Because crosscompile. You don't need actual Linux. Cygwin is okay for that. MinGW may suffice. Still, you will probably need to be able to build your own crosscompiler (based on GCC), linker, debugger, make tools, and the rest of "backbone" of the IDE. Unless your chip supplier is awesome and provides a complete toolchain with IDE.
Only when you're into tiny processors, you don't need Linux. Stuff like car alarm remote, christmas lights blinker, car tire pressure sensor, battery level monitor - stuff that can have 16 bytes RAM, 1KB EEPROM, and the rest of CPU to match, you will need to use an IDE that works with this CPU, no OS, no C compiler, nothing remotely close to Linux - the IDE will most likely be Windows based.
我想说你真的不需要了解 Linux 来进行嵌入式编程。很多开发嵌入式软件的公司都是在windows上做的,与其他操作系统没有接触。
但可以肯定的是,了解更多会让你变得更加多才多艺,而常识则让你成为更好的工程师。这包括不同的操作系统以及许多其他东西。
当谈到 BeagleBoard 时,这取决于您感兴趣的应用程序类型。
如果你想了解底层,我会从一个更简单的处理器开始,学习如何使用外设、硬件中断、去抖动信号……有时自己做这些是有教育意义的。
我想您也可以跳过这一点,从 ARM-A8 和可能的嵌入式操作系统开始,但这不是我遵循的路径。
I'd say you really do not need to know Linux for embedded programming. Many companies developing embedded software do it on windows and have no contact with other OS.
But sure, knowing more makes you more versatile, and general knowledge makes you a better engineer. This includes different OS as many other things.
When it comes to BeagleBoard, it depends on the kind of application you are interested in.
If you want to understand the low-level, I would start on a simpler processor and learn how to use peripherals, hardware interrupts, debouncing signals... There is an educational point in doing this yourself some time.
I suppose you can also skip that and start with an ARM-A8 and possibly an embedded OS, it's just not the path I followed.
我接下来要说的话可能会引起一场口水战,但是……
我发现Linux是一个比Windows更有生产力的开发环境。在我之前的工作中,我们正在为托管交换机和工业自动化设备开发固件,这些设备运行嵌入式 Linux 操作系统。所有开发人员都拥有 Windows 和 Linux 机器,因为用户界面软件仅在 Windows 上运行。不过,我们都使用 Linux 进行开发,因为它更容易。
在我目前的工作中,唯一的选择是运行 Windows,但为了提高工作效率,我们正在运行 Cygwin,它提供类似Linux的环境。在 Windows 上开发不是专门针对 Windows 的软件是非常困难的。
至于开发没有操作系统的嵌入式系统......我有一个Arduino,我偶尔会玩一下。我已经在 Windows 和 Linux 上对其进行了编程,并且发现体验非常相似。使用 Arduino 自己的工具,Windows 似乎运行得更流畅一些,但如果你想破解它并做一些有趣的事情,你最好使用 Linux。
就我个人而言(这可能会引起一些令人讨厌的评论),我认为 Linux 最适合进行高效工作,而 Windows 最适合玩游戏。
基本上,这一切都可以归结为:尝试使用 Linux 来开发您的项目。您可能会发现这是一种更顺畅、更高效的体验。如果您不喜欢它,则不必继续使用它。但这种经历可能是值得的。
编辑(由于问题改写):在为不运行 Linux 本身的嵌入式项目进行编码时,了解“Linux 生活方式”不太可能有多大帮助。据我了解,Unix 哲学涉及两个主要问题:
如果您在没有操作系统的系统上工作,那么您正在为编译器编写代码,并且在任何时候都不太可能使用完整的 shell。您也不像拥有任何类型的文件系统。所以这两点都是没有意义的;通过学习 Linux,你不太可能获得与嵌入式编程具体相关的任何东西,尽管它肯定不会有坏处:-)
What I am about to say may cause a flame war, but...
I have found that Linux is a much more productive development environment than Windows. At my previous job, we were developing firmware for managed switches and industrial automation equipment, which ran an embedded Linux operating system. All the developers had both Windows and Linux boxes, as the user interface software only ran on Windows. We all used Linux for developing, though, as it was simply easier.
At my current job, the only choice is to run Windows, but to make it more productive we are running Cygwin, which provides a Linux-like environment. It is very difficult to develop software on Windows that is not specifically for Windows.
As for developing for an embedded system without an OS... I have an Arduino that I play with occasionally. I have programmed it both from Windows and Linux, and have found the experiences fairly similar. Using Arduino's own tools, Windows seems to run a bit more smoothly, but if you want to hack on it and make something interesting, you're better off using Linux.
Personally (and this will likely provoke some nasty comments), I feel that Linux is best for doing productive work, and Windows is best for playing games.
So basically, this all boils down to this: Try using Linux for developing your project. You will probably find it to be a much smoother, more productive experience. If you don't like it, you don't have to keep using it. But the experience will probably be worth it.
Edit (due to question rewording): Knowing the "Linux way of life" is unlikely to help much when coding for an embedded project that is not running Linux itself. As I understand it, the Unix philosophy is about two main issues:
If you are working on a system without an operating system, you are writing code for a compiler and not likely working with a full shell at any point. You also are unlike to have any sort of file system. So both of these points are moot; you are not likely to gain anything concretely related to embedded programming by studying Linux, although it certainly couldn't hurt :-)
我真的认为如果你想了解一些关于嵌入式领域的知识,你不应该从直接使用操作系统开始。更愿意亲自参与一个小型低级别项目,然后如果您的最终应用程序确实需要它,则添加操作系统。
我认为在嵌入式设备中设置操作系统不会比从头开始更容易。它会给你带来一些功能(我不确定你真的需要学习嵌入式),但如果操作系统端口出现问题,它会给你带来大量的调试时间。
I really think if you want to learn a little about embedded sphere you should not start by using an OS directly. Prefer to have hands on a small low level project then add an OS if it's really needed for your final application.
I don't think setting up an OS into an embedded device will be easier than starting from scratch. It will bring you some functionalities (that I am not sure you really need to learn embedded) but it will bring you lot of hard debugging time in case of problems in the OS port.
我从事嵌入式编程已经有 10 年了,目前是为网络设备编程,之前是为阿帕奇直升机编程。两家公司都在目标上拥有类似 POSIX 的操作系统,但没有直接嵌入 Linux。我目前的公司主要使用 Windows 作为个人开发环境。然而,我们确实有一些用于特殊用途的 Linux 机器。我之前的公司混合使用了 Windows 和 Sun Solaris Unix。因此,无论您走到哪里,您可能不会在日常计算机上使用 Unix 或 Linux,但您可能至少偶尔会遇到它们。
另一方面,我认识一些在 Linux 上进行编程的开发人员,他们的整个职业生涯都以嵌入式 Linux 为目标。这实际上取决于公司,因为较小或较新的公司比公司更倾向于使用 Linux。然而,根据我的经验,在目标上使用嵌入式 Windows 形式的情况非常罕见。我知道设备已经存在,但我本人从未见过开发设备的开发人员。
不管怎样,Linux 是免费使用的,除了适合工作之外还有其他好处。除了放弃一些时间之外,尝试几个月确实没有什么坏处。
I have been doing embedded programming for 10 years, currently for networking equipment and before that Apache helicopters. Both companies had POSIX-like operating systems on the target, but not embedded Linux directly. My current company uses mostly Windows for individual developer environments. However, we do have a few Linux boxes hanging around for special purposes. My previous company used a mix of Windows and Sun Solaris Unix. So wherever you go, you may not use Unix or Linux on your day to day computer, but you are likely to come across it at least occasionally.
On the other hand, I've known developers who have programmed on Linux for embedded Linux targets their entire careers. It really depends on the company, as smaller or newer companies have a tendency to use Linux more than corporations. However, using embedded forms of Windows on targets is very rare in my experience. I know devices are out there, but I've never personally met a developer who worked on one.
Anyway, Linux is free to use and has other benefits besides being good for a job. There's really no downside to giving it a try for a couple of months, other than giving up some of your time.
Linux 在嵌入式领域不断发展……请参阅最新研究:
嵌入式软件和工具市场的十大趋势2011年 - VDC研究
Android 成为美国智能手机市场份额第一
了解 Linux 生活方式<如果您感兴趣的应用程序类型包含在上述链接中,那么 /em> 在嵌入式领域肯定会是一个优势。
Linux is growing in embedded... see latest research:
Top 10 trends for the embedded software and tools market in 2011 - VDC research
Android Becomes Number One in U.S. Smartphone Market Share
Knowing the Linux way of life will definitely be a plus in embedded domain provided the kind of apps you are interested in are contained in the above mentioned links.
在开始嵌入式领域之前,了解 Linux 架构将是一个大问题(尽管基本概述很好),
例如,要砍一棵树,您不必发明一把斧头 - 只需开始使用一把,然后逐渐您可以学会磨
斧头最好从小事做起——亲自动手,并根据当前的需要专注于特定领域。随着你的工作和工作一起成长,牢记你的目标
,你一定会收获更快,而不会陷入自我循环 - 研发去做研发;)
understanding Linux architecture will be over kill (although basic overview is good) before just starting in embedded field
e.g. to cut a tree you don't have to invent an axe - just start using one, then gradually you could learn to sharpen the axe
Its better to get started small - get hands-on, and focus on specific areas as is the need of the hour. grow with your work and work keeping your goals in mind
you will surely gain much faster and not get stuck in self loop - R&D to do R&D ;)
仅当您想嵌入 Linux 时!作为一名拥有约 22 年经验的嵌入式系统开发人员,我认为 Linux 对于很大一部分嵌入式系统项目来说是不合适且不必要的。
了解 RTOS 的工作原理以及基于实时优先级的抢占式调度和 IPC 机制将对您更有帮助。看看例如这个。
Only if you want to embed Linux! And as an embedded systems developer of some 22 years, I would suggest that Linux is unsuitable and unnecessary for a very large proportion of embedded systems projects.
Understanding the workings of an RTOS, and real-time priority based pre-emptive scheduling and IPC mechanisms would stand you in better stead. Take a look at this for example.