kqueue

2002-09-25 Thread Michel Oosterhof


Hello.

Recently I started looking into kqueue(2), and to get to know the
interface better I attempted to turn usr.sbin/moused into a kqueue
program (replacing the main select() loop that reads the mouse
device).

Now I thought I understood the interface, I requested a kqueue, but
as soon as I add an event for monitoring I get an 'Operation not
permitted' error.  Does anyone know if this is caused because
kqueue() only supports FFS? The mouse device is on devfs (I'm running
-CURRENT, btw).

I've got one more question, actually a fact that surprises me, it
seems that tail(1) is the only place in the base system that actually
uses kqueue. Is there a reason for this? I read in most places
kqueue() is more efficient, scalable, etc. I'm sure code like ftpd
or other services would benefit. (And i'm sure Apache could use it
too).

michel

(I'm having some problems with my news reader software, or rather the
news posting software, so similar messages may appear).

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



Re: 3.5GB memory limit?

2002-09-25 Thread Danny Braniss


> It's chipset, not CPU specific.  Your question is like asking if,
> because your Yugo (car) can't go faster than 100 KPH on one brand
> of gasoline, if it's a gasoline problem.
> 
I get the point, though the example of the Yugo is missleading, some
'brands' tend to mix the gasoline, (diesel + kerosene) or sell you 94 Octane
instead of 96, or just add water, and the car will not drive 'so well' :-)

danny



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



Re: Hey, is there space for a newbie? =)

2002-09-25 Thread Bruce M Simpson

On Tue, Sep 24, 2002 at 01:46:03PM -0600, Ronald G Minnich wrote:
> or get freebsd loadable from linuxbios (http://www.linuxbios.org). We load
> plan 9 and WinCE, so how much does freebsd need?

Anyone looked at OpenBIOS? The line has to be drawn somewhere... as regards
supporting multiple chipsets/CPUs. Personally I like the idea of being able
to do PXE-like booting on non-Intel platforms.

BMS

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



Re: Hey, is there space for a newbie? =)

2002-09-25 Thread Bruce M Simpson

On Tue, Sep 24, 2002 at 12:32:40PM -0700, Nate Lawson wrote:
> How about updating Alpine (alpine.cs.washington.edu) and fixing a lot of
> its lousy hacks (i.e. the sysinit stuff)?

Nice idea, but a lot of people will/are use/using Bochs or VMware for this.
Mind you, the Alpine approach doesn't require as much other crap (vmnet,
vmmon, et al) to operate. And tun(4) could be used as a faux ethernet driver.

> Zero copy BPF?

This is a seriously nice idea; but won't it require user-space applications
to allocate their buffers on page boundaries (assuming MMU page tricks are
one underlying mechanism to avoid copies) ?

> Port the Linux Rockwell/Conexant winmodem support to freebsd?  (Tons of
> laptops have this chipset).
>   http://www.mbsi.ca/cnxtlindrv/

I had a brief look at this last month. I should warn you that the Linux
driver is simply a wrapper. The actual software modem is a Linux object
with encrypted symbols which is linked in to the wrapper to provide the
loadable softmodem module. I didn't get further than that - but I imagine
that there must be some way to convert the module to something which
could be linked in to a corresponding FreeBSD .ko.

BMS

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



Re: Hey, is there space for a newbie? =)

2002-09-25 Thread Daniel O'Connor

On Wed, 2002-09-25 at 18:50, Bruce M Simpson wrote:
> > Port the Linux Rockwell/Conexant winmodem support to freebsd?  (Tons of
> > laptops have this chipset).
> >   http://www.mbsi.ca/cnxtlindrv/
> 
> I had a brief look at this last month. I should warn you that the Linux
> driver is simply a wrapper. The actual software modem is a Linux object
> with encrypted symbols which is linked in to the wrapper to provide the
> loadable softmodem module. I didn't get further than that - but I imagine
> that there must be some way to convert the module to something which
> could be linked in to a corresponding FreeBSD .ko.

There are a few ports which do things like this - 
comms/mwavem
comms/ltmdm
audio/aureal-kmod

And of course VMWare.

-- 
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
GPG Fingerprint - 9A8C 569F 685A D928 5140  AE4B 319B 41F4 5D17 FDD5


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



Re: kqueue

2002-09-25 Thread David Malone

On Wed, Sep 25, 2002 at 10:12:53AM +0200, Michel Oosterhof wrote:
> I've got one more question, actually a fact that surprises me, it
> seems that tail(1) is the only place in the base system that actually
> uses kqueue.

It is also used in libc for the DNS resolver.

> Is there a reason for this? I read in most places
> kqueue() is more efficient, scalable, etc.

Probably lack of time to convert more programs. I suspect that inetd
or syslogd might benefit from kqueueing, but I guess the real gains
would be in applications like apache.

David.

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



Re: mbuf chain

2002-09-25 Thread Giorgos Keramidas

On 2002-09-24 13:57, Prafulla Deuskar <[EMAIL PROTECTED]> wrote:
> All,
>
> Is there a pre-set limit on maximum number of fragments in a
> mbuf chain ?

Not as a limit of the mbuf chain code, but as a limit of the IP packet
input code.  Look at the description of the ip_maxfragpackets sysctl
value in src/sys/netinet/ip_input.c

It is initialized by default to (nmbclusters / 4) in ip_init().

The relevant code, that enforces the limit, is near the beginning of
the ip_reass() function in the same file.

Giorgos.

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



Re: Hey, is there space for a newbie? =)

2002-09-25 Thread Julian Stacey

> when the time to write my final thesis in my university arrived
> i immediately thought to help in some way the FreeBSD group.

Nice, Thanks !


> -a fs with journaling: some times ago, i would like to develop
> my own fs with journaling, but right now i could even drop the
> dream of my own fs and JUST port the xfs/jfs for FreeBSD..

Journaling would support user level "Undelete" I presume ?  That would make
BSD more attractive to Micro$oft users, used to the luxury of "Undelete".


> add any other project you 
> think could help the FreeBSD community in general.

An intelligent `learns as it goes' net tool, superior to `fetch' (no
disrespect to fetch intended),  with per host local database to
extend memory of net performance over weeks/months, that learns
where it is, which are it's fast routes, & minimum response times
to servers, where major servers are, & which are heavily/lightly
loaded, when in the day/week; to make intelligent decisions where
to go for ports distfiles, - capable by default of totaly automatic
self initialisation, (though initial hints from human should also
be allowed).

Julian Stacey   [EMAIL PROTECTED]   Computer Sys. Eng. & Unix Consultant, Munich
Ihr Rauchen = mein allergischer Kopfschmerz !  Schnupftabak probieren.

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



Re: Hey, is there space for a newbie? =)

2002-09-25 Thread Ronald G Minnich

On Wed, 25 Sep 2002, Bruce M Simpson wrote:

> Anyone looked at OpenBIOS? The line has to be drawn somewhere... as regards
> supporting multiple chipsets/CPUs. Personally I like the idea of being able
> to do PXE-like booting on non-Intel platforms.

sure, and it will probably run on top of linuxbios.

we're working with them.

ron


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



Re: kqueue

2002-09-25 Thread vijay singh

Hi, this is in no way related to the kqueue question asked below but to
event notification mechanisms in general. I was wondering if there is
some paper or design that talks about how such a facility could be
provided in a Unix type kernel. Kqueue is fairly recent, and I dont know
what its requirements are but I'm thinking of providing this for an old
2.x FreeBSD system. Any ideas, pointers or suggestions are appreciated.

vijay

Michel Oosterhof wrote:
> 
> Hello.
> 
> Recently I started looking into kqueue(2), and to get to know the
> interface better I attempted to turn usr.sbin/moused into a kqueue
> program (replacing the main select() loop that reads the mouse
> device).
> 
> Now I thought I understood the interface, I requested a kqueue, but
> as soon as I add an event for monitoring I get an 'Operation not
> permitted' error.  Does anyone know if this is caused because
> kqueue() only supports FFS? The mouse device is on devfs (I'm running
> -CURRENT, btw).
> 
> I've got one more question, actually a fact that surprises me, it
> seems that tail(1) is the only place in the base system that actually
> uses kqueue. Is there a reason for this? I read in most places
> kqueue() is more efficient, scalable, etc. I'm sure code like ftpd
> or other services would benefit. (And i'm sure Apache could use it
> too).
>

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



URGENT ASSISTANCE IS NEEDED

2002-09-25 Thread edward mulete

Good day, I am Edward Mulete JR. the son of Mr. 
 STEVE MBEKI MULETE from Zimbabwe. I am sorry this mail
 will surprise you, though we do not know, my mother Mrs. Clara 
 got your contact through the International Chamber of Commerce.
 Due to the current war against white farmers in
 Zimbabwe and the support of President Robert Mugabe to
 claim all white owned farms in our country to gain
 favor for re-election.
 
 All white farmers were asked to
 surrender their farms to the government for
 re-distribution and infact to his political party
 members and my father though black was the treasury
 of the farmers association and a strong member of an
 opposition party that did not support the president
 idea. He then ordered his party members and the police
 under his pay row to invade my father's farm and burn
 down everything in the farm. They killed my
 father and took away a lot of items from his farm.
 After the death of my father, our local pastor and a
 close friend of my father handed us over will
 documents with instructions from my father that we
 should leave Zimbabwe incase anything happen to him. The will 
 documents has a certificate of deposit, confirming a deposit
 kept in custody for us in a security company unknown
 to the company that the content is money hence it was deposited as 
 personal belongings and ensure that we do not remain here as we could
 easily be found by his enemies. The total amount is
 US$21.5M.We are therefore soliciting for
 your assistance to help us move the fund out of
 Zimbabwe, as our fate and future is far from
 reality, hence this mail to you. The president's present ban of
 International Press into Zimbabwe and the drop from office of the 
 Finance Minister to avoid giving white farmers fund Transfer
 clearance above US$1M is just a few of the
 unthinkable things he is committing in my Country.
 I have tried to reach my father's close friend Mr.
 John Casahans from Australia also a farmer who was
 leaving in Zimbabwe with us but left with his family
 late last year following this ugly development to no
 avail.
 Should you be interested to help us, contact me
 immediately via email for easy communication and I
 will furnish you with the time frame and modalities of
 the transaction. We have concluded a wonderful plan of 
 caring out the transfer within two weeks. Please note that 
 this transaction is100% confidential and risk free and will 
 not endanger you or us in any way. We have resolved to give you 20%
 of the total sum upon confirmation of the fund in any
 account of your choice were the incident of taxation
 will not take much tool on the money and we look
 forward to coming over to your country to invest our
 share and settle there. I am arranging for a private
  phone so that our conversation can be
 100% confidential.
Please do not use the reply button, reply only to 
 
[EMAIL PROTECTED] Please take note.
 
 
 God bless you indeed as you help yourself and us.
 
 
 Mr. EDWARD MULETE


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



Problems with NATd performance...

2002-09-25 Thread Cody Swanson

Hello all,

I just setup a 4.6.2 machine locally on my network at home to replace an
aging Linux NAT box I had going. Clients behind the new box can only get
100k/sec downloads while clients behind the old Linux box (running ipchains)
get 400k/sec+ downloads off the same cable modem. Locally on the new FreeBSD
box I can get 400k/sec downloads with lynx, it just seems as if the NAT is
not framing packets right. Also, I have tried downloads from other freeBSD
machines, Linux machines and windows2000 machines from inside the network.
All max out at around 100k/sec on a download. Again, if I download on the
box it self I can see 400k/sec.

The machine is a PIII500 with 512mb ram. I have a 3com 3c905 nic for the
internal LAN and a D-Link 530TX revA card for the external link to my cable
modem. I rebuilt the GENERIC kernel with the following options:

options IPFIREWALL
options IPDIVERT

And I added the following lines to rc.conf (as noted in the handbook)

gateway_enable="YES"
kern_securelevel_enable="NO"
ifconfig_xl0="inet 192.168.1.254  netmask 255.255.255.0"
ifconfig_vr0="DHCP"
firewall_enable="YES"
firewall_type="OPEN"
natd_enable="YES"
natd_interface="vr0"
natd_flags=""

Also, here is a copy of an ifconfig of the internal interface:

pinky# ifconfig -xl0

  xl0: flags=8843 mtu 1500
inet 192.168.1.254 netmask 0xff00 broadcast 192.168.1.255
inet6 fe80::260:97ff:fed5:5601%xl0 prefixlen 64 scopeid 0x2
ether 00:60:97:d5:56:01
media: Ethernet autoselect (100baseTX )
status: active

At first I thought this was a windows TCP window size issue, but then when
my freebsd and Linux boxes showed similar results I concluded it's an issue
with my Nat config. Is there anything I can do to increase the throughput? I
heard that 3com 3c905's are not the best card going but I have crappy Dlink
DE220's in my old gateway and they did far more throughput through an old
486DX4.  Any help would be greatly appreciated.




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



Re: Hey, is there space for a newbie? =)

2002-09-25 Thread Dan Nelson

In the last episode (Sep 25), Julian Stacey said:
> > -a fs with journaling: some times ago, i would like to develop my
> > own fs with journaling, but right now i could even drop the dream
> > of my own fs and JUST port the xfs/jfs for FreeBSD..
> 
> Journaling would support user level "Undelete" I presume ?  That
> would make BSD more attractive to Micro$oft users, used to the luxury
> of "Undelete".

You don't need journaling for undelete capability.  When you delete a
file on Netware, the file is simply marked "deleted" but the filename
stays in the directory, and duplicate deleted filenames are allowed. 
When true free disk space gets low, deleted files are purged in the
background, oldest first (I believe).  There is an API for listing,
salvaging, and manually purging deleted files.  I know Netware 3 had
salvage capabilities, and it certainly didn't have a journalling FS :)

You might be able to misuse the Whiteout file type in FFS to present a
similar user interface.  unlink(2) would rename the file to
filename.timestamp and whiteoute it.  ls -W, rm -W, and rm would list,
salvage, and purge, respectively.  Since S_IFWHT is a filetype, you
would have to only allow file deletion, or encode the original filetype
somewhere else.

Alternatively, you could add a file flag equivalent to whiteout. 
"invisible" or something, and use chflags to salvage.

-- 
Dan Nelson
[EMAIL PROTECTED]

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



Re: periodic(8)-produced diffs

2002-09-25 Thread Roman Neuhauser

# [EMAIL PROTECTED] / 2002-09-23 16:10:59 +0100:
> On Mon, Sep 23, 2002 at 05:05:36PM +0200, Roman Neuhauser wrote:
> [... re periodic diffs]
> > And, what would the preferred interface be? Most of periodic.conf
> > knobs are bools, but I'm not sure
> > diff_{context,traditional,unified}_format="{YES,NO}"
> > is better than
> > diff_format="{context,traditional,unified}"
> 
> No reason why rc.conf knobs *have* to be bools, what ultimately
> matters is the case...esac which parses them. I'd avoid relying on a
> default value in /etc/defaults/rc.conf for the sake of robustness.
> 
> I prefer unified diffs, personally.

thanks for your input. another thing I'm not sure about: should this
knob be limited to just setting the diff format? there's also the
possibility of going the rc.conf ${program}_flags path.

i guess the question is whether the interface should be limited to a
safe set of settings, or if the users should be able to shoot
themselves in the foot in any way they want.

quite a few diff switches don't make any sense in the actions
performed by the periodic scripts, but IMO it's root's duty to
choose a reasonable set.

i think i'll try the $diff_program_options route, and post the
patch later today or tomorrow.

-- 
begin 666 nonexistent.vbs
FreeBSD 4.7-RC
5:43PM up 8 days, 58 mins, 18 users, load averages: 0.06, 0.12, 0.07
end

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



Re: Just a wild idea

2002-09-25 Thread Mikko Työläjärvi

On Tue, 24 Sep 2002, Paul Schenkeveld wrote:

> Hi Thomas,
>
> On Tue, Sep 24, 2002 at 01:31:59AM +0200, tho wrote:
> > hi Paul,
> >
> > have you considered using a "file descriptor passing" based technique
> > (section 14.7 of Stevens' UNPv1) ?
> >
> > you may have a process with suser privs which creates file descriptors
> > (e.g. socket bind()ed to a particular address and port) on demand and then
> > passes back the descriptor to the requesting (unprivileged) process through
> > a unix domain socket
>
> I know this technique but the real issue is about many pieces of
> standard software, like BIND named, sendmail, syslogd and so on.
> So this technique, although very usable for new projects, will
> not solve this problem.

As long as the programs are dynamically linked, you can LD_PRELOAD a
wrapper for bind() that passes the socket and address information to
the privileged process that does the actual bind() call and replies
with an errno value.

It works.  I've done it.

  $.02,
  /Mikko

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


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



Re: Hey, is there space for a newbie? =)

2002-09-25 Thread Terry Lambert

Dan Nelson wrote:
> You don't need journaling for undelete capability.  When you delete a
> file on Netware, the file is simply marked "deleted" but the filename
> stays in the directory, and duplicate deleted filenames are allowed.
> When true free disk space gets low, deleted files are purged in the
> background, oldest first (I believe).  There is an API for listing,
> salvaging, and manually purging deleted files.  I know Netware 3 had
> salvage capabilities, and it certainly didn't have a journalling FS :)
> 
> You might be able to misuse the Whiteout file type in FFS to present a
> similar user interface.  unlink(2) would rename the file to
> filename.timestamp and whiteoute it.  ls -W, rm -W, and rm would list,
> salvage, and purge, respectively.  Since S_IFWHT is a filetype, you
> would have to only allow file deletion, or encode the original filetype
> somewhere else.
> 
> Alternatively, you could add a file flag equivalent to whiteout.
> "invisible" or something, and use chflags to salvage.


As the author of NXFS (The NetWare for UNIX extended File System)
for Novell in 1993/1994, I can say that things are a little more
complicated than that, when it comes to undelete.

The NetWare undelete functionality, in particular, the ability to
delete multiple files of the same name, required that globbing
take place in the kernel, and that the "deleted" files be marked
not only in the inode, but in the directory space as well.  The
ability to support hard links is particularly problematic, as is
the ability to recover a particular version of the file.

I can pretty much guarantee you that "whiteouts" would not work;
they exist as masking objects, for use in stacking FS's that
overlay the files in an underlying VFS in a stack: they depend
on iterated directory searches for unioned namespaces -- as
opposed to consecutived searches, when whiteouts are not an
allowed option.

The low-space-purge facility is also exhorbitantly expensive,
unless you can maintain parent pointers for all files, so that
you can traverse the entire non-free inode list, and make a
decision that way, and then *delete by inode number*.  This
basically means that the structure of on disk hard links must
change, in order to permit recovery of the removed directory
entry that you want to purge (frankly, it doesn't make a lot of
sense to purge old "deleted" hard links that still have
directory entry links referencing them...).

This would be an interesting problem to solve; it is similar to
the "versioning FS" problem... which has the same need for
kernel globbing for correct implementation (the purge in that
case is manual or based on an ACL limit on the number of versions
of a file which will be maintained, which makes it much easier).


-- Terry

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



Re: kqueue

2002-09-25 Thread Nate Lawson

On Wed, 25 Sep 2002, Michel Oosterhof wrote:
> Hello.
> 
> Recently I started looking into kqueue(2), and to get to know the
> interface better I attempted to turn usr.sbin/moused into a kqueue
> program (replacing the main select() loop that reads the mouse
> device).
> 
> Now I thought I understood the interface, I requested a kqueue, but
> as soon as I add an event for monitoring I get an 'Operation not
> permitted' error.  Does anyone know if this is caused because
> kqueue() only supports FFS? The mouse device is on devfs (I'm running
> -CURRENT, btw).

No, it's a device driver not fs deficiency.  The serial/ps2/whatever
drivers need to add a KNOTE when they have data ready.  Check out
sys/kern/tty.c for a driver that does this.  This is not a difficult
change -- KNOTE would go into psmintr() near the selwakeup.  You also need
to add kqfilter, attach, detach entries (see ttykqfilter, fil_ttyrdetach,
etc.)
 
> I've got one more question, actually a fact that surprises me, it
> seems that tail(1) is the only place in the base system that actually
> uses kqueue. Is there a reason for this? I read in most places
> kqueue() is more efficient, scalable, etc. I'm sure code like ftpd
> or other services would benefit. (And i'm sure Apache could use it
> too).

No time.

-Nate



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



Re: Hey, is there space for a newbie? =)

2002-09-25 Thread Nate Lawson

On Wed, 25 Sep 2002, Bruce M Simpson wrote:
> On Tue, Sep 24, 2002 at 12:32:40PM -0700, Nate Lawson wrote:
> > How about updating Alpine (alpine.cs.washington.edu) and fixing a lot of
> > its lousy hacks (i.e. the sysinit stuff)?
> 
> Nice idea, but a lot of people will/are use/using Bochs or VMware for this.
> Mind you, the Alpine approach doesn't require as much other crap (vmnet,
> vmmon, et al) to operate. And tun(4) could be used as a faux ethernet driver.

It's still useful and can be expanded like usermode Linux.  Having both
the user code calling a socket and tcp_output in the same address space
helps a lot for GDB.  Your approach is also useful.
 
> > Zero copy BPF?
> 
> This is a seriously nice idea; but won't it require user-space applications
> to allocate their buffers on page boundaries (assuming MMU page tricks are
> one underlying mechanism to avoid copies) ?

See options ZERO_COPY.  Similar tricks would be needed.

> > Port the Linux Rockwell/Conexant winmodem support to freebsd?  (Tons of
> > laptops have this chipset).
> >   http://www.mbsi.ca/cnxtlindrv/
> 
> I had a brief look at this last month. I should warn you that the Linux
> driver is simply a wrapper. The actual software modem is a Linux object
> with encrypted symbols which is linked in to the wrapper to provide the
> loadable softmodem module. I didn't get further than that - but I imagine
> that there must be some way to convert the module to something which
> could be linked in to a corresponding FreeBSD .ko.

Yep.  The grunt work is in mapping the FreeBSD kernel services to provide
the expected entries their binary driver wants.

-Nate


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



vmware reads disk on non-sector boundary

2002-09-25 Thread Mark Santcroos

Vmware2 stopped running from both md and ad devices. Virtual disks still
work. It is caused by a read that is not on sector boundary.

Should a program be able to read non-sector sized chunks from a raw disk 
yes or no? What is the desired behaviour?

The fact that this did work, was it a bug or did this come out due to some
other change. The stacktrace from read(2) is below.

Any input welcome, it's about time that vmware runs again on -current.

Mark


dscheck(c7528a70,c0c20800,4,c7528a70,c28f0800) at dscheck
diskstrategy(c7528a70,10,4,c0c20800,c0c2086c) at diskstrategy+0x7f
readdisklabel(c23f4e00,c28f0800,1,c23d4000,c23f4e4c) at readdisklabel+0xb8
dsopen(c2347e00,2000,0,c23d9588,c23d9200) at dsopen+0x1e6
diskopen(c2347e00,1,2000,c23e0cc0,c26c4700) at diskopen+0x15f
spec_open(cdac9a2c,cdac9ac8,c027796b,cdac9a2c,c0911c50) at spec_open+0x150
spec_vnoperate(cdac9a2c,c0911c50,1,100,c23e0cc0) at spec_vnoperate+0x18
vn_open_cred(cdac9bcc,cdac9ccc,0,c26c4700,cdac9cb8) at vn_open_cred+0x3eb
vn_open(cdac9bcc,cdac9ccc,0,1,cdac9b04) at vn_open+0x29
kern_open(c23e0cc0,8048639,0,1,0) at kern_open+0x1e3
open(c23e0cc0,cdac9d10,c,c23e0cc0,3) at open+0x30
syscall(2f,2f,2f,bfbffae4,bfbffaec) at syscall+0x2ca
Xint0x80_syscall() at Xint0x80_syscall+0x1d

-- 
Mark Santcroos  RIPE Network Coordination Centre
http://www.ripe.net/home/mark/  New Projects Group/TTM

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



Re: kqueue

2002-09-25 Thread Terry Lambert

Michel Oosterhof wrote:
> I've got one more question, actually a fact that surprises me, it
> seems that tail(1) is the only place in the base system that actually
> uses kqueue. Is there a reason for this? I read in most places
> kqueue() is more efficient, scalable, etc. I'm sure code like ftpd
> or other services would benefit. (And i'm sure Apache could use it
> too).


I've got local patches here that convert the RPC library to
use kqueue instead of select.

The obvious objection to such changes is that the internals
of the RPC library are sufficiently exposed that there is a
near-dependency on the use of select; if you look at the "rpc"
man page, for example, you will see, among other things:

 fd_set svc_fdset;

 A global variable reflecting the RPC service side's read file
 descriptor bit mask; it is suitable as a template parameter to
 the select(2) system call.  This is only of interest if a service
 implementor does not call svc_run(), but rather does his own
 asynchronous event processing.  This variable is read-only (do
 not pass its address to select(2)!), yet it may change after
 calls to svc_getreqset() or any creation routines.  As well, note
 that if the process has descriptor limits which are extended
 beyond FD_SETSIZE, this variable will only be usable for the
 first FD_SETSIZE descriptors.

Moving to kqueue overcomes this limitation (the actual limitation,
if you read the code in depth, is "32", which is much worse than
the man page implies).  But it also means that programs that have
been written to take advantage of these somewhat arcane and mostly
(in the programming guides) undocumented hooks would no longer
function, without themselves needing to be rewritten to use kqueue.

It's good enough for me to use locally, to permit control and
configuration (e.g. it's very easy to wire SNMP into existing
programs, if they are based on kqueue, and you have an RPC
library that's also based on kqueue), but the loss of the ability
to use other RPC-aware code without rewriting it is mayb too much
for the changes to be generally acceptable to everyone.

It doesn't help that you change one undocumented arcane interface
for replacing the main select loop, with another undocumented,
arcane interface for replacing the kqueue (not *as* arcane; a
kqueue can be registered in a kqueue for events, so that when an
event occurs on the second, you get an event on the first that
allows you to dispatch to a work routine on the second).

-- Terry

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



Re: vmware reads disk on non-sector boundary

2002-09-25 Thread Poul-Henning Kamp

In message <[EMAIL PROTECTED]>, Mark Santcroos writes:
>Vmware2 stopped running from both md and ad devices. Virtual disks still
>work. It is caused by a read that is not on sector boundary.
>
>Should a program be able to read non-sector sized chunks from a raw disk 
>yes or no? What is the desired behaviour?

No.

>The fact that this did work, was it a bug or did this come out due to some
>other change. The stacktrace from read(2) is below.

This hasn't worked for a long time in -current.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD committer   | 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: vmware reads disk on non-sector boundary

2002-09-25 Thread Mark Santcroos

On Wed, Sep 25, 2002 at 07:41:44PM +0200, Poul-Henning Kamp wrote:
> >The fact that this did work, was it a bug or did this come out due to some
> >other change. The stacktrace from read(2) is below.
> 
> This hasn't worked for a long time in -current.

Long as in > 6 months?

By looking at the code history it seems so indeed. Do you have an idea
what might have 'covered' this though?

A fact is that vmware did work up until a few months. I didn't do a binary
search yet. That is last resort...

Mark

-- 
Mark Santcroos  RIPE Network Coordination Centre
http://www.ripe.net/home/mark/  New Projects Group/TTM

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



Re: vmware reads disk on non-sector boundary

2002-09-25 Thread Poul-Henning Kamp

In message <[EMAIL PROTECTED]>, Mark Santcroos writes:
>On Wed, Sep 25, 2002 at 07:41:44PM +0200, Poul-Henning Kamp wrote:
>> >The fact that this did work, was it a bug or did this come out due to some
>> >other change. The stacktrace from read(2) is below.
>> 
>> This hasn't worked for a long time in -current.
>
>Long as in > 6 months?
>
>By looking at the code history it seems so indeed. Do you have an idea
>what might have 'covered' this though?

No idea...

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD committer   | 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: vmware reads disk on non-sector boundary

2002-09-25 Thread Mark Santcroos

[freebsd-emulation@ bcc'ed]

On Wed, Sep 25, 2002 at 07:47:48PM +0200, Mark Santcroos wrote:
> A fact is that vmware did work up until a few months. I didn't do a binary
> search yet. That is last resort...

Anyone running a -current of several months old and using vmware2?
If so, can you please ktrace it and send me the trace.

Thanks alot.

Mark

-- 
Mark Santcroos  RIPE Network Coordination Centre
http://www.ripe.net/home/mark/  New Projects Group/TTM

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



Re: vmware reads disk on non-sector boundary

2002-09-25 Thread Tim Pozar

On Wed, Sep 25, 2002 at 07:52:17PM +0200, Mark Santcroos wrote:
> [freebsd-emulation@ bcc'ed]
> 
> On Wed, Sep 25, 2002 at 07:47:48PM +0200, Mark Santcroos wrote:
> > A fact is that vmware did work up until a few months. I didn't do a binary
> > search yet. That is last resort...
> 
> Anyone running a -current of several months old and using vmware2?
> If so, can you please ktrace it and send me the trace.

Hmm... I am running VMWARE 2.0.4 build 1142 on a FreeBSD 4.6-STABLE
updated and built on Mon Aug 19 16:51:30 PDT 2002.  I am not seeing
this problem.

Tim
-- 
  Snail: Tim Pozar / LNS / 1978 45th Ave / San Francisco CA 94116 / USA
   POTS: +1 415 665 3790  Radio: KC6GNJ / KAE6247
  "A mass in movement resists change of direction. So does the world
  oppose a new idea. It takes time to make up the minds to its value
  and importance. Ignorance, prejudice and inertia of the old retard
  its early progress. It is discredited by insincere exponents and
  selfish exploiters. It is attacked and condemned by its enemies.
  Eventually, though, all barriers are thrown down, and it spreads
  like fire. This will also prove true of the wireless art." 
  - Nikola Tesla in 1908

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



Re: vmware reads disk on non-sector boundary

2002-09-25 Thread Julian Elischer

vmware used the blocking ("b" devices) interface to disks that do
blocking for you.

Some well meaning but misguided individuals removed block devices
without providing an alernate way of doing this. It should be possible
to do the equivalent of a vn device that accepts misalligned
accesses and reblocks them, but I'll leave that to those whose
job it is to finish.

On Wed, 25 Sep 2002, Mark Santcroos wrote:

> Vmware2 stopped running from both md and ad devices. Virtual disks still
> work. It is caused by a read that is not on sector boundary.
> 
> Should a program be able to read non-sector sized chunks from a raw disk 
> yes or no? What is the desired behaviour?

The desired bahaviour is that it works. No programs shouldn't do it,
but they sometimes do, particularly LINUX programs.. (e.g. vmware)
and the chances that we get linux authors to change is really small.
(Particulary vmware who have been particularly stubborn)

> 
> The fact that this did work, was it a bug or did this come out due to some
> other change. The stacktrace from read(2) is below.
> 
> Any input welcome, it's about time that vmware runs again on -current.
> 
> Mark
> 
> 
> dscheck(c7528a70,c0c20800,4,c7528a70,c28f0800) at dscheck
> diskstrategy(c7528a70,10,4,c0c20800,c0c2086c) at diskstrategy+0x7f
> readdisklabel(c23f4e00,c28f0800,1,c23d4000,c23f4e4c) at readdisklabel+0xb8
> dsopen(c2347e00,2000,0,c23d9588,c23d9200) at dsopen+0x1e6
> diskopen(c2347e00,1,2000,c23e0cc0,c26c4700) at diskopen+0x15f
> spec_open(cdac9a2c,cdac9ac8,c027796b,cdac9a2c,c0911c50) at spec_open+0x150
> spec_vnoperate(cdac9a2c,c0911c50,1,100,c23e0cc0) at spec_vnoperate+0x18
> vn_open_cred(cdac9bcc,cdac9ccc,0,c26c4700,cdac9cb8) at vn_open_cred+0x3eb
> vn_open(cdac9bcc,cdac9ccc,0,1,cdac9b04) at vn_open+0x29
> kern_open(c23e0cc0,8048639,0,1,0) at kern_open+0x1e3
> open(c23e0cc0,cdac9d10,c,c23e0cc0,3) at open+0x30
> syscall(2f,2f,2f,bfbffae4,bfbffaec) at syscall+0x2ca
> Xint0x80_syscall() at Xint0x80_syscall+0x1d
> 
> -- 
> Mark SantcroosRIPE Network Coordination Centre
> http://www.ripe.net/home/mark/New Projects Group/TTM
> 
> 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: Hey, is there space for a newbie? =)

2002-09-25 Thread Dan Nelson

In the last episode (Sep 25), Terry Lambert said:
> Dan Nelson wrote:
> > You might be able to misuse the Whiteout file type in FFS to
> > present a similar user interface.  unlink(2) would rename the file
> > to filename.timestamp and whiteoute it.  ls -W, rm -W, and rm would
> > list, salvage, and purge, respectively.  Since S_IFWHT is a
> > filetype, you would have to only allow file deletion, or encode the
> > original filetype somewhere else.
> > 
> > Alternatively, you could add a file flag equivalent to whiteout.
> > "Invisible" or something, and use chflags to salvage.
> 
> As the author of NXFS (The NetWare for UNIX extended File System)
> for Novell in 1993/1994, I can say that things are a little more
> complicated than that, when it comes to undelete.
> 
> The NetWare undelete functionality, in particular, the ability to
> delete multiple files of the same name, required that globbing
> take place in the kernel, and that the "deleted" files be marked
> not only in the inode, but in the directory space as well.  The
> ability to support hard links is particularly problematic, as is
> the ability to recover a particular version of the file.

That's why I included a rename operation as part of unlink(2). :)  That
way there's no globbing problem.  I knew duplicated filenames would
cause problems, and timestamping the filenames makes it easy for the
user to pick which one they want to restore.  It's up to the
implementor to decide whether undelete(2) automatically renames the
file back to the original, I guess.

NSS's implementation is really neat, btw.  Deleted files in deleted
directories stay where they are, instead of moving to DELETED.SAV.  All
that's missing is a "salvage everything deleted between T1 and T2"
command to allow your to recover from rm -rf's.

> The low-space-purge facility is also exhorbitantly expensive, unless
> you can maintain parent pointers for all files, so that you can
> traverse the entire non-free inode list, and make a decision that
> way, and then *delete by inode number*.  This basically means that

Yes; I can't think of an easy way around this.  Parents for all files,
or just deleted ones?  How did NWFS do it?

-- 
Dan Nelson
[EMAIL PROTECTED]

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



usb lexmark X73 problem

2002-09-25 Thread Mathew Kanner

Hello,
I'm not sure which list to send this to.  I'm having problems
with USB and a POS lexmark x73, if I try to send it a job via unlpt0,
it dies very quickly (ulpt0 offline in dmesg) and I have to powercycle
the printer.
However, if kldunload ulpt, and use ugenX.1, everything is OK.

4.6-STABLE FreeBSD 4.6-STABLE #0: Tue Jul 30 01:00:49 EDT

I didn't see any changes to ulpt in current or stable that
would help so I haven't updated the kernel since the end of July.

--Mat

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



Re: vmware reads disk on non-sector boundary

2002-09-25 Thread Mark Santcroos

On Wed, Sep 25, 2002 at 11:29:12AM -0700, Julian Elischer wrote:
> vmware used the blocking ("b" devices) interface to disks that do
> blocking for you.
> 
> Some well meaning but misguided individuals removed block devices
> without providing an alernate way of doing this. It should be possible
> to do the equivalent of a vn device that accepts misalligned
> accesses and reblocks them, but I'll leave that to those whose
> job it is to finish.

Hi Julian,

That was the background info I was looking for. I might try to do the
remapping myself.

Thanks

Mark

-- 
Mark Santcroos  RIPE Network Coordination Centre
http://www.ripe.net/home/mark/  New Projects Group/TTM

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



Re: Hey, is there space for a newbie? =)

2002-09-25 Thread Terry Lambert

Dan Nelson wrote:
> > The NetWare undelete functionality, in particular, the ability to
> > delete multiple files of the same name, required that globbing
> > take place in the kernel, and that the "deleted" files be marked
> > not only in the inode, but in the directory space as well.  The
> > ability to support hard links is particularly problematic, as is
> > the ability to recover a particular version of the file.
> 
> That's why I included a rename operation as part of unlink(2). :)  That
> way there's no globbing problem.  I knew duplicated filenames would
> cause problems, and timestamping the filenames makes it easy for the
> user to pick which one they want to restore.  It's up to the
> implementor to decide whether undelete(2) automatically renames the
> file back to the original, I guess.

The main issue is that you can't put the timestamp into the name;
it can't be a namespace incursion.  And you can't not include it
in the namespace on lookup, or you end up getting the wrong file,
or stopping with a false positive on lookups.

Therefore, a timestamp (assuming that's considered adequate), must
be considered both on iteration, and on other interfaces that
deal with names.


> NSS's implementation is really neat, btw.  Deleted files in deleted
> directories stay where they are, instead of moving to DELETED.SAV.  All
> that's missing is a "salvage everything deleted between T1 and T2"
> command to allow your to recover from rm -rf's.

It's hard to do this... by which I mean computationally expensive.


> > The low-space-purge facility is also exhorbitantly expensive, unless
> > you can maintain parent pointers for all files, so that you can
> > traverse the entire non-free inode list, and make a decision that
> > way, and then *delete by inode number*.  This basically means that
> 
> Yes; I can't think of an easy way around this.  Parents for all files,
> or just deleted ones?  How did NWFS do it?

The way NWFS handles this in the Native NetWare implementation is
to not support the concept of hard links.  The directory entry is
the inode, and the entirety of the directory is cached in RAM (the
reason why you need more RAM when you have larger disks in NetWare).

The way I handeled this in NXFS is by creating a real on-disk node
for hard links, where the data and instance references were seperate,
and maintained a forward and reverse linked list of instances, as
stored on disk, referenced by inode number.

I had to do this so that the FS could be used in UnixWare, Solaris,
and AIX as if it were another regular UNIX FS implementation.

The net effect of this is that each filesystem object, including the
hard links, has its own on disk instance representation.  When you
add or remove a hard link, you increase/decrease the size of the
instance ring for the references.

Because it's a ring, you can arbitrarily select an inode to be "the
primary inode", and then reference it.  A lookup means a reference
from the secondary inodes to the primary, unless the primary is
already there.  If the directory reference to the arbitrary primary
is removed, then you have to do some juggling, so that the next
instance reference is replaced in the directory entry which
references it, and the previous value is removed.  The order of
operation is to swap the instance refrences, and then delete the
directory reference to the (now non-primary) instance.  This lets
you create a DOW (Delayed Ordered Write -- a technology similer in
effect to soft updates) barrier for the operation (in a soft updates
world, it would permit you to create a dependency entry), thus
guaranteeing FS state will not be indeterminate.

It's very easy to sketch, if the verbal description isn't enough.

The hard part was supporting a UNIX, DOS 8.3, and Appletalk namespace,
simultaneously.  8-).

-- Terry

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



Re: kqueue

2002-09-25 Thread Michel Oosterhof

On Wed, Sep 25, 2002 at 10:35:06AM -0700, Terry Lambert wrote:

> The obvious objection to such changes is that the internals
> of the RPC library are sufficiently exposed that there is a
> near-dependency on the use of select; if you look at the "rpc"
> man page, for example, you will see, among other things:
> 
>  fd_set svc_fdset;
> 
>  A global variable reflecting the RPC service side's read file
>  descriptor bit mask; it is suitable as a template parameter to
>  the select(2) system call.  This is only of interest if a service
>  implementor does not call svc_run(), but rather does his own
>  asynchronous event processing.  This variable is read-only (do
>  not pass its address to select(2)!), yet it may change after
>  calls to svc_getreqset() or any creation routines.  As well, note
>  that if the process has descriptor limits which are extended
>  beyond FD_SETSIZE, this variable will only be usable for the
>  first FD_SETSIZE descriptors.

Actually, this is not in my rpc(3) manpage on my -CURRENT system!
I could not find a reference to svc_fdset in any of the -CURRENT manpages.

It is on my -STABLE system however.

regards,

Michel

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



Spark 5.

2002-09-25 Thread Josef Karthauser

Do we run on Spark 5?  Someone's selling one and a monitor for 300 UK
pounds.  Is it worth getting hold of?

Joe
-- 
"As far as the laws of mathematics refer to reality, they are not certain;
and as far as they are certain, they do not refer to reality." - Albert
Einstein, 1921



msg37070/pgp0.pgp
Description: PGP signature


The poor man's cryptfs

2002-09-25 Thread James Gritton

After playing with a few encrypted filesystems, and giving up on them (after
a kernel crash or two), I went looking for something else to encrypt.  The
logical choice is the device.

Well, the virtual device.  Like a cryptfs that's based on a loopback mount,
I'm encrypting a virtual device based on the "vn" driver.  This was only a
few hours' work, though it's admittedly incomplete.  This is based on the
Blowfish code in the kernel used by ipsec and such, which an extra ioctl
added to set the key.  Only three source files require modification:

sys/sys/vnioctl.h:
  Define the VNIOCSETKEY ioctl

usr.sbin/vnconfig/vnconfig.c:
  Add a "-k" option to specify that an encryption key should be entered via
  getpass(), and passed in with the above ioctl.

sys/dev/vn/vn.c
  Add a blowfish key entry to the softc structure.  This is set via the
  above ioctl, which converts a passed-in string into the key data.
  Encryption is done around the vn's VOP_READ and VOP_WRITE calls, in
  512-byte CBC chunks.

That's it - 90 lines of new code.  This is for my purposes complete and
working, which is to say neither is quite true.  For production-quality
code, some work remains:

* The vn.c code is tied to blowfish.  It would be better to have some
  dynamically selectable encryption scheme.  I like blowfish and it's
  available, but others may want something else.  The vnconfig hack doesn't
  contain any mention of an encryption scheme - it just passes a key string.

* It doesn't work with swap-backed vn devices.  It wouldn't be hard to put
  the same encrypt-decrypt wrappers around the vm_pager_strategy() call, or
  perhaps even to merely move the wrappers further out to encompass both
  vnode and object access methods.

* It doesn't work with labels, probably because of some kernel function(s)
  that make their own read/write calls outside of the vnstrategy's own
  VOP_READ and VOP_WRITE.  To build a new filesystem, I had to newfs a
  swap-backed vn and dd it to the encrypted vn.  But then I can mount the
  encrypted vn without worrying about labels.

* It requires the blowfish functions to be linked into the kernel, which I
  accomplished by changing them from "optional ... ipsec" to "standard" in
  the kernel.  I suppose I could have somehoe linked them to vn.ko directly,
  but that seems the wrong way around.  So even though vn is a module, it
  requires a kernel recompile to use it, unless you're running ipsec or
  ipv6.

The diffs for what I have are small.  If someone wants to make it (more)
complete, the further diffs should be small as well.

- Jamie





--- sys/sys/vnioctl.h.orig  Wed Sep 25 16:38:53 2002
+++ sys/sys/vnioctl.h   Tue Sep 24 22:17:26 2002
@@ -68,6 +68,9 @@
 #define VNIOCGCLEAR_IOWR('F', 3, u_long )  /* reset --//-- */
 #define VNIOCUSET  _IOWR('F', 4, u_long )  /* set unit option */
 #define VNIOCUCLEAR_IOWR('F', 5, u_long )  /* reset --//-- */
+#ifdef VNCRYPT
+#define VNIOCSETKEY_IOW('F', 47, char * )  /* set key */
+#endif
 
 #define VN_LABELS  0x1 /* Use disk(/slice) labels */
 #define VN_FOLLOW  0x2 /* Debug flow in vn driver */
--- usr.sbin/vnconfig/vnconfig.c.orig   Wed Sep 25 16:38:38 2002
+++ usr.sbin/vnconfig/vnconfig.cWed Sep 25 16:43:44 2002
@@ -88,6 +88,9 @@
 #define VN_RESET   0x200
 #define VN_TRUNCATE0x400
 #define VN_ZERO0x800
+#ifdef VNCRYPT
+#define VN_SETKEY  0x1000
+#endif
 
 int nvndisks;
 
@@ -118,7 +121,11 @@
char *s;
 
configfile = _PATH_VNTAB;
+#ifdef VNCRYPT
+   while ((i = getopt(argc, argv, "acdef:gkr:s:S:TZL:uv")) != -1)
+#else
while ((i = getopt(argc, argv, "acdef:gr:s:S:TZL:uv")) != -1)
+#endif
switch (i) {
 
/* all -- use config file */
@@ -154,6 +161,13 @@
global = 1 - global;
break;
 
+#ifdef VNCRYPT
+   /* set key */
+   case 'k':
+   flags |= VN_SETKEY;
+   break;
+#endif
+
/* reset options */
case 'r':
for (s = strtok(optarg, ","); s; s = strtok(NULL, ",")) {
@@ -399,6 +413,18 @@
dev, vnio.vn_size, file
);
}
+#ifdef VNCRYPT
+   if (flags & VN_SETKEY) {
+   char *key;
+
+   /* Read an encryption key and set it */
+   key = getpass("key: ");
+   if (!key[0])
+   key = NULL;
+   if (ioctl(fileno(f), VNIOCSETKEY, &key))
+   warn("VNIOCSETKEY");
+   }
+#endif
/*
 * autolabel
 */
--- sys/dev/vn/vn.c.origWed Sep 25 16:39:19 200

Re: Spark 5.

2002-09-25 Thread Brooks Davis

On Thu, Sep 26, 2002 at 12:09:47AM +0100, Josef Karthauser wrote:
> Do we run on Spark 5?  Someone's selling one and a monitor for 300 UK
> pounds.  Is it worth getting hold of?

A Sparc 5 is a 32-bit machine (approximatly equivalent to a 90Mhz
Pentium) so no.  If you ment's an Ultra5, that's a PCI UltraSPARC so we
do run on those.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4



msg37072/pgp0.pgp
Description: PGP signature


Re: vmware reads disk on non-sector boundary

2002-09-25 Thread Josef Karthauser

On Wed, Sep 25, 2002 at 11:29:12AM -0700, Julian Elischer wrote:
> vmware used the blocking ("b" devices) interface to disks that do
> blocking for you.
> 
> Some well meaning but misguided individuals removed block devices
> without providing an alernate way of doing this. It should be possible
> to do the equivalent of a vn device that accepts misalligned
> accesses and reblocks them, but I'll leave that to those whose
> job it is to finish.

I thought that we hacked around this in the linuxulator 18 months ago
by transparently converting block calls into character calls behind the
scenes.  Either this has been removed or something else is wrong.

Joe
-- 
"As far as the laws of mathematics refer to reality, they are not certain;
and as far as they are certain, they do not refer to reality." - Albert
Einstein, 1921

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



perceived strangeness with getopt(1,3)

2002-09-25 Thread Matthew Emmerton

Maybe I'm missing something huge, but getopt(1,3) aren't working the way I
think they should.

I have a script that I want to take two options, both of which have required
arguments.

gabby# getopt k:s: -k
getopt: option requires an argument -- k
 --
gabby# getopt k:s: -s
getopt: option requires an argument -- s
 --
gabby#

Ok, so far, so good.  But now let's combine them:

gabby# getopt k:s: -k arg1 -s arg2
 -k arg1 -s arg2 --

Ok, looks fine.

gabby# getopt k:s: -k -s
 -k -s --
gabby#

Wha?  Neither of these options specified arguments!  I guess you could
consider that -k's argument was '-s', but I was pretty sure that an option's
argument couldn't start with a dash character (to avoid the ambiguity that
I'm hitting right now.)

I'm pretty sure I'm the one that's confused (not getopt), since I get the
same behaviour on -STABLE and -CURRENT.  Can someone tell me how to
accomplish what I want to do?  Basically, I want this:

gabby# getopt k:s: -k arg1 -s
getopt: option requires an argument -- k
 -k arg1 --
gabby# getopt k:s: -k -s arg2
getopt: option requires an argument -- k
 -s arg2 --
gabby#

--
Matt Emmerton


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



Re: Spark 5.

2002-09-25 Thread Mark Valentine

> From: [EMAIL PROTECTED] (Josef Karthauser)
> Date: Thu 26 Sep, 2002
> Subject: Spark 5.

> Do we run on Spark 5?  Someone's selling one and a monitor for 300 UK
> pounds.  Is it worth getting hold of?

Not for FreeBSD (sun4u only, I believe); SPARC 5 is sun4m (32-bit only).

£300 is expensive - a 170MHz SPARCstation 5 goes for £75 and up on eBay
in the UK (without monitor), and I think a monitor will go for about £40.

The 70MHz and 85MHz(?) models are much slower due to cache, but I've heard
that Linux has had problems with the 170MHz model.

Solaris 9 is rather sluggish on my 85MHz system, but OpenBSD and NetBSD
run OK on my 70MHz system.

The 170MHz SPARCstation 5 was Sun's last decent mid-range workstation.

I've bought SPARCstation 5 bits from Ian at www.13w3.com - you can get
better prices on eBay if you're patient, but I'm pleased with his service.
He's currently listing a SPARC 5 for £125, 17" monitor for £65.

For FreeBSD you'd want an Ultra 1 at least - 13w3.com has a 170MHz model
listed at £225, but there were problems with Solaris 64-bit kernels on
anything less that the 200MHz model (and you have to force the 200MHz
model to boot 64-bit Solaris due to a CPU bug which allows users to
crash them).  Also, you should get the 'E' suffix models for the fast
Ethernet and wide SCSI.  

The Ultra 5 is more expensive and faster, but it's PC class, not a real
Sun.

Cheers,

Mark.

-- 
Mark Valentine, Thuvia Labs <[EMAIL PROTECTED]>   
"Tigers will do ANYTHING for a tuna fish sandwich."   Mark Valentine uses
"We're kind of stupid that way."   *munch* *munch*and endorses FreeBSD
  --   

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



Re: The poor man's cryptfs

2002-09-25 Thread Daniel O'Connor

On Thu, 2002-09-26 at 08:52, James Gritton wrote:
> After playing with a few encrypted filesystems, and giving up on them (after
> a kernel crash or two), I went looking for something else to encrypt.  The
> logical choice is the device.

Have you seen ports/security/vncrypt?

I use ports/security/cfs which uses a loopback NFS server to decrypt a
backing directory for you. It is nice because it expands on the fly but
it isn't a speed demon.

> Well, the virtual device.  Like a cryptfs that's based on a loopback mount,
> I'm encrypting a virtual device based on the "vn" driver.  This was only a
> few hours' work, though it's admittedly incomplete.  This is based on the
> Blowfish code in the kernel used by ipsec and such, which an extra ioctl
> added to set the key.  Only three source files require modification:
> 
> sys/sys/vnioctl.h:
>   Define the VNIOCSETKEY ioctl
> 
> usr.sbin/vnconfig/vnconfig.c:
>   Add a "-k" option to specify that an encryption key should be entered via
>   getpass(), and passed in with the above ioctl.
> 
> sys/dev/vn/vn.c
>   Add a blowfish key entry to the softc structure.  This is set via the
>   above ioctl, which converts a passed-in string into the key data.
>   Encryption is done around the vn's VOP_READ and VOP_WRITE calls, in
>   512-byte CBC chunks.
> 
> That's it - 90 lines of new code.  This is for my purposes complete and
> working, which is to say neither is quite true.  For production-quality
> code, some work remains:

Impressive :)

-- 
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
GPG Fingerprint - 9A8C 569F 685A D928 5140  AE4B 319B 41F4 5D17 FDD5


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



Slow I/O responsiveness with UDMA133

2002-09-25 Thread Sean Farley

I have a Soltek 75DRV5 (VIA 8233a) and a Maxtor 6L080L4.  The problem I
am having is with poor performance with ATA-133.  My ATA-33 system beats
it.

After building a new system, I noticed that it was less responsive when
it came to I/O concerning the hard drive.  The standard XFree86 source
extraction would slow down anything else that tried to access something
off of the drive.  It could take at least 10-20 seconds for a login
attempt from the console to prompt for the password after I entered the
user ID.

On my old system this was not the case.  It would slow down the system,
but it would be much more responsive.  In both cases the write cache was
disabled.  I have fiddled with the BIOS without success.  I even tried
changing the PCI latency on different PCI devices to see if kern/32338
may be effecting me.

To imitate the problem and get some numbers as well, I have been trying
things out using bonnie++.  I ran "bonnie++ -s 256 -d /usr/tmp/bonnie"
where /usr/tmp/bonnie was an empty directory.

I did not have trouble with my cable being recognized, but I am
beginning to wonder whether the order is impacting performance as the
hard drive is on the secondary controller.  I will be annoyed if that
has been the problem.  I still need to dig the box out and try this.

With write cache enabled it does perform better, but I would like the
new computer to at least equal the old system without it enabled.

Here are some benchmarks on my computers.  I believe the sequential
output is the killer.  atacontrol does show the new system to be using
UDMA133.  Both drives are on a controller by themselves.

Before I get to the benchmarks, I have a ktrace of ls -lF of /usr/bin
during bonnie++.  It shows some long times during the listing.

...
   410 ls   5.497238 CALL  readlink(0xbfbfed20,0xbfbfe91c,0x400)
   410 ls   0.096740 NAMI  "./mailq"
   410 ls   12.262074 RET   readlink 21/0x15
...

If I run it again, I can get it to wait a long time on a different call
like close().

Are these times normal?  For a system giving slower values from bonnie++
than a PIII 450, I would expect even better responsiveness.

--
New System
--
Athlon XP 2100
Maxtor (76345MB  [155114/16/63] at ata1-master UDMA133)
7200 RPM

hw.ata.ata_dma: 1
hw.ata.wc: 0
hw.ata.tags: 0
hw.ata.atapi_dma: 0

Bonnie++ test (w/o write cache)
---
Writing with putc()...done
Writing intelligently...done
Rewriting...done
Reading with getc()...done
Reading intelligently...done
start 'em...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
Version 1.02c   --Sequential Output--
-Per Chr- --Block-- -Rewrite-
MachineSize K/sec %CP K/sec %CP K/sec %CP
System 1   256M 10757  10 10767   3 11188   4
--Sequential Input- --Random-
-Per Chr- --Block-- --Seeks--
K/sec %CP K/sec %CP  /sec %CP
67468  97 468575  99 12770  29
--Sequential Create--
-Create-- --Read--- -Delete--
  files  /sec %CP  /sec %CP  /sec %CP
 16  9880  17 + +++ + +++
Random Create
-Create-- --Read--- -Delete--
 /sec %CP  /sec %CP  /sec %CP
+ +++ + +++ + +++


--
Old System
--
PIII 450
Seagate (27199MB  [55262/16/63] at ata0-master UDMA33)
5400RPM

hw.ata.ata_dma: 1
hw.ata.wc: 0
hw.ata.tags: 0
hw.ata.atapi_dma: 0

Bonnie++ test
-
Writing with putc()...done
Writing intelligently...done
Rewriting...done
Reading with getc()...done
Reading intelligently...done
start 'em...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
Version 1.02c   --Sequential Output--
-Per Chr- --Block-- -Rewrite-
MachineSize K/sec %CP K/sec %CP K/sec %CP
System 2   256M 16246  89 16052  24  7069  14
--Sequential Input- --Random-
-Per Chr- --Block-- --Seeks--
K/sec %CP K/sec %CP  /sec %CP
14597  94 17455  14 462.2   3
--Sequential Create--
-Create-- --Read--- -Delete--
  files  /sec %CP  /sec %CP  /sec %CP
 16  5081  46 + +++ 13559  95
Random Create

Re: The poor man's cryptfs

2002-09-25 Thread James Gritton

"Daniel O'Connor" <[EMAIL PROTECTED]> writes:

> Have you seen ports/security/vncrypt?

   Oops :-).  I never was very good at looking to see what's out there.  It
looks good - it apparently supports different crypto algorithms and isn't
broken WRT labels.  Oh well, I can still call mine the poor man's vncrypt...

- Jamie

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



Re: Slow I/O responsiveness with UDMA133

2002-09-25 Thread Mike Silbersack


On Wed, 25 Sep 2002, Sean Farley wrote:

> With write cache enabled it does perform better, but I would like the
> new computer to at least equal the old system without it enabled.

With all due respect, whether that's a reality isn't your choice, it's the
drive's choice. :)

Does the drive support tagged queueing?  That should give you the benefits
of write caching with a little bit more safety.

Mike "Silby" Silbersack


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



Re: The poor man's cryptfs

2002-09-25 Thread Poul-Henning Kamp

In message <[EMAIL PROTECTED]>, "Daniel O'Connor" 
writes:
>On Thu, 2002-09-26 at 08:52, James Gritton wrote:
>> After playing with a few encrypted filesystems, and giving up on them (after
>> a kernel crash or two), I went looking for something else to encrypt.  The
>> logical choice is the device.
>
>Have you seen ports/security/vncrypt?

Or src/sys/geom/geom_aes ?

I have what I hope is industry-strenght encryption in my development
tree with only a few more issues to straigten out before it hits -current.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD committer   | 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: The poor man's cryptfs

2002-09-25 Thread Daniel O'Connor

On Thu, 2002-09-26 at 14:18, Poul-Henning Kamp wrote:
> >Have you seen ports/security/vncrypt?
> 
> Or src/sys/geom/geom_aes ?

Whoo :)

> I have what I hope is industry-strenght encryption in my development
> tree with only a few more issues to straigten out before it hits -current.

MFC? 8-)

Sounds pretty useful..
How does key management work? (or will work)

-- 
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
GPG Fingerprint - 9A8C 569F 685A D928 5140  AE4B 319B 41F4 5D17 FDD5


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



Re: The poor man's cryptfs

2002-09-25 Thread Poul-Henning Kamp

In message <[EMAIL PROTECTED]>, "Daniel O'Connor" 
writes:
>On Thu, 2002-09-26 at 14:18, Poul-Henning Kamp wrote:
>> >Have you seen ports/security/vncrypt?
>> 
>> Or src/sys/geom/geom_aes ?
>
>Whoo :)
>
>> I have what I hope is industry-strenght encryption in my development
>> tree with only a few more issues to straigten out before it hits -current.
>
>MFC? 8-)

No way ever.

>Sounds pretty useful..
>How does key management work? (or will work)

The focus is on protecting a the physical disk, a good shot will be
taken at not compromising keys in RAM, but protecting those is not
in the scope.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD committer   | 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: perceived strangeness with getopt(1,3)

2002-09-25 Thread M. Warner Losh

In message: <009b01c26500$3f7e91a0$[EMAIL PROTECTED]>
"Matthew Emmerton" <[EMAIL PROTECTED]> writes:
: gabby# getopt k:s: -k -s
:  -k -s --
: gabby#
: 
: Wha?  Neither of these options specified arguments!  I guess you could
: consider that -k's argument was '-s', but I was pretty sure that an option's
: argument couldn't start with a dash character (to avoid the ambiguity that
: I'm hitting right now.)

-k's argument is '-s'

Warner

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



Re: perceived strangeness with getopt(1,3)

2002-09-25 Thread Dan Nelson

In the last episode (Sep 25), Matthew Emmerton said:
> Maybe I'm missing something huge, but getopt(1,3) aren't working the
> way I think they should.
> 
> gabby# getopt k:s: -k -s
>  -k -s --
> gabby#
> 
> Wha?  Neither of these options specified arguments!  I guess you
> could consider that -k's argument was '-s', but I was pretty sure
> that an option's argument couldn't start with a dash character (to
> avoid the ambiguity that I'm hitting right now.)

But then how could you specify a filename argument that starts with a
dash?  If you accept that arguments can start with dashes there is no
ambiguity.
 
> I'm pretty sure I'm the one that's confused (not getopt), since I get
> the same behaviour on -STABLE and -CURRENT.  Can someone tell me how
> to accomplish what I want to do?  Basically, I want this:
> 
> gabby# getopt k:s: -k arg1 -s
> getopt: option requires an argument -- k
>  -k arg1 --

You mean "-- s" here I suppose, since -k does have an argument.  getopt
does this already.

> gabby# getopt k:s: -k -s arg2
> getopt: option requires an argument -- k
>  -s arg2 --
> gabby#

You'll just have to catch that in your switch-processing code, and
print an error if you get an argument that starts with a dash.

case $i in 
  -s )
case $2 in 
  -* )
echo "getopt: option requires an argument -- $i" ; exit 1 ;;
esac
flag_s=$2
shift; shift ;;
  ...
esac

-- 
Dan Nelson
[EMAIL PROTECTED]

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