Thanks for your responses!
PeterX wrote:
But it would be interesting to know why you want to do that in the first place? I'm asking because this doesn't sound like kernel development at all. It sounds more like rushing in and rushing out. But maybe I misunderstood you.
I don't want to write an OS, at least currently.
But I'd like to learn the fundamentals of how kernels work, might be more than fundamentals. Presently I download many small kernels from github, read their code and I try to figure out what this code does. I compile them and observe how they run. I find this a very good method to make familiar with how OS-es work at the practically lowest level possible and it's very enjoyable.
I'm aware that various concepts can be implemented in various kernels differently, so implementations of multi-tasking, virtual memory and all the other things in these small kernels don't have to be the same as in kernels of the widely used operating systems such as Linux or Windows, but first it's interesting nonetheless and second in this way I can find myself answers to a lot (but certainly not all) of my questions that I have after reading tutorials, OS Wiki or other resources. And third these implementations provide information about kernel internals anyway, perhaps even better than implementations in large operating systems.
So short answer to you question is: just for fun and education.
PeterX wrote:
And to the several VMs: Of course they contradict each other. Why would one want to run (for example) VirtualBox inside of Qemu? That makes no sense.
I meant Qemu inside VirtualBox. The reason for which I prefer to do it this way is as from
https://qemu.weilnetz.de/w64/: "QEMU for Windows is experimental software and might contain even serious bugs, so use the binaries at your own risk" and my host system is Windows.
bzt wrote:
This can be done. Normally you'll need a so called "gdb-stub" in the kernel to do this, but thankfully you can start qemu with "-s -S" flags and then you can connect gdb to the guest VM, no matter what kernel it's running. Then you can load the symbols and debug sections into gdb for that particular kernel (independently to the VM), and you can also see the source code and run through line-by-line
I'm aware of that method, although I don't have detailed knowledge of it yet. I tried it but with no success, that is it was possible to run kernel step-by-step but like nothing happened. But I think I'll create a new thread for it if I doesn't succeed with it.
bzt wrote:
There's a kernel testing suite by Google, syzkaller, but that requires a special driver for each kernel.
As I understand this driver would need to be provided by the given kernel itself?
Remark: as for now, after installing a graphical environment in my Ubuntu on VirtualBox I can successfully run various kernels in QEMU (installed in this Ubuntu). I'm aware that such a configuration is fragile, but at most I won't be able to run some kernel.
I'm interested, though: does various virtualizers/emulators in practice conflict with each other when installed
side-by-side?