Re: C++ code in a kernel module?

2003-09-09 Thread Peter Jeremy
On Mon, Sep 08, 2003 at 11:12:59PM -0400, Alexander Kabaev wrote:
On Mon, 8 Sep 2003 23:02:33 -0400
Matthew Emmerton [EMAIL PROTECTED] wrote:

 I've been silently following this thread, and unless I missed
 something, has anyone asked John why he wants/needs to use C++ in the
 kernel?
 
Tools, not policy :)

True but if John explains more of what he is trying to do, maybe
someone can suggest either a way to avoid C++ or some insights as to
how he can get his C++ modules to work.

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


Perl 5.8.1-RC4 release notes mention FreeBSD malloc upto 200 times slower than perl malloc

2003-09-09 Thread Yusuf Goolamabbas
In the Perl 5.8.1-RC4 release notes posted here

http://dev.perl.org/perl5/news/2003/perl-5.8.1-RC4.html

it mentions about the Platform specific problems seen by the Perl
development team. 
--
FreeBSD: malloc dilemma

The choice of malloc (the C-level memory management interface) when
building Perl is problematic in FreeBSD.

Using FreeBSD's system malloc for Perl was found to be very slow: in
some cases that was 200 times slower than using the Perl malloc. One
such case is file input: for example

# slurping the whole compressed Perl source code into $a
if (open F,perl-5.8.1.tar.gz) { local $/; $a=F }

is about 200-250 times slower with the system malloc than with the Perl
malloc.

One could use Perl's malloc (Configure -Dusemymalloc), but that was
found to cause random core dumps in FreeBSD with multithreaded programs.
No such problems were found in other platforms, however.

A decision was made to stick with the system malloc, regardless of the
performance problems.
--

Maybe the test case can assist FreeBSD kernel hackers to make malloc
faster.

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


Re: Serial ATA 4.8 Installation -help

2003-09-09 Thread Soren Schmidt
It seems florian mettetal wrote:
 Greetings,
 
 I have built a brand new system founded on an Asus P4PE motherboard, and
 using the FastTrack raid function I have turned my two Maxtor 80GB
 Serial ATA (now reffered to as SATA) hard drives into a Mirror raid.
 
 Proceeding to start the installation of FreeBSD 4.8-stable I selected
 Standard Install, Press ok at the pop up, then at the following popup I
 am confronted with FreeBSD telling me that No disks found! Please
 verify that your disk controller is being properly probed at boot time.
 Has anyone else had this issue? Is this problem fixed in FreeBSD 5.X .
 What can I do to get this to work in FreeBSD 4.8? 

4.x doesn't support the Promise SATA controllers, you need at least 5.1
for that. The -current ATA driver might be backported later this year,
nothing definite yet.

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


Re: linprocfs issues

2003-09-09 Thread Dag-Erling Smørgrav
Steven Hartland [EMAIL PROTECTED] writes:
 Also it seems that linprocfs relies on procfs being mounted
 however I cant find any docs that mention this and see no
 reason why it should be the case. The problem I see
 is that I get errors from linux apps about /proc/pid/file
 not existing. When trussing them they are never trying to
 open file I suspect it is happening when the access either
 cmdline or exe most likely exe.

linprocfs uses parts of the procfs code; for instance, linprocfs's
pid/exe and procfs's pid/file are backed by the same code.  In the
case of pid/cmdline, which exists with the same name in both FreeBSD
and Linux, linprocfs relies on procfs's cmdline to show through
rather than duplicate it.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: OpenBFS (was Re: C++ code in a kernel module?)

2003-09-09 Thread Doug Barton
On Mon, 8 Sep 2003, Pedro F. Giffuni wrote:

 Hi;

 Attached is a good reasons why someone my want to use C++ in the kernel.

Sorry, I don't see anything here except this is all we know how to do.
But, I'm a curmudgeon. :)

Doug

-- 

This .signature sanitized for your protection

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


Re: Booting a machine over the network without pxe.

2003-09-09 Thread omestre
On Tue, 2 Sep 2003, Josef Karthauser wrote:

Here is How i have made this task:

http://www.freebsd.org/cgi/query-pr.cgi?pr=54383

 I guess that is exactly what you want. I have posted a
PR, and maybe the FreeBSD devel team think about it. :)

 []'s

 Leal


 Date: Tue, 2 Sep 2003 21:54:18 +0100
 From: Josef Karthauser [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Booting a machine over the network without pxe.

 Does anyone have any experience of booting a machine over the
 network, like pxeboot, but without running PXE on a network card.
 I imagine that it should be possible to load pxeboot at the boot:
 prompt and have everything just work.

 I could really do with booting my laptop into -stable, where it's only
 got -current installed.  I do however have a -stable server on site with
 plenty of disk space.  It would be really cool to remote boot of that
 via NFS mounts, etc.

 Joe
 --
 Josef Karthauser ([EMAIL PROTECTED]) http://www.josef-k.net/
 FreeBSD (cvs meisterk admin and hacker) http://www.uk.FreeBSD.org/
 Physics Particle Theory (student)   http://www.pact.cpes.sussex.ac.uk/
  An eclectic mix of fact and theory. =


[EMAIL PROTECTED]
SDF Public Access UNIX System - http://sdf.lonestar.org
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Perl 5.8.1-RC4 release notes mention FreeBSD malloc upto 200 times slower than perl malloc

2003-09-09 Thread Kris Kennaway
On Tue, Sep 09, 2003 at 03:00:17PM +0800, Yusuf Goolamabbas wrote:

 Maybe the test case can assist FreeBSD kernel hackers to make malloc
 faster.

This is a FAQ.  For any algorithm one can come up with a workload that
makes it perform badly.  The trick is making it perform well for
common workloads, which FreeBSD's malloc does.

Kris


pgp0.pgp
Description: PGP signature


Re: C++ code in a kernel module?

2003-09-09 Thread John Giacomoni
On Tuesday, Sep 9, 2003, at 00:29 America/Denver, Peter Jeremy wrote:

On Mon, Sep 08, 2003 at 11:12:59PM -0400, Alexander Kabaev wrote:
On Mon, 8 Sep 2003 23:02:33 -0400
Matthew Emmerton [EMAIL PROTECTED] wrote:
I've been silently following this thread, and unless I missed
something, has anyone asked John why he wants/needs to use C++ in the
kernel?
Tools, not policy :)
True but if John explains more of what he is trying to do, maybe
someone can suggest either a way to avoid C++ or some insights as to
how he can get his C++ modules to work.
Peter
simple, I have preexisting C++ code which we are currently
using in userland and wish to push down into the kernel.
It would be ideal to keep the source bases the same without
a rewrite to C.  Admitting of course the possibility of having
to modify to be compatible with both use modes.
At present I am attempting to see what we can and cannot do
in the kernel with C++
John G

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


Re: C++ code in a kernel module?

2003-09-09 Thread Justin C. Walker
On Tuesday, September 9, 2003, at 08:58 AM, John Giacomoni wrote:

On Tuesday, Sep 9, 2003, at 00:29 America/Denver, Peter Jeremy wrote:

On Mon, Sep 08, 2003 at 11:12:59PM -0400, Alexander Kabaev wrote:
On Mon, 8 Sep 2003 23:02:33 -0400
Matthew Emmerton [EMAIL PROTECTED] wrote:
[snip]
simple, I have preexisting C++ code which we are currently
using in userland and wish to push down into the kernel.
It would be ideal to keep the source bases the same without
a rewrite to C.  Admitting of course the possibility of having
to modify to be compatible with both use modes.
At present I am attempting to see what we can and cannot do
in the kernel with C++
FWIW, Darwin (the underpinnings for Mac OS X) uses C++ for its device 
drivers.  This is done by hewing to a model roughly that of Embedded 
C++, compiling statically, and having a separate library that differs 
from libstdc++ in significant ways.  Getting this to work well was 
non-trivial, but it does work (sadly :-}).

If you are trying to get user-mode code to work in the kernel, you are 
in for an enjoyable year...

You can check Apple's Darwin site for available doc 
(http://developer.apple.com/darwin).  The code is available under 
Apple's open source license (APSL 2.0).

Regards,

Justin

--
/~\ The ASCII   Justin C. Walker, Curmudgeon-at-Large
\ / Ribbon Campaign
 X  Help cure HTML Email
/ \
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: C++ code in a kernel module?

2003-09-09 Thread Fred Gilham



 I don't know about __gxx_personaility_v0, but your best bet is to
 look at the .o's and find where it is referenced.  Then back track
 it to what function, then to what construct and go from there.

The __gxx_personality_v0 stuff is actually related to distinguishing
between C++ and Java exceptions.  At least that's what I remember from
my encounters with the same problem.  I haven't been able to retrieve
the documentation that explains it, though.

It seems to come up when you try to link C++ code with the C linking
convention.

-- 
Fred Gilham   [EMAIL PROTECTED]
Lisp has jokingly been called the most intelligent way to misuse a
computer. I think that description is a great compliment because it
transmits the full flavor of liberation: it has assisted a number of
our most gifted fellow humans in thinking previously impossible
thoughts.   E. Dijkstra
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Perl 5.8.1-RC4 release notes mention FreeBSD malloc upto 200 times slower than perl malloc

2003-09-09 Thread Enache Adrian
On Tue, Sep 09, 2003 a.d., Yusuf Goolamabbas wrote:
 # slurping the whole compressed Perl source code into $a
 if (open F,perl-5.8.1.tar.gz) { local $/; $a=F }

I fortunately fixed that in perl 5.8.1, so when slurping regular files
the buffer is no longer grown by little steps with realloc.

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


Re: OpenBFS (was Re: C++ code in a kernel module?)

2003-09-09 Thread Pedro F. Giffuni
--- Doug Barton [EMAIL PROTECTED] wrote:
 On Mon, 8 Sep 2003, Pedro F. Giffuni wrote:
 
  Hi;
 
  Attached is a good reasons why someone my want to use C++ in the kernel.
 
 Sorry, I don't see anything here except this is all we know how to do.
 But, I'm a curmudgeon. :)
 

To be good in C++ you have to be good in C first (at least in theory) and
programmers that feel more modern tend to use OO techniques for the new
stuff. 

I have to admit I don't find much of an advantage in C++, but it doesn't make
much sense to rewrite existing code or change your programming style to
maintain everything in C.

Just my $0.02,

Pedro.



__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: C++ code in a kernel module?

2003-09-09 Thread M. Warner Losh
In message: [EMAIL PROTECTED]
Matthew Emmerton [EMAIL PROTECTED] writes:
: I've been silently following this thread, and unless I missed something, has
: anyone asked John why he wants/needs to use C++ in the kernel?

I refrained from posting the name of a good neurologist in Boulder
that he could go see to get his head checked.

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


NFS mounts and jails

2003-09-09 Thread Brian Reichert
I've successfully been exploring using NFS mounts within a jail.

It's clear to me that a host box running multiple jails needs to
expose that NFS mount to each jail.

As far as I know, that means that NFS partition has to be mounted
(redundantly?) for each jail, even in (in my case), they'll all be
access in the the same way (eg. read-only).

This seems to be that you'll quickly run into some effective upper
limit as to how many NFS mounts a FreeBSD machine can handle (I'm
using 4.7-R for my current experiments.)

So, my question(s):

- is my assertion correct; that is, do I need to redundantly mount
  the same NFS partition for each jail for each jail to access it?

- if not, is there a mechanism for jails sharing a read-only NFS
  mountpoint?

Thanks for any advice...

-- 
Brian 'you Bastard' Reichert[EMAIL PROTECTED]
37 Crystal Ave. #303Daytime number: (603) 434-6842
Derry NH 03038-1713 USA BSD admin/developer at large
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: C++ code in a kernel module?

2003-09-09 Thread Jordan K Hubbard
I can't believe nobody has yet suggested that FreeBSD switch to IOKit...

On Sep 9, 2003, at 12:38 PM, M. Warner Losh wrote:

In message: [EMAIL PROTECTED]
Matthew Emmerton [EMAIL PROTECTED] writes:
: I've been silently following this thread, and unless I missed 
something, has
: anyone asked John why he wants/needs to use C++ in the kernel?

I refrained from posting the name of a good neurologist in Boulder
that he could go see to get his head checked.
Warner
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to 
[EMAIL PROTECTED]

--
Jordan K. Hubbard
Engineering Manager, BSD technology group
Apple Computer
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: C++ code in a kernel module?

2003-09-09 Thread Vaclav Haisman

Apart from -fno-rtti and -fno-exceptions you will probably need to use also
-ffreestanding. Excerpt from gcc man page:

   -ffreestanding
   Assert that compilation takes place in a freestanding environment.
   This implies -fno-builtin.  A freestanding environment is one in
   which the standard library may not exist, and program startup may
   not necessarily be at main.  The most obvious example is an OS
   kernel.  This is equivalent to -fno-hosted.


Vaclav Haisman


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


Basic C++ fBSD 5.x kernel module

2003-09-09 Thread John Giacomoni
I have succeeded in getting a basic C++ module to function inside the
FreeBSD 5.1 kernel.
I figured I'd show the small example I have cooked up which uses basic
C++ constructs such a new/delete and virtual inheritance.
As suggested I have turned off exceptions have been turned off along 
with
RTTI.

the source and Makefile can be found at:
http://www.cs.colorado.edu/~jgiacomo/fbsd_c++module
Things to note are:
a) I rolled my own .cc.o extension to the Makefile
   removed -std=c99
   added -fno-exceptions -fno-rtti -fno-builtin -nostdinc++
   (-fno-builtin should be implied by -ffreestanding but does not seem 
to be)

b) __unused does not seem to work and needed to be #undef'ed
   * Any thoughts?
c) Constructs of the form static void const * const seem to be
   silently ignored by the compiler.  Possibly being 'inlined' in some 
fashion?
   * Any thoughts?

part is 'c' is problem as various macros, such as MALLOC_DEFINE and
DEV_MODULE, use that construct for initialization.
thoughts? comments?  suggestions?

John G

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


Re: NFS mounts and jails

2003-09-09 Thread Nielsen
 As far as I know, that means that NFS partition has to be mounted
 (redundantly?) for each jail, even in (in my case), they'll all be
 access in the the same way (eg. read-only).

Yup, that's right.

 - is my assertion correct; that is, do I need to redundantly mount
   the same NFS partition for each jail for each jail to access it?

As far as I know, yes that's the case. If you're mounting the same system
however you may want to look into mount_null. Yes, there are cache issues,
and these have been discussed multiple times (see the archives), but I've
used null mounts successfully in read-only mode for several years now
without problems.

Cheers,
Nate


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


Re: Serial ATA 4.8 Installation -help

2003-09-09 Thread florian mettetal
On Tue, 2003-09-09 at 02:54, Soren Schmidt wrote:
 It seems florian mettetal wrote:
  Greetings,
  
  I have built a brand new system founded on an Asus P4PE motherboard, and
  using the FastTrack raid function I have turned my two Maxtor 80GB
  Serial ATA (now reffered to as SATA) hard drives into a Mirror raid.
  
  Proceeding to start the installation of FreeBSD 4.8-stable I selected
  Standard Install, Press ok at the pop up, then at the following popup I
  am confronted with FreeBSD telling me that No disks found! Please
  verify that your disk controller is being properly probed at boot time.
  Has anyone else had this issue? Is this problem fixed in FreeBSD 5.X .
  What can I do to get this to work in FreeBSD 4.8? 
 
 4.x doesn't support the Promise SATA controllers, you need at least 5.1
 for that. The -current ATA driver might be backported later this year,
 nothing definite yet.
 
 -Sren


Hmm... I have never setup a mirror Raid before, especially never in
FreeBSD 5.1 , I have always been using 4.8  =/ 

Now, I am at the Select Drives (Second screen) which menas that 5.1 does
see my promise SATA raid controller. Now... I have 3 selections to use
for drives, ad4, ad6, ar0 
First, I have 2 drives, and one is just a mirror of the other. my
presumption is to singularly use ar0, but... I really do not know. And
as this will someday hopefully be my production server... I wanna set it
up right. 

Any clues anyone? 

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


Re: NFS mounts and jails

2003-09-09 Thread Brian Reichert
On Wed, Sep 10, 2003 at 01:08:50AM +, Nielsen wrote:
  - is my assertion correct; that is, do I need to redundantly mount
the same NFS partition for each jail for each jail to access it?
 
 As far as I know, yes that's the case. If you're mounting the same system
 however you may want to look into mount_null. Yes, there are cache issues,
 and these have been discussed multiple times (see the archives), but I've
 used null mounts successfully in read-only mode for several years now
 without problems.

Thanks for the feedback, let me explore that option...

 Cheers,
 Nate

-- 
Brian 'you Bastard' Reichert[EMAIL PROTECTED]
37 Crystal Ave. #303Daytime number: (603) 434-6842
Derry NH 03038-1713 USA BSD admin/developer at large
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


FYI: NetBSD mmap Improvements

2003-09-09 Thread Pedro F. Giffuni
taken from wine HQ:

http://www.winehq.com/?issue=186#NetBSD mmap Improvements

On NetBSD (upcoming 1.6.2, and 1.7/2.0-current), there is a new extension flag
MAP_TRYFIXED that essentially simulates current Linux mmap behavior: try the
mmap() hint first, without clobbering mapped pages, even if the hint falls
within traditionally protected malloc heap space. If the fixed mapping fails,
the block is still mapped at a relocated address, as if mmap were called with
no flags set. 

With this patch, mmapping PE files on NetBSD becomes an order of magnitude
faster, as the vfork()-and-mincore() silly walk is avoided altogether. 

I've implemented the patch as forward-looking, allowing other platforms to add
MAP_TRYFIXED to gain the same benefit. (This mmap flag name does not appear to
be used in any divergent fashion on any other platform, per my research when
picking the flag's name.) 



__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Booting a machine over the network without pxe.

2003-09-09 Thread John-Mark Gurney
omestre wrote this message on Tue, Sep 09, 2003 at 14:22 +:
 On Tue, 2 Sep 2003, Josef Karthauser wrote:
 
 Here is How i have made this task:
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=54383
 
  I guess that is exactly what you want. I have posted a
 PR, and maybe the FreeBSD devel team think about it. :)

boot.netif.hostname already exists as kern.hostname.  Why create yet
another knob for the same value?

Why don't you make it parse nfsroot.* from vfs.root.mountfrom?  That way
you can specify it as nfs:host:/path.

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

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