xboxscene.org forums

OG Xbox Forums => Software Forums => Development => Topic started by: halofreak1990 on September 24, 2012, 07:57:00 AM

Title: Can Xromwell Be Used To Boot Regular Elf32 Binaries?
Post by: halofreak1990 on September 24, 2012, 07:57:00 AM
I'm trying to load a multiboot-compatible ELF32 binary with xromwell on the XBOX as part of an attempt to create a hobby OS that runs on both the PC and the XBOX.
I can boot the file with GRUB Legacy on any PC I've got so the file is valid and bootable, but xromwell won't fire it up.

This is the linuxboot.cfg I use on my XBOX
CODE
title XDSL
kernel KNOPPIX/linux24
initrd KNOPPIX/linux24.gz
append root=/dev/ram0 init=/etc/init rw video=xbox:640x480 frugal quiet kbd-reset
title XDSL Loopback install
kernel KNOPPIX/linux24
initrd KNOPPIX/ird-loop.gz
append root=/dev/ram0 init=/etc/init rw video=xbox:640x480 rootfs_name=xdslfs quiet kbd-reset

title My OS
kernel System/kernel


xromwell loads the file just fine. It's the execution of it that fails.

The output is
CODE
(ELF)...
Image checksum: 0 != computed checksum 630c

There's two more lines of text on the screen, but due to overscan, they are not really readable, but I guess they say
CODE
done
parsing cmdline:


I can see there is some kind of checksum mismatch, but I don't know what checksum xromwell is talking about.

Since the bootloader component of xromwell is based on GRUB, it should be able to load my binary, right?
Title: Can Xromwell Be Used To Boot Regular Elf32 Binaries?
Post by: ldotsfan on September 25, 2012, 09:37:00 PM
I'm not familiar with this section of cromwell code but here's the relevant section: http://xbox-linux.cvs.sourceforge.net/view...pe=text%2Fplain

CODE

if (estate.ip_checksum != sum) {
                printf("\nImage checksum: %hx != computed checksum: %hx\n",
                    estate.ip_checksum, sum);
#if 0
                /* This seems to fail sometimes for certain ELF
                 * files. Unsure why, so just bluntly disable
                 * the restart for now ... Should be fixed
                 * better ...
                 */
                longjmp(restart_etherboot, -2);
#endif
            }


It's part of etherboot. Maybe with that info, you have better luck hunting down the problem?
Title: Can Xromwell Be Used To Boot Regular Elf32 Binaries?
Post by: halofreak1990 on September 30, 2012, 06:31:00 AM
Forget what I said. I just realized I was writing my screen output to the wrong address.

I used OpenXDK's FB address, but that becomes invalid once Xromwell boots an OS.
Looking up the new address in Xromwell's source code fixed my issues.

IOW, I can build an ELF kernel that, just like XBOX-Linux, runs unmodified on both PC and XBOX, as long as you add the necessary code to bridge the gap.