From owner-freebsd-emulation Sun Oct 4 12:37:15 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA15339 for freebsd-emulation-outgoing; Sun, 4 Oct 1998 12:37:15 -0700 (PDT) (envelope-from owner-freebsd-emulation@FreeBSD.ORG) Received: from roma.coe.ufrj.br (roma.coe.ufrj.br [146.164.53.65]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA15327 for ; Sun, 4 Oct 1998 12:37:05 -0700 (PDT) (envelope-from jonny@jonny.eng.br) Received: (from jonny@localhost) by roma.coe.ufrj.br (8.8.8/8.8.8) id RAA10583; Sun, 4 Oct 1998 17:36:39 -0200 (EDT) (envelope-from jonny) From: Joao Carlos Mendes Luis Message-Id: <199810041936.RAA10583@roma.coe.ufrj.br> Subject: Re: APC PowerChute under FreeBSD In-Reply-To: from John Fieber at "Oct 4, 98 02:21:39 pm" To: jfieber@indiana.edu (John Fieber) Date: Sun, 4 Oct 1998 17:36:39 -0200 (EDT) Cc: jonny@jonny.eng.br, emulation@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org #define quoting(John Fieber) // > I've seen it, but it appears to support only 220v models and // > has a very poor documentation. // // What documentation? :) That one. :) // Actually, adding support for new models is pretty trivial. If you have the documentation for both hardware and software. // > I've also tried the Linux apcupsd (binary only), but it also seems // > to have an ioctl emulation incompatibility. And I thought serial ports // > were the most portable device between unixen, after /dev/null. :) // // Since I've just been working in the guts of the emulator to get // Sybase running...what is the ioctl in question? There are at least 4 Unknown errors in the linux_kdump below. The program writes a probe string to the UPS, and waits for an answer that never comes back. The cable is working, I have tested it with apcmon and upsd. roma::root [767] ktrace ./apcupsd-libc5 ./apcupsd-libc5: PANIC! Cannot talk to UPS roma::root [768] linux_kdump: ... 10485 apcupsd-libc5 CALL linux_open(0x80556b8,0x502,0) 10485 apcupsd-libc5 NAMI "/compat/linux/dev/ups" 10485 apcupsd-libc5 NAMI "/dev/ups" 10485 apcupsd-libc5 RET linux_open 3 10485 apcupsd-libc5 CALL linux_open(0x805ac18,0xc2,0x1a4) ... 10485 apcupsd-libc5 CALL linux_ioctl(0x3,0x5401 ,0x805aba0) 10485 apcupsd-libc5 RET linux_ioctl 0 10485 apcupsd-libc5 CALL linux_sigaction(0x1,0xefbfd500,0xefbfd4f0) 10485 apcupsd-libc5 RET linux_sigaction 0 10485 apcupsd-libc5 CALL linux_sigaction(0x2,0xefbfd4f8,0xefbfd4e8) 10485 apcupsd-libc5 RET linux_sigaction 0 10485 apcupsd-libc5 CALL linux_sigaction(0xf,0xefbfd4f0,0xefbfd4e0) 10485 apcupsd-libc5 RET linux_sigaction 0 10485 apcupsd-libc5 CALL linux_ioctl(0x3,0x540b ,0) >> Probably this is the guilty one. 10485 apcupsd-libc5 RET linux_ioctl -1 errno -14 Unknown error: -14 10485 apcupsd-libc5 CALL linux_ioctl(0x3,SNDCTL_TMR_START,0x805a9c0) 10485 apcupsd-libc5 RET linux_ioctl 0 10485 apcupsd-libc5 CALL write(0x3,0xefbfd533,0x1) 10485 apcupsd-libc5 GIO fd 3 wrote 1 byte "Y" 10485 apcupsd-libc5 RET write 1 10485 apcupsd-libc5 CALL linux_sigprocmask(0,0xefbfd4ec,0xefbfd4e8) 10485 apcupsd-libc5 RET linux_sigprocmask 0 10485 apcupsd-libc5 CALL linux_sigaction(0xe,0xefbfd500,0xefbfd4f0) 10485 apcupsd-libc5 RET linux_sigaction 0 10485 apcupsd-libc5 CALL linux_time(0) 10485 apcupsd-libc5 RET linux_time 907529171/0x3617cbd3 10485 apcupsd-libc5 CALL linux_alarm(0x1) 10485 apcupsd-libc5 RET linux_alarm 0 10485 apcupsd-libc5 CALL linux_sigsuspend(0,0,0) 10485 apcupsd-libc5 PSIG SIGALRM caught handler=0x280c3cb0 mask=0x2000 code=0x 0 10485 apcupsd-libc5 RET linux_sigsuspend -1 errno -4 Unknown error: -4 10485 apcupsd-libc5 CALL linux_sigreturn(0xefbfd454) 10485 apcupsd-libc5 RET linux_sigreturn JUSTRETURN 10485 apcupsd-libc5 CALL linux_time(0) 10485 apcupsd-libc5 RET linux_time 907529172/0x3617cbd4 10485 apcupsd-libc5 CALL linux_sigaction(0xe,0xefbfd4f0,0) 10485 apcupsd-libc5 RET linux_sigaction 0 10485 apcupsd-libc5 CALL linux_alarm(0) 10485 apcupsd-libc5 RET linux_alarm 0 10485 apcupsd-libc5 CALL linux_sigprocmask(0x2,0xefbfd4e8,0) 10485 apcupsd-libc5 RET linux_sigprocmask 0 10485 apcupsd-libc5 CALL linux_ioctl(0x3,0x540b ,0x2) 10485 apcupsd-libc5 RET linux_ioctl -1 errno -14 Unknown error: -14 10485 apcupsd-libc5 CALL write(0x3,0xefbfd533,0x1) 10485 apcupsd-libc5 GIO fd 3 wrote 1 byte "Y" 10485 apcupsd-libc5 RET write 1 10485 apcupsd-libc5 CALL linux_sigaction(0xe,0xefbfd4e8,0xefbfd4d8) 10485 apcupsd-libc5 RET linux_sigaction 0 10485 apcupsd-libc5 CALL linux_alarm(0x3) 10485 apcupsd-libc5 RET linux_alarm 0 10485 apcupsd-libc5 CALL read(0x3,0xefbfd513,0x1) 10485 apcupsd-libc5 PSIG SIGALRM caught handler=0x8051980 mask=0x0 code=0x0 10485 apcupsd-libc5 RET read -1 errno -4 Unknown error: -4 10485 apcupsd-libc5 CALL linux_sigreturn(0xefbfd490) 10485 apcupsd-libc5 RET linux_sigreturn JUSTRETURN 10485 apcupsd-libc5 CALL linux_alarm(0) 10485 apcupsd-libc5 RET linux_alarm 0 10485 apcupsd-libc5 CALL linux_sigaction(0xe,0xefbfd4e4,0xefbfd4d4) 10485 apcupsd-libc5 RET linux_sigaction 0 10485 apcupsd-libc5 CALL write(0x2,0xefbfcb40,0x2c) 10485 apcupsd-libc5 GIO fd 2 wrote 44 bytes "./apcupsd-libc5: PANIC! Cannot talk to UPS \a" 10485 apcupsd-libc5 RET write 44/0x2c ... I've also tested it with kermit. Sending a single 'Y' char gives me a 'SM' back, instantly. Jonny -- Joao Carlos Mendes Luis M.Sc. Student jonny@jonny.eng.br Universidade Federal do Rio de Janeiro "This .sig is not meant to be politically correct." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message