Re: top shows all zeroes.

2002-08-26 Thread David Malone

On Sun, Aug 25, 2002 at 04:49:23PM -0700, Patrick Thomas wrote:
 Also, just to add a bit more info, sometimes instead of rebooting to solve
 the problem, the problem doesn't exist, and rebooting causes it to
 manifest.  So it seems fairly random.

Can you watch vmstat -i before and after the problem occurs? I'm
guessing that one of the interrupt counts will stop increasing.

David.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: USB support for new HP printers?

2002-08-26 Thread Marco Molteni

On Sun, 25 Aug 2002 23:36:15 -0600, John Nielsen [EMAIL PROTECTED]
wrote:

 Are there plans to add USB support for HP's newer printers to FreeBSD?
  
 Specificially, the OfficeJets and the LaserJet 1200?  They use a 
 new/different/broken USB interface so they're just recognized as ugen 
 devices at the moment..

have a look at hpoj.sourceforge.net
they plan FreeBSD USB support for a next release

marco

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: USB support for new HP printers?

2002-08-26 Thread John Nielsen

On Monday 26 August 2002 02:51, Marco Molteni wrote:
 On Sun, 25 Aug 2002 23:36:15 -0600, John Nielsen [EMAIL PROTECTED]

 wrote:
  Are there plans to add USB support for HP's newer printers to FreeBSD?
 
  Specificially, the OfficeJets and the LaserJet 1200?  They use a
  new/different/broken USB interface so they're just recognized as ugen
  devices at the moment..

 have a look at hpoj.sourceforge.net
 they plan FreeBSD USB support for a next release

I've been all over the site and read some of the docs.  The most useful 
piece of information I found was this:

FreeBSD, NetBSD, and OpenBSD are not yet supported in USB mode, due to 
missing functionality in the kernel ulpt driver (bidirectional I/O, 
device ID retrieval, switching to 7/1/3, and HP channel-change-request).

The only FreeBSD information in the TODO section has to do with fixing the 
build so it works [better].

I don't get the idea that they are planning to add the missing kernel 
functionality themselves; they don't seem to have done any of that for 
Linux--they just list using a supported kernel as a requirement for USB.

Since I'm mostly just interested in printing to an LJ 1200, I don't know if 
I'd even use the hpoj stuff unless necessary (although it does look 
interesting).  I'm just wondering if kernel support for these beasties is 
already being worked on, and where I can get more information.

JN

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: USB support for new HP printers?

2002-08-26 Thread Marco Molteni

On Mon, 26 Aug 2002 04:28:34 -0600, John Nielsen [EMAIL PROTECTED]
wrote:

 On Monday 26 August 2002 02:51, Marco Molteni wrote:
  On Sun, 25 Aug 2002 23:36:15 -0600, John Nielsen [EMAIL PROTECTED]
 
  wrote:
   Are there plans to add USB support for HP's newer printers to
   FreeBSD?
  
   Specificially, the OfficeJets and the LaserJet 1200?  They use a
   new/different/broken USB interface so they're just recognized as
   ugen devices at the moment..
 
  have a look at hpoj.sourceforge.net
  they plan FreeBSD USB support for a next release
 
 I've been all over the site and read some of the docs.  The most
 useful piece of information I found was this:

[..]

If you check the hpoj email archives, you will see that more than one
person has asked about FreeBSD USB support.

I seem to remember that Matt Dillon provided a few patches.

The piece of information I was referring to in my first posting was from
the TODO list: http://hpoj.sourceforge.net/todo.shtml

High-priority TODO list for version 0.91:

[..]

o Support USB on non-Linux platforms, such as *BSD and maybe Mac OS X
(using libusb?).


marco

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: USB support for new HP printers?

2002-08-26 Thread Terry Lambert

John Nielsen wrote:
  have a look at hpoj.sourceforge.net
  they plan FreeBSD USB support for a next release
 
 I've been all over the site and read some of the docs.  The most useful
 piece of information I found was this:
 
 FreeBSD, NetBSD, and OpenBSD are not yet supported in USB mode, due to
 missing functionality in the kernel ulpt driver (bidirectional I/O,
 device ID retrieval, switching to 7/1/3, and HP channel-change-request).


I'm pretty sure that bidirectional I/O is supported, or there
would be no network devices.

I'm also pretty sure device ID retrieval is in there.

I don't know what the heck switching to 7/1/3 means; most
likely it's some packetization protocol that needs support...
you could probably add this yourself, if they point at the
documentation of what it is, as opposed to just the idea that
it's necessary to have it.

HP channel-change-request sounds like a vendor command that
lives in the vendor device driver, not in ulpt.  Unless that
HP stands for High Priced or Huge Packets or something...
raw USB stuff should handle this without needing to do evil
things to the FreeBSD USB driver that are specific to one
printer from one vendor.


 The only FreeBSD information in the TODO section has to do with fixing the
 build so it works [better].

Probably indicates that the TODO is current, and the other
documentation is out of date...


 I don't get the idea that they are planning to add the missing kernel
 functionality themselves; they don't seem to have done any of that for
 Linux--they just list using a supported kernel as a requirement for USB.
 
 Since I'm mostly just interested in printing to an LJ 1200, I don't know if
 I'd even use the hpoj stuff unless necessary (although it does look
 interesting).  I'm just wondering if kernel support for these beasties is
 already being worked on, and where I can get more information.

Get a list of the things that actually need support, and are not
specific to that printer, and documentation for how to implement,
and it should not be hard to do the work yourself, or find someone
who's willing to do it for you, if you send/loan them hardware.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



pseudo-devices' names vs. names + quantity

2002-08-26 Thread Eugene Panchenko

hello, ppl!

I have a small question to all you: i want to be able to use at most 8 instances of 
the following pseudo-devices at the same time:

pseudo-device bpf 8
pseudo-device gif 8
pseudo-device vn 8
pseudo-device snp 8

after which ones of them do I need to put 8?
I assume that i might omit it after gif since it's an interface, and i can ifconfig 
it up any number of times i want, right? but what about the others?

also, how aften might I get gziped a.outs to run? do I *really* need 'pseudo-device 
gzip' nowadays?

of course, i am speaking about my custom kernel configuration file.

thanks you all very much!

-- eugene

îÏ×ÏÅ ÎÁ îçó:
http://job.ngs.ru - òÁÂÏÔÁ × îÏ×ÏÓÉÂÉÒÓËÅ
http://ngs.ru/wm - îÏ×ÏÓÉÂÉÒÓËÉÊ WM-ÃÅÎÔÒ




To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: top shows all zeroes.

2002-08-26 Thread Patrick Thomas


ok:

# vmstat -i
interrupt   total   rate
ata0 irq14 23  0
ahc0 irq10 15  0
aac0 irq2 6330470 30
fxp0 irq517556113 83
fdc0 irq6   4  0
sio0 irq4   8  0
sio1 irq3   8  0
clk irq0 21008332 99
rtc irq8   264460  1
Total45159433214

Now, when I repeat vmstat -i, all of these numbers (or rather, all of the
large numbers) increase _except_ for `rtc irq8`.

So is this just a simple broken clock on the system, as in, my hardware
clock is physically broken/breaking ?

dmesg says nothing about irq8, so I assume there is no conflict.

Further, regarding the APM conjecture, this is a server and (although I
may be mistaken) does not have APM in the bios at all - I have also
removed it from the kernel.  dmesg tends to confirm the absence of APM.

--bpat

On Mon, 26 Aug 2002, David Malone wrote:

 On Sun, Aug 25, 2002 at 04:49:23PM -0700, Patrick Thomas wrote:
  Also, just to add a bit more info, sometimes instead of rebooting to solve
  the problem, the problem doesn't exist, and rebooting causes it to
  manifest.  So it seems fairly random.

 Can you watch vmstat -i before and after the problem occurs? I'm
 guessing that one of the interrupt counts will stop increasing.

   David.



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



RE: Fast interrupts

2002-08-26 Thread John Baldwin


On 26-Aug-2002 M. Warner Losh wrote:
 can you call wakeup(9) from a fast interrupt handler?  I couldn't find
 the specific answer from the man page:
 
  All processes
  sleeping on a single ident are woken up later by wakeup, often called
  from inside an interrupt routine, to indicate that the resource the pro-
  cess was blocking on is available now.
 
 The only reason I ask is because sio seems to go out of its way to
 schedule a soft interrupt to deal with waking up processes, which then
 calls wakeup...

Since wakeup only needs a spin lock, it is probably ok.  You just can't call
anything that would sleep (in any interrupt handler) or block on a non-spin
mutex.

-- 

John Baldwin [EMAIL PROTECTED]http://www.FreeBSD.org/~jhb/
Power Users Use the Power to Serve!  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: USB support for new HP printers?

2002-08-26 Thread Mikko Työläjärvi

On Mon, 26 Aug 2002, Terry Lambert wrote:

 John Nielsen wrote:
   have a look at hpoj.sourceforge.net
   they plan FreeBSD USB support for a next release
 
  I've been all over the site and read some of the docs.  The most useful
  piece of information I found was this:
 
  FreeBSD, NetBSD, and OpenBSD are not yet supported in USB mode, due to
  missing functionality in the kernel ulpt driver (bidirectional I/O,
  device ID retrieval, switching to 7/1/3, and HP channel-change-request).


 I'm pretty sure that bidirectional I/O is supported, or there
 would be no network devices.

[...]

Though the USB stack handles bi-directional communication, ulpt does not:

Static struct cdevsw ulpt_cdevsw = {
   /* open */ulptopen,
   /* close */   ulptclose,
   /* read */noread, !
...

In -current, an input routine has been added, but all it does is
discard any data that comes from the printer.

  $.02,
  /Mikko

 Mikko Työläjä[EMAIL PROTECTED]
 RSA Security


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: top shows all zeroes.

2002-08-26 Thread Lars Eggert

Patrick Thomas wrote:
 Now, when I repeat vmstat -i, all of these numbers (or rather, all of the
 large numbers) increase _except_ for `rtc irq8`.

interrupt   total   rate
mux irq114851 12
ata0 irq14  94219240
atkbd0 irq1   399  1
fdc0 irq6   2  0
ppc0 irq7   1  0
clk irq039123100
Total  138595354

Large ones increasing, too, but I don't seem to have rtc.

 Further, regarding the APM conjecture, this is a server and (although I
 may be mistaken) does not have APM in the bios at all - I have also
 removed it from the kernel.  dmesg tends to confirm the absence of APM.

Mine's a laptop with APM enabled (BIOS + kernel).

Lars
-- 
Lars Eggert [EMAIL PROTECTED]   USC Information Sciences Institute



smime.p7s
Description: S/MIME Cryptographic Signature


piping to a script

2002-08-26 Thread Antonio Inojal

Hello, I am trying to pipe content from a C program into a shell script. 
What I want to do is to pass the information coming from the C app, into 
an environmental variable in the shell script:

my_app | my_script .

Say that my app spits out the date, ok?
I want that an env variable declared in my_script pick up the data being 
piped and make that data its value.
If anyone knows how to do this, or if I have not explained myself right 
please contact me. Thank You very much.
Tony


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



System Panic: Trap 12 - Page Fault

2002-08-26 Thread Daniel Rudy

Hello,

I'm trying to figure out why my system paniced.  Below is some of the
details that I have come up with so far.  This is the SECOND kernel
panic in a row.  The first one is unusable.

strata:/usr/backup/crash 1034 ### -gdb -k kernel.debug vmcore.1
GNU gdb 4.18 (FreeBSD)
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type show copying to see the conditions.
There is absolutely no warranty for GDB.  Type show warranty for
details.
This GDB was configured as i386-unknown-freebsd...
IdlePTD at phsyical address 0x00311000
initial pcb at physical address 0x00283960
panicstr: page fault
panic messages:
---
Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0x644f0680
fault code  = supervisor read, page not present
instruction pointer = 0x8:0x644f0680
stack pointer   = 0x10:0xc0263634
frame pointer   = 0x10:0xc05fc006
code segment= base 0x0, limit 0xf, type 0x1b
= DPL 0, pres 1, def32 1, gran 1
processor eflags= interrupt enabled, resume, IOPL = 0
current process = Idle
interrupt mask  = net
trap number = 12
panic: page fault

syncing disks...

Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0x30
fault code  = supervisor read, page not present
instruction pointer = 0x8:0xc01de0f8
stack pointer   = 0x10:0xc0263428
frame pointer   = 0x10:0xc0263430
code segment= base 0x0, limit 0xf, type 0x1b
= DPL 0, pres 1, def32 1, gran 1
processor eflags= interrupt enabled, resume, IOPL = 0
current process = Idle
interrupt mask  = net bio cam
trap number = 12
panic: page fault
Uptime: 1m44s

dumping to dev #ad/0x20001, offset 131072
dump ata0: resetting devices .. done
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41
40 39 38 37 36 35 34 33 32 31 30 29 28 2
7 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
---
#0  dumpsys () at /usr/src/sys/kern/kern_shutdown.c:487
487 if (dumping++) {
(kgdb) where
#0  dumpsys () at /usr/src/sys/kern/kern_shutdown.c:487
#1  0xc01529df in boot (howto=260) at
/usr/src/sys/kern/kern_shutdown.c:316
#2  0xc0152e1d in panic (fmt=0xc025ccac %s) at
/usr/src/sys/kern/kern_shutdown.c:595
#3  0xc0224a5f in trap_fatal (frame=0xc02633e8, eva=48) at
/usr/src/sys/i386/i386/trap.c:966
#4  0xc022470d in trap_pfault (frame=0xc02633e8, usermode=0, eva=48) at
/usr/src/sys/i386/i386/trap.c:859
#5  0xc0224287 in trap (frame={tf_fs = 16, tf_es = 16, tf_ds = 16,
tf_edi = 0, tf_esi = -1067713536,
  tf_ebp = -1071238096, tf_isp = -1071238124, tf_ebx = -1071164132,
tf_edx = 6864960, tf_ecx = -970933824,
  tf_eax = 0, tf_trapno = 12, tf_err = 0, tf_eip = -1071783688,
tf_cs = 8, tf_eflags = 66050,
  tf_esp = -1067713536, tf_ss = -1067713536}) at
/usr/src/sys/i386/i386/trap.c:458
#6  0xc01de0f8 in acquire_lock (lk=0xc027551c) at
/usr/src/sys/ufs/ffs/ffs_softdep.c:266
#7  0xc01e21f8 in softdep_update_inodeblock (ip=0xc05bfc00,
bp=0xc1cef15c, waitfor=0)
at /usr/src/sys/ufs/ffs/ffs_softdep.c:3813
#8  0xc01dd159 in ffs_update (vp=0xc620b9c0, waitfor=0) at
/usr/src/sys/ufs/ffs/ffs_inode.c:106
#9  0xc01e6e64 in ffs_fsync (ap=0xc02634dc) at
/usr/src/sys/ufs/ffs/ffs_vnops.c:273
#10 0xc01e5673 in ffs_sync (mp=0xc0930e00, waitfor=2, cred=0xc05cf880,
p=0xc029c2c0) at vnode_if.h:558
#11 0xc0182e53 in sync (p=0xc029c2c0, uap=0x0) at
/usr/src/sys/kern/vfs_syscalls.c:576
#12 0xc0152752 in boot (howto=256) at
/usr/src/sys/kern/kern_shutdown.c:235
#13 0xc0152e1d in panic (fmt=0xc025ccac %s) at
/usr/src/sys/kern/kern_shutdown.c:595
#14 0xc0224a5f in trap_fatal (frame=0xc02635f4, eva=1682900608) at
/usr/src/sys/i386/i386/trap.c:966
#15 0xc022470d in trap_pfault (frame=0xc02635f4, usermode=0,
eva=1682900608)
at /usr/src/sys/i386/i386/trap.c:859
#16 0xc0224287 in trap (frame={tf_fs = 16, tf_es = 16, tf_ds = 16,
tf_edi = 6687744, tf_esi = -1067340800,
  tf_ebp = -1067466746, tf_isp = -1071237600, tf_ebx = -1067340800,
tf_edx = -1481375744,
  tf_ecx = -1067339776, tf_eax = 1682900608, tf_trapno = 12, tf_err
= 0, tf_eip = 1682900608, tf_cs = 8,
  tf_eflags = 66050, tf_esp = -1072234652, tf_ss = -1481375744}) at
/usr/src/sys/i386/i386/trap.c:458
#17 0x644f0680 in ?? ()
#18 0xf09a1cc in ?? ()
cannot read proc at 0
(kgdb) qstrata:/usr/backup/crash 1037 ### -uname -a
FreeBSD strata.pacbell.net 4.6.2-RELEASE FreeBSD 4.6.2-RELEASE #5: Tue
Aug 20 09:41:22 PDT 2002 root@strata.
pacbell.net:/usr/obj/usr/src/sys/STRATA  i386
strata:/usr/backup/crash 1038 ### -

strata:/usr/src/sys/i386/conf 1039 ### -cat WILDFIRE
# * * * *  KERNEL CONFIG FILE
# * * * *  MACHINE WILDFIRE
# * * * *  wildfire.pacbell.net



# CPU/Machine Options
machine 

Re: USB support for new HP printers?

2002-08-26 Thread Ulf Zimmermann

On Mon, Aug 26, 2002 at 01:46:44PM +0200, Marco Molteni wrote:
 On Mon, 26 Aug 2002 04:28:34 -0600, John Nielsen [EMAIL PROTECTED]
 wrote:
 
  On Monday 26 August 2002 02:51, Marco Molteni wrote:
   On Sun, 25 Aug 2002 23:36:15 -0600, John Nielsen [EMAIL PROTECTED]
  
   wrote:
Are there plans to add USB support for HP's newer printers to
FreeBSD?
   
Specificially, the OfficeJets and the LaserJet 1200?  They use a
new/different/broken USB interface so they're just recognized as
ugen devices at the moment..
  
   have a look at hpoj.sourceforge.net
   they plan FreeBSD USB support for a next release
  
  I've been all over the site and read some of the docs.  The most
  useful piece of information I found was this:
 
 [..]
 
 If you check the hpoj email archives, you will see that more than one
 person has asked about FreeBSD USB support.
 
 I seem to remember that Matt Dillon provided a few patches.
 
 The piece of information I was referring to in my first posting was from
 the TODO list: http://hpoj.sourceforge.net/todo.shtml
 
 High-priority TODO list for version 0.91:
 
 [..]
 
 o Support USB on non-Linux platforms, such as *BSD and maybe Mac OS X
 (using libusb?).
 
 
 marco

I have an Laserjet 3330 (Fax/Copy/Scanner/Printer) here attached via
USB to a Mac running OS X, it detects the printer fine as what it is.
Haven't tried to hook it up to FreeBSD.

-- 
Regards, Ulf.

-
Ulf Zimmermann, 1525 Pacific Ave., Alameda, CA-94501, #: 510-865-0204
You can find my resume at: http://seven.Alameda.net/~ulf/resume.html

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Fast interrupts

2002-08-26 Thread Maksim Yevmenkin

John Baldwin wrote:
 
 On 26-Aug-2002 M. Warner Losh wrote:
  can you call wakeup(9) from a fast interrupt handler?  

[ ...]

  The only reason I ask is because sio seems to go out of its way to
  schedule a soft interrupt to deal with waking up processes, which then
  calls wakeup...
 
 Since wakeup only needs a spin lock, it is probably ok.  You just can't call
 anything that would sleep (in any interrupt handler) or block on a non-spin
 mutex.

what is the general locking technique for interrupt handlers?
there must be some sort of locking, right?

man atomic(9) says that current set of atomic operations do not
necessarily guarantee atomicity across multiple processors.

man mutex(9) says that MTX_DEF mutexes _might_ spin for some
amount of time. but it is _only_ a machine specific optimization.

MTX_SPIN are not recomended (correct me if i wrong). WITNESS
gets upset when it finds unlisted MTX_SPIN mutex.

for example NIC drivers call ether_input() from interrupt handlers
which uses mutex to lock input queue. does that mean interrupt
handler can/should use MTX_DEF mutex in this case? 

thanks,
max

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Fast interrupts

2002-08-26 Thread Bosko Milekic


On Mon, Aug 26, 2002 at 09:41:43AM -0700, Maksim Yevmenkin wrote:
 John Baldwin wrote:
  
  On 26-Aug-2002 M. Warner Losh wrote:
   can you call wakeup(9) from a fast interrupt handler?  
 
 [ ...]
 
   The only reason I ask is because sio seems to go out of its way to
   schedule a soft interrupt to deal with waking up processes, which then
   calls wakeup...
  
  Since wakeup only needs a spin lock, it is probably ok.  You just can't call
  anything that would sleep (in any interrupt handler) or block on a non-spin
  mutex.
 
 what is the general locking technique for interrupt handlers?
 there must be some sort of locking, right?

  You are allowed to use mutex locks (both spin and MTX_DEF), only you
  are only allowed to user the former for fast interrupt handlers.

-- 
Bosko Milekic * [EMAIL PROTECTED] * [EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Fast interrupts

2002-08-26 Thread Maksim Yevmenkin

Bosko Milekic wrote:
 
 On Mon, Aug 26, 2002 at 09:41:43AM -0700, Maksim Yevmenkin wrote:
  John Baldwin wrote:
  
   On 26-Aug-2002 M. Warner Losh wrote:
can you call wakeup(9) from a fast interrupt handler?
 
  [ ...]
 
The only reason I ask is because sio seems to go out of its way to
schedule a soft interrupt to deal with waking up processes, which then
calls wakeup...
  
   Since wakeup only needs a spin lock, it is probably ok.  You just can't call
   anything that would sleep (in any interrupt handler) or block on a non-spin
^^
my understanding is that John was talking about any
interrupt handler. Not just fast interrupt hander.

   mutex.
 
  what is the general locking technique for interrupt handlers?
  there must be some sort of locking, right?
 
   You are allowed to use mutex locks (both spin and MTX_DEF), only you
   are only allowed to user the former for fast interrupt handlers.

thanks,
max

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Fast interrupts

2002-08-26 Thread Bosko Milekic


On Mon, Aug 26, 2002 at 10:14:32AM -0700, Maksim Yevmenkin wrote:
 Bosko Milekic wrote:
  
  On Mon, Aug 26, 2002 at 09:41:43AM -0700, Maksim Yevmenkin wrote:
   John Baldwin wrote:
   
On 26-Aug-2002 M. Warner Losh wrote:
 can you call wakeup(9) from a fast interrupt handler?
  
   [ ...]
  
 The only reason I ask is because sio seems to go out of its way to
 schedule a soft interrupt to deal with waking up processes, which then
 calls wakeup...
   
Since wakeup only needs a spin lock, it is probably ok.  You just can't call
anything that would sleep (in any interrupt handler) or block on a non-spin
 ^^
 my understanding is that John was talking about any
 interrupt handler. Not just fast interrupt hander.

   Yeah, you can't call anything that would _sleep_ (e.g., msleep()).
   You could still grab a MTX_DEF mutex for a non-fast interrupt
   handler and possibly block waiting to get it.

-- 
Bosko Milekic * [EMAIL PROTECTED] * [EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: top shows all zeroes.

2002-08-26 Thread Patrick Thomas


ok, after 2+ days, for no discernible reason I now have real top stats
back.

This has occurred within the last 20 minutes, and I have done nothing at
all on the system save normal operation.  vmstat -i now tells me:

# vmstat -i
...
rtc irq8   479105  2
...


The 497105 number is steadily rising ...

and now, about 30 mins later I am at:

rtc irq8   938264  4

--pt




On Mon, 26 Aug 2002, Lars Eggert wrote:

 Patrick Thomas wrote:
  Now, when I repeat vmstat -i, all of these numbers (or rather, all of the
  large numbers) increase _except_ for `rtc irq8`.

 interrupt   total   rate
 mux irq114851 12
 ata0 irq14  94219240
 atkbd0 irq1   399  1
 fdc0 irq6   2  0
 ppc0 irq7   1  0
 clk irq039123100
 Total  138595354

 Large ones increasing, too, but I don't seem to have rtc.

  Further, regarding the APM conjecture, this is a server and (although I
  may be mistaken) does not have APM in the bios at all - I have also
  removed it from the kernel.  dmesg tends to confirm the absence of APM.

 Mine's a laptop with APM enabled (BIOS + kernel).

 Lars
 --
 Lars Eggert [EMAIL PROTECTED]   USC Information Sciences Institute



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Fast interrupts

2002-08-26 Thread John Baldwin


On 26-Aug-2002 Maksim Yevmenkin wrote:
 John Baldwin wrote:
 
 On 26-Aug-2002 M. Warner Losh wrote:
  can you call wakeup(9) from a fast interrupt handler?  
 
 [ ...]
 
  The only reason I ask is because sio seems to go out of its way to
  schedule a soft interrupt to deal with waking up processes, which then
  calls wakeup...
 
 Since wakeup only needs a spin lock, it is probably ok.  You just can't call
 anything that would sleep (in any interrupt handler) or block on a non-spin
 mutex.
 
 what is the general locking technique for interrupt handlers?
 there must be some sort of locking, right?

Normal interrupt handlers should use MTX_DEF mutexes.  Fast interrupt
handlers cannot use those, so they must use MTX_SPIN mutexes instead.

-- 

John Baldwin [EMAIL PROTECTED]http://www.FreeBSD.org/~jhb/
Power Users Use the Power to Serve!  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Fast interrupts

2002-08-26 Thread John Baldwin


On 26-Aug-2002 Maksim Yevmenkin wrote:
 Bosko Milekic wrote:
 
 On Mon, Aug 26, 2002 at 09:41:43AM -0700, Maksim Yevmenkin wrote:
  John Baldwin wrote:
  
   On 26-Aug-2002 M. Warner Losh wrote:
can you call wakeup(9) from a fast interrupt handler?
 
  [ ...]
 
The only reason I ask is because sio seems to go out of its way to
schedule a soft interrupt to deal with waking up processes, which then
calls wakeup...
  
   Since wakeup only needs a spin lock, it is probably ok.  You just can't call
   anything that would sleep (in any interrupt handler) or block on a non-spin
 ^^
 my understanding is that John was talking about any
 interrupt handler. Not just fast interrupt hander.

Yes.  When you block on a MTX_DEF mutex, that is not considered sleeping for the
purposes of that statement.  Sleeping is when you are in SSLEEP (well, what used
to be called SSLEEP).

   mutex.
 
  what is the general locking technique for interrupt handlers?
  there must be some sort of locking, right?
 
   You are allowed to use mutex locks (both spin and MTX_DEF), only you
   are only allowed to user the former for fast interrupt handlers.
 
 thanks,
 max

-- 

John Baldwin [EMAIL PROTECTED]http://www.FreeBSD.org/~jhb/
Power Users Use the Power to Serve!  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: top shows all zeroes.

2002-08-26 Thread Peter Wemm

Patrick Thomas wrote:
 
 ok, after 2+ days, for no discernible reason I now have real top stats
 back.
 
 This has occurred within the last 20 minutes, and I have done nothing at
 all on the system save normal operation.  vmstat -i now tells me:
 
 # vmstat -i
 ...
 rtc irq8   479105  2
 ...
 
 
 The 497105 number is steadily rising ...
 
 and now, about 30 mins later I am at:
 
 rtc irq8   938264  4
 
 --pt

This has happened before.  For some reason, the RTC stops sending the 128Hz
statclock (statistics clock) interrupts.  One way to unwedge that in the past
was to break into ddb and do a 'show rtc' command.. but that is hardly a
solution.  I thought we had solved this problem.

APM however is a known culprit for causing badness here.

 On Mon, 26 Aug 2002, Lars Eggert wrote:
 
  Patrick Thomas wrote:
   Now, when I repeat vmstat -i, all of these numbers (or rather, all of the
   large numbers) increase _except_ for `rtc irq8`.
 
  interrupt   total   rate
  mux irq114851 12
  ata0 irq14  94219240
  atkbd0 irq1   399  1
  fdc0 irq6   2  0
  ppc0 irq7   1  0
  clk irq039123100
  Total  138595354
 
  Large ones increasing, too, but I don't seem to have rtc.
 
   Further, regarding the APM conjecture, this is a server and (although I
   may be mistaken) does not have APM in the bios at all - I have also
   removed it from the kernel.  dmesg tends to confirm the absence of APM.
 
  Mine's a laptop with APM enabled (BIOS + kernel).
 
  Lars
  --
  Lars Eggert [EMAIL PROTECTED]   USC Information Sciences Institute
 
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-hackers in the body of the message
 

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
All of this is for nothing if we don't go to the stars - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: piping to a script

2002-08-26 Thread Rohit Grover

Antonio Inojal wrote:
 
 Hello, I am trying to pipe content from a C program into a shell script.
 What I want to do is to pass the information coming from the C app, into
 an environmental variable in the shell script:
 
 my_app | my_script .
 
 Say that my app spits out the date, ok?
 I want that an env variable declared in my_script pick up the data being
 piped and make that data its value.
 If anyone knows how to do this, or if I have not explained myself right
 please contact me. Thank You very much.


$ ENV_VAR=`my_app` my_script

PS: hackers is not the right forum for such questions.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: top shows all zeroes.

2002-08-26 Thread Brian T. Schellenberger

On Monday 26 August 2002 12:00 pm, Lars Eggert wrote:
| Patrick Thomas wrote:
|  Now, when I repeat vmstat -i, all of these numbers (or rather, all
|  of the large numbers) increase _except_ for `rtc irq8`.
|
| interrupt   total   rate
| mux irq114851 12
| ata0 irq14  94219240
| atkbd0 irq1   399  1
| fdc0 irq6   2  0
| ppc0 irq7   1  0
| clk irq039123100
| Total  138595354
|
| Large ones increasing, too, but I don't seem to have rtc.
|
|  Further, regarding the APM conjecture, this is a server and
|  (although I may be mistaken) does not have APM in the bios at all -
|  I have also removed it from the kernel.  dmesg tends to confirm the
|  absence of APM.
|
| Mine's a laptop with APM enabled (BIOS + kernel).

But on the other hand mine's a laptop with APM and it doesn't have the 
problem.  Then again, my kernel is vintage July 19.

|
| Lars

-- 
Brian, the man from Babble-On . . . .   [EMAIL PROTECTED] (personal)

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: top shows all zeroes.

2002-08-26 Thread Bruce M Simpson

On Mon, Aug 26, 2002 at 11:02:50AM -0700, Peter Wemm wrote:
 This has happened before.  For some reason, the RTC stops sending the 128Hz
 statclock (statistics clock) interrupts.  One way to unwedge that in the past
 was to break into ddb and do a 'show rtc' command.. but that is hardly a
 solution.  I thought we had solved this problem.
 
 APM however is a known culprit for causing badness here.

I should add that my Vaio has APM compiled into the kernel. I've also done
the vmstat -i inspection briefly, all interrupt counters seem to be
incrementing as normal. This problem may have cropped up after a set of
suspend/resume sequences; right now I've had 3 warm reboots since 
yesterday (the laptop has been plugged in and unmoved), the problem has not
yet manifested itself, but when I last noticed it, I had been suspending
and resuming between leaving home and work.

I realize this is purely anecdotal but I'll continue to observe for the
problem re-emerging.

BMS

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: top shows all zeroes.

2002-08-26 Thread Patrick Thomas


I will note that my system is a dual processor system, no APM hardware in
it, and I have an identical machine running a kernel built from an
identical kernel configuration file running an identical FreeBSD system
that has _never_ had the problem.



On Mon, 26 Aug 2002, Bruce M Simpson wrote:

 On Mon, Aug 26, 2002 at 11:02:50AM -0700, Peter Wemm wrote:
  This has happened before.  For some reason, the RTC stops sending the 128Hz
  statclock (statistics clock) interrupts.  One way to unwedge that in the past
  was to break into ddb and do a 'show rtc' command.. but that is hardly a
  solution.  I thought we had solved this problem.
 
  APM however is a known culprit for causing badness here.

 I should add that my Vaio has APM compiled into the kernel. I've also done
 the vmstat -i inspection briefly, all interrupt counters seem to be
 incrementing as normal. This problem may have cropped up after a set of
 suspend/resume sequences; right now I've had 3 warm reboots since
 yesterday (the laptop has been plugged in and unmoved), the problem has not
 yet manifested itself, but when I last noticed it, I had been suspending
 and resuming between leaving home and work.

 I realize this is purely anecdotal but I'll continue to observe for the
 problem re-emerging.

 BMS



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Lint libraries in -STABLE

2002-08-26 Thread Bruce M Simpson

Hi,

Does anybody know if lint library generation was ever fixed in -STABLE?
/usr/libdata/lint appears to be empty.

Thanks
BMS

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



kevent and pipes interaction on 4.6-STABLE

2002-08-26 Thread Dominic Marks

Hey,

I'm attempting the junior userland hacker task of replacing select in
make with kevent. I have written the code and it is, as far as I know
correct.

The problem is that this code doesn't work. An example being the
following:

 cd /usr/src
 /usr/obj/usr/home/dom/code/src/usr.bin/make/make -j2 clean
xxx: kq = 3
xxx: new job on fd 5
xxx: closing job on fd 5
xxx: new job on fd 5

At this point it blocks waiting for events on fd 5 and it never comes
back to life. It I watch kevent being called in Job_CatchOutput it is
returning with EBADF.

I have checked that kq is 0 when Job_CatchOutput is called so the bad
file descriptor message is coming from the pipe. I am using the
job-inPipe variable, which is a valid descriptor (I believe) as the
identification for the new kevent.

Please look at the diff to -CURRENT's make I have attached (small) and
see if I have made any really trivial error. A truss log is also
attached.

Thanks!
--
Dominic Marks
 Computer  Politics Geek
  [work]::[npl.co.uk]  dominic.marks at npl.co.uk 
  [educ]::[umist.ac.uk]  notyet-known at umist.ac.uk 
  [home]::[btinternet]  dominic_marks at btinternet.com 


Index: job.c
===
RCS file: /media/cvs/freebsd/src/usr.bin/make/job.c,v
retrieving revision 1.38
diff -u -r1.38 job.c
--- job.c   20 Jun 2002 19:28:00 -  1.38
+++ job.c   26 Aug 2002 22:06:31 -
 -1,4 +1,5 
 /*
+ * Copyright (c) 2002, Dominic Marks
  * Copyright (c) 1988, 1989, 1990, 1993
  * The Regents of the University of California.  All rights reserved.
  * Copyright (c) 1988, 1989 by Adam de Boor
 -105,6 +106,7 
 #include sys/types.h
 #include sys/stat.h
 #include sys/file.h
+#include sys/event.h
 #include sys/time.h
 #include sys/wait.h
 #include err.h
 -237,8 +239,13 
 * (2) a job can only be run locally, but
 * nLocal equals maxLocal */
 #ifndef RMT_WILL_WATCH
-static fd_set  outputs;/* Set of descriptors of pipes connected to
+#ifdef USE_SELECT
+static fd_set  outputs;
+   /* Set of descriptors of pipes connected to
 * the output channels of children */
+#else
+static int kq = -1;
+#endif /* USE_SELECT */
 #endif
 
 STATIC GNode   *lastNode;  /* The node for which output was most recently
 -704,11 +711,27 
 JobClose(job)
 Job *job;
 {
+int rv;
+struct kevent ke;
+
 if (usePipes) {
 #ifdef RMT_WILL_WATCH
-   Rmt_Ignore(job-inPipe);
+   
+   Rmt_Ignore(job-inPipe);
 #else
+#ifdef USE_SELECT
FD_CLR(job-inPipe, outputs);
+#else
+   memset(ke, 0, sizeof(struct kevent));
+   printf(xxx: closing job on fd %d\n, job-inPipe);
+   ke.ident = job-inPipe;
+   ke.filter = EVFILT_READ;
+   ke.flags = EV_DELETE;
+   rv = kevent(kq, ke, 1, NULL, 0, NULL);
+   if (rv  0) {
+   Punt(kevent(2) failed when closing a job);
+   }
+#endif /* USE_SELECT */
 #endif
if (job-outPipe != job-inPipe) {
   (void) close(job-outPipe);
 -1192,6 +1215,10 
 Job  *job; /* Job to execute */
 char **argv;
 {
+#ifndef USE_SELECT
+int rv;
+struct kevent ke;
+#endif /* USE_SELECT */
 int  cpid; /* ID of new child */
 
 if (DEBUG(JOB)) {
 -1305,7 +1332,19 
 #ifdef RMT_WILL_WATCH
Rmt_Watch(job-inPipe, JobLocalInput, job);
 #else
+#ifdef USE_SELECT
FD_SET(job-inPipe, outputs);
+#else
+   memset(ke, 0, sizeof(struct kevent));
+   printf(xxx: new job on fd %d\n, job-inPipe);
+   ke.ident = job-inPipe;
+   ke.filter = EVFILT_READ;
+   ke.flags = EV_ADD;
+   rv = kevent(kq, ke, 1, NULL, 0, NULL);
+   if (rv  0) {
+   Punt(kevent(2) failed when adding a job);
+   }
+#endif /* USE_SELECT */
 #endif /* RMT_WILL_WATCH */
}
 
 -2313,16 +2352,23 
 void
 Job_CatchOutput()
 {
-int  nfds;
-struct timeval   timeout;
-fd_set   readfds;
+#ifdef USE_SELECT
+int  nfds;
+struct timeval   timeout;
+fd_set   readfds;
+#else
+#define KEVENT_SET_SIZE 8
+int kq, rv, idx;
+struct keventke[KEVENT_SET_SIZE];
+#endif /* USE_SELECT */
 LstNode  ln;
 Job  *job;
 #ifdef RMT_WILL_WATCH
 int  pnJobs;   /* Previous nJobs */
 #endif
-
+
 (void) fflush(stdout);
+
 #ifdef RMT_WILL_WATCH
 pnJobs = nJobs;
 
 -2347,26 +2393,49 
 }
 #else
 if (usePipes) {
+#ifdef USE_SELECT
readfds = outputs;
-   timeout.tv_sec = SEL_SEC;
-   timeout.tv_usec = SEL_USEC;
 
-   if ((nfds = select(FD_SETSIZE, readfds, (fd_set *) 0,
-  (fd_set *) 0, timeout)) = 0)
-   return;
+timeout.tv_sec 

Re: kevent and pipes interaction on 4.6-STABLE

2002-08-26 Thread Dominic Marks

On Mon, Aug 26, 2002 at 11:17:27PM +0100, Dominic Marks wrote:

snip/

One thing I forgot to mention, but which I don't think (hope) matters is
that I'm building make from checked out -CURRENT source on my -STABLE
workstation. That's why the diff is against -CURRENT and the subject
mentions 4.6-STABLE.

Sorry for the ambiguity.

--
Dominic Marks
 Computer  Politics Geek
  [work]::[npl.co.uk]  dominic.marks at npl.co.uk 
  [educ]::[umist.ac.uk]  notyet-known at umist.ac.uk 
  [home]::[btinternet]  dominic_marks at btinternet.com 

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: USB support for new HP printers?

2002-08-26 Thread Don Lewis

On 26 Aug, Mikko Työläjärvi wrote:
 On Mon, 26 Aug 2002, Terry Lambert wrote:
 
 John Nielsen wrote:

  FreeBSD, NetBSD, and OpenBSD are not yet supported in USB mode, due to
  missing functionality in the kernel ulpt driver (bidirectional I/O,
  device ID retrieval, switching to 7/1/3, and HP channel-change-request).


 I'm pretty sure that bidirectional I/O is supported, or there
 would be no network devices.
 
 [...]
 
 Though the USB stack handles bi-directional communication, ulpt does not:
 
 Static struct cdevsw ulpt_cdevsw = {
/* open */ulptopen,
/* close */   ulptclose,
/* read */noread,   !
 ...

I'd like to have bi-directional communication support in the ulpt driver
for my Epson ink jet printer so that I could use the utilities to check
the ink levels and align the nozzles.  This feature is on the ToDo list
on the FreeBSD USB project page.  I looked at the existing driver code a
while back, but that's as far as I got :-(


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: kevent and pipes interaction on 4.6-STABLE

2002-08-26 Thread Dominic Marks

Hey,

The best time to find and fix problems in code is just after you've
submitted it to a public forum. It is also the worst time. :-)

1. Removed pointless traversal on kevent structures in Job_CatchOutput
which I was doing before. Now all kevent objects store the address of
their assigned job in the udata field.

2. Fixed one instance where some variables which should be hiden behind
USE_SELECT preprocessor had snuck out.

Updated diff attached, the main problem persists.

Thanks,
--
Dominic Marks
 Computer  Politics Geek
  [work]::[npl.co.uk]  dominic.marks at npl.co.uk 
  [educ]::[umist.ac.uk]  notyet-known at umist.ac.uk 
  [home]::[btinternet]  dominic_marks at btinternet.com 


Index: job.c
===
RCS file: /media/cvs/freebsd/src/usr.bin/make/job.c,v
retrieving revision 1.38
diff -u -r1.38 job.c
--- job.c   20 Jun 2002 19:28:00 -  1.38
+++ job.c   26 Aug 2002 22:44:05 -
 -1,4 +1,5 
 /*
+ * Copyright (c) 2002, Dominic Marks
  * Copyright (c) 1988, 1989, 1990, 1993
  * The Regents of the University of California.  All rights reserved.
  * Copyright (c) 1988, 1989 by Adam de Boor
 -105,6 +106,7 
 #include sys/types.h
 #include sys/stat.h
 #include sys/file.h
+#include sys/event.h
 #include sys/time.h
 #include sys/wait.h
 #include err.h
 -237,8 +239,13 
 * (2) a job can only be run locally, but
 * nLocal equals maxLocal */
 #ifndef RMT_WILL_WATCH
-static fd_set  outputs;/* Set of descriptors of pipes connected to
+#ifdef USE_SELECT
+static fd_set  outputs;
+   /* Set of descriptors of pipes connected to
 * the output channels of children */
+#else
+static int kq = -1;
+#endif /* USE_SELECT */
 #endif
 
 STATIC GNode   *lastNode;  /* The node for which output was most recently
 -704,11 +711,29 
 JobClose(job)
 Job *job;
 {
+#ifndef USE_SELECT
+int rv;
+struct kevent ke;
+#endif /* ! USE_SELECT */
+
 if (usePipes) {
 #ifdef RMT_WILL_WATCH
-   Rmt_Ignore(job-inPipe);
+   
+   Rmt_Ignore(job-inPipe);
 #else
+#ifdef USE_SELECT
FD_CLR(job-inPipe, outputs);
+#else
+   memset(ke, 0, sizeof(struct kevent));
+   printf(xxx: closing job on fd %d\n, job-inPipe);
+   ke.ident = job-inPipe;
+   ke.filter = EVFILT_READ;
+   ke.flags = EV_DELETE;
+   rv = kevent(kq, ke, 1, NULL, 0, NULL);
+   if (rv  0) {
+   Punt(kevent(2) failed when closing a job);
+   }
+#endif /* USE_SELECT */
 #endif
if (job-outPipe != job-inPipe) {
   (void) close(job-outPipe);
 -1192,6 +1217,10 
 Job  *job; /* Job to execute */
 char **argv;
 {
+#ifndef USE_SELECT
+int rv;
+struct kevent ke;
+#endif /* USE_SELECT */
 int  cpid; /* ID of new child */
 
 if (DEBUG(JOB)) {
 -1305,7 +1334,20 
 #ifdef RMT_WILL_WATCH
Rmt_Watch(job-inPipe, JobLocalInput, job);
 #else
+#ifdef USE_SELECT
FD_SET(job-inPipe, outputs);
+#else
+   memset(ke, 0, sizeof(struct kevent));
+   printf(xxx: new job on fd %d\n, job-inPipe);
+   ke.ident = job-inPipe;
+   ke.filter = EVFILT_READ;
+   ke.flags = EV_ADD;
+   ke.udata = (void *) job;
+   rv = kevent(kq, ke, 1, NULL, 0, NULL);
+   if (rv  0) {
+   Punt(kevent(2) failed when adding a job);
+   }
+#endif /* USE_SELECT */
 #endif /* RMT_WILL_WATCH */
}
 
 -2313,16 +2355,24 
 void
 Job_CatchOutput()
 {
-int  nfds;
-struct timeval   timeout;
-fd_set   readfds;
+#ifdef USE_SELECT
+int  nfds;
+struct timeval   timeout;
+fd_set   readfds;
+#else
+#define KEVENT_SET_SIZE 8
+int kq, rv, idx;
+Job*kjob;
+struct kevent  ke[KEVENT_SET_SIZE];
+#endif /* USE_SELECT */
 LstNode  ln;
 Job  *job;
 #ifdef RMT_WILL_WATCH
 int  pnJobs;   /* Previous nJobs */
 #endif
-
+
 (void) fflush(stdout);
+
 #ifdef RMT_WILL_WATCH
 pnJobs = nJobs;
 
 -2347,26 +2397,46 
 }
 #else
 if (usePipes) {
+#ifdef USE_SELECT
readfds = outputs;
-   timeout.tv_sec = SEL_SEC;
-   timeout.tv_usec = SEL_USEC;
 
-   if ((nfds = select(FD_SETSIZE, readfds, (fd_set *) 0,
-  (fd_set *) 0, timeout)) = 0)
-   return;
+timeout.tv_sec = SEL_SEC;
+timeout.tv_usec = SEL_USEC;
+
+if ((nfds = select(FD_SETSIZE, readfds, (fd_set *) 0,
+   (fd_set *) 0, timeout)) = 0) {
+   return;
+   } else {
+   if (Lst_Open(jobs) == FAILURE) {
+   Punt(Cannot open job table);
+   }
+ 

Re: USB support for new HP printers?

2002-08-26 Thread Terry Lambert

Mikko Työläjärvi wrote:
  I'm pretty sure that bidirectional I/O is supported, or there
  would be no network devices.
 
 [...]
 
 Though the USB stack handles bi-directional communication, ulpt does not:
 
 Static struct cdevsw ulpt_cdevsw = {
/* open */ulptopen,
/* close */   ulptclose,
/* read */noread, !
 ...
 
 In -current, an input routine has been added, but all it does is
 discard any data that comes from the printer.

That should be trivial to correct, for anyone who wants to use
their printer, and requires bidirecitonal I/O...

But I stand corrected.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: kevent and pipes interaction on 4.6-STABLE

2002-08-26 Thread Ian Dowse

In message 20020826225851.GA93947@gallium, Dominic Marks writes:
+static int kq = -1;
+int kq, rv, idx;
kevent(0x3,0xbfbfedbc,0x1,0x0,0x0,0x0)   = 0 (0x0)
kevent(0x809abc0,0x0,0x0,0xbfbfede0,0x8,0x0) ERR#9 'Bad file descriptor'

Look at the above 4 lines, and it is pretty clear what is going on.
You don't want to hide the global `kq' behind an uninitialised local
variable of the same name.

Ian

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: kevent and pipes interaction on 4.6-STABLE

2002-08-26 Thread Terry Lambert

Dominic Marks wrote:
 I'm attempting the junior userland hacker task of replacing select in
 make with kevent. I have written the code and it is, as far as I know
 correct.
 
 The problem is that this code doesn't work. An example being the
 following:

The problem is that kqueue is known to not work well with pipes;
specifically, the available data is not correctly reported.  This
was noted by Alfred before.

BTW: This was one of the motivating factors in my recent set of
patches to support System V Message Queues with kqueue: I needed
a reliable IPC delivery mechanism that worked via kqueue, and
pipes were not it, and I didn't want to have to worry about net
based attacks on my IPC mechanism, so I didn't use sockets.


Contact Alfred for details on the pipe issue, since he discovered
it about the middle of last year.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: problems with pthreads

2002-08-26 Thread Kip Macy

You need to remove the -ansi flag to the compilation to remove the warnings, and
add a -pthread to the link stage so that libc_r will be used instead of libc.



As an aside: this only belongs on -questions. However, considering I got _zero_
response after posting to one then the other when one of my boxes failed to boot
after cvsupping -STABLE and doing a make world I can understand the 
crossposting. I think responding to trolls is more fun for many people.


-Kip

On Sun, 25 Aug 2002, GERARDO ENRIQUE PAREDES MANCIA wrote:

 when trying to portupgrade XFree86-clients from 4.2.??? to the newest version i  
 get this:  
   
 snip  
 LD_LIBRARY_PATH=../../exports/lib cc -O -pipe -march=pentiumpro  -ansi -pedantic  
 -Dasm=__asm -Wall -Wpointer-arith -I../.. -I../../exports/include
 -DCSRG_BASED  -DFUNCPROTO=15 -DNARROWPROTO -c appres.c  
 In file included from appres.c:34:  
 /usr/include/stdlib.h:110: warning: ANSI C does not support `long long'  
 /usr/include/stdlib.h:114: warning: ANSI C does not support `long long'  
 rm -f appres  
 LD_LIBRARY_PATH=../../exports/lib cc -o appres  -ansi -pedantic -Dasm=__asm  
 -Wall -Wpointer-arith -L../../exports/lib appres.o -lXt -lSM -lICE -lXext  
 -lX11 -L/usr/X11R6/lib -Wl,-rpath,/usr/X11R6/lib  
 ../../exports/lib/libXt.so: undefined reference to `pthread_cond_signal'  
 /usr/X11R6/lib/libXThrStub.so.6: undefined reference to `_Xthr_zero_stub_'  
 ../../exports/lib/libX11.so: undefined reference to `pthread_cond_broadcast'  
 /usr/X11R6/lib/libXThrStub.so.6: undefined reference to `_Xthr_self_stub_'  
 ../../exports/lib/libXt.so: undefined reference to `pthread_cond_init'  
 ../../exports/lib/libXt.so: undefined reference to `pthread_mutex_unlock'  
 ../../exports/lib/libXt.so: undefined reference to `pthread_self'  
 ../../exports/lib/libXt.so: undefined reference to `pthread_mutex_destroy'  
 ../../exports/lib/libXt.so: undefined reference to `pthread_mutex_lock'  
 ../../exports/lib/libXt.so: undefined reference to `pthread_cond_wait'  
 ../../exports/lib/libXt.so: undefined reference to `pthread_cond_destroy'  
 ../../exports/lib/libXt.so: undefined reference to `pthread_mutex_init'  
 *** Error code 1  
   
   
 i get the same errors when trying to compile wxWindows apps with:  
   
  g++ -o proggy proggy.cpp `wx-config --libs` `wx-config --cxxflags`   
   
   
 however i got my wxwindows apps to compile (with some warnings) adding -lc_r  
 after the above line.  
   
 i just recently build the world, i track RELENG_4 on a weekly basis, is this 
 problem related to it? if don't, please provide me with any insight how to fix 
 it. 
  
 Thanks 
 Gerardo 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-hackers in the body of the message
 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message