The vmlinuz.bin was added fairly recently by me to make OSv boot on 
hyperkit (see this commit - 
https://github.com/cloudius-systems/osv/commit/1e460f5985c54496795f5aebea413881bc43ebd3).
 
I am afraid that it might not be fully compliant per Linux boot protocol -  
https://www.kernel.org/doc/Documentation/x86/boot.txt and may not be 
compatible with both qemu and grub2.

The key parameters are relocatable_kernel and pref_address which we set to 
OSV_KERNEL_BASE 
- 0x400 and hyperkit is able to deal with it.

I suspect that grub ignores relocatable_kernel (or I just misunderstand the 
spec) and loads the kernel at 0x100000 (as linux). The problem is that 
vmlinuz.bin wraps loader.elf. We could instead as an option make 
vmlinuz.bin wrap lzloader.elf just like usr.img does. But then the code in 
https://github.com/cloudius-systems/osv/blob/master/arch/x64/vmlinuz-boot32.S#L58-L64
 would 
need to change to call uncompression routine. This all seems doable.

BTW I have found some other links from the past describing people booting 
OSv on bare metal - http://yushiomote.org/blog/?p=469 - years ago.

Waldek

PS. Do you see anything printed on the console?

On Tuesday, December 3, 2019 at 10:35:03 AM UTC-5, Pekka Enberg wrote:
>
>
>
> On Tue, Dec 3, 2019 at 5:31 PM Pekka Enberg <[email protected] 
> <javascript:>> wrote:
>
>> Hi Matthew,
>>
>> On Tue, Dec 3, 2019 at 2:42 PM Matthew Weekley <[email protected] 
>> <javascript:>> wrote:
>>
>>> Hello, 
>>>
>>> Sorry, I should’ve been more specific! That is what I am doing. Would it 
>>> be more help if I gave you the script I am running and my grub.cfg...When I 
>>> reboot my system and pick that partition in BIOS, then it kernel panics. 
>>>
>>> I’ve been trying to get it to work for some time now but I am stumped. 
>>> Thanks for your help! 
>>>
>>
>> There's not enough information here to help you.
>>
>> Remember, there could be bugs that prevent booting on bare metals. I 
>> would suggest that you take the following incremental steps:
>>
>> (1) Make sure you have the correct process for an ISO image that boots 
>> Linux with GRUB.
>>
>> (2) Make sure your ISO image with OSv kernel boots under QEMU/KVM (with 
>> the same QEMU parameters as run.py uses now).
>>
>> (3) Make sure your ISO image with OSv boots under QEMU (full emulation 
>> mode).
>>
>> (4) Start experimenting with the above ISO image on bare metal.
>>
>> (5) Insert printfs() to the kernel boot sequence to determine where it 
>> fails.
>>
>> (6) Fix any bugs that appear then repeat step (5) until it boots.
>>
>
> Btw, with this configuration, I can boot to Linux, but OSv just hangs 
> (could be lack of VGA or something else):
>
> # GRUB configuration:
> mkdir -p build/iso/boot/grub
> cat <<EOF > build/iso/boot/grub/grub.cfg
> set timeout=0
> set default="0"
> menuentry "osv" {
>     linux /boot/vmlinuz 
>     boot
> }
> EOF
>
> # Copy kernel image:
> cp build/release.x64/vmlinuz.bin build/iso/boot/vmlinuz
> # ---- OR ----
> cp /boot/vmlinuz-5.2.9-200.fc30.x86_64 build/iso/boot/vmlinuz 
>
> # ISO image creation:
> grub2-mkrescue -o build/os.iso build/iso/
>
> # Boot under QEMU/KVM:
> qemu-system-x86_64 -enable-kvm -cpu host,+x2apic -cdrom build/os.iso
>
> - Pekka
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/05743343-1255-411b-ac9a-72934c8e0b0c%40googlegroups.com.

Reply via email to