• Espruino currently supports WiringPi so you get fast IO, and when running as sudo you get proper IRQs when a pin changes state! it's actually surprising how much hardware access you can get under Linux when running with root priviledges - you can peek and poke registers like you could on a proper microcontroller.

    The thing it's lacking is a utility timer for accurate digitalPulse. As @tve says, this could be a kernel module (in fact that might not even be needed - we just need to find a spare timer peripheral on the Pi and I think we can do it all from user mode with root privileges).

    From my point of view, trying to run on Pi without Linux is just crazy. There are millions (billions?) of lines of code in Linux, and you're basically reimplementing what others have done before, just worse.

    You can compile the Linux kernel with a 'realtime' flag so you can get proper accurate timing out of it if needed.

    IMO, a cut-down Linux disk image that'd run off a ~256MB card, and that booted straight up with Espruino could be really good - and would actually be pretty achievable. You'd get proper USB with WiFi, Ethernet support on the Model B, the dispay, and all that good stuff... and people using it could just jump right into JavaScript without having to worry about Linux.

About

Avatar for Gordon @Gordon started