Availability of SMP Documentation
-
- Member
- Posts: 25
- Joined: Tue Nov 05, 2013 4:06 am
Availability of SMP Documentation
hi, is there any document can help to write a kernel with smp?
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: Availability of SMP Documentation
There is, it's linked from the wiki's SMP page and is entitled "Intel Multiprocessor Specification". From my recollection, this contains the instructions required to initialise non-boot processors and the quirks of multi-processor machines.
Next time, please read the forum rules and search the wiki (Or if you already did, state so in the post and explain why doing so didn't answer your question), people here get a little tired of new members just asking before searching.
Next time, please read the forum rules and search the wiki (Or if you already did, state so in the post and explain why doing so didn't answer your question), people here get a little tired of new members just asking before searching.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
-
- Member
- Posts: 25
- Joined: Tue Nov 05, 2013 4:06 am
Re: Availability of SMP Documentation
hi, i am sorry.
but i did have read the wiki.but still do not know how to start.
i am develop a virtualiztion system with intel-vt, now i have to move to multi-core, one VM on one core.but i do not know what should i do.
so i asked here.
but i did have read the wiki.but still do not know how to start.
i am develop a virtualiztion system with intel-vt, now i have to move to multi-core, one VM on one core.but i do not know what should i do.
so i asked here.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Availability of SMP Documentation
Have you actually gotten far enough to do a single processor kernel running virtualisation of your own? Or even your own kernel with userspace?
I have the impression you're not even halfway there, which means you the questions you have make no sense because you lack experience with the basics.
I have the impression you're not even halfway there, which means you the questions you have make no sense because you lack experience with the basics.
Re: Availability of SMP Documentation
Hi,
This means having "something" to determine which virtual CPUs are using the real CPU/s when, where virtual CPUs share real CPUs if/when necessary; including (e.g.) the ability to detect when a virtual CPU executes a "HLT" instruction (and stops needing a real CPU) and when a virtual CPU receives an IRQ or something (and starts wanting a real CPU again). Of course that "something" is a scheduler, and isn't very different to a normal OS's scheduler except that it's scheduling virtual CPUs that belong to virtual machines instead of scheduling threads that belong to processes.
With this in mind; I'd want boot code, code to start the other CPUs, some basic memory management, then a scheduler. I wouldn't bother implementing any of the "Intel-VT" code until after all that works. I'd also make it so that the virtualisation code is replaceable/modular - e.g. one module that uses "Intel-VT", one that uses "AMD-SVM", one that uses JIT/interpreting, etc (where all of these modules rely on the same "boot code, memory management and scheduling" framework).
Cheers,
Brendan
I'd hope not - the idea of retro-fitting SMP to an existing/complex thing is scary (more scary than designing for SMP from the beginning).Combuster wrote:Have you actually gotten far enough to do a single processor kernel running virtualisation of your own? Or even your own kernel with userspace?
One VM per core sounds bad to me. For example, if the computer has 4 CPUs you should be able to have 3 virtual machines where each virtual machine thinks it has 2 CPUs, or one virtual machine that thinks it has 8 CPUs, or 8 virtual machines that think they have a CPU each, or anything else.watermirror wrote:i am develop a virtualiztion system with intel-vt, now i have to move to multi-core, one VM on one core.
This means having "something" to determine which virtual CPUs are using the real CPU/s when, where virtual CPUs share real CPUs if/when necessary; including (e.g.) the ability to detect when a virtual CPU executes a "HLT" instruction (and stops needing a real CPU) and when a virtual CPU receives an IRQ or something (and starts wanting a real CPU again). Of course that "something" is a scheduler, and isn't very different to a normal OS's scheduler except that it's scheduling virtual CPUs that belong to virtual machines instead of scheduling threads that belong to processes.
With this in mind; I'd want boot code, code to start the other CPUs, some basic memory management, then a scheduler. I wouldn't bother implementing any of the "Intel-VT" code until after all that works. I'd also make it so that the virtualisation code is replaceable/modular - e.g. one module that uses "Intel-VT", one that uses "AMD-SVM", one that uses JIT/interpreting, etc (where all of these modules rely on the same "boot code, memory management and scheduling" framework).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
-
- Member
- Posts: 71
- Joined: Fri Jun 28, 2013 1:48 am
- Contact:
Re: Availability of SMP Documentation
There's an article on OSDever: http://www.osdever.net/tutorials/view/m ... -explained
Reinventing the Wheel, code: https://github.com/songziming/wheel