dell wireless keyboard/mouse package

2004-06-19 Thread Daniel Fleming
I have recently set up FreeBSD on a Dell Inspiron 4600 and the wireless 
keyboard/mouse package that came with it has had 2 issues so far:

--The keyboard tends to repeat letters when I type rapidly, but they don't 
repeat next to each other insead, one character apart.  example: I type 
www.freebsd.org and what may come out on the screen www.frfeebsds.como  
It doesnpt always affect all the letters, and it seems that some, like 'a' 
and 'o' tend to repeat more often.

--The mouse isn't recognised at all.  The reciever hub is recognised (same 
as for keyboard), but the mouse doesn't act at all.  Right now I am running 
a USB optical mouse, and my wireless is sitting off to the side, but it 
would be nice if I could get it back.

Those are the problems, one other issue but not one that is annoying is 
that the reciever/hub is recognised as a logitec hub, not as a dell one.  
this may be because dell bought the logitech one and just redid the 
exteriors, but I thought it was odd that they wouldn't change things 
up...especially after seeing the way they messed with the SBLive!

--Thanks
--Dan
_
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: quiet ATX mid-Towers

2004-06-19 Thread Rob MacGregor
 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of zera holladay
 
 Hello, I am looking for a very quiet ATX mid-tower and
 I was wondering if anybody has a suggestion or
 recommendation.  My hard disks produce the most
 decibels at the most annoying frequency -- its not a
 bad fan.  I am an EE student using FreeBSD, so a quiet
 computer is very important to me.

Well, you could start by looking at http://www.quietpc.com/.  I've
bought various items from them and have been very happy with the result.

Keep in mind however that no one thing will solve the problem.  You need
to replace everything that makes noise, right down to the fan on the
northbridge if you've got one.  You can get fanless cooling for
everything, assuming of course your air temperatures don't regularly
pass 30C.  For the disks the best you can do is:

1) Put them at the back of the case, if you have a case that supports
this (AOpen do some rather nice tower cases that do - their H700
series).

2) Isolate them with noise damping mounts - this however pretty much
guarantees you can't put them in standard 3.5 slot.

3) Replace them with quieter drives.  The newer Seagate drives are
pretty good.

-- 
 Rob | Oh my God! They killed init! You bastards! 

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: dell wireless keyboard/mouse package

2004-06-19 Thread Paul Robinson
On Sat, Jun 19, 2004 at 01:52:13AM -0500, Daniel Fleming wrote:

 I have recently set up FreeBSD on a Dell Inspiron 4600 and the wireless 
 keyboard/mouse package that came with it has had 2 issues so far:

Which version of FreeBSD and where is your dmesg?  And have you asked on
-questions before coming here? If you're running -stable or -current 
have you asked the relevant lists? Have you submitted a pr?

Not being snotty, it's just that by getting all the info needed together,
going and asking on [EMAIL PROTECTED] if they can help and then
if they can't, you then go about submitting a pr (man send-pr) and asking
either -stable or -current or whichever list is appropriate is a much
speedier way to get the right people looking at this and perhaps offering a
solution.

hackers@ is many things, but it's not a tech support forum so you're not 
likely to get much help here I'm afraid.

Hope that helps and you get a useful answer out of that lot, 

-- 
Paul Robinson
http://www.iconoplex.co.uk/
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


ipfw2 test utility

2004-06-19 Thread Viktor Ivanov
Hello -hackers.

I'm thinking about an utility to test a simple packet against the
machine's firewall (ipfw2 to be more specific). I needed it because on
some of my routers the configuration got complicated and the rule
count is too high. And sometimes I need to see quickly what a
colleague have done to the firewall and why it's not working as
expected.

Is there an (easy) way to take the packet-matching code from the
kernel and use it to check a (manually) constructed packet on the
current ipfw2 rule set?

I was planning on writing a simple script that reads the output of
`ipfw list' and then does some very simple checks. Mostly I need to
look what's done to packets from certain address/network coming from a
certain interface. Sometimes I need to check on tcp streams too.

Maybe I should just write a good script to build proper rule sets and
not try to fix a problem by creating more problems :)

Any comments are welcome
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: quiet ATX mid-Towers

2004-06-19 Thread Markie
- Original Message - 
From: Dan Strick [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, June 19, 2004 12:14 AM
Subject: Re: quiet ATX mid-Towers


| On Fri, 18 Jun 2004 07:39:25 -0700 (PDT), zera holladay wrote:
| 
|  Hello, I am looking for a very quiet ATX mid-tower and
|  I was wondering if anybody has a suggestion or
|  recommendation.  My hard disks produce the most
|  decibels at the most annoying frequency -- it_s not a

If it's a high pitched whiny type sound that resembles a rather noisy fan..
I have been there. I had a Maxtor hard disk that did this, I sent it back
(RMA'd it) and they sent me a replacement which is silent. I have also has
this issue with a laptop disk aswell, an IBM Travelstar. My friend also had
this issue with a Western Digital drive... he got that replaced and it's
silent like his other, smaller, WD drive :o)

You may be lucky and the manufacturer will replace it or you may have to
buy a brand new disk (if it is the hard disk making the noise).

|  bad fan.  I am an EE student using FreeBSD, so a quiet
|  computer is very important to me.
| 
|
| and on Fri, 18 Jun 2004 12:10:20 -0500, Vulpes Velox responded:
| 
|...
| 
|  Look around on some case modding and over clocking sites and the like.
| 
|...
| 
|
| When I recently assembled my new PC, I used
|
| www.silentmaxx.net and
| www.endpcnoise.com and
|
| every other case and fan web site I could discover (e.g. via Google).
| They were all commercial (i.e. sales) web sites, but some also offered
| general advice on building quiet PCs.
|
| I also recommend searching for quiet-PC articles on the various hardware
| guide web sites, particularly www.tomshardware.com.
|
| Dan Strick
| ___
| [EMAIL PROTECTED] mailing list
| http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
| To unsubscribe, send any mail to [EMAIL PROTECTED]


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: quiet ATX mid-Towers

2004-06-19 Thread Doug Rabson
On Friday 18 June 2004 15:39, zera holladay wrote:
 Under a kind suggestion, I am re-submitting this
 e-mail with a different subject.  The old message was:

 Hello, I am looking for a very quiet ATX mid-tower and
 I was wondering if anybody has a suggestion or
 recommendation.  My hard disks produce the most
 decibels at the most annoying frequency -- it’s not a
 bad fan.  I am an EE student using FreeBSD, so a quiet
 computer is very important to me.

I like the Antec Sonata cases. They have special drive trays which mean 
that your drives are mounted on rubber grommets to reduce noise. Plus 
they have a decent quiet PSU, a large low-speed case fan at the back 
and a cute blue LED on the front :-)
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: quiet ATX mid-Towers

2004-06-19 Thread Les Biffle
  Hello, I am looking for a very quiet ATX mid-tower and
  I was wondering if anybody has a suggestion or
  recommendation.

My youngest son was on a crusade to find a silent case, and he found
one that is absolutely amazing.  It's the Sonata by ANTEC, and has a
huge, slow case fan, and vibration-isolating hard drive mountings.  Its
reviews on newegg average 5 stars out of 251 voters.  When I get ready to
build another computer, it's the case I'll buy.  Here's the newegg URL
for it:

  http://www.newegg.com/app/viewProductDesc.asp?description=11-129-127DEPA=1

If it has enough bays for you, this is what you want.

Regards,

-Les

-- 
Les Biffle
CISSP   Information Systems Security Consultant
(480) 585-4099   [EMAIL PROTECTED]  http://www.les.biffle.org/
Network Safety,  PO Box 14461,   Scottsdale, AZ 85267
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


lkm i/o port allocation problems

2004-06-19 Thread infamous42md
/*I am trying to figure out how to port over an infrared reciever driver
from linux to freebsd. i have been reading the developers book, as well as the
source for sio/ep and several other char drivers that use i/o ports.  i can't
seem to get my i/o port allocation to work.  whenever i request the region w/
bus_alloc_resource() it returns NULL to me the first time i load my module.
however, once i try again, i get the message:

ser0 at port 0x2f8-0x2ff on isa0

ser is the name of my module.  so it seems that even tho the alloc call is
failing, somehow i still have the region to myself???  and now, even after i
reboot my computer, whenever i try to load my module i immediately get the above
error message.  so it seems that somehow, even tho it is restarted, it never
lets go of the i/o region??  this module is not called at start time, it is only
loaded when i give kldload command

my other problem is that in order to get the probe/attach functions to be
called, i used the identify function in which i call the BUS_ADD_CHILD()
function as i saw ep driver do. is this correct?  b/c after i load my module
once, the next time i try to load it this call always fails.  is this correct
way to do this? if not, how do i get the probe function to be called, b/c it
wasn't being called when i loaded my module.  here is the code, it is very short
as i chopped out the extra stuff. if someone could please take a quick look im
sure it would be obvious what i've done wrong, but i can't see what the problem
is.  i've been digging thru the resource allocation functions and they're just
to complex for me to understand atm.  thanks very much for any help.
*/

#include sys/types.h
#include sys/errno.h
#include sys/param.h  /* defines used in kernel.h */
#include sys/kernel.h /* types used in module initialization */
#include sys/module.h
#include machine/bus.h
#include machine/resource.h
#include sys/bus.h
#include sys/conf.h   /* cdevsw struct */
#include sys/malloc.h
#include sys/rman.h
#include sys/systm.h  /* uprintf */
#include sys/uio.h/* uio struct */

#include isa/isavar.h
#include isa/pnpvar.h

/*  device structure*/
static struct resource *rp;

charser_driver_name[] = ser;
devclass_t  ser_devclass;

/*  isa stuff   */
static int  ser_isa_attach(device_t);
static int  ser_isa_detach(device_t);
static int  ser_isa_probe(device_t);
static void ser_isa_ident(driver_t *, device_t); 

static device_method_t ser_isa_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, ser_isa_probe),
DEVMETHOD(device_attach,ser_isa_attach),
DEVMETHOD(device_detach,ser_isa_detach),
DEVMETHOD(device_identify,  ser_isa_ident),

{ 0, 0 }
};

static driver_t ser_isa_driver = {
ser_driver_name,
ser_isa_methods,
0,
};

static struct isa_pnp_id ser_ids[] = {
{ 0, NULL}
};

static int ser_isa_probe(device_t dev)
{
uprintf(probing\n);

return 0;
}

static void ser_isa_ident(driver_t *driv, device_t dev)
{
int ret  = 0;
device_tchild;

uprintf(identing\n);

child = BUS_ADD_CHILD(dev, 0, ser, 0);
if(child == NULL){
uprintf(bus add child == NULL\n);
return;
}

device_set_driver(child, driv);

/*  allocate i/o ports */
if( (ret = bus_set_resource(child, SYS_RES_IOPORT, 0, 0x2f8, 8)) )
uprintf(bus set bad, ret = %d\n, ret);

}

static int ser_isa_attach(device_t dev)
{
int rid;

uprintf(attaching\n);

rid = 0;
rp = bus_alloc_resource(dev, SYS_RES_IOPORT, rid, 0, ~0, 8, RF_ACTIVE);
if(rp == NULL){
uprintf(bus alloc bad\n);
}else{
uprintf(allocated bus resources\n);
}

return 0;
}

static int ser_isa_detach(device_t dev)
{
/*  give back i/o region */
if(rp){
if(bus_release_resource(dev, SYS_RES_IOPORT, 0, rp) == 0)
uprintf(releasd resources\n);
else
uprintf(error releasein\n);
}

uprintf(detached\n);
return 0;
}

/*
 * Load handler that deals with the loading and unloading of a KLD.
 */
static int
mdev_loader(struct module * m, int what, void *arg)
{
int   err = 0;

switch (what) {
case MOD_LOAD:  /* kldload */
break;
case MOD_UNLOAD:
break;
default:
err = EINVAL;
break;
}
return (err);
}

DRIVER_MODULE(ser, isa, ser_isa_driver, ser_devclass, mdev_loader, 0);


-- 
-sean

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE:lkm i/o port allocation problems

2004-06-19 Thread infamous42md
sorry, i used the wrong email addy to send that email, i've resent it using the 
correct one.

-- 
-sean

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: TIME_WAIT sockets from other users (was Re: bin/65928: [PATCH] stock ftpd uses superuser credentials for active mode sockets)

2004-06-19 Thread Yar Tikhiy
On Sun, May 16, 2004 at 06:16:58PM +0400, Yar Tikhiy wrote
  in [EMAIL PROTECTED]:

 Note for the impatient:  This message does not discuss the well-known
 issue of reusing local addresses through setting SO_REUSEADDR.  This
 message is on reusing local addresses occupied by sockets belonging
 to other users.
[...]
  Attached below is a patch addressing the issue of the inability to
  reuse a local IP:port couple occupied by an established TCP connection
  from another user, but by no listeners.  Could anybody with fair
  understanding of our TCP/IP stack review it please?  Thanks.
[...]
 One more detail to note:
 
 Currently if another user's socket is in the TIME_WAIT state, it
 still counts as occupying the local IP:port couple.  I cannot see
 the point of such a behaviour.  Restricting bind() is to disallow
 unprivileged port stealth, but how can one steal a connection in
 the TIME_WAIT state?
 
 For FreeBSD-4 the above patch would take care of this case along
 with established connections, but in CURRENT TIME_WAIT connections
 are a special case since they no longer use full-blown state.
 Therefore, for CURRENT the above patch mutates into the below one.
[...]

Since I've got no feedback on this issue, I have little hope that
someone will pay attention to my next patch ;-)
However, I have no experience with IPv6, so currently I've got
no choice but to offer my patch for your review, friends, so that
some kind person might take a glance at it while I'm exercising
myself over IPv6 ;-)

I made this patch by analogy with the IPv4 one, which is already
in the CURRENT kernel--luckily, the IPv6 code is rather comprehensible.
It addresses the same issue I was talking about a month ago, but
for the IPv6 stack: It enables the non-root reuse of local address:port
tuples occupied by established or TIME_WAIT TCP connections from
other local users, as long as these particular cases have no security
implications a.k.a.  port theft.

-- 
Yar

Index: in6_pcb.c
===
RCS file: /home/ncvs/src/sys/netinet6/in6_pcb.c,v
retrieving revision 1.52
diff -u -p -r1.52 in6_pcb.c
--- in6_pcb.c   12 Jun 2004 20:59:48 -  1.52
+++ in6_pcb.c   19 Jun 2004 14:15:14 -
@@ -194,14 +194,10 @@ in6_pcbbind(inp, nam, cred)
t = in6_pcblookup_local(pcbinfo,
sin6-sin6_addr, lport,
INPLOOKUP_WILDCARD);
-   if (t  (t-inp_vflag  INP_TIMEWAIT)) {
-   if 
((!IN6_IS_ADDR_UNSPECIFIED(sin6-sin6_addr) ||
-   !IN6_IS_ADDR_UNSPECIFIED(t-in6p_laddr) ||
-   !(intotw(t)-tw_so_options  SO_REUSEPORT))
-so-so_cred-cr_uid != 
-   intotw(t)-tw_cred-cr_uid)
-   return (EADDRINUSE);
-   } else if (t 
+   if (t 
+   ((t-inp_vflag  INP_TIMEWAIT) == 0) 
+   (so-so_type != SOCK_STREAM ||
+IN6_IS_ADDR_UNSPECIFIED(t-in6p_faddr)) 
(!IN6_IS_ADDR_UNSPECIFIED(sin6-sin6_addr) ||
 !IN6_IS_ADDR_UNSPECIFIED(t-in6p_laddr) ||
 (t-inp_socket-so_options  SO_REUSEPORT) 
@@ -216,17 +212,12 @@ in6_pcbbind(inp, nam, cred)
t = in_pcblookup_local(pcbinfo,
sin.sin_addr, lport,
INPLOOKUP_WILDCARD);
-   if (t  (t-inp_vflag  INP_TIMEWAIT)) {
-   if (so-so_cred-cr_uid !=
-   intotw(t)-tw_cred-cr_uid 
-   (ntohl(t-inp_laddr.s_addr) !=
-INADDR_ANY || 
-((inp-inp_vflag  
-  INP_IPV6PROTO) == 
- (t-inp_vflag  
-  INP_IPV6PROTO
-   return (EADDRINUSE);
-   } else if (t  
+   if (t 
+   ((t-inp_vflag 
+ INP_TIMEWAIT) == 0) 
+   (so-so_type != SOCK_STREAM ||
+ntohl(t-inp_faddr.s_addr) ==
+ INADDR_ANY) 

Re: ipfw2 test utility

2004-06-19 Thread Bjoern A. Zeeb
On Sat, 19 Jun 2004, Viktor Ivanov wrote:

 count is too high. And sometimes I need to see quickly what a
 colleague have done to the firewall and why it's not working as
 expected.

use rcs or cvs for tracking changes

-- 
Bjoern A. Zeeb  bzeeb at Zabbadoz dot NeT
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Ntop 3.0 and Shared Library Problem

2004-06-19 Thread Cole
Hey

Im running FreeBSD 4.9, and ive installed ntop-3.0 from Ports. Now ive had
issues with this before, so i decided to remove any and all old packages,
and all duplicate packages, and all dependencies that ntop has that were out
of date.
I then reconfigured and re-built and installed ntop from scratch.
I fixed all the config errors that appeared and all options i wanted.
And i built and installed ntop with both dynaic plugins enabled
and --enable-static-plugin option.

I have also checked that all the permissions for all the plugins and
directories and everything was correct.
But no matter what i do, i still get this problem.

Sat Jun 19 15:55:45 2004  **WARNING** Unable to locate plugin
'/usr/local/lib/ntop/plugins/netflowPlugin.so' entry function [Invalid
shared object handle 0x28070900]
Sat Jun 19 15:55:45 2004  **WARNING** Unable to locate plugin
'/usr/local/lib/ntop/plugins/nfsPlugin.so' entry function [Invalid shared
object handle 0x28070c00]
Sat Jun 19 15:55:45 2004  **WARNING** Unable to locate plugin
'/usr/local/lib/ntop/plugins/pdaPlugin.so' entry function [Invalid shared
object handle 0x28070f00]
Sat Jun 19 15:55:45 2004  **WARNING** Unable to locate plugin
'/usr/local/lib/ntop/plugins/rrdPlugin.so' entry function [Invalid shared
object handle 0x29b90200]

The odd and strange thing is, i have a few other FreeBSD 4.9 Servers, where
ntop compiles and installs the same as above, with no extra things needed to
be done, and no other configure options passed, and ntop compiles and runs
perfectly without a single one of the errors above.  Some of the other
freebsd servers where ntop works fine, is the exact same hardware as the one
above where it doesnt work.

If anyone has any ideas or any suggestions, i am willing to try anything.
Any help will be appreciated.

Thanks
/Cole

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


/bin/ls sorting bug?

2004-06-19 Thread Scott Mitchell
Hi all,

ls(1) says that the -t option will:

 Sort by time modified (most recently modified first) before sort-
 ing the operands by lexicographical order.

which I take to mean that items (in the same directory) with the same
timestamp should be further sorted according to their names.  Unfortunately
it doesn't really work that way:

(562) tuatara:/tmp/foo $ ls -lt
total 0
-rw-rw-r--  1 scott  wheel  0 19 Jun 17:48 c
-rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 b
-rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 d
-rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 e
-rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 f
-rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 g
-rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 h
-rw-rw-r--  1 scott  wheel  0 19 Jun 17:13 i
-rw-rw-r--  1 scott  wheel  0 19 Jun 17:13 j
-rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 a
-rw-rw-r--  1 scott  wheel  0 19 Jun 17:13 k

This is on a 4.10-PRERELEASE machine, but the -CURRENT code seems to be
identical as far as sorting goes.

Is this intended behaviour?  If so, the documentation is wrong.  Otherwise,
the attached patch produces the expected output.  I can commit it if there
are no objections.

Scott

-- 
===
Scott Mitchell   | PGP Key ID | Eagles may soar, but weasels
Cambridge, England   | 0x54B171B9 |  don't get sucked into jet engines
scott at fishballoon.org | 0xAA775B8B |  -- Anon
Index: cmp.c
===
RCS file: /home/ncvs/src/bin/ls/cmp.c,v
retrieving revision 1.9.2.2
diff -u -r1.9.2.2 cmp.c
--- cmp.c   8 Jul 2002 06:59:27 -   1.9.2.2
+++ cmp.c   19 Jun 2004 16:54:55 -
@@ -67,35 +67,47 @@
 int
 modcmp(const FTSENT *a, const FTSENT *b)
 {
-   return (b-fts_statp-st_mtime - a-fts_statp-st_mtime);
+   return (a-fts_statp-st_mtime == b-fts_statp-st_mtime ?
+   namecmp(a, b) :
+   b-fts_statp-st_mtime - a-fts_statp-st_mtime);
 }
 
 int
 revmodcmp(const FTSENT *a, const FTSENT *b)
 {
-   return (a-fts_statp-st_mtime - b-fts_statp-st_mtime);
+   return (a-fts_statp-st_mtime == b-fts_statp-st_mtime ?
+   revnamecmp(a, b) :
+   a-fts_statp-st_mtime - b-fts_statp-st_mtime);
 }
 
 int
 acccmp(const FTSENT *a, const FTSENT *b)
 {
-   return (b-fts_statp-st_atime - a-fts_statp-st_atime);
+   return (a-fts_statp-st_atime == b-fts_statp-st_atime ?
+   namecmp(a, b) :
+   b-fts_statp-st_atime - a-fts_statp-st_atime);
 }
 
 int
 revacccmp(const FTSENT *a, const FTSENT *b)
 {
-   return (a-fts_statp-st_atime - b-fts_statp-st_atime);
+   return (a-fts_statp-st_atime == b-fts_statp-st_atime ?
+   revnamecmp(a, b) :
+   a-fts_statp-st_atime - b-fts_statp-st_atime);
 }
 
 int
 statcmp(const FTSENT *a, const FTSENT *b)
 {
-   return (b-fts_statp-st_ctime - a-fts_statp-st_ctime);
+   return (a-fts_statp-st_ctime == b-fts_statp-st_ctime ?
+   namecmp(a, b) :
+   b-fts_statp-st_ctime - a-fts_statp-st_ctime);
 }
 
 int
 revstatcmp(const FTSENT *a, const FTSENT *b)
 {
-   return (a-fts_statp-st_ctime - b-fts_statp-st_ctime);
+   return (a-fts_statp-st_ctime == b-fts_statp-st_ctime ?
+   revnamecmp(a, b) :
+   a-fts_statp-st_ctime - b-fts_statp-st_ctime);
 }
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /bin/ls sorting bug?

2004-06-19 Thread Tim Kientzle
Scott Mitchell wrote:
ls(1) says that the -t option will:
 Sort by time modified (most recently modified first) before sort-
 ing the operands by lexicographical order.
... the attached patch produces the expected output.  I can commit it if there
are no objections.
Looks good to me.  I wonder if the time sorting should
include the nanos field as well. (Mostly on FreeBSD,
the nanos field is zero, but not always.)
Of course, sorting on the (non-displayed) nanos field
could also produce such unexpected output as you describe.
Tim
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ipfw2 test utility

2004-06-19 Thread Viktor Ivanov
On Sat, 19 Jun 2004 19:20:37 +0300, Anton Alin-Adrian
[EMAIL PROTECTED] wrote:
 
 See nemesistcp from ports.

Isn't this a tool to generate packets, like ipsend(1) and iptest(1)?

 
 I doubt. Faster with logging  scripts.

Do you mean ipfw's log option? If I wanted to see which rule number a packet is
matching, should I add 'log' to every rule? And how much log messages
would generate
if I have thousands of packets coming through every second?
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /bin/ls sorting bug?

2004-06-19 Thread Dimitry Andric
On 2004-06-19 at 19:50:07 Scott Mitchell wrote:

 (562) tuatara:/tmp/foo $ ls -lt
 total 0
 -rw-rw-r--  1 scott  wheel  0 19 Jun 17:48 c
 -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 b
 -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 d
 -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 e
 -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 f
 -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 g
 -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 h
 -rw-rw-r--  1 scott  wheel  0 19 Jun 17:13 i
 -rw-rw-r--  1 scott  wheel  0 19 Jun 17:13 j
 -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 a
 -rw-rw-r--  1 scott  wheel  0 19 Jun 17:13 k

Can you please show the output of ls -ltT ?


pgpXwTsAylawE.pgp
Description: PGP signature


Re: dell wireless keyboard/mouse package

2004-06-19 Thread Luke

I have recently set up FreeBSD on a Dell Inspiron 4600 and the wireless 
keyboard/mouse package that came with it has had 2 issues so far:

--The keyboard tends to repeat letters when I type rapidly, but they don't 
repeat next to each other insead, one character apart.  example: I type 
www.freebsd.org and what may come out on the screen www.frfeebsds.como 
It doesnpt always affect all the letters, and it seems that some, like 'a' 
and 'o' tend to repeat more often.
I'm getting this same problem on my Dell Inspiron 8100 keyboard with no 
FreeBSD and no wireless involved.
I guess that doesn't help you.  I'm just saying it might be hardware.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /bin/ls sorting bug?

2004-06-19 Thread Scott Mitchell
On Sat, Jun 19, 2004 at 09:01:37PM +0200, Dimitry Andric wrote:
 On 2004-06-19 at 19:50:07 Scott Mitchell wrote:
 
  (562) tuatara:/tmp/foo $ ls -lt
  total 0
  -rw-rw-r--  1 scott  wheel  0 19 Jun 17:48 c
  -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 b
  -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 d
  -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 e
  -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 f
  -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 g
  -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 h
  -rw-rw-r--  1 scott  wheel  0 19 Jun 17:13 i
  -rw-rw-r--  1 scott  wheel  0 19 Jun 17:13 j
  -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13 a
  -rw-rw-r--  1 scott  wheel  0 19 Jun 17:13 k
 
 Can you please show the output of ls -ltT ?

Sure (added -i to make it easier to see what's going on here):

(505) tuatara:/tmp/foo $ ls -iltT
total 0
35 -rw-rw-r--  1 scott  wheel  0 19 Jun 17:48:40 2004 c
11 -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13:36 2004 b
11 -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13:36 2004 d
11 -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13:36 2004 e
11 -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13:36 2004 f
11 -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13:36 2004 g
11 -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13:36 2004 h
41 -rw-rw-r--  1 scott  wheel  0 19 Jun 17:13:36 2004 i
51 -rw-rw-r--  1 scott  wheel  0 19 Jun 17:13:36 2004 j
11 -rw-rw-r--  7 scott  wheel  0 19 Jun 17:13:36 2004 a
52 -rw-rw-r--  1 scott  wheel  0 19 Jun 17:13:36 2004 k

Most of those files (a,b,d,e,f,g,h) are hard-linked to each other - so they
definitely share the same timestamp.  i,j,k were created with 'touch -r a i
j k', so they should also have the same time.  c is different to make sure
I didn't break the sort order when files *did* have different times.

Scott

-- 
===
Scott Mitchell   | PGP Key ID | Eagles may soar, but weasels
Cambridge, England   | 0x54B171B9 |  don't get sucked into jet engines
scott at fishballoon.org | 0xAA775B8B |  -- Anon
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /bin/ls sorting bug?

2004-06-19 Thread Scott Mitchell
On Sat, Jun 19, 2004 at 11:47:21AM -0700, Tim Kientzle wrote:
 Scott Mitchell wrote:
 
 ls(1) says that the -t option will:
 
  Sort by time modified (most recently modified first) before sort-
  ing the operands by lexicographical order.
 
 ... the attached patch produces the expected output.  I can commit it if 
 there
 are no objections.
 
 Looks good to me.  I wonder if the time sorting should
 include the nanos field as well. (Mostly on FreeBSD,
 the nanos field is zero, but not always.)

I don't see why not, unless some standard requires the nanos to be
ignored.  That would be pretty strange though...

 Of course, sorting on the (non-displayed) nanos field
 could also produce such unexpected output as you describe.

I guess you'd want yet another option to display the full-resolution
timestamp, if you were going to sort on the whole thing.  And you'd still
want to use the name to break ties.

Scott

-- 
===
Scott Mitchell   | PGP Key ID | Eagles may soar, but weasels
Cambridge, England   | 0x54B171B9 |  don't get sucked into jet engines
scott at fishballoon.org | 0xAA775B8B |  -- Anon
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: quiet ATX mid-Towers

2004-06-19 Thread Jeremie Le Hen
 Under a kind suggestion, I am re-submitting this
 e-mail with a different subject.  The old message was:
 
 Hello, I am looking for a very quiet ATX mid-tower and
 I was wondering if anybody has a suggestion or
 recommendation.  My hard disks produce the most
 decibels at the most annoying frequency -- it?s not a
 bad fan.  I am an EE student using FreeBSD, so a quiet
 computer is very important to me.

This is completly off-topic.  This is not even FreeBSD-related, except
you are a FreeBSD user.

-- 
Jeremie LE HEN aka TtZ/TataZ  [EMAIL PROTECTED]
 [EMAIL PROTECTED]
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: quiet ATX mid-Towers

2004-06-19 Thread Liam J. Foy
On Sat, 19 Jun 2004 22:08:32 +0200
Jeremie Le Hen [EMAIL PROTECTED] wrote:

  Under a kind suggestion, I am re-submitting this
  e-mail with a different subject.  The old message was:
  
  Hello, I am looking for a very quiet ATX mid-tower and
  I was wondering if anybody has a suggestion or
  recommendation.  My hard disks produce the most
  decibels at the most annoying frequency -- it?s not a
  bad fan.  I am an EE student using FreeBSD, so a quiet
  computer is very important to me.
 
 This is completly off-topic.  This is not even FreeBSD-related, except
 you are a FreeBSD user.

This is a chat@ question =)

 
 -- 
 Jeremie LE HEN aka TtZ/TataZ  [EMAIL PROTECTED]
  [EMAIL PROTECTED]
 Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!
 ___
 [EMAIL PROTECTED] mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
 To unsubscribe, send any mail to [EMAIL PROTECTED]


-- 
-Liam Foy
http://liamfoy.kerneled.org
Do only what only you can do.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /bin/ls sorting bug?

2004-06-19 Thread Andriy Tkachuk
 And AFAICS, there's no way to tell ls: first sort on time,
 then on filename, then on size, etc.  This would make a nice addition
 though. :)

But there is nice sort command and power of unix.
Don't you remember the initial UNIX concept to make miracles by small
things fired together? :)


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /bin/ls sorting bug? - change it.

2004-06-19 Thread Garance A Drosihn
At 6:50 PM +0100 6/19/04, Scott Mitchell wrote:
Is this intended behaviour?  If so, the documentation is wrong.
Otherwise, the attached patch produces the expected output.  I
can commit it if there are no objections.
Your patch looks like a reasonable change to me.  By definition,
there can be no one which *depends* on the present behavior in
this situation, because the present behavior is not consistent.
--
Garance Alistair Drosehn=   [EMAIL PROTECTED]
Senior Systems Programmer   or  [EMAIL PROTECTED]
Rensselaer Polytechnic Instituteor  [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: lkm i/o port allocation problems

2004-06-19 Thread M. Warner Losh
: /*I am trying to figure out how to port over an infrared reciever driver
: from linux to freebsd. i have been reading the developers book, as well as the
: source for sio/ep and several other char drivers that use i/o ports.  i can't
: seem to get my i/o port allocation to work.  whenever i request the region w/
: bus_alloc_resource() it returns NULL to me the first time i load my module.
: however, once i try again, i get the message:
: 
: ser0 at port 0x2f8-0x2ff on isa0

Do you have another driver at this range of ports?  It is on my
machine:

sio1 at port 0x2f8-0x2ff irq 3 on isa0

so you have to ensure that you don't have sio binding to this device.
You'll get bus_alloc_resource returning NULL in this case.

: ser is the name of my module.  so it seems that even tho the alloc call is
: failing, somehow i still have the region to myself???

I don't understand this statement at all.  Just because the ISA bus
thinks your driver might have the resources, doesn't mean that your
driver actually has them.  The information is there because many
devices might be at the same location (think aha and bt).

: and now, even after i
: reboot my computer, whenever i try to load my module i immediately get the above
: error message.

What error message.  You included none in your comments.

: so it seems that somehow, even tho it is restarted, it never lets go
: of the i/o region??  this module is not called at start time, it is
: only loaded when i give kldload command

Maybe sio1 has claimed this device already.  Maybe your system has
pnpbios/acpi listing the device?  That's the usual reason...

: my other problem is that in order to get the probe/attach functions to be
: called, i used the identify function in which i call the BUS_ADD_CHILD()
: function as i saw ep driver do. is this correct?

No.  You don't have to do this.  In fact, you shouldn't generally do
this in your driver.  You should either bind to the PNP ID (which gets
reprobed on every driver add), or you should add hints to the boot
loader.

: b/c after i load my module
: once, the next time i try to load it this call always fails. 

That's because one usually doesn't need to do this :-).

: static device_method_t ser_isa_methods[] = {
:   /* Device interface */
:   DEVMETHOD(device_probe, ser_isa_probe),
:   DEVMETHOD(device_attach,ser_isa_attach),
:   DEVMETHOD(device_detach,ser_isa_detach),
:   DEVMETHOD(device_identify,  ser_isa_ident),

You rarely need identify.  In this case it is contraindicated.

: static int ser_isa_probe(device_t dev)
: {
: uprintf(probing\n);
: 
: return 0;
: }

Don't use uprintf.  You will find that when you add the driver to the
boot process, you'll get a panic here because there's no controlling
terminal...

: static void ser_isa_ident(driver_t *driv, device_t dev)
: {
: int ret  = 0;
: device_tchild;
: 
: uprintf(identing\n);
: 
: child = BUS_ADD_CHILD(dev, 0, ser, 0);
: if(child == NULL){
: uprintf(bus add child == NULL\n);
: return;
: }
: 
: device_set_driver(child, driv);
: 
: /*  allocate i/o ports */
: if( (ret = bus_set_resource(child, SYS_RES_IOPORT, 0, 0x2f8, 8)) )
: uprintf(bus set bad, ret = %d\n, ret);
: 
: }

This isn't necessary.  I'd not use it at all.

: static int ser_isa_attach(device_t dev)
: {
: int rid;
: 
: uprintf(attaching\n);
: 
: rid = 0;
: rp = bus_alloc_resource(dev, SYS_RES_IOPORT, rid, 0, ~0, 8, RF_ACTIVE);
: if(rp == NULL){
: uprintf(bus alloc bad\n);
: }else{
: uprintf(allocated bus resources\n);
: }
: 
: return 0;
: }

Chances are good this is failing because there's another device
already servicing the device that has this range.  This may mean that
you will have to have your driver loaded at boot time so it doesn't do
that and you may also have to hack sio to return an indefinite probe
(some non-0 negative number).

There's something called the softc.  You should store store the
resource in the softc for the driver, not in a global.

: static int ser_isa_detach(device_t dev)
: {
: /*  give back i/o region */
: if(rp){
: if(bus_release_resource(dev, SYS_RES_IOPORT, 0, rp) == 0)
: uprintf(releasd resources\n);
: else
: uprintf(error releasein\n);
: }
: 
: uprintf(detached\n);
: return 0;
: }


Apart from the uprintf and sotfc comments above, there's nothign
really wrong here.

: /*
:  * Load handler that deals with the loading and unloading of a KLD.
:  */
: static int
: mdev_loader(struct module * m, int what, void *arg)
: {
:   int   err = 0;
: 
:   switch (what) {
:   case MOD_LOAD:  /* kldload */
:   break;
:   case MOD_UNLOAD:
:   break;
:   default:
:   err = EINVAL;
:   break;
:   }
:   return (err);
: }

You don't need this at all.  In 

-lthr vs. -pthread

2004-06-19 Thread Cyrille Lefevre
Hi,

I'm currently working on enhancements to ps w/ Garance A Drosehn.
I've just added some thread related stuffs and to see them, I'm
using the following program :

#define _REENTRANT
#include pthread.h

#define NUM_THREADS 5
#define SLEEP_TIME 10

void *sleeping(void *);
pthread_t tid[NUM_THREADS];

int
main(int argc, char *argv[])
{
int i;

for (i = 0; i  NUM_THREADS; i++)
pthread_create(tid[i], NULL, sleeping, (void *)SLEEP_TIME);
for (i = 0; i  NUM_THREADS; i++)
pthread_join(tid[i], NULL);
printf(main() reporting that all %d threads have terminated\n, i);
return (0);
}

void *
sleeping(void *arg)
{
int sleep_time = (int)arg;
printf(thread %d sleeping %d seconds ...\n, thr_self(), sleep_time);
sleep(sleep_time);
printf(\nthread %d awakening\n, thr_self());
return (NULL);
}

then, I compile this one in 2 way :

# cc -o thread thread.c -lthr
and
# cc -pthread -o pthread thread.c

here is some of the new ps outputs :

lwp is the thread id and nlwp the the number of threads.
-q switch in posix mode (aka SystemV) and -C select processes
by name (a la pgrep).

# ./thread sleep 1; ps -H -O lwp,nlwp -qC thread
(thread, using -H)
  PIDLWP NLWP TTYTIME COMMAND
85146 156 ttyp0  00:00:00 thread
85146 146 ttyp0  00:00:00 thread
85146 136 ttyp0  00:00:00 thread
85146 126 ttyp0  00:00:00 thread
85146 116 ttyp0  00:00:00 thread
85146  851466 ttyp0  00:00:00 thread
# ./pthread sleep 1; ps -H -O lwp,nlwp -qC thread
(pthread, using -H)
  PIDLWP NLWP TTYTIME COMMAND
96689 122 ttyp0  00:00:00 pthread
96689  966892 ttyp0  00:00:00 pthread

is it normal that -pthread only forks only 1 thread where
-lthr forks 5 of them ?

# ./thread sleep 1; ps -O lwp,nlwp -qC thread
(thread ot pthread, not using -H)
  PIDLWP NLWP TTYTIME COMMAND
73718 156 ttyp0  00:00:00 thread


is it normal that the selected process is the last forked thread and
not the thread owner (father) ?

PS : using -lc_r, there is no thread at all, but I suppose this is an
expected behaviour.

CC -current and -hackers

Cyrille Lefevre.
-- 
mailto:[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: /bin/ls sorting bug?

2004-06-19 Thread Geert Hendrickx
 Don't you remember the initial UNIX concept to make miracles by small
 things fired together? :)

That's a very nice quote!  Gonna answer that the next time someone asks
me what UNIX is.  :-)  

GH
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: -lthr vs. -pthread

2004-06-19 Thread David Xu
libpthread default is M:N threading model,  kernel thread
entity is allocated on demand, things like sleep() only block
thread in userland, no kernel thread will be allocated, so
in your example, you won't see 5 kernel threads, only two
threads are showed here,  the extra thread is a signal thread,
there is only one signal thread in process live cycle.
libthr is 1:1, when you allocate a thread in userland, it creates
a kernel thread too.
David Xu
Cyrille Lefevre wrote:
Hi,
I'm currently working on enhancements to ps w/ Garance A Drosehn.
I've just added some thread related stuffs and to see them, I'm
using the following program :
#define _REENTRANT
#include pthread.h
#define NUM_THREADS 5
#define SLEEP_TIME 10
void *sleeping(void *);
pthread_t tid[NUM_THREADS];
int
main(int argc, char *argv[])
{
   int i;
   for (i = 0; i  NUM_THREADS; i++)
   pthread_create(tid[i], NULL, sleeping, (void
*)SLEEP_TIME);
   for (i = 0; i  NUM_THREADS; i++)
   pthread_join(tid[i], NULL);
   printf(main() reporting that all %d threads have terminated\n,
i);
   return (0);
}
void *
sleeping(void *arg)
{
   int sleep_time = (int)arg;
   printf(thread %d sleeping %d seconds ...\n, thr_self(),
sleep_time);
   sleep(sleep_time);
   printf(\nthread %d awakening\n, thr_self());
   return (NULL);
}
then, I compile this one in 2 way :
# cc -o thread thread.c -lthr
and
# cc -pthread -o pthread thread.c
here is some of the new ps outputs :
lwp is the thread id and nlwp the the number of threads.
-q switch in posix mode (aka SystemV) and -C select processes
by name (a la pgrep).
# ./thread sleep 1; ps -H -O lwp,nlwp -qC thread
(thread, using -H)
 PIDLWP NLWP TTYTIME COMMAND
85146 156 ttyp0  00:00:00 thread
85146 146 ttyp0  00:00:00 thread
85146 136 ttyp0  00:00:00 thread
85146 126 ttyp0  00:00:00 thread
85146 116 ttyp0  00:00:00 thread
85146  851466 ttyp0  00:00:00 thread
# ./pthread sleep 1; ps -H -O lwp,nlwp -qC thread
(pthread, using -H)
 PIDLWP NLWP TTYTIME COMMAND
96689 122 ttyp0  00:00:00 pthread
96689  966892 ttyp0  00:00:00 pthread
is it normal that -pthread only forks only 1 thread where
-lthr forks 5 of them ?
# ./thread sleep 1; ps -O lwp,nlwp -qC thread
(thread ot pthread, not using -H)
 PIDLWP NLWP TTYTIME COMMAND
73718 156 ttyp0  00:00:00 thread
is it normal that the selected process is the last forked thread and
not the thread owner (father) ?
PS : using -lc_r, there is no thread at all, but I suppose this is an
expected behaviour.
CC -current and -hackers
Cyrille Lefevre.
 

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]