From owner-freebsd-hackers Tue Nov 14 18:47:10 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id DFB6137B479 for ; Tue, 14 Nov 2000 18:47:07 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id eAF2l6Z01609; Tue, 14 Nov 2000 18:47:06 -0800 (PST) Date: Tue, 14 Nov 2000 18:47:06 -0800 From: Alfred Perlstein To: Steveb 99 Cc: hackers@FreeBSD.ORG Subject: Re: Porting Linux to FreeBSD Message-ID: <20001114184706.C29448@fw.wintelcom.net> References: <200011140149.eAE1nRI14099@portnoy.lbl.gov> <3A11401F.85B7F51E@vangelderen.org> <003401c04ead$4a6537b0$0441d9cf@earthlink.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <003401c04ead$4a6537b0$0441d9cf@earthlink.net>; from steveb98@earthlink.net on Tue, Nov 14, 2000 at 06:39:34PM -0800 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Steveb 99 [001114 18:39] wrote: > How different is Linux from FreeBSD when it comes to porting code. Nothing > specific just in general, are there major differences or small differences. > Assuming same hardware just OS is different. Device driver vs applications. > What areas are the gottcha's? (I wish you had been more specific...) There can be a lot of gotchas if you're not careful and you use low level interfaces into the system, let me explain: If you use Linux's SOCK_PACKET to do packet filtering you're in for a minor headache when porting to FreeBSD because FreeBSD doesn't have this. However, if you use the freely available 'libpcap' your application would work on Linux and FreeBSD (and Solaris, and others) without problems because libpcap offers an abstraction over several 'native' packet filters. It's really a matter of how your code is done and how Linux specific it is, if you've already ported to Solaris as well as Linux you'll probably find most of the kinks worked out by the time you get around to FreeBSD. But if you make it a habit of #include you're not going to have much fun. As far as device drivers there's some similarities but also a lot of differences with locking structure and internals such as network buffers and IO buffers, porting drivers is most likely going to be a lot more difficult that porting application code. best of luck, -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message