| Paste number 691: | opendarwin faq (work in progress) |
| Pasted by: | finlayd |
| When: | 6 years, 3 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+J7 |
| Channel: | #opendarwin |
| Paste contents: |
Topic
• Abstract
This document provides answers to frequently asked questions about OpenDarwin. This guide refers to the OpenDarwin 7.3 release.
? First Things First
• What is Darwin?
Darwin is an advanced BSD UNIX operating system for PowerPC and x86 compatible architectures, currently owned and developed by Apple Computer, Inc. It forms the core of Apple's flagship Mac OS X [http://www.apple.com/macosx] operating system, which has been catapulted from its release in 2001 to being the most widely distributed UNIX-based operating system [according to http://www.apple.com/macosx/features/unix/].
Building on FreeBSD 5 and Mach 3.0, Darwin provides many advanced features, such as pre-emptive cooperative multitasking, symmetric multiprocessing (SMP), real-time threads, 64-bit kernel services, loadable file systems (including HFS+ and UFS), and more. Darwin also has a powerful, object-oriented device driver subsystem called I/O Kit, widely regarded as being one of the best available for any platform.
Darwin is licensed under the OSI-approved Apple Public Source License [http://www.opensource.apple.com/apsl/], which as of version 2.0 also conforms to the Free Software Foundation's definition of a Free Software License.
To learn more about Darwin, it is highly recommended that you visit Apple's Darwin site[http://developer.apple.com/darwin/]. You may also find the following resources interesting:
The BSD Family Tree [http://www.daemonnews.org/200104/bsd_family.html]
Introduction and History of Darwin [http://www.osnews.com/story.php?news_id=3757&page=1]
Introduction to Darwin [http://ezine.daemonnews.org/200010/darwin.html]
• What is OpenDarwin?
The OpenDarwin Project is an offshoot from Apple's Darwin initiative. It was created as an independent environment, free of ties to Apple proper, which would allow innovation by the community to take place in a more effective manner.
Firstly, the OpenDarwin Project provides infrastructure (web, CVS, mailing lists) for a variety of Darwin-related subprojects, such as DarwinPorts, Darwine and XPostFacto. This provides an important hub for the community, bringing people with valuable expertise together and allowing for collaboration.
Secondly, the OpenDarwin Project makes periodic OpenDarwin releases. OpenDarwin is an operating system based on Apple's Darwin, but with certain "value added" features. For examle, there are various commands, libraries and drivers that are not included in Apple's Darwin release but that we feel are extremely useful when running Darwin. These are often things that Apple has no interest in expending resources on. For example, there are some additional drivers in OpenDarwin for hardware that Apple no longer wishes to officially support (such as older Macs) or has no interest in supporting (such as i386). There are also utilities that provide alternative access to functionality that is normally configured using the GUI in Mac OS X.
You can see the changes made from the official Apple Darwin releases to the corresponding OpenDarwin release on this page [http://www.opendarwin.org/en/plus.php]
• Who would want to use OpenDarwin?
OpenDarwin in its current state is not a fully-featured operating system that is recommended to be deployed on production machines. While it could be used on a webserver, there are many other operating systems that would be far more obvious choices as they are more mature, better supported and so on. That's not to say that it's not possible to use OpenDarwin as a webserver -- the releases even include Apache httpd by default -- it's just that you might find it more effort to set up the system and configure it.
As far as using it on a desktop goes, again there are plenty of other operating systems that may make far better choices. However, OpenDarwin includes X11 and a wide range of software can be installed using DarwinPorts, including fully fledged desktop environments like KDE and GNOME. Just don't expect a trouble-free, high-performance multimedia machine.
Hardware support is patchy at best, especially on x86. As Apple does not produce Mac OS X for x86 there has not been such a big investment in producing the drivers for all the diverse hardware configurations out there in the x86 world as there has been on ensuring that everything runs well on recent PowerPC-based Mac systems.
So, OpenDarwin's target audience at the moment is definitely the developer/power user crowd. There are those coming from OS X looking to learn more about the core of their operating system and find out why things work as they do, look at source to help them better understand what's going on under the hood so they can improve their products, and so on. There are also those coming from other UNIX-like operating systems that are interested in the advanced features and technologies Darwin offers.
In the long-term, we'd love to see OpenDarwin up to par with the rest of the BSD family, so that a person of sound mind would be perfectly able to choose it as a web server or desktop machine. We believe that the technology it's based on is very sound, and is constantly undergoing improvements and developments at the hands of Apple.
There's also the probability that useful enhancements to OpenDarwin will be picked up by Apple and taken upstream into their Darwin distrubution, making their way into an official release of Mac OS X.
• Can I take components of OpenDarwin, modify them and use them in Mac OS X?
Maybe.
If you find the component from the release corresponding to the version of Mac OS X that you are using, then you should be OK. Be aware however that there are certain components where not all the source code is released via Darwin (for example CoreFoundation) or none is released at all (for example certain drivers). This is often because Apple does not have the rights to release the code or because the code contains Apple's trade secrets.
A general rule of thumb is to be careful. You can easily end up with an unbootable system. If you're not sure about something, feel free to ask on the mailing list.
• Can I run Mac OS X programs on OpenDarwin?
Probably not.
A lot of Mac OS X is not available as part of Darwin. Any applications that depend on these parts, including but not limited to Cocoa, Carbon and Quartz, will not run on OpenDarwin. However, command-line programs and those which use X11 for their user interface should run without modification on OpenDarwin. Having said that, if the binary was compiled on Mac OS X it's almost undoubtedly PowerPC-only and you won't be able to run it on OpenDarwin for x86.
• What's with that cute little mascot guy?
That's Hexley, the creation of Jon Hooper. He's the offical OpenDarwin mascot and the unofficial mascot for Darwin in general. Find out more at [http://www.hexley.com].
? Getting and Installing OpenDarwin
• What is the latest version of OpenDarwin?
At the time of writing, the latest version of OpenDarwin is 7.3.
• Where can I get the installer from?
You can download the latest installer from the downloads page [http://www.opendarwin.org/downloads/].
• The ISO image checksum doesn't match. Is my file corrupt?
When downloading the compressed ISO images from a browser, the browser sometimes recognizes the compressed data stream and decompresses it during download. This changes the checksum of the resulting file and does not necessarily mean the image is corrupt. If the mismatched checksum bothers you, we recommend downloading the image using 'curl,' 'wget,' or a dedicated 'ftp' program.
• Can I use boot floppies instead of a CD?
No, you must have a computer capable of booting from the installation CD.
? Compatibility Issues
? What hardware is supported?
? PowerPC
Any Mac that boots Mac OS X 10.3.
• Power Mac G3 (Blue and White) or newer
• PowerBook (Bronze Keyboard) or newer
• Any iMac
• Any eMac
• Any iBook
• Some older machines
Support for some older machines may be possible through the XPostFacto project [http://www.opendarwin.org/projects/XPostFacto/], which maintains its own hardware compatibility list.
? x86
• According to Darwin 7.0.1
IDE:
Only the PIIX4 IDE controllers have been found to work.
Attached devices must be UDMA/33 compatible or better.
Ethernet:
Intel 8255x 10/100 ethernet controllers are supported.
3Com 905cXXX based ethernet controllers are supported.
Video:
You must have a VESA 2.0 compliant video card. Almost all
modern graphics cards are VESA 2.0 compliant. However,
emulators such as vmware do not have VESA 2.0 compliant
emulated video cards.
Successfully tested hardware:
All 440BX motherboards tested have worked with their
internal IDE controllers.
IBM ThinkPad A21m (with onboard Intel ethernet)
• What about the machine list?
• Does OpenDarwin support multiple processors?
Yes. However, while the kernel has SMP capability, it is not supported on x86 and there may be issues with third-party multiprocessor cards or add-on support.
• Does OpenDarwin support wireless networking?
Currently there is no support for wireless networking. However, work is underway and support is expected in a future release of OpenDarwin.
• Why does OpenDarwin use Mach-O instead of ELF as its binary format?
Primarily for historical reasons. However, seeing as Mach-O provides similar features to ELF with the addition of multi-architecture binaries, there is no compelling reason to switch to ELF. If you'd really like to use ELF, feel free to add support for it.
? Configuring
• How do I manage users and groups under Darwin?
Deferred pending decision on adduser.
• How do I configure networking?
Please see the Darwin Networking HOWTO [http://www.opendarwin.org/doc/en/articles/network_config/network_config.php].
• How do I set the timezone?
Darwin's descriptions of timezones live in /usr/share/zoneinfo. If you live in the US, look under the US directory in there. To tell Darwin which of these timezones your computer is actually in, create a symbolic link from one of these files to the file /etc/localtime. For instance, my Darwin machine is in the Mountain timezone, so I would do:
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/US/Mountain /etc/localtime
I first did the rm to make sure there wasn't already an existing timezone file. If you do an ls -l on the file, you can tell what it is currently pointing at.
• How do I configure power management?
Power-management is configured via the file /var/db/SystemConfiguration/com.apple.PowerManagement.xml and the utility pmset. The usage of pmset is explained in the pmset(1) man-page.
An example com.apple.PowerManagement.xml file can be found here.
• What is the hostconfig file?
The hostconfig file, in /etc is a configuration file read by the startup scripts to figure out whether certain services should be turned on, and how to get certain information when configuring the system. The # is the comment character. Anything after the # and on the same line will be ignored.
Usually, the first line of /etc/hostconfig is for configuring the system's hostname(the HOSTNAME variable). This variable can be two values: either -AUTOMATIC- to have the hostname dynamically configured via it's IP address, or it can be a string that is the machine's hostname. Here are examples of the possible configurations:
# Automatically determine the hostname via reverse lookup of IP
HOSTNAME=-AUTOMATIC-
# Set the hostname to "looks-like-a-vacuum-cleaner"
HOSTNAME=looks-like-a-vacuum-cleaner
# Set the hostname to "darwin"
HOSTNAME=darwin
The hostname can be just about anything you want, however, it is usally good if the machine's hostname matches the hostname in DNS.
The next variable in the file is the ROUTER variable. This variable sets what your default router will be. This can be set to 3 types of values: -AUTOMATIC to have the default router configured via DHCP or BootP, the IP address of your default router, or the hostname of your default router. The last form of the ROUTER is discouraged because it can fail depending on your configuration. For instance, if you're using DNS, and your nameserver is off your local subnet, then you'll need your default route set before you can resolve the hostname of your default route. Here are some configuration examples:
# Have the default router set by DHCP
ROUTER=-AUTOMATIC-
# Have the default route set to the IP of 192.168.1.1
ROUTER=192.168.1.1
# Have the default route set to router (this better be resolvable!)
ROUTER=router
The rest of the file contains variables that are used for setting up services on the system. The settings for these can vary, depending on the service, but in general they can be set to -NO- if you don't want the service started on bootup, or it can be set to -YES- if you do want the service started on bootup. For instance, if you wanted a mail server (sendmail) to run when you booted your machine, you can set:
MAILSERVER=-YES-
To figure out exactly what variable does what, and what the potential values are, you'll need to look through the startup scripts in /System/Library/StartupItems
? Troubleshooting
• What is Open Firmware and how do I enter it?
If you really care about Open Firmware, read Apple Developer Technical Noteote TN1061: Fundamentals of Open Firmware, Part I: The User Interface [http://developer.apple.com/technotes/tn/tn1061.html].
To enter OF, hold down "cmd-opt-o-f" as the machine boots. You will find yourself at a white screen with black letters and a CLI prompt.
• I've messed up my Open Firmware settings, how do I fix it?
Open Firmware variables are stored in non-volatile memory. To reset this memory, follow the directions in this Apple Knowledgebase article [http://docs.info.apple.com/article.html?artnum=2238].
• How do I make OpenDarwin display information while booting?
Normally OpenDarwin just shows the Apple logo and a spinning progress indicator during the boot process. For troubleshooting and informational purposes, it can be useful to turn on verbose mode to show what's happening.
If you are on a Mac, you can hold down "cmd-v" to turn on verbose mode for a single boot. If you wish to set it permanently, you can do so by setting the boot-args Open Firmware variable to "-v", either with the nvram command or from the Open Firmware CLI (see What is Open Firmware and how do I enter it? above).
If you are on an x86 machine, enter -v at the boot loader prompt.
• How do I boot into single user mode?
If you are on a Mac, you can hold down "cmd-s" to boot into single-user mode.
If you are on an x86 machine, enter -s at the boot loader prompt.
• What is this "unable to bind to parent" error?
The error in your logs that looks like this:
Jul 27 12:14:32 blueberry netinfod local[140]: unable to bind to parent - RPC: Timed out
is from netinfo trying to connect to a parent, or "master" server. If you are not on a netinfo network, you'll get this error message. If you're not on a netinfo network and would like to see this message stop, you can issue the command:
niutil -destroyprop . /machines/broadcasthost serves
This will prevent netinfo from looking for a master netinfo server.
• I get an 'AllocateKernelMemory' error and the system freezes. How do I fix this?
This error usually only occurs on darwin-x86 6.x. The boot process defaults to building its driver cache using both PPC and i386 object code. Unfortunately, it can run out of memory building this cache and fail. To fix it, reboot from CD, mount the drive and rebuild the cache manually. After booting from CD, choose 'shell' to get a command prompt. In the example, replace X with the drive number and Y with the slice number containing your boot partition.
# fsck -y /dev/rdiskXsY
# mount /dev/diskXsY /mnt
# kextcache -a i386 -m /mnt/System/Library/Extensions.mkext /mnt/System/Library/Extensions
# reboot
To prevent this error from occurring in the first place on darwin-x86, manually run the kextcache command before rebooting.
# kextcache -a i386 -e
• When I try to manually mount a disk partition, why do I get an "operation not supported" error?
The superblock on the disk volume is in an inconsistent state and cannot mount. Repair it with the fsck tool. In the example below, replace X with the drive number and Y with the slice number.
# fsck -y /dev/rdiskXsY
After completing the repair, execute the appropriate mount command.
• Why is it telling me the file already exists, when it clearly doesn't?
The HFS+ filesystem, which you are probably using if you have the standard Darwin install, is a case-insensitive filesystem. This means that files that have the same name, but different capitalization, are treated as the same file under HFS+. This does not affect the storage of files, only file names.
If case sensitivity is important to you, you can use the HFS+ variant HFSX as of OpenDarwin 7.x, which optionally supports case sensitivity. In order to create a case-sensitive HFS volume, you can use the newfs_hfs command with the -s flag. See its manpage for more information.
See Apple Technical Note TN1150: HFS Plus Volume Format [http://developer.apple.com/technotes/tn/tn1150.html] for more information on HFS+ and HFSX.
This paste has no annotations.