How does multi-cores work
How does multi-cores work
This is probably a stupid question but here it goes. If I have a computer with multiple cores, how do I tell the computer which core to use for different instructions? Or does the computer take care of all this (I guess i can affect it, if I want to run two threads on two different cores). Suppose I create a small OS, as Im currently doing. Do I have to care about the double cores or will it work anyway (I've only tried it in Bochs).
Re: How does multi-cores work
The "main" core (called the BSP) boots like normal. All the other cores (called the APs) are basically HLT'ed, until you send them a special interrupt. You have to do a whole lot of work to get the APs to do much at all. To get them to run programs, you need to write a scheduler that chooses which AP to run a process on, and then directs that AP to run the code at a specific memory address.
Re: How does multi-cores work
Thanks! Using multiple cores isn't something I care for right now, just wanted to make sure that a OS that's written for one core still works