Learning Embedded Programming (on the OSD)

The OSD is a great way to learn embedded programming, so when Guttrhead asked the following question on the google mailing list I thought it important enough that I wanted to post my thoughts here too.



On Mon, 2006-09-04 at 11:00 -0700, guttrhead wrote:

> I've been paying some sort of attention to the discussions over the

> past couple of months, but it's all way over my head.  I have no

> experience with linux or testing hardware or pretty much anything thats

> being talked about here, but I am genuinely interested in learning

> about it.  My question to you all is, Where is a good place to start?

> Does anyone know of any classes or books or materials I should buy and

> just start playing with that would help me.

>

> I'm a pretty quick learner, but I don't think I'd learn quick enough to

> have any meaningful input on the OSD.  Possibly on future projects

> though. 



I'm glad you wrote this.  Actually, this is pretty much my situation,
I'm really just a business guy that's interested in learning this stuff.
I've been an MS-DOS/windows user for 20 years or something and poked
around a little on the Unix machines in college, and had a Fortran
course in college, but that's pretty much it.

So basically, I'm teaching myself Linux, C and the OSD all at once.  In
some respects it feels like I'm the guy with the yellow rubber duck
inner tube who shows up to the river and asks about tubing to have the
locals point to some white water rapids and say "sure there's tubing
right here!" when I say "gosh fellas!  I'm not a very experienced rafter
are you sure it's ok?" they say "sure, no problem, you'll be fine"

The good news is that no one drowns hacking the OSD (although I've
certainly felt like jumping out the window on more than one occasion).
I would love to recruit more folks like you into the fold, and I think
it's attractive for a variety of reasons.  Of course, there are tons of
things to hack in the world, but the OSD Situation has some unique
advantages.

*Free Software/Open Source is very powerful movement that touches on
more than just hackers, it really is connected to some basic freedoms
like free speech and the freedom to tinker and invent.  see the below
crappy 5 minute video for my pitch on this
http://www.youtube.com/watch?v=Jey8-AjXX1E
This is a very important societal movement that is making a big impact
throughout the world, and the open source hackers are passionate about
it for good reason.

*Hacking an embedded device is cool.  This is $200 device that connects
TVs and stereos to the network and the internet.  It's a chance to bring
the kind of freedom of communication that exists on the computer to the
living room/bedroom etc.  As much as the file sharing networks are
disruptive, the phenomenon of open devices that connect living rooms,
etc is even more so.  Imagine a world where TV is not controlled by the
current infrastructure of cable companies, local stations and Hollywood,
pretty powerful stuff

*You can start simple.  While it's true that there are a lot of high
level tools (visual basic, etc.) for windows that simplify the creation
of software, that stuff is not appropriate for embedded devices.
However, interesting things can be done with C and like chess, it's
"easy to get started but a lifetime to master."  I just wrote a
countdown program that's actually does something useful and it's 16
lines or something, it was the third C program I've written in my life,
and it runs on the OSD.

*The community is working on high level tools for the OSD.  I keep
hearing folks talk about Lua, which I know nothing about, but it's some
kind of scripting language that will simplify coding on the OSD.  See
http://en.wikipedia.org/wiki/Lua_programming_language 

*The Community is great.  There are a lot of experienced hackers in this
community, and we need to make sure that we don't alienate them by
subjecting them to endless newbie questions, but I believe that if we
coordinate/segregate the discussions, we can manage it, it can work
well.  Some hackers enjoy teaching others, and some don't, with a little
planning we should be able to separate the two adequately.

*It's manufacturer supported.  Community patches get included in
finished products, decisions about the hardware and roadmap are made
openly and with community input.  We support the community with docs,
free product and even some money (which hopefully will increase over
time-more on that later)

Here's what I'm thinking:

1) I'm putting together some beginner documentation, and I would *love*
to get help. see here http://open.neurostechnology.com/node/335 

2) If the above docs don't have enough background, let's provide more.
Part of the deal we need to make with the experienced hackers among us
is to document what we learn along the way.  That way we provide a
manual that they (and we) can point to so that they don't have to teach
the same stuff over and over to every person that comes along.  In
addition, it's also a great recruiting tool.  I'm certain that every day
thousands and thousands of folks around the world hit google to begin
their hacking adventure and if we write articles that hit on their
search terms, we'll attract them to our community.

3) let's setup times on the IRC for lessons.  we'll need at least one
experienced embedded hacker to be the teacher and at least one or two of
us students will have to volunteer to document that lesson.  You don't
have to be Winston Churchill, just summarize what we learned and the
rest of us will have to make the commitment to clean it up.

4) We need to get a volunteer hacker teacher for each lesson.  I've
personally completed two of the lessons, but if there are enough
interested folks, maybe we clean up the documentation and then setup a
time for folks to ask questions about it, etc?

5) We need background material links for the lessons.  Can any of you
experienced guys help with that.  Take a look at my "lessons" and point
out some links for background.  ie. what do you want your students to
read before they show up?

6) we need input on the lessons.  First of all I've proposed two
projects and only four lessons.  These happen to be two projects that
I'm personally interested in, but I'm up for alternate suggestions, if
there are projects that either the community is more interested in or
are a better project for learning or are something that's less in flux
(given the rapid state the OSD firmware is evolving) then please speak
up.

Finally to answer your question, I personally like books when I'm
starting from scratch on something like this.  I'm the subject of a
great deal of ridicule for this, but I like a comprehensive listing that
has passed the threshold of completeness/coherency of getting published.
It's also better for reading on the bus, etc.  The two main references
that I've used are the classic bible of C programming:  Kernighan and
Ritchie "The C Programming Language" and Matthew and Stones "Beginning
Linux Programmming" These layout the landscape for me, for the details,
the web is perfect, usually starting with wikipedia.

I noticed that the author above has an online tutorial, it's pretty old
and I haven't taken it, but it's here
http://www.lysator.liu.se/c/bwk-tutor.html

not sure to what extent I'll be the subject of ridicule for this, but I
found the below helpful too http://computer.howstuffworks.com/c.htm

Thoughts? Thoughts? Thoughts?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

What Linux distro are the big guys useing.

What is the best development platform for the OSD development. Can it be done on windows or will I get slapped silly. I like SUSE but it seems most of the developers are useing debian. Does this mean I have to build my own kernal?

You can probably do it on

You can probably do it on Windows using cygwin. You'll need an NFS and a TFTP server and you'll have to build your own cross-compiler.

As far as Linux, you shouldn't need to build your own kernel to run Debian.

It looks quite easy

I downloaded the tarball from Neuros and was initially a bit wary of it so I installed it into a SuSE 10.x system. This required a bit of tweaking because SuSE doesn't have a 'sudo' command but it still was possible. After I found out that the neuros stuff was harmless I installed a copy on my Ubuntu (i.e. Debian) machine. This just worked.

For those Windows users I recommend doing what I do -- I've got the Ubuntu installed on an old beater system (500MHz P3) which I work from my Windows system using a mixture of Cygwin-X, Putty and WinSCP. These old systems are too slow to run the modern graphical interfaces reliably but they're plenty fast enough if all they have to do is compile stuff and copy files. If I didn't have a spare system then I'd probably install Ubuntu on my Windows computer, but first I'd try the Ubuntu "boot the complete Linux from this CD" release (turns the whole computer into a Linux platform without touching the hard disk). (There's also a "make a Linux file sytem from one very large NTFS file" out there but I can't recall what its called.)

I would try to avoid rebuilding the development environment for something like Cygwin. It will be possible but you might find it quite a large task. I've done quite a lot of embedded work so have had to build cross tools, its quite a lot of work, especially if things don't work right first time, and for a development like this one the toolset and the system should already be stable -- we should be just generating applications or porting packages.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

To combat spam, please enter the code in the image.