Re: 3Com 10/100 Mini PCI Ethernet

2000-08-03 Thread Hellmuth Michaelis

Mike Smith wrote:

  I'm looking for docs for the Mini PCI card in the subject, it has the 3Com
  part/product no. 3CN3AV1556. It is a 10/100 ethernet 56k modem combo card
  built into an HP laptop.
 
 Have you tried booting FreeBSD on this system yet?  If so, does the 'xl' 
 driver pick it up?  If not, can you send the output of 'pciconf -l', as 
 it may just require a new PCI ID in the driver.

Yes, i first tried the ep driver, then the xl and then the vx by adding the
chip id (0x6055) to the probe routine.

I think the ep driver (which does some funny things to the eeprom) managed
to overwrite part of the eeprom so that the xl driver failed to recognize
the card. I then tried to add it to the vx driver (at that point i think
i started to know what i did) which failed too, so i wrote a subroutine
to display the eeprom contents which (because i did not understood the
the OP and SubOP command fields before running it) finally erased the
eeprom contents to 0x in all locations (which now prevents the card
from being initialized by the BIOS - has anybody an idea how to revive
such a PCI card ).

Anyway, i paid my "Lehrgeld" (money for learning ?) and i'm currently
waiting for an exchange card.

Someone from the Linux-camp wrote a vortex diagnostics program which 
displays the eeprom and register contents of those cards, i ported that
in the meantime to be at least able to get a snapshot of the good 
eeprom contents.

Do i understand you right in that you would do a fresh start with this
card using the xl driver ? I'm a bit concerned about again accidentially
overwriting the eeprom, its an _expensive_ card ... ;-)

hellmuth
-- 
Hellmuth Michaelis[EMAIL PROTECTED]   Hamburg, Europe
 We all live in a yellow subroutine, yellow subroutine, yellow subroutine ...



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



RE: vmware changes result in nasty bridging mess

2000-08-03 Thread Reinier Bezuidenhout

I'm using vmware2 in a different way ... I do not have bridging enabled
in the kernel.  I'm using the host method although I do not have
a "legal" subnet on the other side.

I've ment to contact the port maintainer so he can add this to the
Hints.FreeBSD file.

I've configured 10.1.1.1 for the vmnet device, and 10.1.1.2 in windows.
I use ipfw and natd to translate the info ... this works like a charm.

I'm using the latest port of vmware and I don't see those messages, 
probably because I do not have BRIDGING enabled in the kernel.

For thos interested .. here is the natd and ipfw rules.

natd -u -a my_legal_ip

ipfw a 3 divert natd all from 10.1.1.2 to any out via vr0
ipfw a 4 divert natd all from any to my_legal_ip in via vr0

I'm even accessing the NT servers :), browsing bla bla bla :)


Regards
Reinier


On 02-Aug-00 Robert Watson wrote:
 
 bridge_in-- reading table
 bridge_in-- reading table
 bridge_in-- reading table
 bridge_in-- reading table
 bridge_in-- reading table
 bridge_in-- reading table
 bridge_in-- reading table
 bridge_in-- reading table
 bridge_in-- reading table
 ...
 
 The vmware2 port now seems to enable bridging by default, and generate a
 kernel message for every ethernet packet sent.  Bridging on by default may
 have nasty side effects for multi-interface machines (especially security
 side effects).  I haven't read the code (I admit) but I finding the
 current behavior both (a) irritating (messages) and (b) worrying
 (unpredicted bridging with potential side effects).
 
   Robert N M Watson 
 
 [EMAIL PROTECTED]  http://www.watson.org/~robert/
 PGP key fingerprint: AF B5 5F FF A6 4A 79 37  ED 5F 55 E9 58 04 6A B1
 TIS Labs at Network Associates, Safeport Network Services
 
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with "unsubscribe freebsd-hackers" in the body of the message

###
# #
#  R.N. Bezuidenhout  NetSeq Firewall #
#  [EMAIL PROTECTED]   http://www.nanoteq.co.za#  
# #
###

--
Date: 03-Aug-00
Time: 09:04:34

This message was sent by XFMail
--


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



fixing longstanding cp -Rp misbehavior

2000-08-03 Thread Eric P. Scott

I want to make an "exact" copy of a directory tree (as far as
practical).  I was hoping  cp -Rp  would do the trick (assuming
I have no hard-linked files), but it fails on several counts:

1) modification times on directories get smashed

2) UNIX (er, "local") domain sockets aren't copied

3) unless run as root, can't copy _from_ write-protected
   directories

This context diff (against /usr/src/bin/cp/ from 3.5.1-RELEASE)
is intended as a starting point for discussion; if you can come
up with something more elegant, by all means commit that instead.

-=EPS=-
---
*** cp.c.orig   Sat Dec 11 12:33:31 1999
--- cp.c
***
*** 271,278 
warnx("%s: directory causes a cycle", curr-fts_path);
badcp = rval = 1;
continue;
-   case FTS_DP:/* Ignore, continue. */
-   continue;
}
  
/*
--- 271,276 
***
*** 330,335 
--- 328,339 
STRIP_TRAILING_SLASH(to);
}
  
+   if (curr-fts_info == FTS_DP) {
+   if (pflag  setfile(curr-fts_statp, 0))
+   badcp = rval = 1;
+   continue;
+   }
+ 
/* Not an error but need to remember it happened */
if (stat(to.p_path, to_stat) == -1)
dne = 1;
***
*** 388,398 
   * umask; arguably wrong, but it's been that way
   * forever.
 */
!   if (pflag  setfile(curr-fts_statp, 0))
!   badcp = rval = 1;
!   else if (dne)
!   (void)chmod(to.p_path,
!   curr-fts_statp-st_mode);
break;
case S_IFBLK:
case S_IFCHR:
--- 392,399 
   * umask; arguably wrong, but it's been that way
   * forever.
 */
!   if (!pflag  dne) (void)chmod(to.p_path,
!   curr-fts_statp-st_mode);
break;
case S_IFBLK:
case S_IFCHR:
***
*** 407,412 
--- 408,422 
case S_IFIFO:
if (Rflag) {
if (copy_fifo(curr-fts_statp, !dne))
+   badcp = rval = 1;
+   } else {
+   if (copy_file(curr, dne))
+   badcp = rval = 1;
+   }
+   break;
+   case S_IFSOCK:
+   if (Rflag) {
+   if (copy_socket(curr-fts_statp, !dne))
badcp = rval = 1;
} else {
if (copy_file(curr, dne))
*** extern.h.orig   Sun Aug 29 07:11:34 1999
--- extern.h
***
*** 50,55 
--- 50,56 
  int   copy_fifo __P((struct stat *, int));
  int   copy_file __P((FTSENT *, int));
  int   copy_link __P((FTSENT *, int));
+ int   copy_socket __P((struct stat *, int));
  int   copy_special __P((struct stat *, int));
  int   setfile __P((struct stat *, int));
  void  usage __P((void));
*** utils.c.origSat Dec 11 12:33:31 1999
--- utils.c
***
*** 44,49 
--- 44,51 
  #ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
  #include sys/mman.h
  #endif
+ #include sys/socket.h
+ #include sys/un.h
  
  #include err.h
  #include errno.h
***
*** 51,56 
--- 53,59 
  #include fts.h
  #include stdio.h
  #include sysexits.h
+ #include string.h
  #include unistd.h
  
  #include "extern.h"
***
*** 255,260 
--- 258,302 
warn("mknod: %s", to.p_path);
return (1);
}
+   return (pflag ? setfile(from_stat, 0) : 0);
+ }
+ 
+ int
+ copy_socket(from_stat, exists)
+   struct stat *from_stat;
+   int exists;
+ {
+   register int s, n;
+   union {
+   char data[256];
+   struct sockaddr_un un;
+   } u;
+ 
+   if (exists  unlink(to.p_path)) {
+   warn("unlink: %s", to.p_path);
+   return (1);
+   }
+   if ((s = socket(AF_UNIX, SOCK_DGRAM, 0))  0) {
+   warn("socket: %s", to.p_path);
+   return (1);
+   }
+   bzero((void *)u, sizeof u);
+   u.un.sun_len = 255;
+   u.un.sun_family = AF_UNIX;
+   if ((n = strlen(to.p_path)) 
+   sizeof u - (sizeof u.un - sizeof u.un.sun_path)) {
+   warn("bind: %s", to.p_path);
+   (void)close(s);
+   return (1);
+   }
+   

Re: fixing longstanding cp -Rp misbehavior

2000-08-03 Thread Eric P. Scott

Obviously, it's past my bedtime.   I meant =, not 

+   if ((n = strlen(to.p_path)) =
+   sizeof u - (sizeof u.un - sizeof u.un.sun_path)) {


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



LD_PRELOAD odities / Documentation?

2000-08-03 Thread Karl Pielorz

Hi All,

I'm working on some code that runs fine on Linux, but not under FreeBSD...
Trying to port the code is proving to be a pain...

The code is a 'wrapper' / 'shim' that's meant to be LD_PRELOAD'ed before an
executable... I've gotten everything to compile, and the LD_PRELOAD works, but
a lot of syscall's from the wrapper library fail either with bizare messages
such as "malloc(): recursive call", or just die horibly (segmentation faults,
and all sorts).

Are there any problems from making syscalls / library calls from within an
LD_PRELOAD'ed library? - Is anything like this documented anywhere?

Most things seem to work, but calling even simply library routines such as
'strcat', 'sprintf' etc. die in flames...

The wrapper I'm porting wraps a number of functions from libc (e.g. 'open',
'opendir' etc.)

Any pointers would be greatefuly received, unfortunately this all works under
Linux (I'm not bashing anyone on the head with that, I'm far more interested
in getting it working under FreeBSD)...

Thanks,

-Karl


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



RE: LD_PRELOAD odities / Documentation?

2000-08-03 Thread Daniel O'Connor


On 03-Aug-00 Karl Pielorz wrote:
  Any pointers would be greatefuly received, unfortunately this all works
  under
  Linux (I'm not bashing anyone on the head with that, I'm far more interested
  in getting it working under FreeBSD)...

I think the problem is that your calls are being resolved to your own library
first, so that is the routine being called.

AFAIK you have to build a set of pointers to the original (ie libc) routines. I
know esound work with its esddsp program, so you could look there for some tips.

---
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum


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



Re: LD_PRELOAD odities / Documentation?

2000-08-03 Thread Karl Pielorz



Daniel O'Connor wrote:
 
 On 03-Aug-00 Karl Pielorz wrote:
   Any pointers would be greatefuly received, unfortunately this all works
   under
   Linux (I'm not bashing anyone on the head with that, I'm far more interested
   in getting it working under FreeBSD)...
 
 I think the problem is that your calls are being resolved to your own library
 first, so that is the routine being called.
 
 AFAIK you have to build a set of pointers to the original (ie libc) routines. I
 know esound work with its esddsp program, so you could look there for some tips.

Thanks for the reply!

Sorry, I should have posted more details - I'll have a look at the reference
you mentioned...

re. Calling library Routines:

One of the ways I've tried implementing syscalls is to dlopen() the correct
library, and fetch the routines address from there (using dlsym) - and calling
the routine that way...

This doesn't seem to help though :(

-Karl


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



Berkeley make: evaluations inside for loops

2000-08-03 Thread Sheldon Hearn


Hi folks,

Can anyone explain to me why the first Makefile works and yet the second
Makefile doesn't?  The second Makefile produces the following error
messages on ``make test''

| "Makefile", line 1: Malformed conditional (widget == ${BAZ})
| "Makefile", line 1: Need an operator
| "Makefile", line 3: if-less endif
| "Makefile", line 3: Need an operator
| "Makefile", line 9: Need an operator
| make: fatal errors encountered -- cannot continue

#Makefile1:
FOO=widget
BAZ=widget
BAR=
.if ${FOO} == ${BAZ}
BAR=equal
.endif

test:
echo BAR=${BAR}

#Makefile2:
BAZ=widget
.for FOO in ${BAZ}
.if ${FOO} == ${BAZ}
BAR=equal
.endif
.endfor

test:
echo BAR=${BAR}

Ciao,
Sheldon.


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



Re: Berkeley make: evaluations inside for loops

2000-08-03 Thread Neil Blakey-Milner

On Thu 2000-08-03 (13:31), Sheldon Hearn wrote:
 Can anyone explain to me why the first Makefile works and yet the second
 Makefile doesn't?  The second Makefile produces the following error
 messages on ``make test''
 
 | "Makefile", line 1: Malformed conditional (widget == ${BAZ})
 | "Makefile", line 1: Need an operator
 | "Makefile", line 3: if-less endif
 | "Makefile", line 3: Need an operator
 | "Makefile", line 9: Need an operator
 | make: fatal errors encountered -- cannot continue
 
 #Makefile1:
 FOO=  widget
 BAZ=  widget
 BAR=
 .if ${FOO} == ${BAZ}
 BAR=  equal
 .endif
 
 test:
   echo BAR=${BAR}
 
 #Makefile2:
 BAZ=  widget
 .for FOO in ${BAZ}
 .if ${FOO} == ${BAZ}
 BAR=  equal
 .endif
 .endfor
 
 test:
   echo BAR=${BAR}

Makefile2 expands to:
BAZ= widget
.if widget == ${BAZ}
BAR= equal
.endif

And '.if' only takes "expressions", which can be comparisons (ie, "!=",
"=="), which in turn must have a variable on the left hand side.  (don't
ask me why)

Therefore, you should use:

.if ${BAZ} == ${FOO}

instead.

Neil
-- 
Neil Blakey-Milner
Sunesi Clinical Systems
[EMAIL PROTECTED]


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



nfiles

2000-08-03 Thread Laurence Barry



Sure this is a simple one ...

I need to determine the total number of files open on a system. The only way I can think to do this is a sysctl() call with
mib[0]=CTL_KERN and mib[1]=KERN_FILE, then trawl through the file structure that is returned. There must be a simpler
way.

 Laurence Barry

--
 [EMAIL PROTECTED]



sysinstall commands on custom CD

2000-08-03 Thread Johan Kruger

Problem using sysinstall command line version ??

I am running the following BSD ver ( release i built , maybe something does not
work, although i doubt it , i am using it finely )
FreeBSD ockle.dev.nanoteq.co.za 5.0-2724-SNAP FreeBSD 5.0-2724-SNAP #5:
Thu Jul 27 14:47:59 SAST 2000
[EMAIL PROTECTED]:/usr/src/sys/compile/GENERIC  i386



Made a MFS Boot image for CD-Installation.
Crunched 72 Megs of utils into 1.67 Megs, ( thanx to crunch )
Anyhow, i mount the CD with live filesystem on /cdrom on MFS filesystem, and
now runned /stand/sysinstall ( obviously after a chroot to /cdrom )

Works perfectly in interactive mode. I am trying to use on command
line as follows:
try 1:
/stand/sysinstall disk=ad0 partition=all diskPartitionWrite

it doesn't work
so i tried 
try 2:
/stand/sysinstall disk=ad0 partition=all noConfirm=yes diskPartitionWrite

it doesn't work
so i tried 
try 3:
echo aw | /stand/sysinstall disk=ad0 partition=all diskPartitionWrite
it does a Select All and Write, BUT sometimes goes bonkers

try x:
still doesnt work, so compiled sysinstall with LOAD_CONFIG_FILE=/tmp/jjk.conf
mounted a stiffy ( ufs ) on /tmp with my jjk.conf on it.

sysinstall does not even try to load a file ??? My sysinstall manpage specked
that i should put LOAD_CONFIG_FILE=whatever into the Makefile . does not 
use it

Want to use the command line version of sysinstall to partition disks, but
can't get it to work.
Am i doing something Wrong ??

--
E-Mail: Johan Kruger [EMAIL PROTECTED]
Date: 03-Aug-00
Time: 17:53:03

This message was sent by XFMail
--


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



RE: vmware changes result in nasty bridging mess

2000-08-03 Thread Robert Watson

On Thu, 3 Aug 2000, Reinier Bezuidenhout wrote:

 I'm using vmware2 in a different way ... I do not have bridging enabled
 in the kernel.  I'm using the host method although I do not have
 a "legal" subnet on the other side.

That was the configuration I was using also, until I upgraded my version
of -STABLE, and as a result had to upgrade my vmware port.  The results
thus far have been a little worrying, and I'd like to see them fixed
before too many people get hurt.

  Robert N M Watson 

[EMAIL PROTECTED]  http://www.watson.org/~robert/
PGP key fingerprint: AF B5 5F FF A6 4A 79 37  ED 5F 55 E9 58 04 6A B1
TIS Labs at Network Associates, Safeport Network Services



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



3Com 3C905b-TX

2000-08-03 Thread Travis Leuthauser

I'm posting this to questions and hackers in the hopes that someone can help
me.  Here's my scenario:

I have a news server running 4.1 Stable cvsup'd 2 days ago.  Running 3.X I
had no problems.  Had to update to 4 because my 45 G Ultra66 IDE drives were
being very stupid under 3.X.  After the update, I noticed that the most I
could get out of a binary download from the news server on my 100Mbit
network was about 25k/s.  After a few hours of looking over everything and
testing an ftp from one of the clients (running an ftp server).  I
determined that it was just my news service performing slowly.  I was able
to ftp a 700M file that averaged 800k/s.  Mysteriously my news service
picked back up to its normal speed.  When I checked the news server, this is
the message that was displayed on my terminal:

xl0: transmission error: 90
xl0: tx underrun, increasing start threshold to 180 bytes.

Since then, it has popped up a few more times I think now the threshold is
up to 420.  I looked at the xl driver and found where it sets the initial
value:

sc-xl_tx_thresh = XL_MIN_FRAMELEN;

What if I were to change it to say:

sc-xl_tx_thresh = 540;

What effect would that have on my system, good or bad?  Is there an optimum
value to set?  Should I just change out the NIC or is there another card
holding up the bus?  If I wanted to know what the current value of the
buffer is, is there a command that would show me?  If I change the value, do
I need to just recompile my kernel, or is there something else I need to do?

I saw a few posts from 99 about the topic, but no decisive answer was given.
I am going to list the specifics of all the hardware in the box as well as
the major software/ports running on it.  Any help is greatly appreciated.

Thanks,

Travis Leuthauser
Network Administrator
WinConX Online, Inc.

Hardware Specs:

Pentium !!! 500Mhz
512M RAM
Gigabyte GA-6VXE+ w/ VIA Apollo Pro AGPSet
AOpen PG128 AGP Video
3Com 3c905b-tx NIC (has two IP's: one for incoming news - one to feed news
out to users)
Adaptec 2940U2W
4 IBM 9G UW SCSI Drives
Western Digital 45G (using Ultra66)
IBM 45G (using Ultra66)
Western Digital 27G
AOpen 40x CDRom

Software:
named
ssh1
qmail 1.03 w/ tcpserver
big brother 1.4c
dnews 5.4f5 for FreeBSD 4

dmesg output:

Copyright (c) 1992-2000 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 4.1-STABLE #2: Tue Aug  1 16:29:24 CDT 2000
[EMAIL PROTECTED]:/usr/src/sys/compile/NEWS
Timecounter "i8254"  frequency 1193182 Hz
Timecounter "TSC"  frequency 501139586 Hz
CPU: Pentium III/Pentium III Xeon/Celeron (501.14-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x673  Stepping = 3

Features=0x387f9ffFPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,
PAT,PSE36,PN,MMX,FXSR,XMM
real memory  = 536805376 (524224K bytes)
avail memory = 518823936 (506664K bytes)
Preloaded elf kernel "kernel" at 0xc031e000.
Pentium Pro MTRR support enabled
md0: Malloc disk
npx0: math processor on motherboard
npx0: INT 16 interface
pcib0: Host to PCI bridge on motherboard
pci0: PCI bus on pcib0
pcib2: VIA 82C598MVP (Apollo MVP3) PCI-PCI (AGP) bridge at device 1.0 on
pci0
pci1: PCI bus on pcib2
pci1: SiS 6326 SVGA controller at 0.0
isab0: VIA 82C596B PCI-ISA bridge at device 7.0 on pci0
isa0: ISA bus on isab0
atapci0: VIA 82C596B ATA66 controller port 0xe000-0xe00f at device 7.1 on
pci0
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
pci0: VIA 83C572 USB controller at 7.2 irq 11
xl0: 3Com 3c905B-TX Fast Etherlink XL port 0xe800-0xe87f mem
0xe0801000-0xe080107f irq 10 at device 8.0 on pci0
xl0: Ethernet address: 00:50:04:22:cc:4f
miibus0: MII bus on xl0
xlphy0: 3Com internal media interface on miibus0
xlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ahc0: Adaptec 2940 Ultra2 SCSI adapter port 0xec00-0xecff mem
0xe080-0xe0800fff irq 12 at device 9.0 on pci0
ahc0: aic7890/91 Wide Channel A, SCSI Id=7, 16/255 SCBs
pcib1: Host to PCI bridge on motherboard
pci2: PCI bus on pcib1
fdc0: NEC 72065B or clone at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: 1440-KB 3.5" drive on fdc0 drive 0
atkbdc0: Keyboard controller (i8042) at port 0x60,0x64 on isa0
atkbd0: AT Keyboard flags 0x1 irq 1 on atkbdc0
kbd0 at atkbd0
vga0: Generic ISA VGA at port 0x3c0-0x3df iomem 0xa-0xb on isa0
sc0: System console at flags 0x100 on isa0
sc0: VGA 16 virtual consoles, flags=0x300
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
ppc0: Parallel port at port 0x378-0x37f irq 7 on isa0
ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
ppi0: Parallel I/O on ppbus0
lpt0: Printer on ppbus0
lpt0: Interrupt-driven port
ad0: 42934MB WDC WD450AA-00BAA0 [87233/16/63] at ata0-master using UDMA66
ad1: 43979MB IBM-DTLA-307045 [89355/16/63] at ata0-slave using UDMA66
ata1-master: DMA 

ADSL pci modem drivers?

2000-08-03 Thread Mario Sergio Fujikawa Ferreira

Hi,

Does anyone have any information on ADSL
modems under FreeBSD? Driver progress and stuff?
Any PCI cards at all? Mainly the 3com
homeconnect.

http://www.3com.com/client/pcd/homeconnect/dsl/pci.html

Regards,
Mario Ferreira


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



Re: aio_waitcomplete?

2000-08-03 Thread Christopher Sedore


Could you send the source code to me?  I'll take a look if it is simple.

-Chris

On Tue, 1 Aug 2000, Kevin Mills wrote:

 
 In order to get familiar with aio_waitcomplete() and friends, I wrote a
 simple echo server and have run into problems.  If I attempt to hit my echo
 server with more than a few clients ( 3 or 4), I get a bunch of ENOTCONN
 errors from aio_waitcomplete() and on the client end I get an ECONNRESET and
 a 'Broken pipe'.  To ensure I wasn't completely crazy, I wrote the same echo
 server using poll() and non-blocking sockets and it works without error.
 
 Is aio_waitcomplete() ready for prime-time?  Should this work?
 
 I'm using 4.0-stable from 7/13/2000:
 
 4.0-STABLE FreeBSD 4.0-STABLE #2: Thu Jul 13 16:07:07 PDT 2000
 
 Thanks for any assistance!
 
 
 
 
 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



Re: ADSL pci modem drivers?

2000-08-03 Thread Taavi Talvik

On Thu, 3 Aug 2000, Mario Sergio Fujikawa Ferreira wrote:

   Does anyone have any information on ADSL
 modems under FreeBSD? Driver progress and stuff?
   Any PCI cards at all? Mainly the 3com
 homeconnect.
 http://www.3com.com/client/pcd/homeconnect/dsl/pci.html

Typically DSL cards require lot of support from original 
hardware manufacturer (especially DMT chipsets firmware).

As far as I know thee is no publicly released drivers neither for freebsd
or linux (There is unreleased driver for efficient 3060 and alctel
speedtouch usb for linux).

If you have good contact with manufacturers wiling to help with
documentation, firmware etc.. etc.. Then you'll probably find volunteers
for driver writing for freebsd:)

best regards,
taavi
---
Taavi Talvik| Internet: [EMAIL PROTECTED] 
Unineti Andmeside AS| phone: +372 6405150
Ravala pst. 10  | fax: +372 6405151
Tallinn 10143, Estonia  |



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



Re: nfiles

2000-08-03 Thread Dan Nelson

In the last episode (Aug 03), Laurence Barry said:
 I need to determine the total number of files open on a system. The
 only way I can think to do this is a sysctl() call with
 mib[0]=CTL_KERN and mib[1]=KERN_FILE, then trawl through the file
 structure that is returned. There must be a simpler way.

Figure out how pstat -T does it:

$ pstat -T
294/3240 files
0M/1173M swap space


-- 
Dan Nelson
[EMAIL PROTECTED]


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



Re: malloc to arrays?

2000-08-03 Thread Aleksandr A.Babaylov

Chris Costello writes:
 On Wednesday, August 02, 2000, Mike Smith wrote:
  tcpcash_addr = (typeof(tcpcash_addr))
  malloc(sizeof(*tcpcash_addr) * 
  TCPCASH_ROWSIZE * 
  TCPCASH_COOLSIZE);
Just as a note on coding style, this will only hide warnings
 caused by not including stdlib.h.  malloc(3) returns void * and
 does not need to be cast.
So there is an error in gcc in base system?
See:

1cicuta~/w/ra-tools(6)cat tmp.c
#include stdlib.h

int main()
{   int *(i[100]);

i = malloc(400);
}
0cicuta~/w/ra-tools(7)cc tmp.c
tmp.c: In function `main':
tmp.c:6: incompatible types in assignment
1cicuta~/w/ra-tools(8)uname -a
FreeBSD cicuta.babolo.ru 4.0-STABLE FreeBSD 4.0-STABLE #0: Fri Jun  9 14:01:52 MSD 
2000 [EMAIL PROTECTED]:/tmp/obj/usr/src/sys/cicuta  i386
0cicuta~/w/ra-tools(9)

-- 
@BABOLO  http://links.ru/


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



Re: How to make *real* random bits.

2000-08-03 Thread Peter Jeremy

On Wed, 02 Aug 2000 06:15:41 +0200, Poul-Henning Kamp [EMAIL PROTECTED] wrote:
 If I generate true random bits it takes 3 timestamps to get one
 bit of randomness:

 ++--+---+--+-+
 T1   T2 T3  T4 T5T6

 if (T2 - T1  T3 - T2)
 return 0;
 else if (T2 - T1  T3 - T2)
 return 1;
 else
 try again.
...
 Because of this your T3 value can be considered the T1
value for the next random bit you generate. 

No it cannot.  If you did that then the probability would skew from
bit to bit.  If the (t3-t2) was large bit N == 1 and the probability
of bit N+1 == 0 is  .5 then.

I don't follow.  Taking the extended timeline above, and shortening
your algorithm above to (T2-T1)(T3-T2):
 
Since the decay intervals are random[1], there is no correlation
between (T2-T1), (T3-T2), (T4-T3), etc.  I can see that it wouldn't be
safe to use (T2-T1)(T3-T2) and (T3-T2)(T4-T3) since this would
introduce a (T2-T1)(T4-T3) correlation in adjacent bits.

I don't see how there is any correlation between (T2-T1)(T3-T2) and
(T4-T3)(T5-T4).  This effectively gives you 1 bit of randomness for
every two time intervals.

(Though, ignoring geek value, I suspect a reverse-biased transistor
BE junction would be an easier source of randomness).

[1] Subject to slight corrections as a result of the half-lives of
the elements in the decay chain.

Peter


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



Re: malloc to arrays?

2000-08-03 Thread Chris BeHanna

On Fri, 4 Aug 2000, Aleksandr A.Babaylov wrote:

 Chris Costello writes:
  On Wednesday, August 02, 2000, Mike Smith wrote:
 tcpcash_addr = (typeof(tcpcash_addr))
 malloc(sizeof(*tcpcash_addr) * 
 TCPCASH_ROWSIZE * 
 TCPCASH_COOLSIZE);
 Just as a note on coding style, this will only hide warnings
  caused by not including stdlib.h.  malloc(3) returns void * and
  does not need to be cast.
 So there is an error in gcc in base system?
 See:
 
 1cicuta~/w/ra-tools(6)cat tmp.c
 #include stdlib.h
 
 int main()
 {   int *(i[100]);
 
 i = malloc(400);
 }
 0cicuta~/w/ra-tools(7)cc tmp.c
 tmp.c: In function `main':
 tmp.c:6: incompatible types in assignment
 1cicuta~/w/ra-tools(8)uname -a
 FreeBSD cicuta.babolo.ru 4.0-STABLE FreeBSD 4.0-STABLE #0: Fri Jun  9 14:01:52 MSD 
2000 [EMAIL PROTECTED]:/tmp/obj/usr/src/sys/cicuta  i386
 0cicuta~/w/ra-tools(9)

There's no error at all.  You've declared i to be an array of 100
pointers to int, but then you've tried to assign a pointer to that
array, and gcc quite naturally complains.

-- 
Chris BeHanna
Software Engineer (at yourfit.com)
[EMAIL PROTECTED]



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



Re: LD_PRELOAD odities / Documentation?

2000-08-03 Thread Bjoern Fischer

On Thu, Aug 03, 2000 at 11:25:27AM +0100, Karl Pielorz wrote:
 The code is a 'wrapper' / 'shim' that's meant to be LD_PRELOAD'ed before an
 executable... I've gotten everything to compile, and the LD_PRELOAD works, but
 a lot of syscall's from the wrapper library fail either with bizare messages
 such as "malloc(): recursive call", or just die horibly (segmentation faults,
 and all sorts).

To wrap libc functions you have to use dlsym() with the special
handle RTLD_NEXT to get the next incarnation of your function.
E.g. you want to wrap fchmod(), so write your own fchmod() and
after you `corrected' the params you may have to call the `real'
fchmod(). You will get this with dlsym(RTLD_NEXT, "fchmod").

  Bjoern

-- 
-BEGIN GEEK CODE BLOCK-
GCS d--(+) s++: a- C+++(-) UBOSI$ P+++(-) L---(++) !E W- N+ o+
K- !w !O !M !V  PS++  PE-  PGP++  t+++  !5 X++ tv- b+++ D++ G e+ h-- y+ 
--END GEEK CODE BLOCK--


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



Re: LD_PRELOAD odities / Documentation?

2000-08-03 Thread Tony Finch

Karl Pielorz [EMAIL PROTECTED] wrote:

One of the ways I've tried implementing syscalls is to dlopen() the correct
library, and fetch the routines address from there (using dlsym) - and calling
the routine that way...

This doesn't seem to help though :(

I've made this work across Solaris, Linux, and FreeBSD. Can you post
your code? Its hard to debug a vague description.

Tony.
-- 
en oeccget g mtcaaf.a.n.finch
v spdlkishrhtewe y[EMAIL PROTECTED]
eatp o v eiti i d.[EMAIL PROTECTED]


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



Re: vmware changes result in nasty bridging mess

2000-08-03 Thread Vladimir N. Silyaev

In muc.lists.freebsd.hackers, you wrote:

bridge_in-- reading table
bridge_in-- reading table
bridge_in-- reading table
bridge_in-- reading table
bridge_in-- reading table
bridge_in-- reading table
bridge_in-- reading table
bridge_in-- reading table
bridge_in-- reading table
...

The vmware2 port now seems to enable bridging by default, and generate a
kernel message for every ethernet packet sent.  
FreeBSD bridge code doesn't have any vmware related modifications. Only
one modification what was impelmented, it's a special sysctl
net.link.ether.bridge_refresh, which provied support for loadable
ethernets drivers. The rest of bridging code didn't touched at all.

Bridging on by default may
have nasty side effects for multi-interface machines (especially security
side effects). 
It's several ways to work around about that:
- compile kernel without bridging support.
- remove bridge starting code vmware.sh file in rc.d directory.
- create special bridge cluster with one real interface and with one emulated

I haven't read the code (I admit) but I finding the
current behavior both (a) irritating (messages) and (b) worrying
(unpredicted bridging with potential side effects).
I don't know I never seen such effect. Could you to do more testing
about that.

--
Vladimir 


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