Current Issue


Table of contents

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 12.0

Version 12.0 delivers every issue of Sys Admin from 1992 through 2006 and every
issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!

Sys Admin Magazine > Archives > 2000 > January 2000

Linux under FreeBSD

Michael Lucas

FreeBSD has several options for using software from other platforms, such as Wine for Win32 and dosemu for DOS. BSDI, NetBSD, and OpenBSD binaries will run unmodified, and source code from many UNIX or Linux programs can be compiled without modification on FreeBSD. Additionally, FreeBSD includes kernel modules for Linux, SCO, and SVR4. These modules allow you to run unmodified binaries for these platforms on your FreeBSD machine. FreeBSD's Linux module works well enough that several commercial software packages for Linux have been included in the FreeBSD ports system. Similarly, this article was written on Sun StarOffice 5.1 for Linux, on my FreeBSD-current box. Because the last version of RealVideo for FreeBSD is version 3.0, I run RealVideo 5.0 for Linux.

In FreeBSD 3.3-stable or higher, Linux mode has two components: the kernel system call module, and the runtime environment.

The Linux Kernel Module

The kernel-loadable module, or KLM, supports Linux-specific system calls. You can determine whether the Linux KLM is loaded on your system by using:

#kldstat -v | grep linux
 2    1 0xc08dc000 e000     linux.ko
                15 linuxelf
                16 linuxaout
#

(kldstat -v provides other useful information about your kernel, and is generally informative on any FreeBSD system.) If the module is not loaded, you can load it by becoming root and typing:

# linux

You can make this automatic at boot by setting linux_enable="YES" in /etc/rc.conf. Strictly speaking, you don't have to compile a custom kernel to support the Linux module. You'll be more satisfied with your results, however, if your kernel includes the following options:

options "P1003_1B"                 #POSIX infrastructure
options "_KPOSIX_PRIORITY_SCHEDULING" #Built-in POSIX priority scheduling
options "_KPOSIX_VERSION=199309L"   #POSIX version kernel is built for
options SYSVSHM                    #System V shared memory
options SYSVMSG                    #System V semaphores
options SYSVSEM                    #System V messaging
options USER_LDT                      #allow user-level control of i386 ldt

For full instructions on building a custom kernel, check:

http://www.F

				  



MarketPlace

"Six Sigma" Certification
Villanova Six Sigma Certification 100% Online Program - Free Info.

Project Management-Online
Nation's Leading Online PMP Course From Villanova-Find Out More Now.

Flowcharts from C/C++ code -- Free trial download
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.

Automate Software Builds with Visual Build Pro
Easily create an automated, repeatable process for building and deploying software.

Wanna see your ad here?