4 ms·
Discoveryd then builds up a path to /mnt/apps/bin/blink and calls system() to run the blink program with that number as an argument. I have a feeling this is s
by userbinator 11y ago
Discoveryd then builds up a path to /mnt/apps/bin/blink and calls system() to run the blink program with that number as an argument.
I have a feeling this is similar to the left-pad debacle... a whole separate binary just to blink an LED? "Blink n times" should be nothing more than a loop with two delays and presumably a write to a GPIO device in the middle. Unwarranted complexity strikes again.
Does anyone recognise the architecture? "JSR" and "MOVE.D" brings up some PDP-11(?) docs, which doesn't seem right.
- TeMPOraL 11y agoIt feels ok for me. It's kind of the Unix way, with all the /bin/true, /bin/false, /dev/zero, etc. That /mnt/apps/bin/blink may just be exactly that "loop with two delays and presumably a write to a GPIO device in the middle", written in C or even hand-written in ASM.
- dsr_ 11y agoThe problem isn't 'blink'. The problem is calling it via system() and handing unsanitized user input to system().
- JdeBP 11y agoI wonder why it calls daemon() immediately before calling system().
- userbinator 11y agoThat's too narrow in scope. The fact that they decided to make such a trivial function an externally invoked binary is also a large contributing factor, and should not be overlooked. There would otherwise be no need to use system(), "sanitize" user input, etc.
- avian 11y ago> Does anyone recognise the architecture? At the first glance, assembly looks a bit like ETRAX CRIS. https://en.wikipedia.org/wiki/ETRAX_CRIS https://en.wikipedia.org/wiki/ETRAX_CRIS
- tantalor 11y agoThe issue with leftpad was not how trivial it was, but how easily it was lost, and broke so many dependent packages, when the maintainer had a bad day. That could have been any package. It was just a coincidence that leftpad was so small.
- pjc50 11y agoJSR and MOVE.D are also features of m68k, but the mnemonics don't seem to match the opcodes. Maybe it's "Coldfire".