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).
Related videos on Youtube
Author by
HyderA
Updated on September 18, 2022Comments
-
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 theinfoWindow
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 tomarkers.length
. So I get an out of bounds error onmarkers[i]
andinfoWindows[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 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 over 13 yearsYes, 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 over 11 yearscould I just do qemu -kernel linux/arch/x86/boot/bzimage?
-
Renan over 11 years@Coder404 I think so.
-
Coder404 over 11 yearsOk thanks! I'll try it and let you know the results!
-
Coder404 over 11 years