MCPcopy
hub / github.com/copy/v86 / done

Function done

src/browser/starter.js:597–657  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

595 cont(0);
596
597 async function done()
598 {
599 //if(settings.initial_state)
600 //{
601 // // avoid large allocation now, memory will be restored later anyway
602 // settings.memory_size = 0;
603 //}
604
605 if(settings.fs9p && settings.fs9p_json)
606 {
607 if(!settings.initial_state)
608 {
609 settings.fs9p.load_from_json(settings.fs9p_json);
610
611 if(options.bzimage_initrd_from_filesystem)
612 {
613 const { bzimage_path, initrd_path } = this.get_bzimage_initrd_from_filesystem(settings.fs9p);
614
615 dbg_log("Found bzimage: " + bzimage_path + " and initrd: " + initrd_path);
616
617 const [initrd, bzimage] = await Promise.all([
618 settings.fs9p.read_file(initrd_path),
619 settings.fs9p.read_file(bzimage_path),
620 ]);
621 put_on_settings.call(this, "initrd", new v86util.SyncBuffer(initrd.buffer));
622 put_on_settings.call(this, "bzimage", new v86util.SyncBuffer(bzimage.buffer));
623 }
624 }
625 else
626 {
627 dbg_log("Filesystem basefs ignored: Overridden by state image");
628 }
629 }
630 else
631 {
632 dbg_assert(
633 !options.bzimage_initrd_from_filesystem || settings.initial_state,
634 "bzimage_initrd_from_filesystem: Requires a filesystem");
635 }
636
637 this.serial_adapter && this.serial_adapter.show && this.serial_adapter.show();
638
639 this.v86.init(settings);
640
641 if(settings.initial_state)
642 {
643 emulator.restore_state(settings.initial_state);
644
645 // The GC can't free settings, since it is referenced from
646 // several closures. This isn't needed anymore, so we delete it
647 // here
648 settings.initial_state = undefined;
649 }
650
651 if(options.autostart)
652 {
653 this.v86.run();
654 }

Callers 3

virtio_9p.jsFile · 0.85
run_testFunction · 0.85
check_test_doneFunction · 0.85

Calls 1

dbg_assertFunction · 0.85

Tested by

no test coverage detected