Topic: Why build a Linux?

Let me preface this with the fact that I am a Linux newby and an 8bit guy (there isn't an 8bit chip I can't figure out).  Last year I bought a CHB and played with it a bit and got quickly frustrated.  I set about learning Linux, put Ubuntu on a spare computer, got comfortable with the command line, etc.

So.  After having to download a ROM image to make a bigger SD card I found that there were a few Chumby/CHB/Infocast ROMs floating around which led me to Open Embed.  Sounds interesting, but I wondered why exactly one needs to rebuild the Chumby kernel?

2 (edited by infurl 2012-03-15 12:28:12)

Re: Why build a Linux?

By "Chumby kernel" do you mean the actual kernel of the operating system, or the whole installation?

The kernel is just one part of the software which forms the nucleus of the system and houses all the device drivers, whether they are compiled in or loaded as modules. Custom building a kernel can make a system a bit more efficient and secure and it also guarantees that you have all the correct header files for compiling new device drivers that you might be developing as modules.

If you mean the whole installation, by rebuilding it using openembedded you get a complete, organised system that already supports a large number of packages and is supported by a largish community. Aside from that, it is an interesting exercise, albeit frustrating if your build system isn't up to the task.

I've built several different versions using openembedded and I've just now started looking at the possibility of building a version using Cross Linux from Scratch. I don't know how practical this will be but I do like the idea of having a minimal installation where I more or less understand everything that went into it. Openembedded is so huge that it's not much different from using any other "shrink-wrapped" Linux distribution, even though you do have to build it yourself.

Re: Why build a Linux?

I think that's a good question.  You can go a long way with the CHB without bothering to build a custom kernel.

However for my needs as a developer I want a set of easily reproducible and well documented steps that reliably generate the final ROM image.  My personal version of hell is the situation where you can't reproduce that little change you had to make to the stock kernel to get that USB wifi driver working because originally you tried 10 things and eventually it worked and you weren't sure what combination of steps were the necessary ones.  By using OE I can put everything under source control in one place, document every change, and be confident that as long as github is still standing, I can re-create a bit-perfect copy of any ROM image I've ever tagged.*

* OE pulls in tons of sources from other locations, and to be totally bullet proof you need to keep a copy of the source cache because eventually those external sources do go away.

Re: Why build a Linux?

Responding mostly because of how recent these posts are and how close they are to what I'm doing. 

I have open embedded running on my "chumby one" and I would be happy to answer questions but I have one of my own.  Is anyone aware of the drivers that are used within the original chumby ram that handle the volume knob and the button on top?
I see from examples that flash code refers to the knob as a mousewheel event but I'm betting there are drivers involved to make that happen. 

I'm trying to write a python/pygame application that outputs midi, so using flash is out of the question.  I've gotten pretty far with OE, python, and the touch screen.  I'm just trying to access more devices like the volume knob and the top button...

Re: Why build a Linux?

The knob presents itself at "/dev/input/by-id/soc-noserial-event-joystick" and returns "input_event" structures (see <linux/input.h>)

The top button presents itself at "/dev/switch", and should return structures of the form:

        struct button_event
            struct timeval timestamp;
            unsigned int action; // button has been pressed or released
            unsigned int button_state; // state of button

Re: Why build a Linux?

It appears to be slightly different on this OE version:

dmesg snippet:
[    0.880000] Chumby bend sensor driver version 2.3-Falconwing initializing (
[    0.890000] input: bend-sensor as /devices/platform/bend-sensor/input/input0
[    0.930000] input: STMP3XXX touchscreen as /devices/virtual/input/input1
[    0.930000] input: stmp3xxx-rotdec as /devices/virtual/input/input2

Which sounds like the knob is /dev/input/event2
and the switch is actually          /dev/input/event0

root@chumby-falconwing:/dev/input# ls -lR
drwxr-xr-x    2 root     root           100 Jun  2 18:33 by-id
drwxr-xr-x    2 root     root            60 Jun  2 18:33 by-path
crw-r-----    1 root     root       13,  64 Jun  2 18:33 event0
crw-r-----    1 root     root       13,  65 Jun  2 18:33 event1
crw-r-----    1 root     root       13,  66 Jun  2 18:33 event2
crw-r-----    1 root     root       13,  63 Jun  2 18:33 mice
crw-r-----    1 root     root       13,  32 Jun  2 18:33 mouse0
lrwxrwxrwx    1 root     root             6 Jun  2 18:33 touchscreen0 -> event1

lrwxrwxrwx    1 root     root             9 Jun  2 18:33 soc-noserial-event-kbd -> ../event0
lrwxrwxrwx    1 root     root             9 Jun  2 18:33 soc-noserial-event-ts -> ../event1
lrwxrwxrwx    1 root     root             9 Jun  2 18:33 soc-noserial-ts -> ../mouse0

lrwxrwxrwx    1 root     root             9 Jun  2 18:33 platform-bend-sensor-event-kbd -> ../event0

Before I run my pygame app I need the following 'export' in order to get the touchscreen to work, will I need something similar for the rotary wheel and switch?