Intro to Darwinism
No, this isn’t going to be a religious or scientific battle about the origin of our universe. It’s going to be a first look at Darwin, the underlying level of Mac OS X. Right now you are probably asking yourself why, how, or are confused as to what Darwin really is. I can give a you a great nutshell answer for each. Strap on your geek boots, here we go!
Darwin is FreeBSD for the PowerPC processor (G3 and up actually). It is open source and can be downloaded free of charge from http://developer.apple.com/darwin/projects/darwin/ (an Apple site). The download is about 120 megs and the installation can’t be easier. If you have ever tried to install Linux you will envy Darwin’s install. It is truly drag and drop (and there’s not even any dragging!). Just double click, select an empty partition and you are in UNIX. I said before that Darwin is the underlying level of OS X. Here is what that means:
As you can tell, Darwin is on the bottom of our chart; this means it controls all the base level OS operations. You can access Darwin in the Terminal.app in OS X (in the Utilities folder). That’s all good but we power users want more. For that we move to why.
Why not? Well, it isn’t user friendly, has no native GUI (X Windows can be installed but isn’t part of Darwin), can’t run any of your applications, and the list gets longer. What it does, it does well: all UNIX functions. Aqua is beautiful but takes RAM and CPU cycles. That is a waste if you are using your box as a server. OS X has real powerful server tools like Apache built-in, and MySQL and PHP can be installed making OS X a powerful web server. The same server can be run from Darwin without the wasted RAM and CPU cycles that Aqua brings. In fact, Darwin can be your network’s NAT server (for sharing net access). You can have an older G3 serve as your router/firewall/webserver all without paying a dime. Even if you don’t want to use those features there is no easier way to learn UNIX (except using it in the terminal).
Once you run the installer, go up to the startup disk control panel and select the disk (or partition) with Darwin on it. If you don’t want to make it the default disk, just hold Option at startup and select the boot disk at that point (instead of using the startup disk control panel). After a few minutes you will have a blinking cursor; type the following:
You will get the following message: “Welcome to Darwin!”. This signifies that you are all logged in and are ready to do anything you choose. Here are the commands I found most useful:
ls = list files in current directory
cd = change directory (cd / takes you to the main directory)
mkdir = make directory, creates folder
pico = opens up pico (a text editor). A file string followed by pico will open that file in pico (Ex: pico /files/test.pl will open a file called test.pl located in the /files directory)
All the OS X directions in my Perl tutorial apply to Darwin (since it is OS X).
To connect to the internet I edited the /etc/iftab file in pico to read:
en0 inet 192.168.1.102 netmask 255.255.255.0 up
en0 inet -DHCP-
The IP address is specified by my router so that will change depending on your setup.
After I was on the net I did an FTP transfer. To connect to an FTP server type:
ftp ftp.servername.TLD (replace TLD with the ending tld)
It will prompt you for a username if necessary and then a password. You can use the cd and ls commands to move around the file tree. Type: get FILENAME to download files and: put PATH/TO/FILE.txt to upload files. Type ? for a list of all commands.