Page 1 of 1
How does multi-cores work
Posted: Wed Mar 04, 2009 5:14 am
by mangaluve
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
Posted: Wed Mar 04, 2009 5:30 am
by bewing
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
Posted: Wed Mar 04, 2009 5:52 am
by mangaluve
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