Chapter Two- running countdown on the OSD

Well, everything's going along swimmingly (not really, but the #neuros folks have had pity on me and talked me off the ledge on many occasions).

So now it's time to get a simple command line program running on the OSD. Remember, this tutorial isn't about kernel hacking. I'm just interested in getting some 3rd party applications (namely my own) running on the OSD (and I feel there's tons of cool stuff that can be done there), so I needed a just few peices of the equation that the low level OSD hackers need. Thankfully, we can abbreviate a lot of what the kernel hackers have to do.



Per the intro, my first project is to get countown.c running on the OSD. Here it is: 



#include <stdio.h>

#include <stdlib.h>

#include <time.h>



#define DATE 247

int main()

{

    struct tm *tm_ptr;

    time_t the_time;



    (void) time(&the_time);

    tm_ptr = localtime(&the_time);



    printf("Date: %02d/%02d/%02d\n",

        tm_ptr->tm_mon+1, tm_ptr->tm_mday,tm_ptr->tm_year-100);

/*    printf("Local Time: %02d:%02d:%02d\n",

        tm_ptr->tm_hour, tm_ptr->tm_min, tm_ptr->tm_sec);*/

    printf("Days to Gamma Shipment: %02d\n", DATE-tm_ptr->tm_yday);

    exit (0);   

}



Step Number One-Connect the OSD to the PC:

"Again?"  You say.  "Didn't we already do that in Chapter One?"  Well, yes we did, but now we need to connect it more!  Honestly, I don't fully get it myself, but basically it seems like the Ethernet is the main interface to the device (it's 1000 times faster than the Serial for one thing) but somehow you seem to still need the Serial.  First we needed the serial to setup the network, which ok, seemed reasonable because somehow you have to setup the network before the Ethernet could work.  Then we said well, how about a network setup screen that you can operate from the TV and remote:  which I entered as Bug 633. But then even after I got the Ethernet going, the guys said I still needed it for seeing errors or something.  I don't understand that part yet, but hopefully someone from the Council of Elders can comment on the above bug and we can figure out how to eliminate this dreaded serial thing.   I anticipated setting up the network connnection between the OSD and the PC to be painful (and it was, Derobert and I spent hours on it) because of firewalls and whatnot, but it seems that it really is a necessary step to do anything useful with the OSD.  We talked about shuttling files on a CF card, etc but they would all add so much time to debugging any program that you pretty much have to bite the bullet and network the device.



connection between OSD and PC shown

The above picture shows the dual connections between the OSD and PC.  Note that the Ethernet is connected directly between the OSD and PC, The OSD's Ethernet chip allows this without requiring a crossover cable.  In my case, I'm using wifi to connect to the internet and Ethernet only for connecting to the OSD.  Note also that I'm using a USB to Serial connector because I don't have a serial port on my laptop.



There were a number of steps required to connect the OSD and the laptop.  In the previous chapter I outlined getting Serial working, the remaining steps were the following:


  1. Getting The Ethernet Networking setup on my Laptop (the Host PC)
  2. Setting up NFS on my laptop (to share a directory with the OSD.)

It's worth noting that we did not have to setup tftp, I guess this is the protocol that's used for the device to boot from the host PC, but again we didn't touch the kernel stuff here, so there was no need for that.



2.  Setup Networking between the OSD and Host PC

(under construction)



Note:  With lots of help from derobert and others on the IRC, I got this running, you will see hours of discussion on the Sept 2-3, 2006 logs, which I need to summarize.

screen capture of countdown output



victory!  count-arm runs.  It may not look impressive, but it's a big step!


Comments

Comment viewing options

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

Getting started

First comment -- minicom is like Hyperterm, I think these programs are designed to make people crazy by only working just well enough that they won't throw them away. Use gtkterm and save your sanity.

Second comment -- I do quite a bit of development on boards like the Neuros. I primarily work on a PC, though -- its not that I'm a Windowze fan, I just use the one system for day to day stuff. I develop on a Linux box, typically an old beater that's running a modern distribution which I access from the PC using tools like Putty, Cygwin-X and WinSCP. I'll work the SBC with the same toolset (without the 'X', of course), using ssh/scp from the Linux box as needed. NFS mounts and TFTP work OK but they are more of a nuisance; I'll have to use these for the time being becuase the OSD only has telnet at the moment.

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.