Live data from Hacker News

How to programmatically find out if computer is on

haiku-os.org

151–160 of 197 posts

Re: How to programmatically find out if computer is on

#151

Earlier quoted context omitted.

Is... this not how your WoL works? Hitting the NIC is equivalent to pressing the on button, boots the OS, etc. I've been using this for years to wake hosts at home when I'm abroad. It's invaluable.

Now I'm almost curious if every PCI slot has a pin equivalent to the power button pin on the mainboard and also feed some basic background power to the cards even when turnt off. I doubt it actually is this simple though, the industry rarely chooses KISS.

There is a pin that provides access to the 3.3v standby bus, and a wake pin that can be used to wake the CPU.

Re: How to programmatically find out if computer is on

#152

This reminds me of the time when I had a TV attached to my computer through HDMI and I wanted to write a program that checked whether it was on or off. It turned out to be impossible, because even when it was turned off, it still appeared as connected on Windows because it was technically on stand by.

Really it is a matter of opinion -- you and the TV just disagreed about the definition of "on" I guess.

Re: How to programmatically find out if computer is on

#153
post #89

While this is a joke, there are some contexts in which it does make sense to ask whether the computer is on. For instance, most laptops have an embedded controller which runs all the time, even when the laptop is powered off, and manages things like battery charging and the power state. Within that embedded controller, an is_computer_on() function could legitimately return "false".

Could you apply the same reasoning to 'double is_computer_on_fire()'?

Re: How to programmatically find out if computer is on

#154
post #135

Earlier quoted context omitted.

Is... this not how your WoL works? Hitting the NIC is equivalent to pressing the on button, boots the OS, etc. I've been using this for years to wake hosts at home when I'm abroad. It's invaluable.

I think the parent means that you should be able to talk to the NIC about the computer, without the NIC needing to get the CPU powered on so that the CPU can tell the NIC what to do. Like a very-minimally-functional BMC.

That's AMT, provided by Intel ME.

As far as I'm concerned ME-equipped NICs should unconditionally be behind VPNs, but the AMT functionality itself is really cool. Even the 10+ year old machines that don't support VNC let you remotely hit CTRL+ALT+DEL, issue an ACPI shutdown, perform a hard reset (equivalent to hitting the reset button on 486-era boxen), etc. So basically you can do either soft or hard shutdowns or reboots. Quite granular.

I actually used the hard-reset functionality while playing around with Linux early boot on a laptop a few years ago. Rebuild initramfs (loaded via PXE), use `curl` to hit AMT reset endpoint. Very cool.

Re: How to programmatically find out if computer is on

#160

Earlier quoted context omitted.

For the sake of the argument, I think it's more of a shared capability of the motherboard _and_ the NIC, rather than the sole responsibility of the NIC. I wonder if that could be implemented solely by the motherboard. After all, it could supply a small amount of power to the NIC while shutdown and embed a minimal NIC driver to monitor incoming packets without the need for the NIC to do the monitoring itself.

I am not sure how this would meaningfully differ from the current state of affairs, where the NIC runs in a low power mode while the PC is off.

Because currently you need support of WoL from both your NIC (to enter low power WoL monitoring mode) and your motherboard (to listen for WoL events from the NIC and trigger power on).

If the motherboard would embed a simplistic NIC/WoL driver then you could have WoL on any NIC, with the motherboard acting like any client. I suppose that would mean using the PCI lane and stuff to communicate with the NIC though which may defeat the purpose of a dedicated low power interface.

Post reply on HN