How does kernel know how many cores there are

265 views Asked by At

I am wondering how is Linux kernel made aware of all available cores on the system? For the purposes of scheduler I'd assume kernel has to know how many cores there are, who provides kernel info about all the cores on the system?

1

There are 1 answers

0
Brendan On BEST ANSWER

Who provides kernel info about all the cores on the system?

It depends on which system.

For 80x86 PCs, the firmware constructs table/s (ACPI tables now) which provide a list of CPUs, and the kernel parses those tables.

For small embedded systems (with no firmware), the number of CPUs might be compile-time constant or provided by the boot loader somehow (e.g. "flattened device tree").