When developping an operating system, one has to press and hold the power button A LOT.
Even when I haven't borked the kernel into an unusuable state, I need to do a hard reboots all the time. Operating system development should be fun and and It's gettin', it's gettin', it's gettin' kinda hectic.
Time to automate the process!
For the first pass I tried keeping things stupid simple
I got a teensy 4.1. I set the 13th digital pin (which also controls the led) as output followed the RawHID example
Pin 13 is also teensy's embedded led. When 13th pin is set to high the relay shorts the power switch and turns on the test machine.
To turn on the machine I send a single char over serialm
Which engages the relay and that in turn shorts the power switch.
It works, I hate it!
What's next?
- Protocol: sending a single char to open and close the relay is an absolutely abismal way of doing things. So I need to come up with very simple protocol to do the things I want to. The single char is akin to pressing the button, I'd like more intelligence and safety guards around the power on and off behaviours.
- Server: The entire point of automating this stuff is so I don't have to be physically near the box when it boots, so I need to be able to boot over the network.