From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 11 13:40:30 2009 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D38A2106564A for ; Wed, 11 Feb 2009 13:40:30 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 121138FC1E for ; Wed, 11 Feb 2009 13:40:29 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA12335; Wed, 11 Feb 2009 15:25:05 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <4992D1B0.8020708@icyb.net.ua> Date: Wed, 11 Feb 2009 15:25:04 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.19 (X11/20090110) MIME-Version: 1.0 To: Aniruddha Bohra , hackers@freebsd.org References: <43a2dc1a0902101243w5ce35609x35dbe440c39d80a8@mail.gmail.com> In-Reply-To: <43a2dc1a0902101243w5ce35609x35dbe440c39d80a8@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: a little bit of c++ in kernel [module] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 13:40:31 -0000 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 > Aniruddha, thank you very much for the feedback! I looked through the code and the patch and I see the following: 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. The questions that I have left: 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? 2. did you have to write any other run-time support code or platform glue code (besides new/delete)? 3. I assume virtual inheritance can be used in kernel code? do you use it? Thank you again! -- Andriy Gapon