From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <0610ae68d7966ee68ba2033283925411@plan9.bell-labs.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] Apm Enhancement + some bonuses From: "Russ Cox" In-Reply-To: <000001c2daaf$c28d7e60$f7e84dd5@makr4j0ty5i9an> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Sat, 22 Feb 2003 16:51:16 -0500 Topicbox-Message-UUID: 6e496d70-eacb-11e9-9e20-41e7f4b1d025 ^t^t is an ugly hack -- it doesn't need more letters. there are ways to provide everything you added without going into the kernel. because ^p currently does nothing on terminals, we can sit at terminals, connect to the consoles of cpu servers, and reboot them by typing ^p. changing ^p to have a magic meaning on terminals will break that behavior, hence it won't happen. i'm still sorry that ^p kills drawterm. as you noted, you can get aux/apm to let you turn things off by uncommenting /* else if(strcmp(p, "off")==0) respondx(r, apmsetpowerstate(&apm, dev, PowerOff)); */ in /sys/src/cmd/aux/apm.c. once you've done that, you don't need ^t^t 5 or ^t^t 6 to turn the screen on and off. you don't need ^t^t g: ^t^t r already reboots both cpu servers and terminals. you are right that you can't run disk/kfscmd halt echo off >/mnt/apm/ctl but you could easily write a program to halt the file system and then turn off the machine: #!/bin/python import plan9 # open both kfd = plan9.open("/srv/kfs.cmd", plan9.ORDWR) cfd = plan9.open("/mnt/apm/ctl", plan9.OWRITE) # halt kfs plan9.write(kfd, "halt") while 1: s = plan9.read(kfd) if s == "done" || s == "success": break plan9.write(1, s) # turn off system plan9.write(cfd, "off") russ