Subject: Re: Xbox port - bootloader
To: None <openbsd@softhome.net, port-i386@netbsd.org>
From: Christian Limpach <chris@pin.lu>
List: port-i386
Date: 03/28/2004 20:00:12
>
http://cvs.xbox-linux.org/viewcvs.py/xbox-linux/cromwell/boot/BootStartBios.
> c?rev=1.69&view=auto
>
> As you can see in:
>
> int ExittoLinux(CONFIGENTRY *config)
>
> There is the ASM code that jumps to the Linux kernel. If any of you can
> help me out with this, I will really apreciate it. I want to execute a
> NetBSD kernel instead of the Linux one. But I have no clue on how to do
it.
> I tried to read boot and dosboot's src but I guess I have no skills to do
> this... Anyone whiling to help a good cause?

It seems to me that:

The loader expects the kernel to have a prepended bootsector (like Linux'
bzImage kernels do).  It reads the number of header sectors (bootsector not
included) from position 0x1f1 in the image and then loads the image to
0x100000.

So if you prepend 512 bytes to a regular kernel and you put the value 8 at
position 0x1f1 in these 512 bytes, the loader should be happy and load the
kernel image to 0x100000, starting 0x1200 into the file (= 9 sectors, 1
bootsector + 8 sectors = 0x1000 which is the offset of the .text segment in
the ELF image).

If this works, you'll probably have to clear the bss early in locore.S and
you'll need to move the symbol table to where it's expected.

Good Luck

    christian