-22

Recently I posted a question asking how operating systems create threads (How do operating systems exit uniprocessor mode?)

As stated in the first version of the question, I wanted to know how an operating system controls the other cores on a CPU.

I believe a misconception occurred where trusted users thought I was asking about a specific operating system or something?

Obviously different operating systems do things differently, so no answer would be correct for everyone who landed on the question.

This is like asking "how do I install things?" without giving details about what it is you want to install and where. There could be hundreds of different "correct" answers.

My question was not about how operating systems keep track of threads, schedule them, etc, but instead about how they physically start a different thread. Like how do they tell another hardware thread or core to start running.

I'm new to x86 but after learning the instruction set as best I could (still lots to learn, obviously) I didn't see any instructions labelled "start new thread" or "wake up core".

I later changed my question to better reflect the nature of what I was asking, but I think I just made it more unclear.

I think the title "How do operating systems create threads" is the most easy to understand for people not aware of the specifics of operating systems and kernels and what uniprocessor mode is.

In fact, this kind of question is likely to be searched by new programmers! A simple, straight forward title is paramount.

The question was closed for being "unfocused", likely because it was perceived that I was asking about an implementation without saying which one (and asking about a specific implementation would probably be improper on SO regardless)

This is not the case.

10
  • 3
    As described, the question sounds more appropriate for Software Engineering or superuser.com. Jul 22, 2022 at 17:25
  • 1
    @KarlKnechtel superuser is for end users, but this is a question about development. Software Engineering appears to be about general policy and how groups can work together (not really what I'm asking)
    – Badasahog
    Jul 22, 2022 at 17:30
  • 5
    I would definitely agree that the question is Too Broad (what is now called Unfocused on SO). I just spent a couple of minutes looking it up, and there is only one stub article on osdev that seems to actually cover the necessary code (and only barely), and the answer basically seems to be ACPI. That is a fairly broad spec that you would need to be intimately familiar with.
    – van dench
    Jul 22, 2022 at 17:33
  • @vandench this seems unlikely. ACPI is a power management spec. Can you provide a link?
    – Badasahog
    Jul 22, 2022 at 17:38
  • wiki.osdev.org/SMP The link to the multiprocessor spec is dead, googling it reveals this en.wikipedia.org/wiki/MultiProcessor_Specification Since most newer machines support Advanced Configuration and Power Interface (ACPI) which subsumes the MPS functionality, MPS has for the most part been supplanted by ACPI. MPS can still be useful on machines or with operating systems that do not support ACPI. Technically it looks like the actual init signal is sent over the LAPIC, but focusing on that is a massive oversimplification.
    – van dench
    Jul 22, 2022 at 17:44
  • 1
    "A simple, straight forward title is paramount." For a simple, straightforward question, yes. If, however, the question is complex, requiring knowledge unlikely to be held by new programmers (and I would say a good 80-90% of the programmers on Stack Overflow know nothing about kernels, MPS, LAPIC, or anything to do with the hardware side of programming), then an oversimplified title can be the worst thing possible. Jul 22, 2022 at 17:48
  • @HereticMonkey This is a fair point, but I feel that this is a very simple question (although there doesn't seem to be a simple answer).
    – Badasahog
    Jul 22, 2022 at 17:52
  • 12
    Simple questions without simple answers aren't simple questions.
    – Kevin B
    Jul 22, 2022 at 17:53
  • 1
    @KevinB "Why are computers expensive?" is a very simple question with a very complex answer
    – Badasahog
    Jul 22, 2022 at 17:56
  • 10
    As originally written, the question was definitely too broad/needs focus, as it was asking about every processor and every OS. Even with the edit to limit it to AMD64 chips, it still feels too broad/needs focus (at a minimum, because it's asking about every OS, but that's not the only issue). It is/was, effectively asking for a complete tutorial about how operating systems (plural) move from uniprocessor to multiprocessor modes. If this was limited to a single OS and a single CPU (and specific associated chips), then it might be in-scope. However, that's still a large topic.
    – Makyen Mod
    Jul 22, 2022 at 19:40

1 Answer 1

2

This doesn't exactly feel like an assembly question. It's in the realm of and domain of assembly and low-level programming, but the answer is subject to (as demonstrated in the comments) obscure standards and is heavily microprocessor-dependent, it seems.

I wouldn't personally know what to do since I can't even pretend to be an assembly expert of any kind - that one class I did in college where I wrote ARM doesn't really count here - so I would defer to those who are more knowledgeable in the field than I. My observation is simply that this doesn't feel like it'd be on-topic here. I could be wrong.

3
  • What "obscure standards" are you referring to? How could such a standard operation be considered "microprocessor-dependent" if older operating systems work on newer hardware?
    – Badasahog
    Jul 22, 2022 at 17:50
  • 1
    Newer hardware is generally backwards compatible with the same hardware in it's class, though things like how a CPU core is brought online absolutely looks different for different types of microprocessors. Jul 22, 2022 at 18:27
  • @AnonCoward the links you gave were for two different instruction sets. I'm asking about x86
    – Badasahog
    Jul 22, 2022 at 19:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .