Monday 5 July 2010

Linux Amiga Project - Prerequisites

So now we know the basics, lets check the prerequisites for installing Linux From Scratch.

1) A computer.

Anyone fall at this hurdle? Get out, get out now.

2) To build your functional Linux system, you first need a functional Linux system.

Yes, that is as insane as it sounds. It is actually quite important though. You need some sort of system running on your PC to build the tools which then let you build the rest of the programs. I imagine this must have been much harder in the past, but now-a-days you can get any number of Linux flavours that run directly from a CD or USB stick without having to be installed. I am going to run an Ubuntu Live CD from a USB Stick because that is going to let me start with a completely clean slate – i.e. nothing on the disk I am going to use for the install.

There are certain minimum requirements that the building, or as the book calls it host, system requires. I have flirted with Arch Linux in the past, but it is very tricky to get a Live CD working with Arch. So, instead, I am going to use Ubuntu. The current version at the time of writing is Lucid Lynx, although by the time I get to a functional Workbench the current version will probably be Zany fucking Zebra.

3) A working Internet connection

Please see some of my earlier posts for the fun and games involved in getting network cards to work with Ubuntu. I do not intent to repeat that insanity here.

4) Software to compile source code.

The following command should be sufficient to meet the requirements in Lucid Lynx:

sudo apt-get install bison build-essential texinfo gawk

Which is pretty simple. I had to add 'gawk' to this recently to cure a FUBAR using Maverick. There is an issue here though. I am going to be doing the project in stages, so I will need to power down from time to time. This means that when I reboot from my USB Key, I will need to run that command again to reinstall the necessary software. That is a pain over a slow or even non-existent Internet connection. So instead I am going to make a custom Live CD image which has that software (and my Network Card Firmware) already installed. This is not the place to go into how to make such a customised Live CD, and it is not necessary to complete this project – it just makes the installation a little easier.

5) Somewhere to install the software.

The first thing you do to start the installation is to configure the disk you are going to be installing to. Disk management for Linux is pretty much the same as Windows – you have a partition which you format with a filesystem. There are two essential differences between the systems: mounting and swap. In Windows, for example, partitions are automatically mounted and given drive letters. The file system then sits on top of the disk. In Linux the filesystem exists independently of the disks. Everything in Linux is a file or a directory. Devices such as mice and keyboards appear as files; as do disks and partitions.

The root of the whole filesystem is '/'. Typically that is where the principal disk is mounted. Before a disk or partition is mounted it appears as a device file in the /dev/disk folder. You can't use it as a disk in that form however, first you need to mount the disk. To mount just means to make the partition available to the filesystem. When you mount the disk you choose where it is mounted in the file system. Other partitions are mounted at different points in the file system. It is common to have a separate partition for the 'home' folder for instance. When you run Linux from a CD or USB stick it mounts a virtual filesystem in RAM as '/'. This is effectively a window into the compressed software on the CD or stick. Any changes that are made will disappear when the machine is turned off.

The second difference between Linux and Windows is swap. This is a part of the disk the system can use if it runs out of RAM. This is a single file on Windows – usually called pagefil.sys. On Linux it is a separate partition. It is not mounted to the filesystem like other partitions. With this system, I am not going to bother with a swap file. With sufficient RAM, it is unnecessary for the tasks I will be undertaking.

The idea when installing LFS is to create your partition and then mount it to a temporary point in the Live CD/USB filesystem. Normally this would be at /media/lfs. The idea is that this partition becomes a folder on the host system that you can copy files to etc. Once you are ready to boot LFS the partition is mounted to '/' and becomes the base of the final system. Remember that if you are using a Live CD or USB stick, the '/' partition on the host machine will disappear. However, any changes you make to a mounted physical partition in that filesystem will persist because you changed them on the disk.

For this project I have decided to use a 4GB USB key as the installation medium. There are a couple of reasons for this. I do not want to go through the hassle of partitioning my hard disk in my main PC and the disk drives in my Frankenstein machine are about as quick as a modern USB Key. The main reason though, is that this is a LOOOOONG process, and I want the flexibility of doing a bit here, and a bit there on different PCs. I need a portable drive to make that work – so what better than a USB Key. I have made sure that my USB Key is bootable on my desktop, laptop and spare machine BEFORE I started to install an operating system on it. Please note I am NOT going to install to the same USB key that I am using to run the Live CD. I am therefore going to be using 2 USB Keys to complete this task. I will try to stick to a naming convention. The USB Stick with the LiveCD version of Ubuntu installed will be referred to as the 'Live Key' and the installation stick will be referred to as the 'Amiga Key'. Well if I remember anyway.

6) Linux Source Code.

The source code for Linux From Scratch is spread all round the internet, and hosted by the organisations or individual authors responsible for each piece of code. Linux From Scratch maintains a list of all the software locations, which you can just feed into 'wget' to download them. Originally, I thought that because I was installing to a USB Key, space is at a premium, and I did not intend to store all of the packages on the USB Key, while I was building the system. One option would be to download each package as and when it was needed. There are two drawbacks with this. Firstly this could be frustrating if, for instance, the particular server of a package maintainer is offline when I get to the part of the build that needs that software. Secondly, I need some packages more than once, and it would be a waste of bandwidth to download them twice. I have decided to actualy keep a copy of all the packages on the installation medium. To be honest, they don't take up THAT much space. Also, if I keep them around, what I should end up with is a /sources/ directory with all the necessary downloaded sources in it (not just the ones for LFS but also for all the add on software). I should then be able to archive that whole directory once I am finished and I can then reinstall the whole lot without the need for any net connection.

Helpfully the Linux From Scratch guys have got together with the Server Beach guys, and made the whole source code for every LFS package available in one place. I decided to pop the source package on my Live Key, so it would be available once I booted into the live key. This is not a step you can achieve when the Live Key is booted, because it it read only. First of all you bring up a terminal window, and move to the Live Key. Mine is called [2G] so it auto mounts under ubuntu to [/media/2G/. This means I just have to run:

cd /media/2G

I can then download the .tar file (some 261Mb) with all the necessary packages in it as follows:

wget http://anduin.linuxfromscratch.org/sources/LFS/lfs-packages/lfs-packages-6.6.tar

The source archive is then accessible from the:
/cdrom

folder in the live filesystem. You could also achieve this from a windows machine, as the Live Key should have a FAT32 partition on it. You would just copy the bit of the command after the [wget] to the title bar of Firefox and then choose to save the file to the Live Key root directory.

As you may be able to glean from the filename, I am going to be using version 6.6 of Linux From Scratch, which is the latest stable version. Given where we are going now, stability is fucking essential.

7) The Amiga Emulator Source Code

You find this at E-UAE. The latest version at the time of writing is 0.8.29-WIP4, and is dated 2007. Not much movement on that project then. I am also going to try and compile this with support for a certain type of Amiga Disk Image, the Interchangeable Preservation Format. You can download this here.

8) An Amiga Kickstart ROM image.

This is a non-free piece of software which was usually stored on a chip on the Amiga. Think of it as the BIOS. As I have an A1200 I have been able to use an Amiga program called 'transrom' to copy my Kickstart image to a file. I then transferred that to my PC. It is possible to do this using a floppy disk as the Amiga can read 720k PC Floppies, but my PC no longer has a floppy disk, so I attached a Serial Cable instead. This is, frankly, advanced. You are far better doing what I also did and buying the Amiga Forever from Cloanto. I bought it several years ago now, and I also purchased the Plus Pack which came with a wider selection of ROMs. Essentially, I can emulate not just the A1200, but the A500 and other less popular variants as well.

9) Amiga Software.

Rather obvious really. Once you have your Amiga Emulator up and running you need some software to run on it. You cannot read Amiga disks on a normal PC without special hardware. Using the Serial Cable trick above you can copy disk images to PC. You also get a good selection of Workbench Disks with the Amiga Forever pack. There are of course less legitimate sources of all this stuff floating around the interweb. I feel quite sure that any google search including the words 'amiga rom torrent' or 'amiga workbench torrent' will point the less scrupulous in society in the right direction. But I hope you feel bad doing it, really, Cloanto's prices are pretty decent. You can also download some free games from the Dream 17 website. I got Alien Breed in IPF format from here, and I will use those images to test the IPF system in due course.

No comments:

Post a Comment