Load Linux bzImage in QEMU?

157

From qemu's help:

Linux/Multiboot boot specific:
-kernel bzImage use 'bzImage' as kernel image
-append cmdline use 'cmdline' as kernel command line
-initrd file    use 'file' as initial ram disk
-dtb    file    use 'file' as device tree image

A quick test here using Arch's kernel/initrd (qemu -kernel /boot/vmlinuz-linux -initrd /boot/initramfs-linux.img) worked (dropped me into a recovery shell since I didn't provide a root device).

Share:
157

Related videos on Youtube

HyderA
Author by

HyderA

Updated on September 18, 2022

Comments

  • HyderA
    HyderA over 1 year

    The code

    for ( var i:int = 0; i < markers.length; i++ )
    {
        markers[i].addEventListener( MapMouseEvent.CLICK, function( e:Event ):void
        {
            markers[i].openInfoWindow( infoWindows[i] );
        });
        map.addOverlay( markers[i] );
    }
    

    I have a list of markers in markers array, and a list of associated InfoWindowOptions in the infoWindow array.

    The Issue

    By the time the marker is clicked and the anonymous function called, the for loop has already finished and i is now equal to markers.length. So I get an out of bounds error on markers[i] and infoWindows[i].

    I would like to create a list of associated functions as well and store it in an array. So I can do something like this instead:

    for ( var i:int = 0; i < markers.length; i++ )
    {
        markers[i].addEventListener( MapMouseEvent.CLICK, markerListeners[i] );
    }
    

    So what I need to know is either,

    • How can I can store a list of function references in an array?
    • Is there a better way of doing this?
  • alxx
    alxx over 13 years
    +1 for detailed explanation. Memory leak might be defeated by using weak reference argument in addEventListener, but anonymous handlers approach was bad anyway. I also would not create all InfoWindows at once, if it can be done after marker clicked (this is note for question author).
  • Jonathan Dumaine
    Jonathan Dumaine over 13 years
    Yes, that's true, but I don't know enough details about the application to give proper advice. I showed them instantiated that way just so the author could see how a dictionary works.
  • Coder404
    Coder404 over 11 years
    could I just do qemu -kernel linux/arch/x86/boot/bzimage?
  • Renan
    Renan over 11 years
    @Coder404 I think so.
  • Coder404
    Coder404 over 11 years
    Ok thanks! I'll try it and let you know the results!
  • Coder404
    Coder404 over 11 years