Chameleon

Issue 390: Multiboot args ignored starting with r2411

Reported by Peter DiCamillo, Mar 22, 2015

I use the multiboot support in Chameleon, and when I tried to 
upgrade to a newer version of Chameleon I was having various 
problems. I tracked this down to the fact that Chameleon was 
ignoring the arguments passed on the multiboot command line. The 
problem first appears in r2411, and is due to a change that was made 
to boot2/mboot.c. In mboot.c, this block of code was moved from the 
multiboot_to_boot function to the hi_multiboot function:

-----

    if(bootdevice != BAD_BOOT_DEVICE)
    {
        // boot only returns to do a chain load.
        for(;;)
        {   // NOTE: boot only uses the last byte (the drive number)
            common_boot(bootdevice);
            if(chainbootflag)
                chainLoad();
            else
                waitThenReload();
        }
    }
    // Avoid returning to high-memory address which isn't valid in 
the segment
    // we are now in.
    // Calling sleep() ensures the user ought to be able to use 
Ctrl+Alt+Del
    // because the BIOS will have interrupts on.
    for(;;)
        sleep(10);
    // NOTE: *IF* we needed to return we'd have to fix up our return 
address to
    // be in low memory using the same trick as below.
    // However, there doesn't seem to be any point in returning to 
assembly
    // particularly when the remaining code merely halts the 
processor.

-----

I don't understand Chameleon well enough to understand why this 
change is a problem. However, reverting the change eliminated the 
problem, with multiboot args working as expected.

Reproducing this requires using multiboot to invoke Chameleon, such 
as from grub 2. For debugging, I found it convenient to add these 
lines around line 981 of libsaio/sys.c:

	printf("multiboot_partition_set = %d\n", 
multiboot_partition_set);
	printf("multiboot_partition = %d\n", 
multiboot_partition);
	printf("multiboot_skip_partition_set = %d\n", 
multiboot_skip_partition_set);
	printf("multiboot_skip_partition = %d\n", 
multiboot_skip_partition);

They display the values from the multiboot args right before sys.c 
uses them. When the bug is present all the values are 0, and when 
args are working, the values match the specified arguments.

Comment 1 by ErmaC , Mar 23, 2015

Hi Peter.

Thx for your description.
I will apply and revert the commit for mboot

Cordially

ErmaC
Status: Started

Comment 2 by ErmaC , Mar 24, 2015

Pls try the revision 2643.

ErmaC

Comment 3 by Peter DiCamillo, Mar 25, 2015

Hi, I tested with 2643 and the multiboot args are working as they 
should. Thanks for the quick update!

Comment 4 by ErmaC , Mar 25, 2015

Status: Fixed

Created: 9 years 6 days ago by Peter DiCamillo

Updated: 9 years 4 days ago

Status: Fixed

Followed by: 1 person

Labels:
Priority:Medium
Type:Defect