Re: Accessing filesystem from a KLD

2005-07-02 Thread Seb
Andrey Simonenko wrote :
 You got page fault from namei(), which is called from vn_open() to lookup
 a path name.  namei() tries to obtain a reference on current directory for
 the current thread.  This current directory (fd_cdir field) is NULL in
 your kthread.  At this point a page fault in kernel address space is
 generated.

You were right :) It works now.

 Can you change fd_cdir in kthread to rootvnode I don't know, haven't
 checked this yet.  

It works - and that's what NDISulator does. You also need to set fd_rdir.

Thanks !

Mike Silbersack wrote :
 Ask [EMAIL PROTECTED] for his code that does exactly what you're 
 asking for. :)

I've looked at Damien's source, but AFAIK in his driver, the firmware is 
loaded from userspace through an ioctl call on the network interface.

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


Re: hot path optimizations in uma_zalloc() uma_zfree()

2005-07-02 Thread Andriy Tkachuk
I have doubts it will works:

-   item = bucket-ub_bucket[--bucket-ub_cnt];
-1bbe: 66 ff 49 08   decw   0x8(%ecx)
-1bc2: 0f bf 41 08   movswl 0x8(%ecx),%eax
-1bc6: 8b 44 81 14   mov0x14(%ecx,%eax,4),%eax
-1bca: 89 45 f0  mov%eax,0xfff0(%ebp)
+   item = *(--bucket-ub_last);
+1bbe: 8b 51 0c  mov0xc(%ecx),%edx
+1bc1: 8d 42 fc  lea0xfffc(%edx),%eax
+1bc4: 89 41 0c  mov%eax,0xc(%ecx)
+1bc7: 8b 52 fc  mov0xfffc(%edx),%edx
+1bca: 89 55 f0  mov%edx,0xfff0(%ebp)

here even more refereces to memory in your variant.


-   bucket-ub_bucket[bucket-ub_cnt++] = item;
-22b9: 0f bf c2  movswl %dx,%eax
-22bc: 8b 4d 0c  mov0xc(%ebp),%ecx
-22bf: 89 4c 83 14   mov%ecx,0x14(%ebx,%eax,4)
-22c3: 8d 42 01  lea0x1(%edx),%eax
-22c6: 66 89 43 08   mov%ax,0x8(%ebx)
+   *(bucket-ub_last++) = item;
+22b9: 8b 43 0c  mov0xc(%ebx),%eax
+22bc: 8b 55 0c  mov0xc(%ebp),%edx
+22bf: 89 10 mov%edx,(%eax)
+22c1: 83 43 0c 04   addl   $0x4,0xc(%ebx)



- Original Message - 
From: Nikos Ntarmos [EMAIL PROTECTED]
To: ant [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, June 30, 2005 7:31 PM
Subject: Re: hot path optimizations in uma_zalloc()  uma_zfree()


 Hi there.
 
 I wouldn't have gone into this if ant hadn't produced that 10% figure
 for the speed improvement with simply reordering of increments and
 dereferences (although jhb@ reported the speed-up he noticed was much
 less than that).
 
 I attach* a patch that: (i) incorporates ant's exchange of uc_freebucket
 for uc_allocbucket, and (ii) throws away the uma_bucket.ub_cnt counter
 of free bucket entries, in favor of a pointer -- uma_bucket.ub_last --
 to the last free bucket entry. If a simple reordering is capable of
 producing a 10% improvement, this change should do much better, since it
 saves the 'add-' in the 'add-and-dereference' process of using arrays
 and counters. The semantics of the pointer closely follow those of the
 ub_cnt counter: ub_last - ub_bucket should equal the old value of
 ub_cnt.
 
 I grep'ed through the whole source repository and the uses of
 uma_bucket.ub_cnt seem confined within sys/vm/uma_core.c, so this change
 must be quite self-contained -- i.e. the change in the fields of
 uma_bucket doesn't seem to affect any other part of the system. One
 could argue that it may make the code a bit less readable, but it only
 affects uma_core.c, so it may be worth the inconvenience.
 
 I don't have a FreeBSD box around any more, so I can't test this patch.
 Heck, I can't either check it for syntax errors and such, so don't throw
 things at me if this doesn't even compile. Can somebody with the time
 and resources give it a try?
 
 \n\n
 
 * Also online at http://noth.ceid.upatras.gr/Misc/uma_bucket.diff
   to avoid being bitten by mailers auto{wrapp,indent}ing the diff
   content.
 

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


wake on lan support for sis driver (NetSemi chip)

2005-07-02 Thread stsp
Hello,

I have written a patch that teaches the sis driver to put
the NatSemi DP83815 chip into wake on lan mode on system shutdown.

A _very_ sketchy, but working, version, that still includes debugging
related macro craft that won't be in the final version, can be found at
http://stsp.in-berlin.de/wol/

Currently, the patch puts the card into wake on Magic Packet mode,
and leaves it at that. There is no configurability at all.
Ideally, I'd like the wake mode (None (default), Broadcast, Unicast,
Magic Packet, etc) and special things like SecureOn passwords to be
run-time configurable.

The best idea I came up with is defining a set of wake on lan related ioctls,
and adding commands to ifconfig that use them to hand user requests such as
put my card into wake on broadcast mode, please down to the driver.
With such a framework in place, adding wake on lan support for other
cards would only require a driver to implement ioctls that match
wake on lan features supported by the driver/chip, and voila, it's
run-time configurable as well. This design also creates a unified user
interface independent of the underlying driver, pretty much like 'ethtool'
does on linux.

Is there anything wrong with such a design, or does anyone have a better
idea how to make the driver run-time configurable?

I am not aware of any other network driver in the tree that implements
wake on lan. But if there were any, I would of course adapt my patch to
their behaviour.

Any comments on the patch in general are also appreciated (Note that
I've read style(9) by now, and I know that I need to make a few fixes
here and there ;)

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


Re: ICH6R RAID

2005-07-02 Thread Dag-Erling Smørgrav
Gayn Winters [EMAIL PROTECTED] writes:
 Thus to get ICH6R supported on 5.4 I need to load 5.4R onto one drive,
 apply the mk3 patch, recompile, reboot, build a release bootable CD,
 shutdown, reset the hardware to RAID1, and reload from the new CD.  This
 ought to work like it does using 6.0-CURRENT-SNAP004 (which I am now
 happy with).  The suggestion below to avoid sysinstall and craft the
 array by hand doesn't seem to use the hardware RAID1 supported by ICH6R.

I don't quite follow that.

 1.  How exactly do I know when a patch (mk3 in this case) is in a
 release?

by tracking release notes and / or commit logs

 2.  If the above strategy makes sense, how can I get the latest mk3 for
 5.4?

you can't.

 3.  If I'm missing something, e.g. around sysinstall, what am I missing?
 (Sakurada-san suggested using atacontrol create..   to build ar0 with a
 degraded array (that I got to work), but if the above strategy works, I
 think this won't be necessary, unless again I'm missing something!

just configure the array in BIOS before installing.

 4.  I'm leaning towards just using software RAID (gmirror) for this
 system, which must be a production system when it is up. Both 5.4 and
 6.0 look hopeless for different reasons. Thoughts on this?

I don't understand what you mean by hopeless.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]

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


6 current snap 004 troubles

2005-07-02 Thread Lucas Holt
I just attempted to install the last current snap from june on one of  
my systems.  About half way through the bootup process from the cd,  
the kernel dies with a cant divide by zero error.  This occurs a  
little after trying to initialize my first sata drive.  It does a  
connect, disconnect, connect on the device and then i hit the error.   
Is there a useful way to save the dmesg output without using a serial  
cable?  (i don't have one)  If not, i'll just type it up.  I'd like  
to see this fixed by release as 5.4 does not support my sata  
controller out of the box.


Lucas Holt
[EMAIL PROTECTED]

FoolishGames.com  (Jewel Fan Site)
JustJournal.com (Free blogging)
FoolishGames.net (Enemy Territory IoM site)

Think PC.. in 2006 you can own an Apple PCintosh. Whats next, windows  
works?


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


Re: ICH6R RAID

2005-07-02 Thread Masashi SAKURADA
Hello, Gayn,

From: Gayn Winters [EMAIL PROTECTED]
Subject: ICH6R RAID
Date: Wed, 29 Jun 2005 19:01:31 -0700

 I even tried building the mirror then disabling one drive using the
 firmware setup. The firmware says then to have the OS rebuild the
 mirror. OK,... The OS then boots fine to ad4 and can see ad6.  I can dd
 if=/dev/ad4 of=/dev/ad6 successfully, but I cannot get atacontrol to
 rebuild the mirror.  Maybe this approach will work, and I'm doing
 something wrong...

I dont know if this is right way. Why don't you try
atacontrol(8). Install minimal stuff to ad4, then try atacontrol
create RAID1 0 /dev/ad4 /dev/ad6. Reboot by install CD, You can see
ar0 and choose it to install what you want.

--Masashi SAKURADA/AH0K/JR2GMC
E-mail: [EMAIL PROTECTED] URL: http://www.ah0k.com/
PGP-fingerprint: 9332 0E9F 78AB E793 0E9F  84C6 FA74 3A11 3235 EC1E
PGP-Public-Key: http://www.ah0k.com/personal/c1868.html


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


6.0-CURRENT-SNAP005 snapshots available

2005-07-02 Thread Scott Long

All,

I've just uploaded ISO images for the July snapshot of 6.0-CURRENT. 
They are available at:


ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/Jul_2005

It looks like some sites are still syncing them, so please check back
if they are not available at your favorite mirror.

This will likely be the last snapshot of 6.0-CURRENT before the RELENG_6
branch is made.  I've written a brief README.TXT and placed it in with
the image files to document the changes and known problems with this
release.  Please download these images and test them so that we can make
6.0 and excellent release.

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