Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use for qboot? #145

Open
davedoesdev opened this issue May 22, 2015 · 7 comments
Open

Use for qboot? #145

davedoesdev opened this issue May 22, 2015 · 7 comments

Comments

@davedoesdev
Copy link
Contributor

I was wondering if there's any value in qboot for Capstan?

https://lwn.net/Articles/645455/

BIOS?

@penberg
Copy link
Contributor

penberg commented May 25, 2015

If it makes QEMU boot faster, it also makes OSv boot faster under Capstan.

@davedoesdev
Copy link
Contributor Author

I'll give it a go once I get it compiling

@davedoesdev
Copy link
Contributor Author

qboot does boot linux with separate -kernel or cbfs in pflash.
It would need the OSV 'kernel' pulling out of the image or put into a cbfs image.

@penberg
Copy link
Contributor

penberg commented May 28, 2015

@davedoesdev How much does it improve boot times?

Do you know how to build cbfs images? We probably could add a "qemu-cbs" image target in osv.git and upload those in the Capstan repository as part of the release process.

@davedoesdev
Copy link
Contributor Author

I did some rough measurements by adding -nographic -S to the command line, pressing 'Ctrl-A c' to get to the monitor, then 'Ctrl-A t' to turn on timestamps then typing 'c' and finally Enter.

For standard BIOS until first kernel message this gave 0.989, 0.932, 0.988 (average: 0.969)
For qboot BIOS (fw_cfg): 0.895, 0.887, 0.835 (average: 0.872)
cbfs timings: 0.688 0.597 0.643 (average: 0.642)

This was unmodified Ubuntu 14.10 qemu.

I built the cbfs image per the qboot README:

dd if=/dev/zero of=boot.bin bs=4096 count=1
../coreboot-HEAD-44cbe10/util/cbfstool/cbfstool cbfs.rom create -s 8128k -B boot.bin -m x86 -o 0x1000
../coreboot-HEAD-44cbe10/util/cbfstool/cbfstool cbfs.rom add -f ~/Downloads/aboriginal-1.4.1/build/system-image-x86_64/linux -n vmlinuz -t raw
echo 'console=ttyS0' > cmdline
../coreboot-HEAD-44cbe10/util/cbfstool/cbfstool cbfs.rom add -f cmdline -n cmdline -t raw

and then ran with:

qemu-system-x86_64 -nographic -drive if=pflash,file=bios.bin,readonly=on -drive if=pflash,file=cbfs.rom,readonly=on -no-reboot -S

@davedoesdev
Copy link
Contributor Author

Or you can do as @bonzini suggests:

I compiled qboot with -DBENCHMARK_HACK and added "-device isa-debug-exit,iobase=0xf4" to the QEMU command line. Then you can just us "time" from the shell.

@bonzini
Copy link

bonzini commented May 30, 2015

Is OSv compiled as multiboot or does it a vmlinuz-style header? cbfs is only supported for vmlinuz, at least for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants