To: efoo@crl.dec.com
Subject: bootloader: patching first word?
From: nathanw@mit.edu (Nathan J. Williams)
Date: 29 Jun 2000 18:12:35 -0400
Message-ID: <mtuaeg4t9v0.fsf@ten-thousand-dollar-bill.mit.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Lines: 17
Xref: ten-thousand-dollar-bill.mit.edu netbsd.ipaq:35


So today I figured out why there's the flag to patch the first word of
the bootloader - to skip over the a.out header, right? Just stripping
the bootloader binary of the header (what the ELF version does) causes
all the absolute references in the data section to be off by 0x20, and
a.out doesn't support the notion of a separate start address for the
data area.

Anyway... having figured this out, I looked at bootldr.c and saw that
the code in program_flash_region() that is conditional on
LFR_PATCH_BOOTLOADER is just doing *other* bootloader stuff - checking
the magic value and the checksum. Where's the code to actually do the
patching? (it's also going to need some work since the magic value
will then be at 0x40, not 0x20....)

        - Nathan

