Subject: Re: old machines (fwd)

From: [email-masked]
Date: Tue, 3 Jun 1997 23:36:04 +0100 (BST)

Matthew Wilcox writes:
> > The Linux kernel does support ARM2!  It is grouped in with ARM3, but the
> > kernel *always* autodetects the CPU type and selects the right-way-to-do-it.
> > Eg. on the ARM3, it will use the SWP instruction, but on the ARM2 it will
> > use a protected LDR/STR.
> 
> That's not what the code said to me.  It looked suspiciously like the SWP
> was there in the ARMV and not in the ARMO.  What you say is certainly the
> right way to do it, but since it didn't even compile, I don't know this
> works.

You're confusing the ARMV and ARMO.  ARMO is more or less the 'unversioned' ARMs -
ARM2, ARM250 and ARM3.  The interprocessor parts are in arch/arm/mm/arm2,3.S.
ARMV is for ARM6 and above, which always include the SWP instruction.  Since the
kernel is in a different configuration, these can therefore be inlined.

An ARMO kernel will run on ARM2, 250 and ARM3, automatically adjusting for
whatever CPU it finds (see arch/arm/kernel/head.S and arch/arm/kernel/setup.c).
The same thing happens on ARM6 and up in arch/arm/kernel/head32.S.

> > It *absolutely* cannot be in config.in - too many things in the makefiles
> > and config files depend on the machine type to be set *before* make config
> > is run, eg. setting up the right sub-architecture directories etc.
> 
> Ahh.  I wondered why it was all commented out in the config.in.  There's
> no instructions on actualyl configuring the kernel.  Tell me, what should
> I edit?  The main Makefile or the one in the subdirectory?  I've built my
> own kernels before, but it's always been a case of following-the-newbie
> configuration script.  I have no objection to learning, I just don't know
> my way around the tree yet.

Check the README.arm file, which details exactly what you have to do.  Here is
the relevent extract:

                             Notes
                             =====

Compilation of kernel
---------------------

  In order to compile ARM Linux, you will need a compiler capable of generating
  ARM code with GNU extensions.

  To build a kernel, you have to configure the top-level makefile, replacing:

    ARCH = i386
        with
    ARCH = arm

  Also, if you wish to cross-compile, then change:

    CROSS_COMPILE=
        to
    CROSS_COMPILE=<your-path-to-your-compiler-without-gcc>
        eg.
    CROSS_COMPILE=/usr/arm/tools/arm-unknown-linuxaout-

  Then examine arch/arm/Makefile for sub-architecture options (including
  processor and machine type), setting them as required, eg:

    PROCESSOR=armv
    MACHINE=rpc

  Do a 'make config', followed by 'make dep', and finally 'make all' to
  build the kernel (vmlinux).  A compressed image can be built by doing
  a 'make zImage' instead of 'make all'.

> There's an awful lot of documentation lying around, labelled HELP, README,
> INSTALL, etc, some of which is somewhat out of date.  Some of it is
> ambiguous and other bits contradict each other.  To be fair, it is all
> labelled as experimental and current and so on.  But I think it needs some
> work.  It might be better to have the bootloader source code availble
> generally, since I would have seen the --kernel= option.  Probably. 

The INSTALL file on the FTP site is not out of date.  In fact, it's probably
only just been updated.  The INSTALL file basically takes you through setting
up the RiscOS side of ARM Linux.

In the kernel tree, *most* of the documentation is untouched from the Intel
version.  The CREDITS and MAINTAINERS files have been modified to include
any relevent information.

What exactly is labelled as experimental, current etc?

The command line that you need for using the boot loader initially is
definitely in the INSTALL file on the FTP site in the riscos directory.
The INSTALL file contains a step by step guide to installing and checking
that the kernel is able to boot on your system.  Please read it.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |       Russell King      [email-masked]         --- ---
  | | | | http://whirligig.ecs.soton.ac.uk/~rmk92/home.html  /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |      *  who wishes that he was in Hong Kong  *      ---  |
    +-+-+ -------------------------------------------------  /\\\  |