Re: What do people think of maybe using the sourceforge software?

2000-05-17 Thread Jordan K. Hubbard

 Second, the projects page we have now, with all due respect to the
 people that try to keep it reasonably organised, is a mess due to the
 lack of updates. people only maintain their project pages perhaps, but
 certainly not the links that lead to them. 
 
 Being able to work with more people on the same project on an equal
 bases would be a good idea IMHO.

Well, I have to say that I installed and played with sourceforge for
awhile and it's, well, highly dedicated to being sourceforge.

The various product links *all* point back to sourceforge.com relative
addresses and there's no concept of "$PROJECTNAME" or "$PROJECTBASE"
to customize the sourceforge software for someone else, like the
FreeBSD project.  It's very much an example of a "code straight to the
goal and for one purpose" implementation and, unfortunately, thus
completely unsuitable for our purposes without some major hackery.

Maybe if we could find something else...

- Jordan


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



RE: smb printer trouble

2000-05-17 Thread Koster, K.J.

Perhaps there are some invisible spaces after some of the backslashes?

Kees Jan

==
 You are only young once,
  but you can stay immature all your life


 -Original Message-
 From: Charlie Root [mailto:[EMAIL PROTECTED]]
 Sent: dinsdag 16 mei 2000 20:39
 To: [EMAIL PROTECTED]
 Subject: smb printer trouble
 
 
 I wrote a simple filter to print to an nt print queue through
 the smbclinet. It tests to see if the file is postscript or
 text, and if it is text it sends a control code to tell the 
 printer to do the lf-crlf conversion. 
 
 My problem is that the '\' escapes in the first line get clobbered.
 for example, if I print this printcap:
 
  begin printcap 
 lp:\
   :sh:\
   :lp=/dev/lpt0:\
   :sd=/var/spool/output/lpd/lp:\
   :lf=/var/log/lpd/lpd.log:
 
 lplaser:\
   :sh:\
   :lp=/dev/null:\
   :if=/root/filters/smb-filter:\
   :sd=/var/spool/output/lpd/lplaser:\
   :lf=/var/log/lpd/lpd.log:
  end printap 
 
 the entire entry for "lp" will be on one line, but the "lplaser"
 entry will print out like it is supposed to.
 
 I know why it is doing it, however I don't know how to fix it. Any
 help will be appreciated (script is below). 
 
 Thanks,
 James
 
  begin smb-filter 
 #!/bin/sh
 
 # Input filter to print to a NT print queue, requires smbclient.
 #
 # Author: James Halstead, e-mail: [EMAIL PROTECTED]
 #
 # Read stdin to a temp, make sure to determine the print 
 type, then use
 #   smbclient to print to the nt queue.
 
 
 SERVER=SERVER NAME
 PRINTER=cwPRINTER NAME
 TEMP=/tmp/smbprint
 
 TEMP=`mktemp -q $TEMP.XX`
 
 read firstline
 first_two=`expr "$firstline" : '\(..\)'`
 
 if [ "$first_two" != "%!" ]; then
   printf "\033k3G"  $TEMP 
 fi
 
 #lets see, copy the firstline to temp, cat the rest to the temp, 
 # make one ugly command to print the file to the smb printer then
 # rm the temp file.
 
 echo "$firstline"  $TEMP  cat  $TEMP \
 /usr/local/bin/smbclient $SERVER\\$PRINTER -UGUEST -N\
  -c"print $TEMP" \
 rm -f $TEMP /dev/null  exit 0
 
 exit 1
  end smb-filter 
 
 
 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: newbus documentation

2000-05-17 Thread Alexander Langer

To follow up myself, I got the first important comments from Matthew
N. Dodd, which I will merge this evening.

Alex
-- 
I need a new ~/.sig.


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



new comer...

2000-05-17 Thread G.B.Naidu


Hi,

I am G.B. Naidu, a unix maniac.

What is the discussion that's going on currently on this list? 

I have some simple question. Many of you might have written some hooks
into the kernel. I wonder what are these hooks and how to write them? 

Can somebody help me to understand this.

thanks
--gb

-- 



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



Re: SSE support for FreeBSD

2000-05-17 Thread Andrew Gallatin


Issei Suzuki writes:
  I add SSE support for FreeBSD 4.0-RELEASE and 5.0-CURRENT.  Some more
  work is needed everything to go well, but it works functionally now.
  
  The patches and documents are avaiable at:
  
  http://home.jp.freebsd.org/~issei/sse/sse.html
  
  Limitations:
- Multiprocessor system is not supported.
- There is no exception handler to deal with SSE Exceptions.
- No spaces are available for SSE registers in struct fpregs. So, we
  cannot record SSE registers when dumping core, nor access to SSE
  registers via procfs.
  
  Comments, bug reports etc. are welcome.

Cool!

Have you (or anybody else) considered using the PIII SIMD
functionality for optimizing kernel bcopy/copyin/copyout and
checksums?  There are linux kernel patches for this at
http://www.redhat.com/~mingo/mmx-patches

I have a trivial user-level app which shows a bcopy speedup of between
40% (PIII Xeon, 733MHz) and 50% (PIII, 450MHz) when using the kni
memcpy stolen from those patches rather than the bcopy from libc, so I
think it could be worth looking into.

Cheers,

Drew

--
Andrew Gallatin, Sr Systems Programmer  http://www.cs.duke.edu/~gallatin
Duke University Email: [EMAIL PROTECTED]
Department of Computer Science  Phone: (919) 660-6590



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



bpf question

2000-05-17 Thread Dmitry Samersoff

I have traffic metering program using bpf,
it works fine on relatevly free net but looses about 30% 
of packets on havy loaded one.

Could any body suggest me something?

Thank you!

-- 
Dmitry Samersoff, [EMAIL PROTECTED], ICQ:3161705
http://devnull.wplus.net
* There will come soft rains ...


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



Re: Looking for advice on lpr/lpd changes

2000-05-17 Thread Garance A Drosihn

At 4:56 PM -0400 5/11/00, Ted Buswell wrote:
I don't like the proposed idea (shell script mod of smb.conf) either,
however I was under the impression with your lpr mod you would also
bludgeon the user with 4*5*200 printer shares.

I had thought that with your lpr mod, you still need to somehow add
the "printer/hm" variations into the list of shares presented by samba.

Or am I missing a samba configuration option that permits the user to
specify the queue the job is sent to [instead of having them select
from a predefined list] ?

We have enough regular printer queues that we ran into trouble
presenting a list of shares to the user.  (the problem might have
only been under win95).  Due to that, our users always connect
directly to a printer share, they do not browse for it.  They have
to define a printer as \\sambasrv\unixptr

Many of our users are laptop users, so they only add the printers
they personally care about.  The unix side needs to know all the
printer names, but any given laptop (or even any of the PC's in
our public labs) only have about 10 printers defined.

I had not thought about browsing for printer shares.  I'll try
to keep that in mind too.


---
Garance Alistair Drosehn   =   [EMAIL PROTECTED]
Senior Systems Programmer  or  [EMAIL PROTECTED]
Rensselaer Polytechnic Institute


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



Question about file write????

2000-05-17 Thread Joy Ganguly


hi all, 

i have written a special ioctl which writes data into a file from a buffer in
kernel memory. it invokes fo-fo_write() and involves one copy from kernel
mem
to disk cache. however this takes substantially more time than an ordinary
write which copies from user space to the disk cache. any explanations??? 

thanx in advance 

joy 


Get free email and a permanent address at http://www.netaddress.com/?N=1


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



ATM adapter

2000-05-17 Thread Daniel Hilevich

Hi,
I'm looking to purchase an ATM adapter for my FreeBSD box. The two adapters
specified in the "Integrating ATM networking into BSD" document (Adaptec
ANA-59x0  efficient ENI-155) are no longer available.
My needs are simple:
-PCI/ISA ATM adapter.
-Compatibility with the en0 driver (or any other driver that exists for
FreeBSD).

Does anyone knows about such a device?

Thank you,
Daniel




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



Re: ATM adapter

2000-05-17 Thread Poul-Henning Kamp


Get the Fore PCA200 and use the "HARP" ATM code which is far more
functional than the "Chuck ATM" code.


--
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


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



Re: ATM adapter

2000-05-17 Thread Andrzej Bialecki

On Wed, 17 May 2000, Daniel Hilevich wrote:

 Hi,
 I'm looking to purchase an ATM adapter for my FreeBSD box. The two adapters
 specified in the "Integrating ATM networking into BSD" document (Adaptec
 ANA-59x0  efficient ENI-155) are no longer available.
 My needs are simple:
 -PCI/ISA ATM adapter.
 -Compatibility with the en0 driver (or any other driver that exists for
 FreeBSD).

The cards and the driver you mention is the old ATM implementation made by
Chuck Cranor (sp?). There is much newer and much more sophisticated
framework called HARP, which is part of FreeBSD beginning with, I think,
3.0-RELEASE. HARP supports (among others) Fore PCA-200e card which I
use. See the docs in /usr/share/examples/atm.

NOTE: this card requires loading a firmware each time it's initialized
(after reboot). The firmware has to be _exactly_ the version that is
mentioned in the HARP docs, because HARP drivers refer to locations in the
binary image..

Also, be sure to set proper encapsulation on both sides of your link
(e.g. LLC/SNAP).

Other than that, the card works perfectly ok for me.

Andrzej Bialecki

//  [EMAIL PROTECTED] WebGiro AB, Sweden (http://www.webgiro.com)
// ---
// -- FreeBSD: The Power to Serve. http://www.freebsd.org 
// --- Small  Embedded FreeBSD: http://www.freebsd.org/~picobsd/ 




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



Re: Question about file write????

2000-05-17 Thread Alfred Perlstein

* Joy Ganguly [EMAIL PROTECTED] [000517 09:41] wrote:
 
 hi all, 
 
 i have written a special ioctl which writes data into a file from a buffer in
 kernel memory. it invokes fo-fo_write() and involves one copy from kernel
 mem
 to disk cache. however this takes substantially more time than an ordinary
 write which copies from user space to the disk cache. any explanations??? 

What are you using for your kernel to kernel copy?

(copyin and friends are hand optimized for great speed when copying
from/to userspace)


-- 
-Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
"I have the heart of a child; I keep it in a jar on my desk."


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



Re: Question about file write????

2000-05-17 Thread Joy Ganguly

Alfred Perlstein wrote:

 * Joy Ganguly [EMAIL PROTECTED] [000517 09:41] wrote:
 
  hi all,
 
  i have written a special ioctl which writes data into a file from a buffer in
  kernel memory. it invokes fo-fo_write() and involves one copy from kernel
  mem
  to disk cache. however this takes substantially more time than an ordinary
  write which copies from user space to the disk cache. any explanations???

 What are you using for your kernel to kernel copy?


 fo-fo_write uses uiomove() with seg_flg = UIO_SYSSPACE. uiomove() uses
bcopy() to do the actual copying. my ioctl sets up the struct uio to point to the
kernel buf and calls fo-fo_write(). Hence the only difference between my ioctl
and original write is that the former has seg_flg = UIO_SYSSPACE and the latter
has UIO_USERSPACE.




 (copyin and friends are hand optimized for great speed when copying
 from/to userspace)


what sort of optimizations are you referrring to?? is there some other way i can
do this??


 --
 -Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
 "I have the heart of a child; I keep it in a jar on my desk."

 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



How to make system Sync

2000-05-17 Thread FTG staff

I had a couple of system out of sync problems.

(1) PCI sync problem:
ATM adapter updates a buffer return pointer and generates intr, 
but when driver pulls out the information that updated by adapter,
some memory in the last piece of the pool is garbage.
e.g.
head - c010
tail - c0100400

c010 - buf0
c014 - buf1
...
c0100100 - bufn
...
c0100160 - bad address or 0
...

If I let driver tsleep() for a while, the problem can be improved.
So, it looks like that adapter pushed (DMA) the data into memory,
but not been seen by CPU right way due to the DMA sync issue.
How can we sync the DMA transaction in BSD?


(2)
page fault trap does not show up right way:
at #7, lock_ObtainSpin is defined as simple_lock(). Before this line,
I put a line code --
char*   psp = panicstr;

to save the panicstr status, and we can see psp is NULL; i.e., "page fault"
has not been trapped yet. Where a few instructions down to tsleep(),
the panicstr is set to "page fault", but there is no code in the function
_simple_lock() can cause page fault. So, the page should be happened at
earlier time somewhere.
For this problem, how can we enforce the page trap show up at right spot
to catch the problem?

-Jin

-- core information --
gdb -k kernel.4 vmcore.4

#0  boot (howto=256) at ../../kern/kern_shutdown.c:304
#1  0xc0193059 in panic (fmt=0xc03646ef "page fault")
at ../../kern/kern_shutdown.c:554
#2  0xc02c3b4a in trap_fatal (frame=0xc0380fa8, eva=112)
at ../../i386/i386/trap.c:924
#3  0xc02c37fd in trap_pfault (frame=0xc0380fa8, usermode=0, eva=112)
at ../../i386/i386/trap.c:817
#4  0xc02c3383 in trap (frame={tf_fs = 16, tf_es = 16, tf_ds = 16, 
  tf_edi = 256, tf_esi = -1070028992, tf_ebp = -1070067700, 
  tf_isp = -1070067756, tf_ebx = 0, tf_edx = 1073741824, 
  tf_ecx = -1069825280, tf_eax = 1074236058, tf_trapno = 12, tf_err = 0, 
  tf_eip = -1072080212, tf_cs = 8, tf_eflags = 66118, tf_esp = 768, 
  tf_ss = -1070133429}) at ../../i386/i386/trap.c:423
#5  0xc0195aac in tsleep (ident=0xc038a740, priority=296, 
wmesg=0xc033f121 "slock", timo=200) at ../../kern/kern_synch.c:425
#6  0xc018e45e in _simple_lock (alp=0xc03e2e74, 
id=0xc0370f4b "../sdapi_streams.c", l=768) at ../../kern/kern_lock.c:604
#7  0xc02f7d60 in sd_stream_dispatch (apip=0xc0ec28c0, rockp=0xc03e2280, 
bufp=0xc0a58200, eventp=0xc0ee2400) at ../sdapi_streams.c:768
#8  0xc02f251b in sd_UpcallEvent (vcp=0xc0ec3200, eventp=0xc0ee2400, 
bufp=0xc0a58200) at sdapi.c:973
#9  0xc02f2630 in sd_DataCallback (vc_cookie=0xc0ec3100, contextp=0xc0ec3200, 
bufp=0xc0a58200, packet_arg=0x0) at sdapi.c:1024
#10 0xc02df683 in bcd_service_rbrq (rbrqi=0xc0d7cba8) at ../bcd_rx.c:1560
#11 0xc02e3a3e in bcd_he_intr (bu=0xc0d7b000) at ../FreeBSDK/bcd_he.c:632
(kgdb) up 6
#6  0xc018e45e in _simple_lock (alp=0xc03e2e74, 
id=0xc0370f4b "../sdapi_streams.c", l=768) at ../../kern/kern_lock.c:604
604 tsleep(lockpausetime, PCATCH | PPAUSE, "slock",
(kgdb) up
#7  0xc02f7d60 in sd_stream_dispatch (apip=0xc0ec28c0, rockp=0xc03e2280, 
bufp=0xc0a58200, eventp=0xc0ee2400) at ../sdapi_streams.c:768
768 lock_ObtainSpin(sd_user_lock);
(kgdb) p psp
$1 = 0x0
(kgdb) p panicstr
$2 = 0xc03accc0 "page fault"



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



Laptop support for the mss pcm driver.

2000-05-17 Thread Ira L Cooper


For those using the mss pcm driver on laptops, this a patch to
fix the skipping and volume changes that happen after resuming from
hiberation or suspension.  Note that your laptop will not resume playing
music until you close and re-open the sound device using these patches.

The patch is available at http://www.mit.edu/~ira/mss.c.diff 
and it is relative to -STABLE but it should apply cleanly to -CURRENT.

The patch is to src/sys/dev/sound/isa/mss.c.

Please e-mail me with any comments on this patch.

-Ira


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



netgraph support for channelized LMC 1504 PCI card?

2000-05-17 Thread Len Conrad

There was some talk about this back in March or so, leaving me rembering 
someone said that it wouldn't be too hard or long to do it.

Has there been any progress?

Len



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



Re: Question about file write????

2000-05-17 Thread Alfred Perlstein

* Joy Ganguly [EMAIL PROTECTED] [000517 11:19] wrote:
 Alfred Perlstein wrote:
 
  * Joy Ganguly [EMAIL PROTECTED] [000517 09:41] wrote:
  
   hi all,
  
   i have written a special ioctl which writes data into a file from a buffer in
   kernel memory. it invokes fo-fo_write() and involves one copy from kernel
   mem
   to disk cache. however this takes substantially more time than an ordinary
   write which copies from user space to the disk cache. any explanations???
 
  What are you using for your kernel to kernel copy?
 
 
  fo-fo_write uses uiomove() with seg_flg = UIO_SYSSPACE. uiomove() uses
 bcopy() to do the actual copying. my ioctl sets up the struct uio to point to the
 kernel buf and calls fo-fo_write(). Hence the only difference between my ioctl
 and original write is that the former has seg_flg = UIO_SYSSPACE and the latter
 has UIO_USERSPACE.
 
 
 
 
  (copyin and friends are hand optimized for great speed when copying
  from/to userspace)
 
 
 what sort of optimizations are you referrring to?? is there some other way i can
 do this??

bcopy should be using the hand optimized code, I think you may have
to explain more of what you're doing if anyone is going to be able
to help.


-- 
-Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
"I have the heart of a child; I keep it in a jar on my desk."


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



Re: How to make system Sync

2000-05-17 Thread Alfred Perlstein

* Jin Guojun [EMAIL PROTECTED] [000517 12:34] wrote:
 I had a couple of system out of sync problems.
 
 (1) PCI sync problem:
   ATM adapter updates a buffer return pointer and generates intr, 
   but when driver pulls out the information that updated by adapter,
   some memory in the last piece of the pool is garbage.
 e.g.
   head - c010
   tail - c0100400
 
   c010 - buf0
   c014 - buf1
   ...
   c0100100 - bufn
   ...
   c0100160 - bad address or 0
   ...
 
 If I let driver tsleep() for a while, the problem can be improved.
 So, it looks like that adapter pushed (DMA) the data into memory,
 but not been seen by CPU right way due to the DMA sync issue.
 How can we sync the DMA transaction in BSD?

I think the way you accomplish this is by telling the adapter to
generate an interrupt when it's completed its DMA operation, you
seem to be generating interupts at the start instead of the end.

-Alfred


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



Re: netgraph support for channelized LMC 1504 PCI card?

2000-05-17 Thread Poul-Henning Kamp

In message [EMAIL PROTECTED], Len Conrad wri
tes:
There was some talk about this back in March or so, leaving me rembering 
someone said that it wouldn't be too hard or long to do it.

Has there been any progress?

I have still not received my hardware :-(

--
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.


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



Re: newbus documentation

2000-05-17 Thread Alexander Langer

Second revision is online at
http://big.endian.de/misc/newbus-intro.txt

The led-driver is still in the tar.gz I posted yesterday, but this
tar.gz still has version 1.

Please, guys. READ IT! COMMENTS!

Alex


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



kernel 'nproc' and 'proc' symbols in FreeBSD 3.x

2000-05-17 Thread Vadim Belman

Which symbols might be used instead of 'nproc' and 'proc' (which is
FreeBSD 4.0 specific, as far as I understand) with FreeBSD 3.x kernels? I
have a local port of ucd-snmp 4.1.1 with host resources module included
which works fine but complains about this symbols on all 3.x boxes.

-- 
/Voland Vadim Belman
E-mail: [EMAIL PROTECTED]



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



Re: bpf question

2000-05-17 Thread Wes Peters

Dmitry Samersoff wrote:
 
 I have traffic metering program using bpf,
 it works fine on relatevly free net but looses about 30%
 of packets on havy loaded one.
 
 Could any body suggest me something?

A much faster processor?

What kind of CPU/memory/network interface are you using?

-- 
"Where am I, and what am I doing in this handbasket?"

Wes Peters Softweyr LLC
[EMAIL PROTECTED]   http://softweyr.com/


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



Re: Question about file write????

2000-05-17 Thread Joy Ganguly

Alfred Perlstein wrote:

 bcopy should be using the hand optimized code, I think you may have
 to explain more of what you're doing if anyone is going to be able
 to help.

well this is what i am doing:

i have a device buffer in contiguous physical memory. i want to write
that buffer into
a file disk. for that ive written a simple ioctl which works similar to
the syscall
write. except that it transfers from kernel space instead of user
space.  my user
program calls this ioctl with the write file descthe ioctl calls
fp-f_ops-fo_write after setting up the uio to do the transfer.

earlier the user code looked like:-

fd=open("/dev/mydev",O_RDONLY);
buf=malloc(BUFSIZE);
read(fd,buf,BUFSIZE);
w_fd=open("foo",O_WRONLY|O_CREAT);
write(w_fd,buf,BUFSIZE);

now the user program looks like:

fd=open("/dev/mydev",O_RDONLY);
ioctl(fd, MYDEVREAD, size);
w_fd=open("foo",O_WRONLY|O_CREAT);
ioctl(w_fd,MYDEVWRITE,size);

as a result of this the copy involved in the first read is eliminated.
but it takes
longer to do the 2nd ioctl than to do the write.

if this does not explain what i am doing please let me know.

thanx in advance


 --
 -Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
 "I have the heart of a child; I keep it in a jar on my desk."


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



Re: How to make system Sync

2000-05-17 Thread FTG staff

Alfred Perlstein [EMAIL PROTECTED] stated:
  I had a couple of system out of sync problems.
  
  (1) PCI sync problem:
ATM adapter updates a buffer return pointer and generates intr, 
but when driver pulls out the information that updated by adapter,
some memory in the last piece of the pool is garbage.
  e.g.
head - c010
tail - c0100400
  
c010 - buf0
c014 - buf1
...
c0100100 - bufn
...
c0100160 - bad address or 0
...
  
  If I let driver tsleep() for a while, the problem can be improved.
  So, it looks like that adapter pushed (DMA) the data into memory,
  but not been seen by CPU right way due to the DMA sync issue.
  How can we sync the DMA transaction in BSD?
 
 I think the way you accomplish this is by telling the adapter to
 generate an interrupt when it's completed its DMA operation, you
 seem to be generating interupts at the start instead of the end.

I do not think I have control on when interrupt can be started.
The interrupts are generated when either the # of buffers below
the buffer threshold or the I/O packages greater than I/O threshold.

In Solaris driver, a ddi_dma_sync() routine is used for DMA sync in this case:

#define BCD_FLUSH_CACHE_FOR_HOST(dhandle, offset, length) \
ddi_dma_sync(dhandle, offset, length, DDI_DMA_SYNC_FORKERNEL)

Only thing I am not clear is that reference manual says:

For this adapter, the SDRAM_CTRL register "should" have LB_64_ENB bit set to 1.

There is no further information on this register. I wonder this could cause
the problem since majority PC motherboards have a 32-bit PCI local bus (LB).

-Jin


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



Re: Question about file write????

2000-05-17 Thread Matthew Dillon


:i have a device buffer in contiguous physical memory. i want to write
:that buffer into
:a file disk. for that ive written a simple ioctl which works similar to
:the syscall
:write. except that it transfers from kernel space instead of user
:space.  my user
:program calls this ioctl with the write file descthe ioctl calls
:fp-f_ops-fo_write after setting up the uio to do the transfer.
:
:earlier the user code looked like:-

I think it would be a whole lot easier to implement mmap() on the
device, then allow the user process to mmap() the device buffer 
and read() and write() it directly.  I don't think you need to
implement any ioctl's for this problem.

fd = open device
ptr = mmap(...)

fd = open file
read(fd, ptr, BUFSIZE)  read from file, store into device buf
...
write(fd, ptr, BUFSIZE) read from device buf, store into file

-Matt



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



Cisco Port Grouping w/FreeBSD

2000-05-17 Thread Yann Ramin

Hi,

I have a question for the networking gurus out there.  How exactly would you
configure a FreeBSD machine connected to a Cisco switch with port grouping on
two Ethernet channels?  

Also, for future reference, the funny network delays on the switched network
were solved.  It turns out if you force the switch to 100/full on the port, the
Intel PRO 100/B card will run at 100/half, since it assumes the switch is a
non-autonegotiating hub.  Use auto select on both sides works very well.

Yann


-- 


Yann Ramin  [EMAIL PROTECTED]
Atrus Trivalie Productions  www.atrustrivalie.eu.org
irm.it.montereyhigh.com
Monterey High ITwww.montereyhigh.com
ICQ 46805627
AIM oddatrus
Marina, CA  

"All cats die.  Socrates is dead.  Therefore Socrates is a cat."
- The Logician

# fortune
"To be responsive at this time, though I will simply say, and therefore
this is a repeat of what I said previously, that which I am unable to
offer in response is based on information available to make no such
statement."



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



Re: smb printer trouble

2000-05-17 Thread James Halstead

I know it is happening because of the ``read firstline'' command. It is
using the standard shell way
of continuing a line using the '\' char and applying that to the input. That
explains why only the first
line is effected.

Actually, if there is a way that I can read only the first two chars from
the standard input that would
solve the problem for nearly all the cases. I only need the first two chars
to do my test, then I can leave the rest up to cat. It would be even better
if sombody could tell me a way to push chars back on to the stdin stream
that way I can completly avoid making a temporary file.

Thanks,
James ([EMAIL PROTECTED])

- Original Message -
From: "Koster, K.J." [EMAIL PROTECTED]
To: "'Charlie Root'" [EMAIL PROTECTED]
Cc: "'FreeBSD Hackers mailing list'" [EMAIL PROTECTED]
Sent: Wednesday, May 17, 2000 4:40 AM
Subject: RE: smb printer trouble


 Perhaps there are some invisible spaces after some of the backslashes?

 Kees Jan

 ==
  You are only young once,
   but you can stay immature all your life


  -Original Message-
  From: Charlie Root [mailto:[EMAIL PROTECTED]]
  Sent: dinsdag 16 mei 2000 20:39
  To: [EMAIL PROTECTED]
  Subject: smb printer trouble
 
   begin smb-filter 
  #!/bin/sh
  
  # Input filter to print to a NT print queue, requires smbclient.
  #
  # Author: James Halstead, e-mail: [EMAIL PROTECTED]
  #
  # Read stdin to a temp, make sure to determine the print
  type, then use
  #   smbclient to print to the nt queue.
  
 
  SERVER=SERVER NAME
  PRINTER=cwPRINTER NAME
  TEMP=/tmp/smbprint
 
  TEMP=`mktemp -q $TEMP.XX`
 
  read firstline
  first_two=`expr "$firstline" : '\(..\)'`
 
  if [ "$first_two" != "%!" ]; then
printf "\033k3G"  $TEMP
  fi
 
  #lets see, copy the firstline to temp, cat the rest to the temp,
  # make one ugly command to print the file to the smb printer then
  # rm the temp file.
 
  echo "$firstline"  $TEMP  cat  $TEMP \
  /usr/local/bin/smbclient $SERVER\\$PRINTER -UGUEST -N\
   -c"print $TEMP" \
  rm -f $TEMP /dev/null  exit 0
 
  exit 1
   end smb-filter 




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



boot/kernel debugging

2000-05-17 Thread J McKitrick

I've used softice for debugging under windows, and i was wondering if gdb
offers similar capabilities.  It seems the best way to debug the ECP
parallel port problem is to step through the code during the boot phase.
Can this be done, or is there too much timing-critical stuff going on then?

jm
-- 
---
Jonathon McKitrick -- [EMAIL PROTECTED]   
I am a bomb technician.  If you see me running, try to keep up.
---


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



modules and newbus

2000-05-17 Thread Adam

I got the impression that newbus would make it easier to make kernel
modules out of things.  What in general does it take to make something
into a kld?  I'm thinking of pcm for example.  



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



Re: leaking sockets (closure)

2000-05-17 Thread Bosko Milekic


Hi Mike,

On Wed, 17 May 2000, Mike Silbersack wrote:

 Heh, that's sorta neat, I guess.  It'll be interesting to find out if the
 leak is due to the mbuf waiting in some way, or a totally unrelated bug
 we're tickling.  I'd almost guess the latter.

I finally peeked at the tcp_timer stuff and quickly realized:

`grep keepalive /etc/defaults/rc.conf'

or, equivalently,

`sysctl -A | grep keepalive'

should quickly make things clear... :-)

Notice the explicit initialization of always_keepalive to zero in
  tcp_timer.c, which is what at first glance tripped me off.

(I have re-simulated the exhaustion and all seems fine).

 -Bosko

--
 Bosko Milekic * pages.infinit.net/bmilekic/index.html * www.technokratis.com
 [EMAIL PROTECTED] * [EMAIL PROTECTED] * [EMAIL PROTECTED]

 "Give a man a fish and he will eat for a day. Teach him how
  to fish, and he will sit in a boat and drink beer all day."




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



Re: modules and newbus

2000-05-17 Thread Andrew Reiter


Just as a quite spot note... Im near completion on my KLD programming
tutorial... Just got to push out a section or two more and then wait for a
review and it will be ready for relaease.  This will/should help many with
their general questions regarding how to write KLDs and hopefully willhelp
with questions regarding "is it useful to write a KLD"..

Thanks

andrew

On Thu, 18 May 2000, Adam wrote:

|I got the impression that newbus would make it easier to make kernel
|modules out of things.  What in general does it take to make something
|into a kld?  I'm thinking of pcm for example.  
|
|
|
|To Unsubscribe: send mail to [EMAIL PROTECTED]
|with "unsubscribe freebsd-hackers" in the body of the message
|

-
Andrew Reiter[EMAIL PROTECTED] 
Computer Security Engineer 



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



Musings on ip checksumming

2000-05-17 Thread Dave Preece

I'm trying to write a simple static NAT, and have got a bit stuck with the
new checksum in the IP header thing with me is that I'm not happy about
something till I understand it (and it appears that the IP stack is well
behaved and won't send something unless the IP checksum is right either).

Looking into ping.c for an example we have a checksum calculator (in_cksum)
that I have been trying to understand. It takes a header and adds all the 16
bit words to a 32 bit acumulator. Fine. It then takes the top 16 bits and
adds them to the bottom 16, (adding an additional one if this operation
itself takes the resulting number to 17). Not what I understand as a
checksum, but none the less a perfectly valid algorithm.

What I *don't* understand is this: The routine appears to be written as if
would only work on a big endian system i.e. this would only work if
u_short's and int's were stored most significant byte first. This impression
is further underscored by using  16 to fold the top 16 bits into the lower
16 bits. The pile of htons calls and ntohs calls I was expecting to see is
simply not there.

So, how come it works?

Dave :)  (but a bit confused)


Ref: 
/usr/src/sbin/ping/ping.c
/usr/src/lib/libalias/alias_local.h  (ADJUST_CHECKSUM)



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