Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 03 Jul 1999 08:39:49 +0200
From:      Marcel Moolenaar <marcel@scc.nl>
To:        Chris Dillon <cdillon@wolves.k12.mo.us>
Cc:        stable@FreeBSD.ORG
Subject:   Re: Linux emulation
Message-ID:  <377DB035.7EE9AF75@scc.nl>
References:  <Pine.BSF.4.10.9907022216050.57187-100000@mail.wolves.k12.mo.us>

next in thread | previous in thread | raw e-mail | index | archive | help
[snip]

> > Andrij Korud wrote:
> > > "LINUX: 'ioctl' fd=0, typ=0x54(T), num=0x17 not implemented"

[snip]

> I wrote:
> > Can you apply the following patch and tell me if it solves your problem
> > without creating new problems? :-)

[snip]

Chris Dillon wrote:
> I just tried this patch on my server and it does the job, almost.
> There is no "unsupported ioctl" error message, but the daemon can't
> communicate with the UPS _unless_ I frob the port with tip(1) while
> the daemon is running.  The exact moment that I tip the serial port,
> the daemon comes alive and tells me UPS communications were
> established and its happy.  tip(1) isn't able to actually talk to the
> UPS, though it doesn't give me any errors of any kind, and I just ~.
> to exit out.  This would be acceptable if I could find an automated
> way of frobbing the serial port so that the daemon works.  :-)

I figured something like that would do the trick. A ktrace showed that
read(2) on the com-port returns -1 with errno set to -11. Everything else
seemed to work.

Can you tell us what kind of frobbing you did? Maybe there's a bug
somewhere in the TCGETS/TCSETS iotcls (these are used right after the
TIOCMBIC ioctl).

In the mean time I prepare the patch for being committed.

As for automated frobbing :-) Maybe it helps to initialize the device at
boot-time. See /etc/rc.serial

> BTW, I haven't tested to see if this breaks Linux emulation in any
> other way, since that is the only thing I'm using it for on that
> machine.  I may take PowerAlert home and play with it there and see if
> the X client works under emulation, too.

The only breakage I expect is when using one of the ioctls. So you don't
have to worry about any other kind of breakage.

> Here are the patches I have so far to make it install and work fairly
> cleanly under FreeBSD.  Yes, the patches are quite "hackey", but
> that's all you're gonna get without a rewrite of all the scripts to be
> more portable or just plain BSD-aware (there are only provisions for
> SysV-style startup scripts).  The one bit where I changed a
> "no_nl_echo" to a printf was purely cosmetic so that things looked
> right on system startup.
[snip]

I have my uname patch applied by default, which means that uname returns
"Linux" by default. When you run the pap_inst script in a Linux sh, it all
works out of the box. Changing the defaults and directories in the script
to match a FreeBSD environment is something which would be nice in case of
a real port though (hint :-)

Thanks for the feedback!

-- 
Marcel Moolenaar                                  mailto:marcel@scc.nl
SCC Internetworking & Databases                     http://www.scc.nl/
Amsterdam, The Netherlands                         tel: +31 20 4200655


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?377DB035.7EE9AF75>