MP init question.

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.
Post Reply
numbercrunch
Posts: 2
Joined: Sun Dec 02, 2012 12:15 am

MP init question.

Post by numbercrunch »

This question probably comes as an annoyance but I can't seem to find clear documentation on the matter. Assuming the following scenario: I have my BSP about to enter protected mode, the AP's will of course follow. The point of confusion for me, can for example 3 cpus be in protected mode maybe even long mode while one is hanging out in real mode?

I guess I just never thought of this. It's not ideal i know, but just a question based on possibility.


Thanks.
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: MP init question.

Post by thepowersgang »

First off - all CPUs have their own copy of internal state (registers and 1st level cache), so they can be in different operating modes.

As a related notes, APs will stay in real mode (in a CLI-HLT loop) until woken by the BSP (using a sequence of Inter-processor interrupts).
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
rdos
Member
Member
Posts: 3306
Joined: Wed Oct 01, 2008 1:55 pm

Re: MP init question.

Post by rdos »

numbercrunch wrote:The point of confusion for me, can for example 3 cpus be in protected mode maybe even long mode while one is hanging out in real mode?
Absolutely. My long mode support even only runs CPUs that execute long mode applications in long mode, while applications that are 32-bit (or 16-bit or even V86) run in protected mode. No CPU is in real mode after boot though, as I let them hibernate in protected mode instead.

This interoperability of x86 modes is the beauty of the architecture.
numbercrunch
Posts: 2
Joined: Sun Dec 02, 2012 12:15 am

Re: MP init question.

Post by numbercrunch »

thanks for the replies it was just something I was going to experiment for fun. After sending an INIT to my AP's I was going to have one stay in real mode and make use of a few bios interrupts.

again I know it's not feasible, just an experiment :)
Post Reply