This patch revives old boot32/loader.bin mode which apparently was used to boot OSv in multiboot mode (aka -kernel with qemu).
Please note that there are some gaps in this multiboot implementation. For example cmdline does not get properly passed and it only work multiboot loaders that put multiboot info structure in low memory. Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com> --- Makefile | 5 +++-- arch/x64/boot32.S | 2 +- scripts/run.py | 10 ++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 770b28d0..0ca95c64 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,7 @@ endif quiet = $(if $V, $1, @echo " $2"; $1) very-quiet = $(if $V, $1, @$1) -all: $(out)/loader.img links +all: $(out)/loader.img links $(out)/loader.bin .PHONY: all links: @@ -442,7 +442,8 @@ $(out)/loader.bin: $(out)/arch/x64/boot32.o arch/x64/loader32.ld $(call quiet, $(LD) -nostartfiles -static -nodefaultlibs -o $@ \ $(filter-out %.bin, $(^:%.ld=-T %.ld)), LD $@) -$(out)/arch/x64/boot32.o: $(out)/loader.elf +$(out)/arch/x64/boot32.o: $(out)/loader-stripped.elf +$(out)/arch/x64/boot32.o: ASFLAGS += -I$(out) $(out)/fastlz/fastlz.o: $(makedir) diff --git a/arch/x64/boot32.S b/arch/x64/boot32.S index 00298fba..33597e6d 100644 --- a/arch/x64/boot32.S +++ b/arch/x64/boot32.S @@ -22,4 +22,4 @@ start32: .align 4096 elf64_header: -.incbin "loader.elf" +.incbin "loader-stripped.elf" diff --git a/scripts/run.py b/scripts/run.py index e5a76f1d..9a00e87b 100755 --- a/scripts/run.py +++ b/scripts/run.py @@ -63,6 +63,7 @@ def set_imgargs(options): if options.sampler: execute = '--sampler=%d %s' % (int(options.sampler), execute) + options.osv_cmdline = execute cmdline = ["scripts/imgedit.py", "setargs", options.image_file, execute] if options.dry_run: print(format_args(cmdline)) @@ -121,6 +122,12 @@ def start_osv_qemu(options): elif options.ide: args += [ "-hda", options.image_file] + elif options.kernel: + args += [ + "-kernel", options.kernel_file, + "-append", options.osv_cmdline, + "-device", "virtio-blk-pci,id=blk0,drive=hd0,scsi=off", + "-drive", "file=%s,if=none,id=hd0,%s" % (options.image_file, aio)] else: args += [ "-device", "virtio-blk-pci,id=blk0,bootindex=0,drive=hd0,scsi=off", @@ -489,9 +496,12 @@ if __name__ == "__main__": help="XEN define configuration script for vif") parser.add_argument("--cloud-init-image", action="store", help="Path to the optional cloud-init image that should be attached to the instance") + parser.add_argument("-k", "--kernel", action="store_true", + help="Run OSv in QEMU kernel mode as multiboot.") cmdargs = parser.parse_args() cmdargs.opt_path = "debug" if cmdargs.debug else "release" if cmdargs.release else "last" cmdargs.image_file = os.path.abspath(cmdargs.image or "build/%s/usr.img" % cmdargs.opt_path) + cmdargs.kernel_file = "build/%s/loader.bin" % cmdargs.opt_path if not os.path.exists(cmdargs.image_file): raise Exception('Image file %s does not exist.' % cmdargs.image_file) if cmdargs.cloud_init_image: -- 2.17.1 -- 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 osv-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.