You want to read the local apic, which you can read about in "Volume 2a":
http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html
Each processor has a corresponding local apic, each local apix has an apic identifier register, which is assigned a unique value during system initialization.
The original core that goes online is called the boot processor (BSP) and can be any physical core on the matrix. More information is in βVolume 3a,β where they talk about the process of selecting a boot processor.
Here is an excerpt from vol3a:
8.4.1 BSP and AP processors
The MP Initialization Protocol defines two classes of processors: boot processor (BSP) and application processors (AP). After turning on the power or RESET of the MP system, the system equipment dynamically selects one of the processors on the system bus as the BSP. Other processors are referred to as APs.
As part of the BSP selection mechanism, the BSP flag is set in MS32 IA32_APIC_BASE (see Figure 10-5) of the BSP, indicating that it is a BSP. This flag is cleared for all other processors.
The BSP executes the BIOS boot belt code to configure the APIC environment, create system-wide data structures, and starts and initializes access points. When the BSP and AP are initialized, the BSP starts executing the operating system initialization code.
source share