Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I wouldn't just blame bochs/qemu or grub, I have seen them both boot OSes over an MB in size in less than 5 seconds. That basically leaves two options:
- You're using your tools wrong (and I don't think KVM is the fix since I've done without it for long enough)
- You're not measuring properly. In other words you're not actually measuring from the time you hit enter in grub until the first instruction in your kernel is executed. Since GRUB doesn't visibly show you exactly that moment, your kernel has to do it, and your kernel might decide to do a ton of other stuff first.
Also, 250k for a starter(?) kernel sounds like a lot. Mine is a mere 15k in comparison and runs an entire userspace just fine. That may also be a hint to your problem
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
sortie wrote:Perhaps try enable kvm using -enable-kvm if you have it available?
Thanks. Will give it a shot.
Combuster wrote:I wouldn't just blame bochs/qemu or grub, I have seen them both boot OSes over an MB in size in less than 5 seconds. That basically leaves two options:
- You're using your tools wrong (and I don't think KVM is the fix since I've done without it for long enough)
- You're not measuring properly. In other words you're not actually measuring from the time you hit enter in grub until the first instruction in your kernel is executed. Since GRUB doesn't visibly show you exactly that moment, your kernel has to do it, and your kernel might decide to do a ton of other stuff first.
Also, 250k for a starter(?) kernel sounds like a lot. Mine is a mere 15k in comparison and runs an entire userspace just fine. That may also be a hint to your problem
-Could you elaborate on what you mean by using my tools wrong?
-I have tried making the timeout nonzero and have discovered that the lag is entirely prior to the GRUB menu coming, so I'm confident it is something that GRUB is doing, not the kernel.
Combuster wrote:Also, 250k for a starter(?) kernel sounds like a lot. Mine is a mere 15k in comparison and runs an entire userspace just fine. That may also be a hint to your problem
I investigated your advice, but I don't think size is the problem. I ran strip on my kernel and it's down to 88k (still large, but ~1/3 the prior size) and GRUB took 1 min 7 sec in bochs. Compare to 1 min 4 sec with the old file.
Of course, the discarded parts aren't loaded anyways, but I don't think 88k should take 1 minute to read off the disk.
Mind you that bochs is significantly slower than real hardware. You will need to adjust the instructions-per-seconds accordingly to how fast it runs on your computer. But, it's probably not worth thinking too much about how fast bochs runs, just whether it runs correctly.