From owner-freebsd-hackers Tue Nov 14 9:41:17 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 44BE237B4E5 for ; Tue, 14 Nov 2000 09:41:15 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.0/8.11.0) with ESMTP id eAEHfDR12501; Tue, 14 Nov 2000 10:41:14 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id KAA48265; Tue, 14 Nov 2000 10:41:13 -0700 (MST) Message-Id: <200011141741.KAA48265@harmony.village.org> To: tjmsdn@ifrance.com Subject: Re: C and C++ on FreeBSD Cc: freebsd-hackers@FreeBSD.ORG In-reply-to: Your message of "Tue, 14 Nov 2000 12:21:31 EST." <00111412240100.00321@tjonas_dev.eicon.com> References: <00111412240100.00321@tjonas_dev.eicon.com> Date: Tue, 14 Nov 2000 10:41:13 -0700 From: Warner Losh Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <00111412240100.00321@tjonas_dev.eicon.com> Thierry writes: : We are implementing our OS modem on FreeBSD, but lot of our sources : have writen in C++. Is it possible to compile the FreeBSD kernel in : C++ to include our driver ? Yes and No. If you use only the bare minimal subset of features for the C++ and avoid the problem areas of the language, you might be able to. But you'd have to add new and delete support to the kernel's library. That should be almost trivial. The problem areas definitely include exceptions, some automatic memory allocation (where temporary variables are malloced), large objects appearing on the stack (because the kernel stack is so small). I don't know if ctors for static objects would be called in the kernel. Templates might also be a problem, but they might not. Years ago I was able to do some very simple C++ in the kernel, but never integrated the support. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message