[SOLVED] How to be sure to be in 'Mono-core processing' ?
Posted: Thu Jan 05, 2017 8:49 am
[EDIT: my main questions have been answered, the rest is more about curiosity]
Hi there !
The short version (tl;dr):
-- Working on an "Intel Core i7 (Ivy Bridge)" CPU
-> Is there a way to know if an AP core of a multi-core CPU has been enabled ?
-> Is there a way to switch from multi-core to mono-core processing at OS startup? (shutdown/disable AP cores ?)
The story:
I've been interested in trying to build some kind of "RTOS" since a while, (I only have an Intel Core i7 CPU to try that out !)
What I have programmed until know (it's functional):
- bootlader
- basic CPU initialization (IDT, GDT, protected mode...)
- graphic controller (simple VBE to have on screen messages)
Your wiki and Intel/AMD's developer manuals sure helped a lot for the early steps, but know I'm facing a problem which is twisting my mind a bit too much:
To start simple - "beginner mode" -, I would like to be sure my RTOS works in mono-core processing. Only when I'll fully understand everything about that would I go multi-threading and all.
For the sake of starting easy again, I'm using a BIOS to focus on the OS part at the moment. Here's where the problem starts: although BIOSes are not necessarily supposed to do so, I'm not entirely sure my BIOS does not startup all CPU AP cores.
However, neither in Intel Software Developer manual, nor in ACPI specifications, nor on OS Dev nor elsewhere did I find the way to "know" if CPU cores where enabled. Did I miss a flag or something ?
Nevertheless, I decided to proceed to shutdown every AP core according to Intel MP specifications: send the APs an INIT IPI with HALT instruction at warm reset vector.
But these specifications are quite old, and I remember reading on this forum this method was not done anymore. Is this still valid ?
Thanks a lot for your expertise !
(If ever this info was written somewhere, I guess I'll just go reprogram my brain)
Hi there !
The short version (tl;dr):
-- Working on an "Intel Core i7 (Ivy Bridge)" CPU
-> Is there a way to know if an AP core of a multi-core CPU has been enabled ?
-> Is there a way to switch from multi-core to mono-core processing at OS startup? (shutdown/disable AP cores ?)
The story:
I've been interested in trying to build some kind of "RTOS" since a while, (I only have an Intel Core i7 CPU to try that out !)
What I have programmed until know (it's functional):
- bootlader
- basic CPU initialization (IDT, GDT, protected mode...)
- graphic controller (simple VBE to have on screen messages)
Your wiki and Intel/AMD's developer manuals sure helped a lot for the early steps, but know I'm facing a problem which is twisting my mind a bit too much:
To start simple - "beginner mode" -, I would like to be sure my RTOS works in mono-core processing. Only when I'll fully understand everything about that would I go multi-threading and all.
For the sake of starting easy again, I'm using a BIOS to focus on the OS part at the moment. Here's where the problem starts: although BIOSes are not necessarily supposed to do so, I'm not entirely sure my BIOS does not startup all CPU AP cores.
However, neither in Intel Software Developer manual, nor in ACPI specifications, nor on OS Dev nor elsewhere did I find the way to "know" if CPU cores where enabled. Did I miss a flag or something ?
Nevertheless, I decided to proceed to shutdown every AP core according to Intel MP specifications: send the APs an INIT IPI with HALT instruction at warm reset vector.
But these specifications are quite old, and I remember reading on this forum this method was not done anymore. Is this still valid ?
Thanks a lot for your expertise !
(If ever this info was written somewhere, I guess I'll just go reprogram my brain)