S
S
Sergey2017-08-11 11:02:06
css
Sergey, 2017-08-11 11:02:06

How does the OS manage CPU cores?

How, for example, does Windows assign a given kernel to a given thread? How does setup disable CPU cores? I looked through my eyes, but I did not see such instructions in the list of CPU instructions. Through the ports commands are given to the CPU, or what?
And if the kernel is disabled in the setup, then the other kernel will use the memory caches of the disabled kernel?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Smeecy Smeecy, 2019-03-30
@Wekeed

Make it completely a picture and don't worry)

K
ksnk, 2019-03-30
@ksnk

And what should be done? If the design is completely rubber, then for a start - make a completely "rubber" curve, with the ability to get the reference coordinates of the blocks. It is better to make such a curve on svg, since when the image is expanded, the line width will change. The solution for the line itself may look like this - by window.resize, after a short time interval, redraw the curve on svg and insert it into the background.
For blocks with text, everything is worse - you need to arrange the blocks not exactly at the reference points, but so that the blocks do not overlap each other. If the text block itself is not the same as it seems to the designer, but such as the site owner wants, then you will have to master the craft of a tiler;)
As a simple option - put text blocks with a reference in the upper left corner, and if it goes beyond the frame, then right or lower ... on the same window.resize

1
15432, 2017-08-11
@15432

Disabling the processor cores occurs in the BIOS, the methods vary depending on the model and manufacturer. Usually this is setting bits in some PCI Config Space register of the chipset.
At the stage of computer startup, only 0 core (0 thread in case of SMT) is active, it starts to be executed from the address FFFFFFF0, where the BIOS (UEFI) image is currently located. The remaining cores (threads) are in the WFS state (Wait For Startup Inter-Processor Interrupt, waiting for an intra-processor interrupt to start work). During the boot process, the multithreading mechanism of the operating system itself is configured, contexts, queues, tables, and so on. Including for each processor (thread), Idle cycles are created in which everyone will spin in anticipation of new tasks. Once everything is set up, the rest of the cores are awakened via SIPI (Startup Inter-Processor Interrupt) and the address of this very Idle cycle is transferred to them.
And then the operating system adds tasks to the task queue that require execution, and at the next periodic interruption, the kernel changes context and this task starts executing. Somewhere in the kernel (ntoskrnl.exe)
Pro cache depends on the processor. For example, in Ryzen, the cache is shared by a processor unit of four cores. The 1500 model has 4 cores, 2 cores are disabled for each block, while the cache is not cut, but the 1400 cores are also 4, but one of the two assemblies is disabled, so the cache is half as large

P
pfg21, 2017-08-11
@pfg21

for power management, a module external to the processor is used, which is controlled by writing the corresponding bits to the corresponding addresses.
There is no point in creating a separate CPU instruction.

O
Optimus, 2017-08-11
Pyan @marrk2

All hardware is accessed through the driver, the kernel can be switched at a lower level somewhere

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question