Not entirely true I'm afraid...I got tossed in front of UNIX/C
with only a housemate who wanted to offload a contract to help.
Cranked out the needed program in around a month and got the
early completion bonus. Of course it didn't work very well
because it was heavily database oriented (remember academic-
Ingress? surely not...now they call it PostGres) running
on a multi-user VAX that probably thought 1Mhz processors
were a miracle come true...Of course that was 25yrs ago when
I still had some brain cells. I almost flunked the one CS class
I tried to take, but at least I learned what a Turing Machine
was supposed to do. Now I can nod knowingly at any mention
of the Stopping Problem.

Posix? We don't need no stinking pthreads-badges. Aren't
threads implemented with multiple processes and mmap()?
No, that was later on...it's so hard to remember.

oops, I'm showing my age.
Organizing a FAQ with the distilled wisdom would be great.
MS

ps...always loved that reference to the Pot component...

Philip Levis wrote:
Michael Schippling wrote:
Wow! Can we figure out how to put this post into a FAQ or something?
This sort of stuff seems to be left as an exercise for the reader
in the regular doc...e.g., I didn't know that ints were disabled
during StdControl.start()...


They're also disabled during init(). :)

This does seem like a big one, which would be useful to put in the FAQ. One of the challenges, of course, is that there are so many of these details in TinyOS that knowing all of them is a big undertaking. I don't think TinyOS is particuarly egregious in this regard: if you were to toss somebody in front of UNIX without 30 years of distilled wisdom and undergrad OS classes, then there would be a lot of gotchyas. One silly example: "Please tell me why I can't pthread_create inside a signal handler?!?!?!"

The only advantage, I think, is that the TinyOS code is small enough that you *can* read it all and understand it all, at least the core. Some stuff in lib/ is a bit tricky (e.g., TinyDB, Mate'), and radio stacks are notoriously difficult, but stuff like the main control loop are pretty simple and straight forward. Note the crazy old hold-over from the mica platform, which had a variable potentiometer on the radio:

module RealMain {
  uses {
    command result_t hardwareInit();
    interface StdControl;
    interface Pot;
  }
}
implementation
{
  int main() __attribute__ ((C, spontaneous)) {
    call hardwareInit();
    call Pot.init(10);
    TOSH_sched_init();

    call StdControl.init();
    call StdControl.start();
    __nesc_enable_interrupt();

    while(1) {
       TOSH_run_task();
    }
  }
}


Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to