Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Detection on processor cores and hyperthreading (Announce)

posted by Laaca Homepage, Czech republic, 25.01.2021, 15:35

> What method described on OSdev you use? In my CPUID I use CPUID way, too
> scared to mess with ACPI ;) I'll post results later.

I use the ACPI scan. You have to parse RSDP -> RSDT -> MADT and parse the processor-ACPI records.
It detects all logical cores and it is not so difficult.

The problem is to distinquish whether the reported core is physical core or virtual core from hyperthreading.

The proper approach is to take the ACPI-ID from each reported core (byte value) and parse individual bits. Because 7-2 bits (or 7-1 bits) identifies the physical core and low 0 bit (or 0-1 bits) identifies the hyperthreaded core.

To get the information whether the right division for physical/hyperthreaded bits is 5-3 or 6-2 or 7-1 you should use the CPUID instruction.

I do not use the CPUID but rely on the recomended (or mandatory?) order how the cores should be reported from ACPI.

---
DOS-u-akbar!

 

Complete thread:

Back to the forum
Board view  Mix view
22632 Postings in 2109 Threads, 402 registered users, 402 users online (0 registered, 402 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum