Re: Driver question

2003-11-10 Thread Bruce M Simpson
Craig,

On Sat, Nov 08, 2003 at 10:11:22PM -0500, Craig StJean wrote:
> I have a prism2 USB wireless device. I've never written drivers before but I have 
> been developing for the past 8 years. Could someone guide me to a website or 
> something that would help me write a USB wrapper for the wi device? I have a copy of 
> the old uwi driver which is now broken so it may help me along the way aswell.

I'd suggest co-ordinating your efforts with Stuart Walsh who wrote the atwi
USB driver. This is for atmel USB parts, but there are certain devices with
the same VID/PIDs which are prism2 USB devices. His code might serve as a
good starting point for you.

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


Re: geom_mirror implementation

2003-11-10 Thread Pawel Jakub Dawidek
On Sun, Nov 09, 2003 at 01:34:50PM -0800, David Schultz wrote:
+> > > > I've played around with GEOM a bit and beefed up geom_mirror, which is
+> > > > already in the tree but not built yet.
+> > > > 
+> > > > You can find the patch at .
+> > > 
+> > > Hmm...I believe geom_mirror is supposed to be an example, and
+> > > geom_ccd is supposed to be the production mirroring implementation.  
+> > > ccd does have its quirks, though...
+> > 
+> > Last time I checked ccd needed to be manually reconfigured to run in
+> > degraded mode and sync is not possible. In my book that's not good
+> > enough for production.
+> > 
+> > Furthermore it would be nice with a mirror implementation that
+> > automatically syncs the mirror after an unclean shutdown.
+> 
+> Yeah, RAID support in FreeBSD is in a rather sorry state right
+> now.  ccd(4) doesn't work with ATAng on my machine without causing
+> panics and data corruption, raidframe is broken in -CURRENT, and
+> vinum tends to lag behind changes and break.  But that doesn't
+> mean that the right solution is to add a *fourth* incompatible
+> RAID implementation.  If there's a good reason ccd(4) is harder to
+> fix than geom_mirror, then you might want to talk to phk about
+> rewriting geom_ccd based on geom_mirror.  I believe scottl and phk
+> have plans to fix raidframe, though, which would address a lot of
+> the present limitations.

Raidframe is going to be fixed by [EMAIL PROTECTED] This is a good news,
but raidframe doesn't fit too good to GEOM infrastructure.
GEOM gives flexibility which is duplicated by RF.

I've start some work on more advance RAID implementation wich should
fit to GEOM just fine. Every RAID level will be a different GEOM class,
but with one configuration utility. All classes will share as many code as
possible to be flexible in adding new RAID levels in futher. Strategy
of choosing disks, failures handle, etc. should be also general. I want to
provide support for many on-disk metadata formats if it will be possible.

The bad news is that it is only a concept, I've only some initial code
and project draft. I hope I'll find time to implement this.

-- 
Pawel Jakub Dawidek   [EMAIL PROTECTED]
UNIX Systems Programmer/Administrator http://garage.freebsd.pl
Am I Evil? Yes, I Am! http://cerber.sourceforge.net


pgp0.pgp
Description: PGP signature


Re: kevent and related stuff

2003-11-10 Thread John-Mark Gurney
andi payn wrote this message on Thu, Oct 30, 2003 at 07:54 -0800:
> * The kevent mechanism doesn't monitor directories in a sufficient way
> to make fam happy. If you change a file in a directory that you're
> watching, unlike imon or dnotify, kevent won't see anything worth
> reporting at all. This means that for directory monitoring, kevent is
> useless as-is. Again, if I wanted to patch kevent to provide this
> additional notification, would others want this?

This is to prevent running out of memory.. one of the great advantages
of kqueue's is that all memory necessary is allocated at the time the
event is posted.  If kevent successfully set your event, then you know
you'll get all instances of the event.

The problem with putting a notify on a directory and having it watch
the children is that file's ATIMES change w/o the directory knowing
about it.  Are you suggesting that files start to know which directory
they are located in?  What happens when you link the same file into the
directory thousands of times?  Do you get the one notification or
thousands of notifications?

The solution to that is to open each file in the directory, and monitor
that.  You also monitor the directory for changes to get notified of
any new or removed files.

As for getting notified of atime, etc, it shouldn't be hard to add a
VN_KNOTE(vp, NOTE_ATTRIB); to ufs_itimes, though you should only post
it if any of the three times get modified.

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: question about user space addressed, mmap, and getting phys address

2003-11-10 Thread John-Mark Gurney
Sean McNeil wrote this message on Sat, Nov 01, 2003 at 14:40 -0800:
> Sorry I am not on the list, but I was hoping someone here might be able
> to help me.  I have a design that I cannot change that does the
> following:
> 
> 1) Calls mmap on a chunk of memory that the device driver uses to DMA to
> a video decoder.
> 
> 2) This chunk of memory is treated as several DMA buffers.  There is an
> ioctl setup to indicate when a section of that memory is being used and
> when it is freed (usage count).
> 
> I need to take the address from the mmap, add an offset, send it through
> an ioctl, and then relate it back to the physical address that it was
> originally mapped from.
> 
> Unfortunately, the address I get from the ioctl is a user-space address
> and when I use vtophys I get back 0.  Is there some other mechanism to
> convert a user-space address to a physical address?
> 
> Any and all help will be greatly appreciated.

I wrote a fucntion for a video encoder card that does this.  I think
passing in physical address is a bad thing, (and svgalib is nice and
mmap's the video frame buffer for you) so I made my driver require
you to pass the address via ioctl pointing to it's local buffer.

The function is a bit long, but look at
http://people.FreeBSD.org/~jmg/zoran-0.5.tar.gz
in the file zoran-0.5/dev/zr/zr_os.c the function verify_contig.

I've stolen that code from other parts of the kernel that do something
similar, but I forget where now.

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: geom_mirror implementation

2003-11-10 Thread John-Mark Gurney
Pawel Jakub Dawidek wrote this message on Mon, Nov 10, 2003 at 09:51 +0100:
> I've start some work on more advance RAID implementation wich should
> fit to GEOM just fine. Every RAID level will be a different GEOM class,
> but with one configuration utility. All classes will share as many code as
> possible to be flexible in adding new RAID levels in futher. Strategy
> of choosing disks, failures handle, etc. should be also general. I want to
> provide support for many on-disk metadata formats if it will be possible.
> 
> The bad news is that it is only a concept, I've only some initial code
> and project draft. I hope I'll find time to implement this.

I think GEOM aware raid is a good idea, though it'd be cool to be able
to support controllers/drives that have an onboard engine.  I've heard
of scsi drives that have an xor engine that can take a block of data,
xor it with the on disk data, write the new data, and pass the xor'd
data to the parity disk.

I've started writing a raid4 style geom module.  I've realized that this
is more complex since blocks can come in at any time, and you have to
be careful.

One thing that I wouldn't mind would be the ability to stick a cache
layer between two GEOM modules.  Could we do this by tricky use of a
vnode or something?  Read caching with a write through cache is a must
if you want decent performance in raid[45] configs.

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: config and opt_*h files, how it works?

2003-11-10 Thread John-Mark Gurney
TSaplin Mikhail wrote this message on Tue, Dec 09, 2003 at 11:25 +0600:
> I want add some my own options to kernel.
> I've add "U04_KOI8R opt_cdunicode.h" to sys/conf/options,
> and #include "opt_cdunicode.h" to source files.
> 
> But when i do make depend, mkdep cant find opt_cdunicode.h
> Whats wrong and how it works?

Did you rerun config?  the opt_*.h files are created by config, so if
you modify the sys/conf/options files you need to rerun config.

Hope this helps.

P.S. You might want to fix the date on your computer.  It's not yet
December.

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: geom_mirror implementation

2003-11-10 Thread Lukas Ertl
On Mon, 10 Nov 2003, Pawel Jakub Dawidek wrote:

> I've start some work on more advance RAID implementation wich should
> fit to GEOM just fine. Every RAID level will be a different GEOM class,
> but with one configuration utility. All classes will share as many code as
> possible to be flexible in adding new RAID levels in futher. Strategy
> of choosing disks, failures handle, etc. should be also general. I want to
> provide support for many on-disk metadata formats if it will be possible.

Having a 'generic' RAID GEOM with individual RAID levels in subclasses
sounds like a very good idea.  The basic difference would be the routine
that splits up IO requests according to the RAID level.

regards,
le

-- 
Lukas Ertl eMail: [EMAIL PROTECTED]
UNIX Systemadministrator   Tel.:  (+43 1) 4277-14073
Vienna University Computer Center  Fax.:  (+43 1) 4277-9140
University of Vienna   http://mailbox.univie.ac.at/~le/
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: EMCsq/SAN

2003-11-10 Thread Danny Braniss
some time ago I asked if there was any experience with EMC/SAN/FiberChanel
under FreeBSD, so for the record:

Qlogic ISP 2300 PCI FC-AL Adapter connected to EMC/Clariion
works, it's faster than any local disk/raids we've tried, but have no numbers
to compare with other OS (Windows/Linux).

danny


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


Re: Update: Debox sendfile modifications

2003-11-10 Thread Igor Sysoev
On Sun, 9 Nov 2003, John-Mark Gurney wrote:

> Igor Sysoev wrote this message on Sun, Nov 09, 2003 at 15:16 +0300:

> > > If you made this a fd transparent operation then I would agree with
> > > it.
> > 
> > The current sendfile() implementation works with sockets only.
> > Well, I agree that such sendfile() implementation is a hack.
> > Nowever this implementation is very usefull in the real world -
> > it allows to minimize a data copy in http and ftp servers.
> > 
> > I just could not figure to myself where can be usefull the
> > high perfomance sendfile() to a pipe.
> 
> It's not so much of how, but optimizing for the general case, not
> the specific case.  I was using pipes as an example, what about for
> coping one fd to another?  Right now cp will try to mmap a 16meg buffer,
> and use that, if it fails, it falls back to a read/write loop.. why
> not do something like copyfd that does it more optimally?
> 
> > I think that it's better to leave sendfile() as a sending to a socket
> > only hack. I believe that any sendfile() generalization (e.g. sending
> > data from a socket to a file) is useless.
> 
> oh? why do you think that is useless?  What about all the applications
> like ftp clients, and wget/fetch/curl that do it on a regular basis?

To notice some perfomance impact of using sendfile() in cp, wget, etc
I need to run simultaneously hundreds of these applications.
To see the perfomance impact of using sendfile() in http or ftp server
I need to serve hundreds of clients. The first case is too rare
while the second one is common for the busy servers.


Igor Sysoev
http://sysoev.ru/en/

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


Re: Driver question

2003-11-10 Thread M. Warner Losh
In message: <[EMAIL PROTECTED]>
Bruce M Simpson <[EMAIL PROTECTED]> writes:
: Craig,
: 
: On Sat, Nov 08, 2003 at 10:11:22PM -0500, Craig StJean wrote:
: > I have a prism2 USB wireless device. I've never written drivers before but I have 
been developing for the past 8 years. Could someone guide me to a website or something 
that would help me write a USB wrapper for the wi device? I have a copy of the old uwi 
driver which is now broken so it may help me along the way aswell.
: 
: I'd suggest co-ordinating your efforts with Stuart Walsh who wrote the atwi
: USB driver. This is for atmel USB parts, but there are certain devices with
: the same VID/PIDs which are prism2 USB devices. His code might serve as a
: good starting point for you.

There's also an OpenBSD wi driver that has a USB attachment.

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


kqueue, NOTE_EOF

2003-11-10 Thread marius aamodt eriksen
hi - 

in order to be able to preserve consistent semantics across poll,
select, and kqueue (EVFILT_READ), i propose the following change: on
EVFILT_READ, add an fflag NOTE_EOF which will return when the file
pointer *is* at the end of the file (effectively always returning on
EVFILT_READ, but setting the NOTE_EOF flag when it is at the end).

specifically, this allows libevent[1] to behave consistently across
underlying polling infrastructures (this has become a practical
issue).

in openbsd, this was a trivial change in filt_ufsread():

 kn->kn_data = ip->i_ffs_size - kn->kn_fp->f_offset;
+if (kn->kn_data == 0 && kn->kn_sfflags & NOTE_EOF) {
+   kn->kn_fflags |= NOTE_EOF;
+   return (1);
+}
+
 return (kn->kn_data != 0);

(and adding NOTE_EOF to event.h, of course)

what do you think about this?  can it be integrated into netbsd and
freebsd as well?  i have discussed this with provos@, and we seem to
agree this is a viable solution.

thanks,

marius.

[1] http://monkey.org/~provos/libevent

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


Re: Kylix in FreeBSD

2003-11-10 Thread andi payn
On Thu, 2003-11-06 at 06:09, Marco van de Voort wrote:
> > * jasaorp <[EMAIL PROTECTED]> [031031 04:59]:
> > Getting the Kylix IDE to function on FreeBSD has been one of the ongoing
> > hair-pulling tasks I undertake every few months.  The installer alone is
> > a pain in the ass, since it performs "compatibility checks" in such
> > Linux-centric ways as hard-coding /bin/bash into the shell scripts, and
> > searching for shared libraries by name from hard-coded paths.  (GTK
> > especially gives the installer fits because FreeBSD's gtk library has a
> > -x11 at the end of the name.)  But once you work around those issues
> > with some creative symlinking and script editing, the console tools
> > install fairly painlessly.

A while back, someone put together a howto for installing Kylix on
Mandrake (which, despite being a linux distro, also has the "wrong"
names for many libraries, such as gtk-x11). If this is still being
maintained, it might have some useful hints for getting/keeping it
working on FreeBSD.

> If you futs with getting Kylix to run under FreeBSD, don't forget the
> special glibc requirements that some versions of Kylix have. Maybe you
> should probably simply replace the entire /compat userland with the userland
> of a distro that Kylix supprorts _with_ kylix extra patches installed?

I managed to get Kylix sort of working by booting to linux, installing
Kylix, rebooting to FreeBSD, then copying most of /mnt/linux to
/compat/linux. Unfortunately, this also broke nearly all of my other
linux ports 

Is there some documentation on what exactly FreeBSD expects to find
there? For example, if I wanted to build a linux_base-mdk9.2, so I could
more easily run all the binaries I have built/installed on a Mandrake
9.2 system, where would I start?


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