Are both cores in a dual core processor used when the CPU is in single tasking mode?

0

Will an OS running in single tasking mode (not multitasking mode) take advantage of both cores in a dual core processor?

EDIT: In response to the first comment: Yes, but when the computer boots there is only one task running; the bootloader. My question is: At that point, are both cores running the same task or can both only be used when in multitasking mode.

Isaac D. Cohen

Posted 2015-01-19T20:56:26.857

Reputation: 115

1I think you need to expand on your question a bit more. An OS is always "multi-tasking" even on a single core CPU. That's largely the point of an OS is to allow for scheduling of tasks on the available CPU time. – Foosh – 2015-01-19T21:11:32.293

The bootloader is not really part of the OS.

– Ƭᴇcʜιᴇ007 – 2015-01-19T21:26:03.670

Even the kernel could run in single tasking mode with it being the only task. – Isaac D. Cohen – 2015-01-19T21:27:14.117

https://stackoverflow.com/questions/14261612/which-core-initializes-first-when-a-system-boots - I don't know what code the APs (the non "bootstrap processor") is running but it's likely just halted or spinlocking in an idle-loop while the designated BSP is running the boot time firmware. – LawrenceC – 2015-01-19T21:32:14.187

Answers

2

If you are talking about the standard x86/amd64 PC platform, the following happens on a hardware level when the system is powered on (from here):

In a multicore system, the bootstrap processor is the CPU core (or thread) that is chosen to boot the system firmware, which is normally single-threaded.

At RESET, all of the processors race for a semaphore flag bit in the chipset The first finds it clear and in the process of reading it sets the flag; the other processors find the flag set and enter a wait-for-SIPI (Start-up Inter-Processor Interrupt) or halt state.

The first processor initializes main memory and the Application Processors (APs), then continues with the rest of the boot process. (http://www.drdobbs.com/go-parallel/article/print?articleId=232300699)

So, all processors except the one that "won" the race above will be in a halt state, waiting for the SIPI. If the "BootStrap Processor" never issues a SIPI to the other CPUs (read this), that's the state they will stay in (for example, if you boot DOS, which doesn't know anything about multiple cores, or the APIC, or SIPIs).

So, to answer your question, the other cores will be idle.

LawrenceC

Posted 2015-01-19T20:56:26.857

Reputation: 63 487