Re: FreeBSD installers and future direction

2013-05-27 Thread Bruce Cran

On 27/05/2013 16:48, Alfred Perlstein wrote:
Why can we not use in the interim use pc-sysinstall on the platforms 
that it performs best on and use bsdinstall on the others?


Because pc-sysinstall doesn't have a UI - it's only a backend. If we 
update bsdinstall to use it, then it won't work on other platforms.


--
Bruce
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: FreeBSD installers and future direction

2013-05-27 Thread Bruce Cran

On 27/05/2013 19:03, Alfred Perlstein wrote:
Do we always have to seek the lowest common denominator for our user 
experience?


Yes.

--
Bruce
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: FreeBSD installers and future direction

2013-05-27 Thread Bruce Cran

On 27/05/2013 21:28, Alfred Perlstein wrote:

On 5/27/13 11:40 AM, Bruce Cran wrote:

Yes.

Is this a joke?


It probably /was/ too short a reply. Personally I think there should be 
a single UI and scripting interface across all platforms. We should try 
and get pc-sysinstall running on all of them first in case there's some 
problem that means it can't be done, in which case we'd need to use a 
different backend.


--
Bruce
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: FreeBSD installers and future direction

2013-05-26 Thread Bruce Cran

On 26/05/2013 18:54, Teske, Devin wrote:

http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/harshbhatt/1


This proposal is not made public, and you are not the student who 
submitted the proposal, nor are you a mentor for the organization it was 
submitted to.


--
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: FreeBSD installers and future direction

2013-05-26 Thread Bruce Cran

On 27/05/2013 00:27, Dirk Engling wrote:

Still, thanks for pointing all that out, but I rather wanted to look at
the installer from another angle, as it is supposed to provide everyone
from FreeBSD novices to experts with a comfortable way to do things the
right way and yet be flexible enough to avoid abandoning the tool once
the requirements differ.


I'd like to see an option of different front-ends for the 
installer/configurator to cater for different users - at least an X11 
application, but there was also an idea of having a http-based 
installation UI.


--
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


FreeBSD installers and future direction

2013-05-25 Thread Bruce Cran
I heard there was some discussion at BSDCan about the direction of a 
future FreeBSD installer.  Considering we currently have bsdinstall, 
pc-sysinstall, and an effort to revive sysinstall, I'd be interested to 
know what was decided (if anything) and whether I could help make 
progress towards getting a single really good installer/frontend - 
instead of the current situation with several, none of which have a 
much-needed UI for setting up an installation on ZFS.


--
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: FreeBSD installers and future direction

2013-05-25 Thread Bruce Cran

On 25/05/2013 17:15, Matt Olander wrote:

 From my vague recollection, we discussed improving bsdinstall by tying
it in with pc-sysinstall, which we've been threatening to do for at
least a year. Also, there was much discussion about Devin's bsdconfig
perhaps tying in with a Google SoC Project.

I think Devin was nominated for most of the work, since he was unable
to defend himself :P


Thanks. From previous discussions with Devin I think he has other plans 
for the installer that don't involve pc-sysinstall. But since it seems 
the future is all sh(1) code, I won't be able to contribute.


https://wiki.freebsd.org/PCBSDInstallMerge lists a few limitations with 
pc-sysinstall - are these being fixed?


--
Bruce
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?)

2012-08-05 Thread Bruce Cran

On 05/07/2012 10:48, Olivier Smedts wrote:

And it really annoys me too because usually, instead of an immediate
command not found, you've got a reply seconds later if on a not so
fast computer. When working on Ubuntu, after a typo or missing command
I have the time to realize that something strange is happening, to
read again what I typed and to hit ^C before any message is displayed.



That annoys me too. The openSUSE guys worked on the same problem 
(https://bugzilla.novell.com/show_bug.cgi?id=435160), going from a few 
seconds down to 700ms and got told they'd need to do better :)
In the end they added a COMMAND_NOT_FOUND_AUTO variable, disabled by 
default, to do the slow search, and the standard behaviour became to 
print a message similar to Command not found. If this isn't a typo, run 
cnf command to find the package containing it which is a solution I 
like.


--
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: [rfc] a few kern.mk and bsd.sys.mk related changes

2011-05-28 Thread Bruce Cran
On Sat, May 28, 2011 at 06:23:26PM +, Alexander Best wrote:
 
 well i'm not an expert on this. but are we 100% sure that a kernel on amd64
 compiled with -O2 frename-registers can be debugged the same way as one with
 -O? if that is the case: sure...-O2 is fine. ;)
 
 however i've often read messages - mostly by bruce evans - claiming that
 anything greater than -O will in fact decrease a kernel's ability to be
 debugged just as well as a kernel with -O.
 

The critical option when -O2 is used is -fno-omit-frame-pointers, since removing
frame pointers makes debugging impossible (on i386). With -O2 code is moved 
around and
removed, so debugging is more difficult, but can still provide useful
information.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: [UPDATE] host-setup(1): a dialog(1)-based utility for configuring FreeBSD

2011-04-23 Thread Bruce Cran
On Fri, 22 Apr 2011 09:52:44 -0700
Devin Teske dte...@vicor.com wrote:

 Looks like `--hline' is not supported anymore. Thinking this should
 either be patched or documented in ERRATA/UPGRADING.

I think you mean UPDATING :)

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: [UPDATE] host-setup(1): a dialog(1)-based utility for configuring FreeBSD

2011-04-22 Thread Bruce Cran
On Fri, 22 Apr 2011 15:41:46 +
Alexander Best arun...@freebsd.org wrote:

 FreeBSD 9.0-CURRENT amd64

A new version of dialog was imported a few days ago - maybe something
broke?

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Switching to [KMGTPE]i prefixes?

2011-03-24 Thread Bruce Cran
On Fri, 25 Mar 2011 00:21:15 +
Alexander Best arun...@freebsd.org wrote:

 i hacked up humanized_number(3) a bit in order to produce the
 following df(1) output:
 [...]
 4.2Gi   4.2Gi  0B   100%   0 0  100%   /media/dvd

I don't know if it's correct, but Snow Leopard uses Bi for bytes.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: listing all modules compiled into a kernel instance

2011-03-01 Thread Bruce Cran
On Tue, 1 Mar 2011 06:20:29 -0500
Maxim Khitrov m...@mxcrypt.com wrote:

 kldstat provides information about components that were loaded
 dynamically. If your kernel was built with INCLUDE_CONFIG_FILE option
 (enabled by default in GENERIC), then you can see the static
 components using:

It seems it can also list static components:

 kldstat -v
Id Refs AddressSize Name
 11 0xc040 4c51b4   kernel (/boot/kernel/kernel)
Contains modules:
Id Name
95 if_lo
86 elf32
87 shell
96 igmp
97 mld
90 sysvmsg
91 sysvsem
[...]

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: man 3 getopt char * const argv[] - is const wrong ?

2011-02-15 Thread Bruce Cran
On Tue, 15 Feb 2011 04:19:10 +0100
Julian H. Stacey j...@berklix.com wrote:

 Again you fail to post a precise complete URL for free open anonymous
 reference.  One might wonder your involvment with open.org/ISO/IEEE.

It seems registration is required for the SUS, but you can get
POSIX.1-2008 free at http://pubs.opengroup.org/onlinepubs/9699919799/ .

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: man 3 getopt char * const argv[] - is const wrong ?

2011-02-13 Thread Bruce Cran
On Sunday 13 February 2011 17:15:37 Julian H. Stacey wrote:
 Hi,
 Thanks to all respondents, I'll re-read comments in a bit,
 I went searching for reference:
 
 Matthias wrote:
  the prototype is in line with the Single Unix Specification v4 aka IEEE
  Std. 1003.1-2008 (sorry no URL, I have checked my local copy, check
  http://www.opengroup.org/ you can access it free of charge after
  registering name and email address).
 
 Thanks, but I didn't find it.
   ( I used X Open's Search but wan't easy, (I recall fat green
   cardboard boxes from XOpen 20+ years back) : impression
   remains: opaque unattractive.  Part of the attraction of C
   was a slim light affordable volume, 1cm thick, well written,
   2 indexes, easy reading, carrying  reference :-)
 

http://www.google.co.uk/search?q=opengroup+getopt gets results for 
1003.1-2004.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: memstick.img is bloated with 7% 2K blocks of nulls

2011-02-12 Thread Bruce Cran
On Sat, 12 Feb 2011 17:56:08 +0100
Julian H. Stacey j...@berklix.com wrote:

 It's not so obvious but in man mdconfig, there's no [] around -t
 type, I read that as -t something is mandatory, (though it starts
 without for you ...  I suspect -t default is malloc, though manual
 doesnt say that, but look what manual says re. malloc ... panic ).

But from the manual page:

-f file
 Filename to use for the vnode type memory disk. Options -a
 and -t vnode are implied if not specified.

So if you specify -f then you get -t vnode automatically.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: [RELEASE] host-setup(1): a dialog(1)-based utility for configuring FreeBSD

2011-02-11 Thread Bruce Cran
On Fri, 11 Feb 2011 08:56:42 +0100
Damien Fleuriot m...@my.gd wrote:

 The list strips non-text attachments so there isn't much to see at
 the moment though...

It wasn't supposed to be attached - try
http://druidbsd.sourceforge.net/download/host-setup.txt :)

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: memstick.img is bloated with 7% 2K blocks of nulls

2011-02-11 Thread Bruce Cran
On Fri, 11 Feb 2011 20:09:30 +0100
Julian H. Stacey j...@berklix.com wrote:

 memstick.img wastes 7% with 2K blocks of nulls.

Could this be due to using UFS1 instead of UFS2?

On a related note, at some point the release scripts should be updated
to use gpart instead of fdisk/bsdlabel.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: memstick.img is bloated with 7% 2K blocks of nulls

2011-02-11 Thread Bruce Cran
On Sat, 12 Feb 2011 01:54:58 +0100
Julian H. Stacey j...@berklix.com wrote:

-O filesystem-type
  Use 1 to specify that a UFS1 format file system be
 built; use 2 to specify that a UFS2 format file system be built.  The
 default format is UFS2.
 If anyone fancies looking deeper, please do :-)

I checked with dumpfs that memstick.img is UFS1.

Also, mounting /dev/md0 confuses the kernel into ultimately panic'ing,
since /dev/md0a is the proper slice. For the mfsroot.gz file from the
CD ISOs:

# mdconfig -a -f mfsroot
md0
# mount /dev/md0a /mnt
# ls /mnt
ls: /mnt: Bad file descriptor
# cd /mnt
cd: /mnt: Not a directory
# vim /mnt

panic: ffs_read: type 0

kdb_enter()
panic()
ffs_read()
vn_read
dofileread()
kern_readv()
read()
syscallenter()
syscall()
Xfast_syscall()

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: getting a list of open files versus PID nos.?

2010-12-08 Thread Bruce Cran
On Wed, 8 Dec 2010 14:54:57 -0800
Matthew Fleming mdf...@gmail.com wrote:

 This is what lsof is for.  I believe there's one in ports, but I have
 never tried it.

Is there any advantage to using lsof instead of fstat(1) (fstat -p pid)?

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Logical vs. bitwise AND in sbin/routed/parms.c

2010-11-22 Thread Bruce Cran
I've been going through src/bin and src/sbin seeing how easy it would
be to remove warnings clang generates. During the work I came
across routed/parms.c which appears to be doing a logical instead of
bitwise AND. Would the following change be correct?

Index: /usr/src/head/sbin/routed/parms.c
===
--- /usr/src/head/sbin/routed/parms.c   (revision 215671)
+++ /usr/src/head/sbin/routed/parms.c   (working copy)
@@ -876,11 +876,11 @@
if ((0 != (new-parm_int_state  GROUP_IS_SOL_OUT)
  0 != (parmp-parm_int_state  GROUP_IS_SOL_OUT)
  0 != ((new-parm_int_state ^
parmp-parm_int_state)
-  GROUP_IS_SOL_OUT))
+  GROUP_IS_SOL_OUT))
|| (0 != (new-parm_int_state  GROUP_IS_ADV_OUT)
 0 != (parmp-parm_int_state 
GROUP_IS_ADV_OUT)  0 != ((new-parm_int_state ^ parmp-parm_int_state)
- GROUP_IS_ADV_OUT))
+ GROUP_IS_ADV_OUT))
|| (new-parm_rdisc_pref != 0
 parmp-parm_rdisc_pref != 0
 new-parm_rdisc_pref !=
parmp-parm_rdisc_pref)

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Logical vs. bitwise AND in sbin/routed/parms.c

2010-11-22 Thread Bruce Cran
On Mon, 22 Nov 2010 10:48:09 -0800
Artem Belevich fbsdl...@src.cx wrote:
 hdr.elf.e_ident[EI_OSABI] is not a bitmask and '==' should've been
 used instead. Now ldd.c has two instances of this bug due to
 copy/pasting of orignal code.

Fixed in r215705. Thanks!

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Summary: Re: Spin down HDD after disk sync or before power off

2010-11-19 Thread Bruce Cran
On Tue, 16 Nov 2010 20:40:00 +
Bruce Cran br...@cran.org.uk wrote:

 One problem with the code that's been committed is that the shutdown
 event handler doesn't get run during a suspend operation so an
 emergency unload still gets done when running acpiconf -s3.

Something else I noticed today: I've just got a new disk that supports
NCQ and found the kern.cam.ada.ada_send_ordered sysctl that appears to
enable/disable its use (?).   But the shutdown handler that spins
the disk down only gets initialized if ada_send_ordered is enabled. I
was wondering what the reason for this is?

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Summary: Re: Spin down HDD after disk sync or before power off

2010-11-16 Thread Bruce Cran
On Fri, 22 Oct 2010 10:03:09 +
Alexander Best arun...@freebsd.org wrote:

 so how about olivers patch? it will only apply to ata devices so it's
 garanteed not to break any other CAM devices (i'm thinking about the
 aac controller issue). you could revert your previous shutdown work
 and plug olivers patch into CAM. you might want to replace the
 combination of flush/standby immediate with sleep.

One problem with the code that's been committed is that the shutdown
event handler doesn't get run during a suspend operation so an
emergency unload still gets done when running acpiconf -s3.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: fsync(2) manual and hdd write caching

2010-10-27 Thread Bruce Cran
On Wed, 27 Oct 2010 02:00:51 -0700
per...@pluto.rain.com wrote:

 Short of mounting synchronously, with the attendant performance
 hit, would it not make sense for fsync(2) to issue ATA_FLUSHCACHE
 or SCSI SYNCHRONIZE CACHE after it has finished writing data
 to the drive?  Surely the low-level capability to issue those
 commands must already exist, else we would have no way to safely
 prepare for power off.

mounting synchronously won't help, will it? As I understand it that
just makes sure that data is sent straight to disk and not left in
memory; the data will still be stored in the HDD cache for a
while.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Summary: Re: Spin down HDD after disk sync or before power off

2010-10-27 Thread Bruce Cran
On Wed, 27 Oct 2010 15:04:39 +0200 (CEST)
Oliver Fromme o...@lurza.secnetix.de wrote:

 I'm also against printing a warning for values less than 600.
 If I want to set the value to 300, I don't want to be slapped
 with a useless warning.

Having just checked Windows and seen that it lets you specify a timeout
down to 1 minute with no warnings, I don't think we want to make it
more difficult for people to do the same thing on FreeBSD.  I don't
know if atacontrol already does this, but maybe we could have a log
entry, for example:

 atacontrol /dev/ad0 spindown 60
spin-down timer set to 60 seconds.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: fsync(2) manual and hdd write caching

2010-10-26 Thread Bruce Cran
On Wed, 27 Oct 2010 01:19:18 +0200
Ivan Voras ivo...@freebsd.org wrote:

 fsync(2) actually does behave as advertised, auses all modified data 
 and attributes of fd to be moved to a permanent storage device. It
 is the problem of the permanent storage device if it caches this
 data further.

http://www.opengroup.org/onlinepubs/009695399/functions/fsync.html at
first suggests it should flush write caches, but does allow for
implementations that don't:

The fsync() function is intended to force a physical write of data
from the buffer cache, and to assure that after a system crash or other
failure that all data up to the time of the fsync() call is recorded on
the disk.

...

In the middle ground between these extremes, fsync() might or might
not actually cause data to be written where it is safe from a power
failure.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: fsync(2) manual and hdd write caching

2010-10-26 Thread Bruce Cran
On Tue, 26 Oct 2010 21:36:18 +
Alexander Best arun...@freebsd.org wrote:

 since there's a thread on freebsd-questions@ concerning fsync(2) and
 the fact that hdd write caching can cause this syscall to basically
 be a no op, could somebody please copy the BUGS section from sync(2)
 to fsync(2)?

Shouldn't the BUGS section of sync(2) be removed?

The sync() system call may return before the buffers are completely
 flushed.

But from
http://www.opengroup.org/onlinepubs/009695399/functions/sync.html : 

The writing, although scheduled, is not necessarily complete upon
return from sync().

That would suggest it's not actually a bug.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Slow disk access while rsync - what should I tune?

2010-10-24 Thread Bruce Cran
On Sun, Oct 24, 2010 at 04:18:51PM +0100, Matthew Seaman wrote:
 
 However, taking backups slowly makes it harder to ensure you have a
 consistent backup, so I recommend you investigate snapshotting the
 filesystem (well supported for UFS, trivially easy for ZFS) and then
 backup the snapshot as slowly as you like.

I'm not sure snapshots are so well supported for UFS.
From sys/ufs/ffs/README.snapshot:

As is detailed in the operational information below, snapshots are
definitely alpha-test code and are NOT yet ready for production use.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Summary: Re: Spin down HDD after disk sync or before power off

2010-10-24 Thread Bruce Cran
On Sun, 24 Oct 2010 19:47:57 +0300
Alexander Motin m...@freebsd.org wrote:

 Comparing two ways implementing spindown, I've recalled that both of
 them using xpt_polled_action() method, which depends on working
 controller polling operation. So they could be almost equaly not good.
 But the method present in HEAD now is more universal. Looking on fact
 that need of spindown is not so obvious for SCSI devices (in SAN
 environments), we can just make kern.cam.power_down tunable a bitmask
 of supported protocols for now. Patch is attached.

I've just committed the patch to move the functionality into ada(4).
Should it be reverted?

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Summary: Re: Spin down HDD after disk sync or before power off

2010-10-22 Thread Bruce Cran
On Fri, 22 Oct 2010 12:07:36 +0200
Tijl Coosemans t...@coosemans.org wrote:

 FreeBSD frequently accesses hard disks (log files, flushing dirty
 memory pages every 30s,...) and laptop drives tend to have aggressive
 power saving settings by default. That's why your load cycle is so
 high.

I'm not sure the APM value updates the idle3 timer inside the
drive: it may be necessary to run WD's wdidle3.exe tool to change the
power management timer.  And yes, people are rather annoyed that it's
necessary to have a copy of DOS to update the drive!

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Summary: Re: Spin down HDD after disk sync or before power off

2010-10-21 Thread Bruce Cran
On Thu, 21 Oct 2010 14:33:49 +0200
Dag-Erling Smørgrav d...@des.no wrote:

 The problem with setting a short idle timeout is that, on a typical
 laptop or desktop system, you end up spinning the disk down and back
 up several hundred times a day, which increases power consumption, I/O
 latency and wear.

Do we think our users are silly enough to set a short timeout of just a
few minutes?  I'd think most would use a setting of 20-30 minutes at
a minimum. I never did understand why there were so many warnings;
after all, some laptops even come with a default APM scheme in their
HDDs that powers the disk down after 7 seconds!

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Summary: Re: Spin down HDD after disk sync or before power off

2010-10-21 Thread Bruce Cran
On Thu, 21 Oct 2010 13:41:14 +
Alexander Best arun...@freebsd.org wrote:

 personally i still think something like the attached patch would be
 nice to have. there's a chance users might type the following:
 
 'atacontrol spindown device 10'
 
 thinking the timeout value is measured in minutes. 

I agree - users coming from ataidle(8) will expect the timeout to be in
minutes too.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Summary: Re: Spin down HDD after disk sync or before power off

2010-10-21 Thread Bruce Cran
On Thu, 21 Oct 2010 16:35:06 +0200
Dag-Erling Smørgrav d...@des.no wrote:

 Really?  That would make the system close to unusable, and the disk's
 life expectancy would be reduced to a few months; a disk that performs
 two load / unload cycles per minute on average will need replacing
 after three to six months.  Remember, there was a huge flap a couple
 of years when Ubuntu shipped with a default timeout of 90 seconds,
 which is more than ten times more than what you suggest.

The Ubuntu issue was what I was thinking of - I got that mixed up with
the aggressive power management of the WD EARS drives.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: issue with unsetting 'arch' flag

2010-10-06 Thread Bruce Cran
On Wednesday 06 October 2010 00:50:54 Alexander Best wrote:

 `touch ftest  chflags arch ftest  chflags -vv 0 ftest`.
  ^^non-root ^^root^^non-root
 
 chflags claims to have cleared the 'arch' flag (which should be impossible
 as non-root user), but indeed has done nothing.

I guess that should be sudo chflags arch ftest?

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: A simple and hopefully usable FreeBSD live CD -- now with images

2010-08-26 Thread Bruce Cran
On Tue, 24 Aug 2010 15:47:39 +0200
Ed Schouten e...@80386.nl wrote:

 Yes, it's compressed with xz(1). Just run unxz filename to
 decompress it. It should be part of the latest FreeBSD releases. If
 not, be sure to install /usr/ports/archivers/xz.

You can also uncompress it using 7-zip (http://7-zip.org/) in Windows.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: behaviour changes in mdconfig? or something related?

2010-08-04 Thread Bruce Cran
On Wed, 4 Aug 2010 14:40:27 +0200
Samuel Martín Moro faus...@gmail.com wrote:

 Since 8.1 (8.0?), after calling bsdlabel, I still have /dev/${dev}a,
 but/dev/${dev}c doesn't show up anymore.

The 'c' partition is no longer created on FreeBSD 8 - you should
use /dev/${dev} instead of /dev/${dev}c : 
http://www.freebsddiary.org/upgrade8.php .


-- 
Bruce 
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: TCP over UDP

2010-07-12 Thread Bruce Cran
On Sat, 10 Jul 2010 08:05:29 -0400
Sergey Babkin bab...@verizon.net wrote:

 Basically, every time you use UDP, you've got to reinvent your
 own retransmission and reliability protocol. And these protocols
 are typically no good at all, as the story with NFS switching
 from UDP to TCP and improving the performance shows. At the same
 time TCP provides a very good transport control logic, so why not
 just reuse this logic in a library to solve the UDP issues once
 and for all?

Have you looked at SCTP? It may provide the features you've looking
for:
http://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol#Motivations

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: I need reply in Embedded FreeBSD Kernel Theme

2010-06-12 Thread Bruce Cran
On Sat, 12 Jun 2010 13:19:22 +0930
Matt Thyer matt.th...@gmail.com wrote:

 However my Soekris net4801 board still takes about 2.5 minutes to boot
 and I think time could be saved by parallel probing of hardware where
 possible.
 
 Much work has been done on fast boot times in the Linux world
 including an impressive demonstration by an Intel team for car
 instrumentation panels (on Youtube... Google for fastest Linux boot).

It's on the list of ideas for 9.0: see
http://wiki.freebsd.org/FreeBSD9#head-960c3f5a8747af95199367a8c84030dfe2b99f1b

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: sysbench / fileio - Linux vs. FreeBSD

2010-06-05 Thread Bruce Cran
On Sat, 5 Jun 2010 12:50:15 +0200
Stefan Miklosovic miklosovic.free...@gmail.com wrote:

  /var : ufs with softupdates
  /usr/obj : zfs with checksums disabled
  /usr/src : zfs with compression enabled
  /home   : zfs with compression disabled and checksums enabled
 
  I ran a test with a blocksize of 8KB and 16 threads.
 
  /var   : 25.2MB/s
  /usr/obj : 64.8MB/s
  /usr/src : 386.3MB/s
  /home   : 60.3MB/s
 
 Do I understand it well? It seems that zfs with compression enabled on
 /usr/src with 8KB block size and 16 threads performs 386.3MB/s which
 is about 6 times better than debian5? I am thinking about this image
 http://tech-blog.wooh.hu/~wooh/debian_vs_freebsd_io_16_seqwr.png

Yes - on one run it even hit 500MB/s. I suspect, however, that the
benchmark isn't accurate because it won't be writing typical data.
Instead it's probably using a buffer that compresses very well.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: sysbench / fileio - Linux vs. FreeBSD

2010-06-04 Thread Bruce Cran
On Saturday 05 June 2010 00:58:35 Adam PAPAI wrote:

 Why FreeBSD is supreme with 1 and 2 thread. And why is it 2 and 3 times
 slower with 4-8-16-32 threads compared to Debian? The first two tests (1
 thread and 2 thread) showed me that FreeBSD is supreme in I/O, but later
 tests showed me, that it can produce horrible I/O.
 
 How can I tune my disk to make it faster? Is it possible? What is the
 reason of the really slow I/O with more than 4 threads? What do you
 recommend me to do? Why is it damn slow with 8K blocksize?

Some quick tests show that ufs does do rather poorly on my system too. I have 
the following filesystems setup:

/var : ufs with softupdates
/usr/obj : zfs with checksums disabled
/usr/src : zfs with compression enabled
/home   : zfs with compression disabled and checksums enabled

I ran a test with a blocksize of 8KB and 16 threads.

/var   : 25.2MB/s
/usr/obj : 64.8MB/s
/usr/src : 386.3MB/s
/home   : 60.3MB/s

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Common OS/kernel code between freebsd and linux

2010-05-22 Thread Bruce Cran
On Saturday 22 May 2010 13:55:26 RW wrote:
 On Sat, 22 May 2010 05:09:31 -0700
 
 Anjali Kulkarni anj...@juniper.net wrote:
  I am not sure the right forum to ask this question - is there any
  effort done to find portable code between different OSes,
  particularly freebsd and linux?
 
 BSD code has been used in most operating systems due to its open
 licence, but it's very awkward to mix GNU/Linux GPLed code with BSD
 code without the whole thing ending up GPLed.

The bigger problem perhaps is that Linux has its own way of doing things: 
whereas for example UNIX has traditionally used routing sockets, Linux uses 
netlink. I don't think there's much in the way of common architecture between 
Linux and FreeBSD unfortunately.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Compiling kernel with gcc43

2010-03-25 Thread Bruce Cran
On Thu, Mar 25, 2010 at 02:18:34PM -0300, Mario Lobo wrote:

 All right !! Thanks for replying !
 
 There are a lot of locations throughout the source code where -Werror is
 enabled
 How can I disable -Werror globally? via src.conf ? will it do it for
 world/kernel?
 will this damage the resulting kernel/world binaries?

You should be able to use NO_WERROR in src.conf to prevent -Werror 
being used.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: ATA 4K sector issues

2010-03-17 Thread Bruce Cran
On Wednesday 17 March 2010 10:16:16 Mohacsi Janos wrote:
 Dear FreeBSD hackers,
   What is the situation with ATA 4K dirves in FreeBSD? Are there any
 support for them in fdisk or disklabel?

# mdconfig -a -f ddfile -S 4096
md0
# fdisk /dev/md0
fdisk: could not detect sector size
# mdconfig -d -u 0
# mdconfig -a -f ddfile -S 1024
md0
# fdisk /dev/md0
*** Working on device /dev/md0 ***
parameters extracted from in-core disklabel are:
cylinders=130 heads=255 sectors/track=63 (16065 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=130 heads=255 sectors/track=63 (16065 blks/cyl)

fdisk: invalid fdisk partition table found
fdisk: /boot/mbr: length must be a multiple of sector size

So it seems there's still work to do to get fdisk working, but I can't try 
gpart since I don't have a real disk.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: ATA 4K sector issues

2010-03-17 Thread Bruce Cran
On Wednesday 17 March 2010 18:16:09 Olivier Smedts wrote:

 Why not on geom_md ?

Thanks! After getting a no such geom message when I tried a couple of 
commands without having created any partitions I presumed it was looking for a 
DISK provider.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: building world with debugging symbols

2010-03-05 Thread Bruce Cran
On Friday 05 March 2010 05:28:39 Alexander Best wrote:

 any suggestions on how to successfully build world with debugging symbols
  are welcome.

Use DEBUG_FLAGS instead:

DEBUG_FLAGS=-g

The build system knows not to strip the binaries when that's defined, too.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Greetings... a patch I would like your comments on...

2010-01-25 Thread Bruce Cran
On Fri, 22 Jan 2010 16:10:35 +0100
Ed Schouten e...@80386.nl wrote:

 * Ivan Voras ivo...@freebsd.org wrote:
  This is a good and useful addition! I think Windows has implemented
  a generalization of this (called wait objects or something like
  that), which effectively allows a select()- (or in this case
  kqueue())-like syscall to wait on both file descriptors and
  condvars (as well as probably other MS-style objects). It's useful
  for multiplexing events for dissimilar sources.
 
 NtWaitForSingleObject(), NtWaitForMultipleObjects(), etc. :-)

Just to avoid any possible confusion, Microsoft have stopped
documenting the Nt* functions, or have marked them as obsolete: in
userland you call WaitForSingleObject, WaitForMultipleObjects
etc. while in the kernel you use KeWaitForSingleObject,
KeWaitForMutlipleObjects etc.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: bad source in the distro iso's

2009-11-16 Thread Bruce Cran
On Mon, 16 Nov 2009 10:51:56 +0100
Dag-Erling Smørgrav d...@des.no wrote:

 Trever anti_spam...@yahoo.com writes:
  With regard to 8.0 RC23, simply using the src/install.sh script for
  the src works without the errors and corrupted files.
 
 I wonder why we still bother splitting the tarballs...  it's not like
 anyone is going to try installing 8.0 from floppies.

See
http://lists.freebsd.org/pipermail/freebsd-stable/2009-October/052241.html
- apparently people are still wanting to install from floppies.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Is the FreeBSD ABI compatibility policy documented anywhere

2009-09-24 Thread Bruce Cran
On Thu, 24 Sep 2009 14:00:04 -0700
Julian Elischer jul...@elischer.org wrote:

 Stef Walter wrote:
  It seems that FreeBSD has an ABI compatibility policy where major
  versions remain ABI and API compatible throughout minor point
  versions. That is to say that the kernel interfaces and libraries
  for (eg) 7-STABLE, 7.1-RELEASE, 7.2-RELEASE are not supposed to
  change.
  
  Is this a policy of the project? If so, is it documented anywhere?
  Or is it just a convention?
 
 It is a policy of the project but I don't think our policies are 
 written down as such. I think you will find it referenced in
 many places in a sideways manner rather than directly.
 
 Possibly in the developer handbook

The only place I found it directly referenced was in
http://wiki.freebsd.org/VendorInformation

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: USB Device identification in dmesg and usbconfig

2009-09-23 Thread Bruce Cran
On Wed, 23 Sep 2009 22:44:54 +
Tom Judge t...@tomjudge.com wrote:

 Hi,
 
 I have been working on getting at least some support for the Function 
 (F1-12) keys on my MS Natural 4000 keyboard. Here is the original PR
 on the subject: usb/116947.  My patch can be found here: 
 http://svn.tomjudge.com/freebsd/patches/ms-natural-4000/usb-natural4000.patch 
 and I have submitted an update to the PR.
 
 
 When I reboot into the kernel the quirk is detected correctly and the 
 function keys work.
 
 However the device does not seem to be correctly identified here is
 the dmesg output:
 
 ugen2.3: vendor 0x045e at usbus2
 ukbd0: vendor 0x045e product 0x00db, class 0/0, rev 2.00/1.73, addr
 3 on usbus2
 kbd2 at ukbd0
 uhid0: vendor 0x045e product 0x00db, class 0/0, rev 2.00/1.73, addr
 3 on usbus2
 
 Here is usbconfig list output:
 
 ugen2.3: product 0x00db vendor 0x045e at usbus2, cfg=0 md=HOST
 spd=LOW (1.5Mbps) pwr=ON
 
 
 How do I get the output to match other devices like this:
 
 ugen2.4: Microsoft at usbus2
 ums0: Microsoft Microsoft Optical Mouse with Ti, class 0/0, rev 
 2.00/1.20, addr 4 on usbus2
 ums0: 3 buttons and [XYZ] coordinates ID=17

I'm starting to suspect this is a bug in the USB code that Microsoft
devices use. I've seen this on two PCs now, both on 7.x and 8.0-RC1;
sometimes they'll identify properly by getting the strings out of the
device (e.g. Microsoft 3-Button Mouse with IntelliEye(TM)) but most
of the time I'll just see the generic device and product IDs.  

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Partial kvm dumps

2009-08-26 Thread Bruce Cran
On Mon, 24 Aug 2009 10:45:58 +0300
Mikolaj Golub to.my.troc...@gmail.com wrote:

 http://code.google.com/p/trociny/downloads/list
 
 I would like to hear what other people think about this. It looks
 very useful for me. At least as a first step it would be nice to
 extend KVM to work with partial dumps so the users could try this and
 see if it turned out to be useful.

Having recently been debugging core dump support in the base system
utilities I spotted what looks like a bug in your code: the 'execfile'
parameter to kvm_open or kvm_openfiles should be NULL if you want to
use the kernel from the running system; some people may not be running
a kernel from /boot/kernel/kernel by default.

-- 
Bruce
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: ATA driver update for 7.2RELEASE available

2009-06-27 Thread Bruce Cran
On Fri, 26 Jun 2009 22:11:08 +0200
Søren Schmidt s...@deepcore.dk wrote:

 This is a total replacement of the ATA driver, modulerized as in - 
 current, but based on my WIP not from what might have happend to - 
 current since I gave up maintainership.

It's great to see the driver be modularised since removing unneeded
drivers (for example, on powerpc and embedded platforms) can save
~200KB.

Could you add some documentation for the modules in /sys/conf/NOTES
please?  I looked through the sources and put together the patch for
8.0 which is avaiable at
http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/133162 but it sounds
like some more drivers will need to be added for 7.2.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: pkg_info segfault Revision: 193189

2009-06-01 Thread Bruce Cran
On Sun, 31 May 2009 17:34:05 -0400
Eitan Adler eitanadlerl...@gmail.com wrote:

 pkg_info --IwantAcookie
 Segmentation fault: 11 (core dumped)
 on FreeBSD 7.2-STABLE i386

getopt_long expects the array of options to be NULL-terminated, so it's
walking off the end.

-- 
Bruce Cran--- /usr/src/usr.sbin/pkg_install/info/main.c	2008-06-10 10:55:25.0 +0100
+++ main.c	2009-06-01 21:25:37.0 +0100
@@ -58,6 +58,7 @@
 	{ verbose,	no_argument,		NULL,		'v' },
 	{ version,	no_argument,		NULL,		'P' },
 	{ which,	required_argument,	NULL,		'W' },
+	{ NULL,		0,			NULL,		0   },
 };
 
 int
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org

Re: pkg_info segfault Revision: 193189

2009-06-01 Thread Bruce Cran
On Mon, 1 Jun 2009 16:30:26 -0400
Glen Barber glen.j.bar...@gmail.com wrote:

 On Mon, Jun 1, 2009 at 4:28 PM, Bruce Cran br...@cran.org.uk wrote:
  On Sun, 31 May 2009 17:34:05 -0400
  Eitan Adler eitanadlerl...@gmail.com wrote:
 
  pkg_info --IwantAcookie
  Segmentation fault: 11 (core dumped)
  on FreeBSD 7.2-STABLE i386
 
  getopt_long expects the array of options to be NULL-terminated, so
  it's walking off the end.
 
 
 Hi guys,
 
 There was a PR submitted (about pkg_add) already about this, with a
 patch.  I am unsure if the patch was looked at yet.
 

The PR is bin/133473
(http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/133473) and contains the
same patch for pkg_info.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: C99: Suggestions for style(9)

2009-05-01 Thread Bruce Cran
On Fri, 01 May 2009 01:30:26 -0700
Julian Elischer jul...@elischer.org wrote:

 Christoph Mallon wrote:
 
  since really you'd want to write:
 
  struct foo *fp = get_foo();
  if (!fp) return;
  struct bar *bp = fp-bp;
 
  which isn't legal in 'C'.  However, we have enough where this isn't
  
  You're mistaken, this is perfectly legal C. See ISO/IEC 9899:1999
  (E) §6.8.2:1. In short: you can mix statements and declarations.
 
 now, but not all C compilers are C99 and a lot of FreeBSD code
 is taken and run in other situations. There is FreeBSD code
 in all sorts of environments, not all of which have new compilers.
 

Doesn't FreeBSD already use C99 features such as stdint and named
initializers?  I don't think sys/cam/scsi/scsi_ses.c would
compile with a C89 compiler for example.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: ACPI-fast default timecounter, but HPET 83% faster

2009-04-30 Thread Bruce Cran
On Thu, 30 Apr 2009 08:46:41 -0400
John Baldwin j...@freebsd.org wrote:

 On Sunday 26 April 2009 10:27:42 pm Garrett Cooper wrote:

  Why's the default ACPI-fast? For power-saving functionality or
  because of the `quality' factor? What is the criteria that
  determines the `quality' of a clock as what's being reported above
  (I know what determines the quality of a clock visually from a
  oscilloscope =])?
 
 I suspect that the quality of the HPET driver is lower simply because
 no one had measured it previously and HPET is newer and less proven.
 

http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/acpica/acpi_hpet.c
shows some of the history behind the decision.  Apparently it used to
be slower but it was hoped it would get faster as systems supported it
better. I guess that's happening now.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Garbled kernel messages on shutdown

2009-04-17 Thread Bruce Cran
On Thu, 16 Apr 2009 14:14:19 -0400
Damian Gerow dge...@afflictions.org wrote:

 Gary Jennejohn wrote:
 : [snip a whole bunch of stuff]
 :  This kernel output really looks bad:
 :  Wai
 :  tSiynngc i(nmga xd is6k0s ,s evcnoonddess)  rfeomra
 isnyisntge.m. .pr0o :  cess `syncer' to stop...0 done
 :  
 : 
 : I can't speak to the rest, but this is probably because you have
 SMP and : don't have `options PRINTF_BUFR_SIZE=128' in your kernel
 config.
 
 Ah, so that's what causes that.
 
 Any particular reason GENERIC has SMP, but doesn't set
 PRINTF_BUFR_SIZE=128? 

I think from previous discussions there might be some concern about
stack usage when it's enabled.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Linux setpci equivalent in FreeBSD?

2009-04-14 Thread Bruce Cran
On Tue, 14 Apr 2009 19:22:50 +0200
Zahemszky Gábor ga...@zahemszky.hu wrote:

 Hi!
 
 I'v found (well, mav@ found it) on a wiki page  (*) a trick to use
 some TI sdhci cards. They use the setpci command, to set some bits in
 the HW. Are there any tool under FreeBSD to do the same?

pciconf(8) ?

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: building a gcc crosscompiler

2009-04-09 Thread Bruce Cran
On Wed, 08 Apr 2009 21:30:14 -0400
Chuck Robey chu...@telenix.org wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Since the last time I built a gcc crosscompiler, the gcc folks have
 added in dependencies on mpfr and gmp libraries.  When I first read
 this, I was worried that I had a chicken/egg problem, but I found
 that you can do with the host's version of those libraries.  I found
 a port of gnu libmpfr, but I notice here that FreeBSD has it's own
 libmp, and I don't know if the 4.3.1 version of gnu gcc can use our
 libmp, or if I need to install the port libgmp4 and tell the gnu
 gcc configure about which mp I'm using.
 
 So, if you know if I can use FreeBSD's libmp, or if I need to build
 the ports libgmp4, please let me know.

I don't know if it's required, but devel/cross-gcc does depend on
math/libgmp4 .

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Overflow in vm.vmtotal expected when allocating huge amounts of memory?

2009-03-26 Thread Bruce Cran
Are overflows in the vm counters expected when dealing with huge
amounts of memory on 64-bit platforms?  I wrote an application which
malloc'd 10TB memory and then sat doing nothing; vm.vmtotal showed
-2132654356K.  Shouldn't unsigned integers be used for any vm stats to
avoid overflows?

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Simulating bad network conditions

2009-02-18 Thread Bruce Cran
On Wed, 18 Feb 2009 08:57:15 +
xorquew...@googlemail.com wrote:

 On 2009-02-18 11:42:00, Maxim Konovalov wrote:
  
  ipfw(8) prob + dummynet(8).
  
 
 Hi. Thanks for the quick response.
 
 Is there, by any chance, an equivalent for PF? I see there's 'ALTQ'
 but it looks to be poorly supported (unless I misunderstand). I have
 quite a complicated setup here with PF forwarding and jails and I'm
 not sure how well ipfw will play along.

ALTQ can drop 20% of packets using something like:

block in proto icmp probability 20%

It seems ALTQ can't delay packets though, so you'd need to use dummynet
for that.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: a little bit of c++ in kernel [module]

2009-02-11 Thread Bruce Cran
On Wed, 11 Feb 2009 22:51:02 +0100
Christoph Mallon christoph.mal...@gmx.de wrote:

 Aniruddha Bohra schrieb:
  On Wed, Feb 11, 2009 at 8:25 AM, Andriy Gapon a...@icyb.net.ua
  wrote:
  on 10/02/2009 22:43 Aniruddha Bohra said the following:
  You can see Click: http://read.cs.ucla.edu/click/
  It does not  run on FreeBSD 4.
  I have an old diff which builds on the work by Marko Zec and Bruce
  Simpson, that allows me to load the click module.
  http://www.cs.rutgers.edu/~bohra/click-1.5.0.diff
  1. options -fpermissive -fno-exceptions -fno-rtti are passed to
  c++ compiler 2. there are new/delete implementations that use
  kernel malloc
 
  I think that #1 means that there are no exceptions, (non-trivial)
  dynamic_cast and typeid for kernel c++ code.
  
  Correct.
 
 That's a pity. Lack of exceptions negates some major benefits of C++.
 
  1. do you use any global/static objects with constructors? did you
  have to write any code to call on those constructors when the
  module is loaded?
  
  Not sure about this one. But AFAIK, there are no global static
  objects with constructors in Click code.
  There is one router object that is always initialized and it is
  updated by writing to the clickfs file system.
  The other objects are created with new.
  
  2. did you have to write any other run-time support code or
  platform glue code (besides new/delete)?
  
   Apart from the new and delete, I think the other things were the
  pseudofs code to initialize the file system,
  the locks in include/click/sync.hh, the glue code in atomic.hh.
  
  
  3. I assume virtual inheritance can be used in kernel code? do you
  use it?
 
 Virtual inheritence needs no support from the outside, so it is
 available.
 
  Yes. For example, all objects inherit from Element and that
  defines virtual functions. (include/click/element.hh)
 
 Virtual inheritance is something completely different than virtual
 methods. 

Microsoft has an overview of using C++ in kernel drivers at
http://www.microsoft.com/whdc/driver/kernel/KMcode.mspx .  It sounds
like the situation on FreeBSD may be somewhat similar.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: lzo2 shows insane speed gap

2008-12-29 Thread Bruce Cran
On Tue, 30 Dec 2008 01:47:47 +0100
Christian Weisgerber na...@mips.inka.de wrote:

 Nate Eldredge:
 
  It might be good first to rule out compiler / library differences.
 
 Sure.  Let's cut this short:
 
 Slow
 Athlon 64 X2 5200+ 2.6 GHz,  FreeBSD 8.0-CURRENT amd64   ~60
 min Phenom 9350e 2.0 GHz,OpenBSD 4.4-CURRENT amd64
 ~80 min UltraSPARC-IIe 500 MHz (Blade 100),  OpenBSD 4.4-CURRENT
 sparc64  10 h++
 
 Fast
 Pentium 4 3.0 GHz,   FreeBSD 6.4-RELEASE i386 36 s
 Xeon E5405 2.0 GHz (PowerEdge 1950), OpenBSD 4.4-CURRENT amd6447 s
 Alpha 21164A 500 MHz (AlphaPC164),   OpenBSD 4.4-CURRENT alpha 9
 min
 
 Let me draw your attention to the fact that the two amd64 systems
 that run different operating systems are both slow, whereas the two
 amd64 systems that run the same operating system (compiler, libraries)
 diverge in speed.
 
 
 Oh, and everybody is invited to run
 
 $ cd /usr/ports/archivers/lzo2  make

I'm running 8.0-CURRENT amd64 here on a Turion64 X2 machine. Without
malloc debugging (malloc.conf - aj) 'make test' takes 25s; after
removing malloc.conf thus turning on debugging, it takes over 10
minutes.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: How to quickly determine if UFS2 FS is clean from command line?

2008-12-25 Thread Bruce Cran
On Thu, 25 Dec 2008 17:14:02 -0800
David Wolfskill da...@catwhisker.org wrote:

 At work, we have some machines we're setting up that have a fair
 amount of UFS2 scratch space.
 
 While we would prefer to leave the file systems in question intact
 iff they are clean, we do not want to run fsck(8) against them
 if they are not (because we expect that it would take too long);
 rather, we want to merely recreate them (with newfs(8)).
 
 While I might be able to hack something together by cribbing
 appropriate bits of fsck_ffs(8), I'm a great deal more comfortable
 cobbling up glue scripts and the like -- I don't fancy myself all
 that much of a C coder.
 
 Anyone know of a reasonable way to quickly determine whether or not
 a UFS2 file system is clean from the command line?

dumpfs will tell you the status of the 'clean' flag:

dumpfs /dev/ad0s1d | grep clean

That will output a line like:

cgrotor 0  fmod 0  ronly 0  clean 1

Just like with fsck you can also tell dumpfs the previous mountpoint
too and it'll use the right device.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: How to quickly determine if UFS2 FS is clean from command line?

2008-12-25 Thread Bruce Cran
On Thu, 25 Dec 2008 17:49:56 -0800
David Wolfskill da...@catwhisker.org wrote:

 A reality check later, I find that for the file systems in question,
 dumpfs(8) produces the wanted information (and quite a bit more)
 nearly instantly, then spends about 33 seconds dumping cylinder group
 information that I have no interest in.

I only ran it on a 2GB filesystem so I didn't see how slow it is!

It looks like ffsinfo(8) can also display the superblock: by
specifying only level 0x001 it should be fast, though the flags are
combined into a single value in the output.

-- 
Bruce Cran
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: change to ee.c

2008-11-30 Thread Bruce Cran
On Sat, 29 Nov 2008 23:21:48 -0500
Eitan Adler [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Xin LI wrote:
  Hi, Eitan,
 
  Tanks for interested in this but I'm afraid that your patch is
  incorrect.  mkstemp returns a file descriptor rather than a string
  pointer, therefore, the subsequent open() would have undefined
  behavior. It looks like that we actually want fd = mkstemp() here.
 Thanks.  If this is the case how come gcc did not return any warnings?
  
  Note that we may want to bring vendor fixes before making any
  changes to reduce duplicated work...
 I was not aware that this was a third party program. I'll look around
 and see if this was fixed.
 

The version of ee in FreeBSD is fairly old: the latest from
http://mahon.cwx.net/ is 1.4.6.  Even so, the
latest version still generates lots of warnings from gcc because the
developer used NULL instead of '\0' (i.e the NULL constant instead of
the NUL string).  The patch at
http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/127986 fixes them; I
emailed the developer but got no reply.

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


Re: change to ee.c

2008-11-30 Thread Bruce Cran
On Sun, 30 Nov 2008 09:12:26 -0500
Eitan Adler [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Bruce Cran wrote:
 snip
  The version of ee in FreeBSD is fairly old: the latest from
  http://mahon.cwx.net/ is 1.4.6. 
 How difficult would it be to bring it up to date?  How come it has not
 been updated so far?

I'd guess it hasn't been updated because it works as it is and nobody
has taken an interest in bringing it up to date.  I don't know how many
patches have been applied locally to it but that would be the main
challenge in importing a newer version: you'd have to go through the
FreeBSD CVS history and check that any changes/fixes that were made to
FreeBSD's version are either already included in the new release or
ensure that those changes get re-applied to the new version.

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


Re: Make files for /usr/src/sys/dev/*

2008-11-15 Thread Bruce Cran
On Sun, 16 Nov 2008 04:10:31 +0059
Alexej Sokolov [EMAIL PROTECTED] wrote:

 where are the Makefiles for drivers in /usr/src/dev/*

For drivers which can be built as modules,
they're in /usr/src/sys/modules/*

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


Re: need help with vbox

2008-10-16 Thread Bruce Cran

Ivan Voras wrote:

Desmond Chapman wrote:
  

It's dependent upon kbuild. Since the developers have no intention of fixing 
the issue, I would like a tutorial on converting the kmk file to a normal 
Makefile.



What is kmk? Google only shows it's used with VirtualBox and nowhere
else. If it's something the authors of VirtualBox created, you'll have
to ask them.
  


Apparently it's the tool used to build kbuild 
(http://svn.netlabs.org/kbuild/wiki/kmk, http://kbuild.sourceforge.net/) 
projects.   It seems it's what the Linux kernel build system uses.


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


Re: ATA Security patch to atacontrol

2008-09-30 Thread Bruce Cran

Daniel Roethlisberger wrote:

Andrey V. Elsukov [EMAIL PROTECTED] 2008-09-30:
  

Jeremy Chadwick wrote:


Can you provide me datasheet and technical reference material to what
ATA Security is?  Which ATA specification is this documented in?  I'd
like to read it.
  
I think you can found it in ATA-ATAPI-7 vol.1: 4.7 Security Mode feature 
set.



Exactly.  Even though the actual T13 standard must be purchased, you can
find the documents and drafts of it online at various places by googling
for appropriate keywords.  For example:

   http://hddguru.com/content/en/documentation/2006.01.27-ATA-ATAPI-7/

The ATA command set, including the ATA Security commands, is in vol. 1.

In 2005, there was a much-cited article in the German c't magazine about
the security implications of ATA Security, which might be worth a read
too.  It is available online in English:

   http://www.heise.de/ct/english/05/08/172


http://www.t13.org has all the latest drafts at 
http://www.t13.org/Documents/MinutesDefault.aspx?DocumentType=4DocumentStage=2


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


Re: atacontrol broken in 7.1-PR

2008-09-28 Thread Bruce Cran
On Sun, 28 Sep 2008 10:43:58 + (UTC)
Pegasus McCleaft [EMAIL PROTECTED] wrote:

 Hello everyone.
 
   I was wondering if anyone else is experiencing this problem.
 I have recently reloaded my machine (due to a meltdown of my primary
 boot drive) and noticed that under 7.0-rel the atacontrol command
 seems to work great, however, under 7.1 I get and error
 
 atacontrol: ioctl(IOCATADEVICES): Device not configured
 
   Has anyone else seen this error. I wouldent be conserned if
 it wasent for the fact that it worked under 7.0-rel but now dosent.
 The machine is using both the:
 
 atapci0: SiI SiI 3132 SATA300 controller
 atapci1: JMicron JMB363 SATA300 controller

I'm also seeing this problem on my amd64 7.1-PRERELEASE system:

 atacontrol list
ATA channel 0:
Master: acd0 HL-DT-ST DVD+/-RW GSA-T11N/A102 ATA/ATAPI revision 5
Slave:   no device present
atacontrol: ioctl(IOCATADEVICES): Device not configured


I've attached the dmesg, and truss output from atacontrol list.

-- 
Bruce Cran
__sysctl(0x7fffe8b0,0x2,0x7fffe8cc,0x7fffe8c0,0x0,0x0) = 0 (0x0)
mmap(0x0,576,PROT_READ|PROT_WRITE,MAP_ANON,-1,0x0) = 34365149184 (0x800529000)
munmap(0x800529000,576)  = 0 (0x0)
__sysctl(0x7fffe920,0x2,0x800630fc8,0x7fffe918,0x0,0x0) = 0 (0x0)
mmap(0x0,32768,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34365149184 
(0x800529000)
issetugid(0x80052a015,0x800524869,0x800634910,0x8006348e0,0x57ac,0x7fffe918)
 = 0 (0x0)
open(/etc/libmap.conf,O_RDONLY,0666)   ERR#2 'No such file or 
directory'
open(/var/run/ld-elf.so.hints,O_RDONLY,057)= 3 (0x3)
read(3,[EMAIL PROTECTED]...,128) = 128 (0x80)
lseek(3,0x80,SEEK_SET)   = 128 (0x80)
read(3,/lib:/usr/lib:/usr/lib/compat:/u...,156) = 156 (0x9c)
close(3) = 0 (0x0)
access(/lib/libc.so.7,0)   = 0 (0x0)
open(/lib/libc.so.7,O_RDONLY,030607240)= 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=17511,size=1174560,blksize=4096 }) = 0 (0x0)
read(3,\^?ELF\^B\^A\^A\t\0\0\0\0\0\0\0...,4096) = 4096 (0x1000)
mmap(0x0,2240512,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_NOCORE,3,0x0) = 
34366246912 (0x800635000)
mprotect(0x800724000,4096,PROT_READ|PROT_WRITE|PROT_EXEC) = 0 (0x0)
mprotect(0x800724000,4096,PROT_READ|PROT_EXEC)   = 0 (0x0)
mmap(0x800824000,118784,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED,3,0xef000) = 
34368274432 (0x800824000)
mmap(0x800841000,94208,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0)
 = 34368393216 (0x800841000)
close(3) = 0 (0x0)
sysarch(0x81,0x7fffe9a0,0x80052e088,0x0,0xffd03650,0x7fffe6f8) 
= 0 (0x0)
mmap(0x0,384,PROT_READ|PROT_WRITE,MAP_ANON,-1,0x0) = 34365181952 (0x800531000)
munmap(0x800531000,384)  = 0 (0x0)
mmap(0x0,42096,PROT_READ|PROT_WRITE,MAP_ANON,-1,0x0) = 34365181952 (0x800531000)
munmap(0x800531000,42096)= 0 (0x0)
__sysctl(0x7fffe950,0x2,0x800841ae0,0x7fffe948,0x0,0x0) = 0 (0x0)
sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0)
 = 0 (0x0)
sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0)
open(/dev/ata,O_RDWR,03766320) = 3 (0x3)
ioctl(3,IOCATAGMAXCHANNEL,0xec20)= 0 (0x0)
ioctl(3,IOCATADEVICES,0xe590)= 0 (0x0)
fstat(1,{ mode=-rw-r--r-- ,inode=307828,size=2281,blksize=4096 }) = 0 (0x0)
__sysctl(0x7fffdba0,0x2,0x800845b48,0x7fffdbb8,0x0,0x0) = 0 (0x0)
__sysctl(0x7fffd6f0,0x2,0x8008547d8,0x7fffd6e8,0x0,0x0) = 0 (0x0)
__sysctl(0x7fffd730,0x2,0x7fffd74c,0x7fffd740,0x0,0x0) = 0 (0x0)
readlink(/etc/malloc.conf,0x7fffd790,1024) ERR#2 'No such file or 
directory'
issetugid(0x80071c2aa,0x7fffd790,0x,0x0,0x80ac1c40,0x7fffd768)
 = 0 (0x0)
break(0x60)  = 0 (0x0)
break(0x70)  = 0 (0x0)
ioctl(3,IOCATADEVICES,0xe590)ERR#6 'Device not configured'
atacontrol: write(2,atacontrol: ,12)   = 12 (0xc)
ioctl(IOCATADEVICES)write(2,ioctl(IOCATADEVICES),20)   = 20 (0x14)
: write(2,: ,2)= 2 (0x2)
Device not configured
write(2,Device not configured\n,22)= 22 (0x16)
ATA channel 0:
Master: acd0 HL-DT-ST DVD+/-RW GSA-T11N/A102 ATA/ATAPI revision 5
Slave:   no device present
write(1,ATA channel 0:\nMaster: acd0...,122) = 122 (0x7a)
process exit, rval = 1
Copyright (c) 1992-2008 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 7.1-PRERELEASE #0: Fri Sep 12 22:23:24

Re: atacontrol broken in 7.1-PR

2008-09-28 Thread Bruce Cran
On Sun, 28 Sep 2008 17:36:03 -0700
Jeremy Chadwick [EMAIL PROTECTED] wrote:
 Bruce and Pegasus,
 
 Can you please apply the below patch to src/sbin/atacontrol.c and let
 me know what the output is when doing atacontrol list?
 
 This won't solve the problem, but it will help in determining which
 piece of code in src/sys/dev/ata/ata-all.c is returning an error to
 ioctl() (different pieces of the code return different errors, either
 ENXIO, ENODEV, or another error depending upon what gets returned
 from ata_raid_ioctl_func()).

ATA channel 0:
Master: acd0 HL-DT-ST DVD+/-RW GSA-T11N/A102 ATA/ATAPI revision 5
Slave:   no device present
atacontrol: ioctl(IOCATADEVICES) returned -1: Device not configured

This laptop's running GENERIC, so ATA_STATIC_ID is in my kernel config.

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


Re: IPv6 CVS

2008-08-05 Thread Bruce Cran
On Tue, 5 Aug 2008 05:28:17 -0700
Jeremy Chadwick [EMAIL PROTECTED] wrote:

 On Tue, Aug 05, 2008 at 12:04:33PM +0100, Pegasus Mc Cleaft wrote:
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:owner-freebsd-
   [EMAIL PROTECTED] On Behalf Of Stefan Sperling
   Sent: 05 August 2008 11:51
   To: Maxim Konovalov
   Cc: freebsd-hackers@freebsd.org; Pegasus Mc Cleaft; Tim Clewlow
   Subject: Re: IPv6 CVS
   
   On Tue, Aug 05, 2008 at 02:16:35PM +0400, Maxim Konovalov wrote:
On Tue, 5 Aug 2008, 19:52+1000, Tim Clewlow wrote:
   

  Hi all,
 
  Does anyone know if there are any IPv6 CVS servers for
  FreeBSD?
   (As
  in
  receiving the STABLE and ports branches) I currently use
  cvs.freebsd.org but
  it dosent have an  record.
 
  Ta
 
  Peg

  dig  cvsup4.freebsd.org

cvs != cvsup.  Speaking of cvsup -- cvsup4.ru.freebsd.org has
an ipv6 address as well.
   
   AFAIK the Modula3 runtime does not support IPv6.
   
   Stefan
  
  Thanks everyone, 
  
  Looks like Tim is correct where I am able to ping cvsup4,
  but unfortunately the csup utility reports a fail (Connection
  Refused) as it tries to connect to the V6 address. It will quite
  happily connect to the same machine V4. 
 
 csup is written in C; it does not use Modula3/ezm3.  cvsup uses
 Modula3/ezm3.

The problem is cvsupd - since it's written in Modula3 and doesn't
support IPv6 you have to use an inetd/netcat hack to accept IPv6
connections on the server. As mentioned in
http://lists.freebsd.org/pipermail/freebsd-current/2008-July/086710.html
cvsup18.freebsd.org and cvsup4.ru.freebsd.org both accept IPv6
connections.

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


Re: profiling broken on RELENG_7/i386

2008-07-13 Thread Bruce Cran
On Sun, 13 Jul 2008 18:01:12 +0400 (MSD)
Dmitry Morozovsky [EMAIL PROTECTED] wrote:

 On Sun, 13 Jul 2008, Peter Jeremy wrote:
 
 PJ On 2008-Jul-04 13:01:11 +0400, Dmitry Morozovsky [EMAIL PROTECTED]
 PJ wrote:
 PJ It seems we step on a bug in gcc in RELENG_7/i386
 PJ 
 PJ It is triggered at least by profiling program which uses
 PJ getopt(3):
 PJ 
 PJ I think it's actually in the profiling initialisation code.  If
 PJ you try to run sample code under gdb, you can see that .mcount()
 PJ is not preserving %ecx, though main() assumes it does.
 
 I see.  However, I'm afraid we need knowledge of some gcc guru to
 bring the fix in.
 

This is a known bug in 7.x and has apparently been fixed in -CURRENT. 
See http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/119709 for more
details.

-- 
Bruce Cran




signature.asc
Description: PGP signature


Re: Glaring 64 bit omission

2008-07-09 Thread Bruce Cran
On Wed, 9 Jul 2008 13:50:17 -0400
Zaphod Beeblebrox [EMAIL PROTECTED] wrote:

 I did mention in my introduction that I was aware of this history
 (including that web page).  I brought this up again because it hadn't
 seen daylight in quite some time.  The Wiki page seems to say that it
 was updated about a month ago.  Without figuring how to pull the
 wiki's version history, I don't see significant change.  Of note, the
 last conversation the wiki references is 8 months old.
 
 In particular, none of these activities seem to pop up in the regular
 FreeBSD Project status reports.

Click on the Info link to see the history. The recent change was just
to the markup, not the page content; the last real change was in
November 2007.

-- 
Bruce Cran


signature.asc
Description: PGP signature


Re: How can I translate IP to hostname in C

2008-05-22 Thread Bruce Cran

John Timony wrote:

Hi,guys

I am writing a c program in FreeBSD,and I can not
translate a ip to hostname
,i wonder if there is a function to take this job...



You could use gethostbyaddr(3), but those traditional functions have 
been replaced with more flexible versions such as getnameinfo(3) on 
newer systems.  There's a good introduction to modern sockets 
programming at http://people.redhat.com/drepper/userapi-ipv6.html


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


Re: sshd patch to avoid DNS lookups when using 'UseDNS no' or -u0

2008-05-11 Thread Bruce Cran

Ollivier Robert wrote:

According to Bruce Cran:
I've attached a patch which implements this (the change to loginrec.c 
reverts it back to the default OpenSSH code) and was wondering if someone 
could take a look at it.


If you have not already done so, please use send-pr to record it in GNATS,
that will help not forgetting about it, thanks!


The patch has been attached to PR bin/97499 - 
http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/97499


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


sshd patch to avoid DNS lookups when using 'UseDNS no' or -u0

2008-04-30 Thread Bruce Cran

While investigating PR bin/97499 I realised that revision 1.2 of
loginrec.c, which was in FreeBSD 4.6, introduced a DNS lookup into sshd
itself which is impossible to avoid even after specifying 'UseDNS no' or 
-u0, and which duplicates one which has already been done earlier.


The default OpenSSH behaviour is to decide whether or not to do the DNS
lookup in get_remote_name_or_ip based on both the UseDNS setting and
whether -u0 was specified on the command line.  This has the
disadvantage that unless the utmp length is specified on the command 
line the IP address may be resolved even when the hostname later has to 
be truncated to fit in the utmp record; it's this
that rev 1.2 of loginrec.c fixed.  A alternative solution which avoids 
the extra DNS lookup is to initialize the utmp_len variable in sshd.c to 
be UT_HOSTSIZE instead of MAXHOSTNAMELEN: this keeps the existing 
behaviour but still allows the user to override it

with the -u parameter.

I've attached a patch which implements this (the change to loginrec.c 
reverts it back to the default OpenSSH code) and was wondering if 
someone could take a look at it.


--
Bruce


 --- /usr/src/crypto/openssh/loginrec.c 2006-09-30 14:38:04.0 +0100
 +++ loginrec.c 2008-03-31 21:45:37.0 +0100
 @@ -688,8 +688,8 @@
strncpy(ut-ut_name, li-username,
MIN_SIZEOF(ut-ut_name, li-username));
  # ifdef HAVE_HOST_IN_UTMP
 -  realhostname_sa(ut-ut_host, sizeof ut-ut_host,
 -  li-hostaddr.sa, li-hostaddr.sa.sa_len);
 +  strncpy(ut-ut_host, li-hostname,
 +  MIN_SIZEOF(ut-ut_host, li-hostname));
  # endif
  # ifdef HAVE_ADDR_IN_UTMP
/* this is just a 32-bit IP address */


 --- /usr/src/crypto/openssh/sshd.c 2006-11-10 16:52:41.0 +
 +++ sshd.c 2008-03-31 21:45:41.0 +0100
 @@ -71,6 +71,7 @@
  #include stdlib.h
  #include string.h
  #include unistd.h
 +#include utmp.h

  #include openssl/dh.h
  #include openssl/bn.h
 @@ -235,7 +236,7 @@
  u_int session_id2_len = 0;

  /* record remote hostname or ip */
 -u_int utmp_len = MAXHOSTNAMELEN;
 +u_int utmp_len = UT_HOSTSIZE;

  /* options.max_startup sized array of fd ints */
  int *startup_pipes = NULL;



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


Re: Re: Architectures with strict alignment?

2008-01-05 Thread Bruce Cran

Marco van de Voort wrote:

On Sat, Dec 08, 2007 at 03:43:30AM +0100, Ivan Voras wrote:

  

Which of the architectures FreeBSD supports (if any) have strict memory
alignment requirements? (in the sense that accessing a 32-bit integer
not aligned on a 32-bit address results in a hardware trap/exception).



I do know that older PPCs (PowerPC603) have a requirement on aligning of
floats.

IIRC the e.g. Linux the kernel hooks an exception handler that makes it
transparent for apps (at the cost of some performance), and NetBSD does not
I never ran FreeBSD on PPC, so I wouldn't know that one.
  


The newer 32-bit PPCs (G4 / PPC7447A) can't handle unaligned 64-bit 
accesses
either - they generate a trap which gets handled by fix_unaligned in 
/sys/powerpc/powerpc/trap.c on FreeBSD.


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


Re: Very slow writing to SATA disk

2005-10-29 Thread Bruce Cran
On Sat, Oct 29, 2005 at 01:00:36AM +0200, S?ren Schmidt wrote:
 
 On 29/10/2005, at 0:41, Mikhail Teterin wrote:
 
 Look in smartmontools I provided patches for that, its not rocket
 science you know...
 
 
 This attitude -- on top of the API change itself -- is not really  
 encouraging
 for ISVs, you know :-)
 
 Sigh, ataidle is a hack and the author had no intention to listen  
 back when, so I dont feel teribly sorry about it you know. Spinning  
 down disks needs to be done at the driver level so ATA knows what  
 state the disk is in etc...

I'm the author of ataidle.  I know it is a hack, and I agree that
power management should be done at the driver level.  However, I have
released what worked for me in the hope that other people find it useful
- but yes, there is always the possibility that data will be lost, since
  it does bypass the driver.

Unfortunately I've been very busy recently and so have until
now been unable to look at FreeBSD 6.0 and the new ATA driver.  
I have however updated ataidle to cope with the 
new API and it can be downloaded from
http://www.cran.org.uk/bruce/software/ataidle-0.9.tar.gz .

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


Re: FreeBSD and MacOS

2004-07-03 Thread Bruce Cran
On 3 Jul 2004, at 10:05, Eitarou Kamo wrote:
Hi John and all,
John Von Essen wrote:
Since OPENSTEP kernel had an x86 port, its not to far off to conclude 
that darwin could be run on x86 - but I think all the x86 talk was 
just hypothetical - would only happen in real life if some hardcore 
coders had alot of spare time on their hands...
Apple will not invest it, I wonder.
No, Apple _does_ invest the money and time to create an x86 port: 
http://www.opensource.apple.com/darwinsource/
That is only the kernel and command-line utilities, there's no GUI 
included.   http://www.kernelthread.com/mac/osx/arch_xnu.html provides 
a good overview of the kernel.   Apple did have a port of MacOS X to 
x86 
(http://www.theregister.co.uk/2002/09/02/apples_x86_os_named_sized/), I 
would guess they were waiting to see which CPU they were going to use 
after the G3, since Motorola were being a little slow in making faster 
PowerPC CPUs.   They were considering switching to an Intel-based line; 
 in the end they went with IBM and their PPC970, so I would think it's 
fairly unlikely we'll now ever see a version (of the GUI) for x86.

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


Re: Setting Standby Mode for ATA Disks

2004-07-02 Thread Bruce Cran
On 25 Jun 2004, at 17:51, Arne Schwabe wrote:
Hi,
is there a way to set the standby mode for ATA Disks
Under linux hdparm -S seems to work:
   -S Set the standby (spindown) timeout for the drive.  This 
value is
  used by the drive to determine how long to wait  (with  
no  disk
  activity)  before  turning  off the spindle motor to 
save power.
  Under such circumstances, the drive may take as long as 
30  sec-
  onds  to respond to a subsequent disk access, though 
most drives
  are much quicker.  The encoding of the timeout value is 
somewhat
  peculiar.   A  value  of zero means off.  Values from 
1 to 240
  specify multiples of 5 seconds, for timeouts from 5  
seconds  to
  20  minutes.   Values from 241 to 251 specify from 1 to 
11 units
  of 30 minutes, for timeouts from 30 minutes  to  5.5  
hours.   A
  value  of 252 signifies a timeout of 21 minutes, 253 
sets a ven-
  dor-defined timeout, and 255 is interpreted as 21  
minutes  plus
  15 seconds.

I googled but I did not found anything like this for FreeBSD :/
ATAidle (http://www.cran.org.uk/bruce/software/ataidle.php and 
sysutils/ataidle in ports) does this.  Unfortunately due to a site 
redesign, the page seems to have been dropped from the google results; 
I'll have to add the keywords back in so it gets listed again!

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


Re: utility to set idle timeout on ata drives

2004-01-02 Thread Bruce Cran
On Thu, Jan 01, 2004 at 10:33:03PM -0500, Matthew N. Dodd wrote:
 On Thu, 1 Jan 2004, Bruce Cran wrote:
  If people are interested I can add more power management features
  and possibly create a package/port of it.
 
 It it really necessary to use a configure script and associated junk to
 build a utility that is less than 500 lines of code?
 

It's not necessary at the moment, and I've removed it all in version 0.02
in favour of a very simple Makefile.
However, if I'm making a port of it, the configure stuff makes it easier 
for users to reconfigure where to install it, any options which appear etc.
I personally think that although the configure scripts massively bloat
the package, it makes it easier for end-users since most packages use it,
and it's generally more user-friendly than manually editing a Makefile to
change options, where to install, libs and all that.  In addition, the
current version is very basic, and I'm already planning to extend it to
handle all the other power management issues - my aim is to have a program
that eventually correctly handles more or less the complete feature set
of power management in ata drives.

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


utility to set idle timeout on ata drives

2004-01-01 Thread Bruce Cran
I've been putting together a router/gateway box for my network,
but had been wanting to spin down the hard drives to reduce the
noise of the box.   I've put together a page which I think might be
useful for people putting together router machines as well as laptop
users - it's at http://www.cran.org.uk/bruce/software.php.  It 
describes how to get a FreeBSD 5.1 or later computer to spin-down
ata hard drives - I've been searching for a while for a utility to
do this, and after failing to find one I decided to write it myself.
If people are interested I can add more power management features
and possibly create a package/port of it.  Apologies if this is
off-topic for -hackers - I hope people might find this information
useful.

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


Re: Ultra ATA card doesn't seem to provide Ultra speeds.

2003-07-31 Thread Bruce Cran
On Thu, Jul 31, 2003 at 06:33:28PM -0600, [EMAIL PROTECTED] wrote:
 
   Maybe not, but they do give a transferspeed from medium range and that
   is what can be expected.
 
  Hmm, I guess not everyone does that. We have some seagates here at work we
  were wondering about because they seemed too slow, and we couldn't find
  anything aside from what we already knew... the tranfer speed of the
  SCSI interface, which is basically from drive cache to controller. That is
  unless the manufacturers hide the info somewhere so you really have to
  dig, which wouldnt' surprise me.
 
 Example took me less than 64 seconds to find (for Seagate Barracuda IV):
 http://www.seagate.com/cda/products/discsales/personal/family/0,1085,559,00.html
 Look for 'Avg. Sustained Transfer Rate'. AFAIK, every manufacturer I know
 gives the sustained transfer rate specs (which are sometime a bit too high than
 in reality). If the specs are not specified, it'd be very suspicious, and I
 would think 128 time before buying such drives.
 

The transfer rates are usually given for the outside of the disk I think. 
Speeds usually drop about 15-20MB/s between the outside and
inside.   If you've got FreeBSD 5.1, you can use the 'diskinfo -t disk' 
command to measure the performance of the hard drive.   It should be a little
more accurate than using dd, because I'm guessing the reads/writes don't go
through the vfs layer.

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


Re: file size different from ls to du

2003-07-29 Thread Bruce Cran
On Tue, Jul 29, 2003 at 05:27:14PM +0200, Bogdan TARU wrote:
 
   Hi Drew,
 
  I have tried to create some files of myself, with 'spaces' in them
 (holes?), but they don't act like this. So could you please explain what
 'sparse' means, and the 'trick' to create them?
 

Try using the 'truncate' utility:

truncate -s 102400G onehundred_terabytes

This will create a file which looks like it's 100TB though 'ls', but
which only uses 64KB in the directory usage via 'du'.  Generally, creating
a file, seeking past the end of the file then writing something, 
will create a 'sparse' file.  This, when read, will appear 
to contain zeros for all entries past the previous end of file, 
to the entry which was written to.

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


BCM4401 driver

2003-07-28 Thread Bruce Cran
I realise that there's a 'beta' FreeBSD driver out for this card, and I've 
been attempting to learn the kernel interfaces such as bus_dma and mbuf
handling to debug it, but without much success.  On my Dell, it seems to
mostly work if I set the number of RX descriptors very low, around 5, but at
the default of 200 the network stalls with invalid packets.   Running a 
tcpdump on the interface shows that, with 5 descriptors, there's an occasional
bad packet, but it doesn't stop any network access working.  With 200, I get
loads of bad packets, where tcpdump shows the mac addresses (the ethernet
header I guess)  quite a few bytes
into the packet.   I recently ran the system with the driver preloaded, and
after a while it locked the system up, spamming me with 'bcm0: discarding frame
w/o ethernet header (len 4294967296 pktlen 4294967296)'.  It looks as though
there's either a problem with where the chip is putting the data, or
something's wrong with the mbuf handling, but which only gets triggered after
a while.   Does anyone know enough about 
network drivers to know what the problem might be? 
It would be great to have this card supported, and it seems that the driver 
is very near to being working, it just needs a bit more debugging work 
done on it.

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


Re: High CPU usage when forwarding packets

2003-03-08 Thread Bruce Cran
On Fri, Mar 07, 2003 at 10:58:23AM -0800, Terry Lambert wrote:
 Bruce Cran wrote:
  Also, I'm getting
  several thousand 'lnc0: Missed packet -- no receive buffer' messages.
  Could this be the problem, or is the system just not powerful enough do
  nat?  The sis0 card is 100MBit PCI, while the lcn0 is 10MBit ISA.
 
 The no receive buffers available message happens when the
 system runs out of mbufs.
 
 There are a lot of reasons this could happen, but the proximal
 cause is you didn't tune the number NMBCLUSTERS, et. al. high
 enough.  You should try rebuilding your kernel with a larger
 number.
 
 If the problem still happens, you need to do a netstat -a  x,
 and then look for large numbers in the Recv-Q and Send-Q
 columns, and then figure out what's causing them.
 

Thanks, I added kern.ipc.nmbclusters=8192 to /boot/loader.conf and the
messages have stopped.   I have also learnt that the high CPU usage is
simply because I'm trying to push 600KB/sec over an ISA bus, and lots
of copying is going on.   I'd like to get a PCI card and stop using the
onboard lnc, but unfortunately the single PCI slot is already taken up
by other other NIC.

Bruce Cran

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


High CPU usage when forwarding packets

2003-03-07 Thread Bruce Cran
I've just setup a P75 system as a router, containing fa311 and pcnet network
cards.   The fa311 is doing nat to my private network, which is served by the
pcnet card.  However, I've found that it often uses 40% cpu just to send
packets from the fa311 (sis) to the pcnet (lnc) cards.  natd uses 20%, 10%
are interrupts, and 25% is 'system' as shown in top.  Also, I'm getting 
several thousand 'lnc0: Missed packet -- no receive buffer' messages.
Could this be the problem, or is the system just not powerful enough do
nat?  The sis0 card is 100MBit PCI, while the lcn0 is 10MBit ISA.

Bruce Cran

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