Live data from Hacker News

How to programmatically find out if computer is on

haiku-os.org

191–197 of 197 posts

Re: How to programmatically find out if computer is on

#191

Earlier quoted context omitted.

Wouldn't a CPU halt state mean no code is running?

a computer has multiple CPUs. One may be halted while another still running.

That was one of the interesting things about BeOS - that you could turn off CPUs while it was running via the desktop. Just make sure to leave one running.

Re: How to programmatically find out if computer is on

#192

> If the computer isn't on, the value returned by this function is undefined. Shouldn't it just block until the computer turns back on? Probably interferes with pthreads.

Hmm, it seems like you need to make sure the computer is on before calling this function, or else you run the risk of getting back undefined data. Seems like we also need a function that can be used to tell if the computer is on...

You need to halt this thinking at once

Re: How to programmatically find out if computer is on

#193

Earlier quoted context omitted.

Store the LUKS crypto key in the TPM, and make sure secure boot is used so the TPM will only reveal the key if the systems boot chain is verified.

Nope. That's dangerous, TPM keys can be sniffed on the bus: https://trmm.net/tpm-sniffing/

Is a LUKS key being sent remotely to Intel ME _not_ vulnerable to being sniffed on the LAN?

Re: How to programmatically find out if computer is on

#194
post #193

Earlier quoted context omitted.

Nope. That's dangerous, TPM keys can be sniffed on the bus: https://trmm.net/tpm-sniffing/

Is a LUKS key being sent remotely to Intel ME _not_ vulnerable to being sniffed on the LAN?

You don't need to involve ME into remote decrypting. Embed the LUKS binaries and dropbear into your initramfs, and off you go.

Re: How to programmatically find out if computer is on

#196
post #139

Earlier quoted context omitted.

I’ve wondered what Go APIs involving channels should do when the computer is put to sleep and later on wakes up.

Maybe I haven't done enough Go to know why that's something to wonder about? They wouldn't just carry on when resumed like anything else?

Yeah, but what should happen to the values that would’ve been sent while the computer was asleep, but couldn’t be. Should they be resent as soon as possible after computer wakes up, or dropped? (It probably depends on the exact API and its needs.)

Re: How to programmatically find out if computer is on

#197

I'm curious if there's any significance in number 0.63739 in this implementation double is_computer_on_fire(void) { return 0.63739; } https://github.com/haiku/haiku/blob/8f16317a5b6db5c672f33181...

My first thought is that it looked close to 1-e^-1, but that doesn't seem to be it.

Closest I came was sqrt(3)/e = 0.637185
Post reply on HN