Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do programming languages/libraries communicate with hardware? [closed]

so I was looking into if there was any way to get around the XNA/Silverlight lockdown Microsoft has set up for the Windows Phone 7, as so maybe I could use SFML(.net binding) for application development and other libraries I've come to know.
I found none.....

Now all I'm wondering is why the windows phone and other similar devices don't allow some languages and unmanaged libraries such as OpenGL to be used, especially since I just found out about platform invocation/ external linkage/ other bilingual techniques.

To understand this I guess I need to undersand the relationship between a language and a machines hardware: How does a c/c++ library like OpenGL communicate with the screen/graphics card ?

bonus question: XNA doesn't use OpenGL/DirectX so is it an entirely independent graphics API?

like image 692
Griffin Avatar asked Sep 13 '11 04:09

Griffin


People also ask

How does a programming language communicate with hardware?

This code is given to the compiler and it then converts it into assembly code. Then, it's converted to binary, ie; 0's and 1's which represents digital voltages which are then fed into transistors in the hardware.

How do programming languages interact with OS?

A programming language does not interact with the operating system because it's a language, an abstract idea, it is not an (inter)actor of any kind. It's simply a system that can be used to express programs and algorithms using its lexical elements, conforming to its grammar and rules and so on.

Which of the programming languages interact directly with hardware of a processor?

At the hardware level, computers understand one language, called machine language (also called object code). This is the set of instructions supported by the computer's processor hardware and is specific to each type of processor.

Which language is directly communicate with computer hardware?

Machine language is the language understood by a computer. It is very difficult to understand, but it is the only thing that the computer can work with. All programs and programming languages eventually generate or run programs in machine language.


1 Answers

The Operation System encapsulate all the Hardware with the same API. In the OS internal, it used the hardware io address to control it.

And the OpenGL/DirectX/XNA encapsulate all the OS's system API with a simple, easy used interface to all the program upon it.

Just like below:

Hardware <- HAL <- DirectX / OpenGL <- XNA <- Your Program

Hope this helpful:)

Jason

like image 118
Jason Cheng Avatar answered Sep 29 '22 11:09

Jason Cheng