2

As far as I have understood, LLVM doesn't let you enforce using a specific processor register. Does that mean a language that uses LLVM under the hood, can't be used for developing an OS, a bootloader or such things that for example requires direct access to registers?

Are there any other reasons why LLVM IR can or cannot be used in OS development?

4
  • For the parts where you need to access specific special registers you would be using assembly anyway. Commented Jul 25, 2016 at 9:32
  • @FUZxxl That's exactly what i'm asking for. So I can't get that low-level with LLVM to stop using Assembly? Commented Jul 25, 2016 at 9:35
  • 1
    If that's what you are asking, yes, you can't. Though, this kind of code is typically very little of an operating system's code. You can't get rid of it by any other mean either. Commented Jul 25, 2016 at 9:36
  • @FUZxxl Great, if you don't mind posting it as an answer, I can at least upvote and probably choose as an accepted answer! Commented Jul 25, 2016 at 9:40

1 Answer 1

4

LLVM is an abstract machine. As such, it does not directly allow you to access certain hardware registers. However, you can still use inline assembly (through the call asm LLVM bitcode mnemonic) or program the few functions that need access to fixed hardware registers in assembly and call them from your LLVM code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.