ARM Linux 2.6 and upper

Please check <ftp://ftp.arm.linux.org.uk/pub/armlinux> forupdates.

Compilation of kernel

In order to compile ARM Linux, you will need a compiler capable ofgenerating ARM ELF code with GNU extensions. GCC 3.3 is known to bea good compiler. Fortunately, you needn’t guess. The kernel will reportan error if your compiler is a recognized offender.

To build ARM Linux natively, you shouldn’t have to alter the ARCH = linein the top level Makefile. However, if you don’t have the ARM Linux ELFtools installed as default, then you should change the CROSS_COMPILEline as detailed below.

If you wish to cross-compile, then alter the following lines in the toplevel make file:

ARCH = <whatever>

with:

ARCH = arm

and:

CROSS_COMPILE=

to:

CROSS_COMPILE=<your-path-to-your-compiler-without-gcc>

eg.:

CROSS_COMPILE=arm-linux-

Do a ‘make config’, followed by ‘make Image’ to build the kernel(arch/arm/boot/Image). A compressed image can be built by doing a‘make zImage’ instead of ‘make Image’.

Bug reports etc

Please send patches to the patch system. For more information, seehttp://www.arm.linux.org.uk/developer/patches/info.php Always include someexplanation as to what the patch does and why it is needed.

Bug reports should be sent tolinux-arm-kernel@lists.arm.linux.org.uk,or submitted through the web form athttp://www.arm.linux.org.uk/developer/

When sending bug reports, please ensure that they contain all relevantinformation, eg. the kernel messages that were printed before/duringthe problem, what you were doing, etc.

Include files

Several new include directories have been created under include/asm-arm,which are there to reduce the clutter in the top-level directory. Thesedirectories, and their purpose is listed below:

arch-*

machine/platform specific header files

hardware

driver-internal ARM specific data structures/definitions

mach

descriptions of generic ARM to specific machine interfaces

proc-*

processor dependent header files (currently only twocategories)

Machine/Platform support

The ARM tree contains support for a lot of different machine types. Tocontinue supporting these differences, it has become necessary to splitmachine-specific parts by directory. For this, the machine category isused to select which directories and files get included (we will use$(MACHINE) to refer to the category)

To this end, we now have arch/arm/mach-$(MACHINE) directories which aredesigned to house the non-driver files for a particular machine (eg, PCI,memory management, architecture definitions etc). For all futuremachines, there should be a corresponding arch/arm/mach-$(MACHINE)/include/machdirectory.

Modules

Although modularisation is supported (and required for the FP emulator),each module on an ARM2/ARM250/ARM3 machine when is loaded will takememory up to the next 32k boundary due to the size of the pages.Therefore, is modularisation on these machines really worth it?

However, ARM6 and up machines allow modules to take multiples of 4k, andas such Acorn RiscPCs and other architectures using these processors canmake good use of modularisation.

ADFS Image files

You can access image files on your ADFS partitions by mounting the ADFSpartition, and then using the loopback device driver. You must havelosetup installed.

Please note that the PCEmulator DOS partitions have a partition table atthe start, and as such, you will have to give ‘-o offset’ to losetup.

Request to developers

When writing device drivers which include a separate assembler file, pleaseinclude it in with the C file, and not the arch/arm/lib directory. Thisallows the driver to be compiled as a loadable module without requiringhalf the code to be compiled into the kernel image.

In general, try to avoid using assembler unless it is really necessary. Itmakes drivers far less easy to port to other hardware.

ST506 hard drives

The ST506 hard drive controllers seem to be working fine (if a littleslowly). At the moment they will only work off the controllers on anA4x0’s motherboard, but for it to work off a Podule just requiressomeone with a podule to add the addresses for the IRQ mask and theHDC base to the source.

As of 31/3/96 it works with two drives (you should get the ADFS*configure harddrive set to 2). I’ve got an internal 20MB and a greatbig external 5.25” FH 64MB drive (who could ever want more :-) ).

I’ve just got 240K/s off it (a dd with bs=128k); that’s about half of whatRiscOS gets; but it’s a heck of a lot better than the 50K/s I was gettinglast week :-)

Known bug: Drive data errors can cause a hang; including cases wherethe controller has fixed the error using ECC. (Possibly ONLYin that case...hmm).

1772 Floppy

This also seems to work OK, but hasn’t been stressed much lately. Ithasn’t got any code for disc change detection in there at the moment whichcould be a bit of a problem! Suggestions on the correct way to do thisare welcome.

CONFIG_MACH_ andCONFIG_ARCH_

A change was made in 2003 to the macro names for new machines.Historically,CONFIG_ARCH_ was used for the bonafide architecture,e.g. SA1100, as well as implementations of the architecture,e.g. Assabet. It was decided to change the implementation macrosto readCONFIG_MACH_ for clarity. Moreover, a retroactive fixup hasnot been made because it would complicate patching.

Previous registrations may be found online.

Kernel entry (head.S)

The initial entry into the kernel is via head.S, which uses machineindependent code. The machine is selected by the value of ‘r1’ onentry, which must be kept unique.

Due to the large number of machines which the ARM port of Linux providesfor, we have a method to manage this which ensures that we don’t end upduplicating large amounts of code.

We group machine (or platform) support code into machine classes. Aclass typically based around one or more system on a chip devices, andacts as a natural container around the actual implementations. Theseclasses are given directories - arch/arm/mach-<class> - which containthe source files and include/mach/ to support the machine class.

For example, the SA1100 class is based upon the SA1100 and SA1110 SoCdevices, and contains the code to support the way the on-board and off-board devices are used, or the device is setup, and provides thatmachine specific “personality.”

For platforms that support device tree (DT), the machine selection iscontrolled at runtime by passing the device tree blob to the kernel. Atcompile-time, support for the machine type must be selected. This allows fora single multiplatform kernel build to be used for several machine types.

For platforms that do not use device tree, this machine selection iscontrolled by the machine type ID, which acts both as a run-time and acompile-time code selection method. You can register a new machine via theweb site at:

Note: Please do not register a machine type for DT-only platforms. If yourplatform is DT-only, you do not need a registered machine type.

---

Russell King (15/03/2004)