bao-project / bao-demos

A guide on how to build and use a set of Bao guest configurations for various platforms
Other
33 stars 37 forks source link

standalone ramdisk #2

Closed zt449569708 closed 2 years ago

zt449569708 commented 3 years ago

In demo , build Linux with a built-in initramfs. If I want to use standalone ramdisk, what should I do? Thanks.

josecm commented 3 years ago

@zt449569708 I moved the issue to the demos repo.

At the moment Bao only supports loading a single binary for each VM. We also did not want to include any OS boot specific code in bao so one needs a minimal code header inside the VM itself to do this (in the demo, lloader)

To achieve your goal, you would need to pack up the ramdisk and pass its address in a similar way as it's done for the device tree in the lloader. You'll probably need to pass the linux,initrd-start, linux,initrd-end or ramdisk_size=, ramdisl_start= in the device tree either as chosen node fields or as kernel command line parameters, respectively. You could also do this by packaging the images with a traditional bootloader such as u-boot, but it seems unnecessary.

josecm commented 2 years ago

@zt449569708 where you able to solve your problem?