7. Porting and Programming


Contents of this section

7.1 Is any of the NetBSD or NetBSD/mac68k source restricted by AT&T, USL, or Apple copyrights or restrictions?

NetBSD sources are not encumbered by AT&T, USL, Apple, or anyone else. The sources are distributed under a Berkeley-style software license (see http://www.NetBSD.org/Goals/redistribution.html for details), with portions of it (outside of the kernel) falling under the GNU General Public License.

7.2 Is the source for the Mac-side Utilities available (Booter, Installer, Mkfs)?

Yes. You will need CodeWarrior (or perhaps Think C 6.0 or greater) to work with the project file. The source is available on:

ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-1.5/mac68k/installation/misc/src/
or any of its mirrors.

7.3 Does NetBSD/mac68k support shared libraries?

Yes.

7.4 What are shared libraries for?

Consult Advanced Programming in the Unix Environment by W. Richard Stevens. Chapter 7.7 -- Shared Libraries.

7.5 Where do I get kernel sources from?

The latest kernel sources are available from ftp.NetBSD.org or one of the mirrors in the directory /pub/NetBSD/NetBSD-current/src/sys/ . Check out the NetBSD/mac68k Meta-FAQ for more information on following current sources.

7.6 Is there any way to set up a cross-compiler for NetBSD/mac68k?

Yes. Thanks to everyone who has contributed to this one. There is a HOWTO by Markus Hitter (hitterm@trier.fh-rpl.de) located at: http://www.macbsd.com/macbsd/howto/cc-HOWTO

Also, Alan Palmer (hawks@mcs.com) has setup a cross-compiler for Solaris 2.4. It can be found at: ftp://ftp.macbsd.com/pub/NetBSD/contrib/cross-compiling/

Although the above HOWTO's might be slightly out of date, work is ongoing to make it easier to cross-compile NetBSD on other platforms.

7.7 Is there any kind of manual for the kernel debugger?

Yes, the manual page for the kernel debugger is ddb(4).

Thanks to Scott Reynolds (scottr@og.org) and Allen Briggs (briggs@puma.macbsd.com) for this answer.

7.8 Are there any good books to help me understand UN*X internals?

Check out the Recommended Reading section of the Meta-FAQ.

7.9 Are there any Mac OS utilities for investigating hardware so I can begin implementing support for it?

Yes. Apple has quite a few useful utilities located at:

ftp://ftp.apple.com/developer/Tool_Chest/Devices_-_Hardware/
There are at least three useful subfolders in this directory:

Many thanks to Alan Palmer (apalmer@il.us.swissbank.com) for providing the above information.

7.10 Why is sys_errlist[] redefined when I try to compile anything?

This is because in traditional BSD systems, the sys_errlist[] array was generally known to exist, but it had never officially been defined in any include file. So, many older programs which use this array (which is fairly common since it contains a list of system error strings) had to include their own definitions of it. However, NetBSD did choose to define it in a header file, and it is not defined in quite the same way as most of the older programs do it, so a conflict often arises.

It is usually safe to simply comment out the offending line in the source file, since changing the header file will probably break the compilation of many newer programs. Most recent programs can be configured to look for the definition if it exists or do not include their own definition.

7.11 Whenever I compile a program using iostreams with g++, I get this error:

/usr/libexec/ld.so: Undefined symbol "_tgetstr" in testprog:
How can I fix this?

From Jason Thorpe (thorpej@nas.nasa.gov):

This is a really lame bug in libg++ (well, that happened to interact strangely with a lame bug in the NetBSD shared lib implementation).
Add -ltermcap to the end of the library list.

7.12 Is there anywhere I can get source or binaries that have already been ported to NetBSD/mac68k?

Yes. pkgsrc contains the necessary files to help you quickly install many of the common software packages available on the Internet. Please take a look at the NetBSD package system documentation for more information.


Next Chapter | Previous Chapter

Table of contents of this chapter, General table of contents

Beginning of this Chapter


(Contact us) $NetBSD: faq-7.html,v 1.2 2007/06/09 20:18:05 dsieger Exp $
Copyright © 1994-2003 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.