Kernel Options

From Atari Wiki
Revision as of 15:52, 11 October 2011 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Linux Kernel

The Linux kernel controls filesystem access. To be able to use disks with Atari partitions on them directly with Linux, you can build a new kernel that includes the code for Atari partition tables and filesystems. This guide gives instructions for doing this using User Mode Linux.

Prerequisites

You should use a fairly recent Linux installation and make sure that gcc is installed (a lot of modern distributions omit the compiler to make more room for other applications). You should find a terminal emulator and make sure that you are comfortable with the command prompt.

Go to the command prompt and make a new directory to keep all the files in:

mkdir atarikernel
cd atarikernel

Files

  • Download the latest stable kernel release from Kernel.org. You need a full release ("F" link), not a patch. Don't be tempted to just use the kernel source for your distribution, as it will usually have some modifications in it. Remember to store it in the directory where we're keeping all the files.
Expand all of the files from the archive, e.g.:
tar xjf linux-2.6.19.2.tar.bz2
This should create a new directory linux-2.6.19.2 with all of the kernel source inside.
  • Download a prebuilt filesystem image such as this one and expand it:
bunzip2 FedoraCore5-x86-root_fs.bz2

This will take a little while, it's a fairly well-compressed file.

Configuration

  • The ARCH=um in the following is very important. Type the following commands, substituting your specific kernel directory as appropriate:
cd linux-2.6.19.2
make mrproper
make mrproper ARCH=um
make defconfig ARCH=um
make menuconfig ARCH=um
This prepares the configuration for user mode Linux and brings up the configuration menu.
  • Make the following selections:
    • Under UML-specific options, select hostfs (press 'Y' to switch it on)
      • This lets you access files in your main Linux system, so you can copy files between the Atari disk and the Linux system
    • Under File systems, go to DOS/FAT/NT filesystems, select MSDOS fs support
      • The MSDOS fs support includes support for the Atari FAT filesystem
    • Under File systems still, go to Partition types and select Advanced partition selection and then Atari partition table support
    • Under File systems still, go to Native Language Support and select codepage 437
      • This tells the system how to interpret the character set of the filesystem, it's the default so it needs to be included
  • Exit the menu, and save the configuration when prompted.

Building

Building is simple:

make ARCH=um
make modules ARCH=um
make modules_install ARCH=um INSTALL_MOD_PATH=/tmp

This builds the kernel and the modules, and creates all of the necessary module files in /tmp. We'll have to put those into the filesystem we're booting from. Now that the modules are built, you can get rid of some of the information they used, making the new linux system smaller:

strip linux

Inserting Modules

To add the modules to the filesystem, you need root permission, as we'll mount the filesystem to write to it. On most systems, this command is what you type:

su

Followed by your root password. However, on ubuntu systems, you type

sudo bash

Followed by your own password.

Now, to insert the modules:

mount -t ext3 FedoraCore5-x86-root_fs /mnt -o loop
cp -a /tmp/lib/modules/2.16.19.2 /mnt/lib/modules/
umount /mnt
exit

Again, you need to make sure to use the version number of the kernel source that you downloaded.

Running

To run the new Linux, use the following command:

./linux ubda=FedoraCore5-x86-root_fs mem=128M

Once it's running, you should get a login screen. Log in as root, with no password. You can now play with the system. The following command shuts down the user mode linux:

halt

Accessing Files

To access the Atari files, run the new Linux system as follows:

./linux ubda=FedoraCore5-x86-root_fs ubdb=atari.img mem=128M

Where atari.img is the file or device containing the Atari partition table and filesystems. Inside the user mode linux, you should be able to mount the partitions:

mount -t msdos /dev/ubdb1 /media

Now /media is the content of the Atari drive. Don't forget to umount or shut down to ensure that changes are written back.

Similarly, to access a directory in your host environment, use:

mount -t hostfs none /mnt -o /home/zoe/tmp

Where /home/zoe/tmp is wherever you want to make files accessible to the user mode linux system.

You should now be able to copy files between /mnt and /media as needed with the cp command.