Subject: decstation boot loader

From: Florian Lohoff <[email-masked]>
Date: Sat, 26 Aug 2000 22:06:08 +0200

Hi,
i sat down a couple of hours and had a look at current possibilities
of booting the decstations from HD. I am not much further than
i was was before - And now i got a couple of questions probably one
of the more specialised mips hackers might answer.

- The bootblock of the decstation might contain up to 51 extents
  to load from the disks.

  1. Do these extents refer to the start of the disk or the start
     of the probably first partition.

  2. Do i have to set a checksum in the bootblock or does the checksom
     only apply to the disklabel

  3. What binarys is the bootloader able to load. From the BSD sources
     i guess its only raw instructions.

  4. Does the MS-DOS disklabel and the DEC bootblock interfer in any
     kind that its impossible to have a diskloader with MS-DOS Disklabels 

I rewrote the bootprep.c today to play around with loading different binarys.
I added the honor of partition information meaning - The new (i call
it writeboot) looks at the start of the partition and calculates
the extents relativ to the start of the disk. But still i dont get any
results. When trying to boot those partitions with any kind of combination
the prompt only returns to the prom command line.

I thought of a bootloader much like the silo - Capable of reading
an ext2 filesystem via libext2 etc.

Flo
-- 
Florian Lohoff		[email-masked]		      	+49-5201-669912
      "Write only memory - Oops. Time for my medication again ..."

---

From: Harald Koerfgen <[email-masked]>
Date: Sun, 27 Aug 2000 19:19:49 +0200 (CEST)

Hi Flo,

>      of the probably first partition.

The PROM knows nothing about partitions or such so these extends refer obviously
to the start of the disk.
 
>      only apply to the disklabel

The PROM doesn't even know anything about a checksum.
 
>      i guess its only raw instructions.

Yes. "mipsel-linux-objcopy --output-target=binary" is your friend.
 
>      kind that its impossible to have a diskloader with MS-DOS Disklabels 

No, that should work as long as the the the boot map is short enough not to
overwrite the partition information.
 
> the prompt only returns to the prom command line.

I have successfully booted Linux kernels with bootprep. Depending on the code you
want to load, for example a second stage bootloader, you may need to adjust
"boot_block->loadAddr" and "boot_block->execAddr".
 
> an ext2 filesystem via libext2 etc.

That's what I always wanted to do but I never found the time...

-- 
Regards,
Harald

---

From: Florian Lohoff <[email-masked]>
Date: Sun, 27 Aug 2000 19:38:20 +0200

On Sun, Aug 27, 2000 at 07:19:49PM +0200, Harald Koerfgen wrote:
> 
> The PROM knows nothing about partitions or such so these extends refer
> obviously to the start of the disk.
> 

Good

> Yes. "mipsel-linux-objcopy --output-target=binary" is your friend.

Even worse ...

Compilation - Relocation - Stripping - 

start.b: start.r
        objcopy --remove-section=.bss \
                --remove-section=.data \
                --remove-section=.reginfo \
                --remove-section=.mdebug \
                --output-target=binary start.r start.b 

start.r: start.o
        ld -Ttext=0x80020000 -Tdata=0x80020000 -Tbss=0x80020000 \
                start.o -o start.r

start.o: start.S        
        gcc -fomit-frame-pointer -G 0 -mno-abicalls -fno-pic -c start.S

> overwrite the partition information.

Does that mean that the limit of the boot_map in the bootprep
is arbitrary and the DEC firmware bootloader would continue
read/process boot_maps in the whole first block ?

> I have successfully booted Linux kernels with bootprep. Depending on
> the code you want to load, for example a second stage bootloader, you
> may need to adjust "boot_block->loadAddr" and "boot_block->execAddr".

Yep - I guessed so - loadAddr hasnt changed but i guess execAddr
needs to point to kernel_entry ...

> That's what I always wanted to do but I never found the time...

:) - Well see - I got someone else i donated a Decstation to
whom i gave the first goal of writing a boot loader for the donation :)

The problem right now which i have is that i cant seem to load
ANYTHING - Not raw instructions not elf not ecoff - Even simplest
instruction like a tight loop (Wouldnt go back into prom)
dont seem to get executed. 

Flo