BIOS interrupt call from c#
-
Hello Guys, Does anyone koow how to call a bios INT call from a c# application????? like http://en.wikipedia.org/wiki/BIOS_call[^] Regards :rose:, nishu
-
Hello Guys, Does anyone koow how to call a bios INT call from a c# application????? like http://en.wikipedia.org/wiki/BIOS_call[^] Regards :rose:, nishu
Unfortunately you can't call assembly code directly from managed code. There is one workaround I can think of; That is to put your assembly code in a C++ -whether managed or not- dll library and call it from your C# code. In your C++ project you can put your assebly as inline -but IIRC this doesn't allow interrupts to be called-, or put it as an asm file and link it with your project. I did that sometime ago and it worked.
Regards:rose:
-
Unfortunately you can't call assembly code directly from managed code. There is one workaround I can think of; That is to put your assembly code in a C++ -whether managed or not- dll library and call it from your C# code. In your C++ project you can put your assebly as inline -but IIRC this doesn't allow interrupts to be called-, or put it as an asm file and link it with your project. I did that sometime ago and it worked.
Regards:rose:
can you please explain me in depth. nishu
-
can you please explain me in depth. nishu
Forgive me if my reply was too shallow.:-> I'll try to fill you with more details, but forgive I still got to be breif as there are too much details that I can't cover in one post. Now, the interrupts you are talking about are in Assembly code which is a very low level language very close to machine code. These are some sort of a very low level functions that are hardcoded in the processor. Some sort of a processor specific API that should be called at the lowest level of programming... The machine code. Before the DotNet emergance, all exe files were in assembly/machine code. Every compiler was to compile any code into assembly/machine code. Now in DotNet the compiler actually compiles you code into MS Intermediate Language, which is not machine code. When you double click a DotNet exe file, the DotNet framework actually does the compilation into the machine code in the memory. This is called JIT -Just In Time- compilation. Why did they do that?? It's quite long to say. The assembly language itself has something similar to a compiler that is called assembler, in which you could write your assembly code directly and convert it to exe file. When C++ emerged they made a feature in MS C++; That is to write assembly code either within your C++ code in asm blocks -something like the unsafe, or try blocks of C#-. Ans Since they all will turn into machine code in the end, it didn't really matter. Yet using this method -i.e. inline assembly block-, didn't support interrupt calls -remember, interrupts are like functions hardcoded in the processor-. The other way is to write your assembly code as you would in an assembler. Put it in a asm file, and link -something like referencing- that asm file in your C++ project. This was the way if you want to write large code blocks in assembly, and keep the main bulk of your program in C++. Again all the .cpp and .asm file wil be mixed up in one big .exe file written in machine code. Now, in C# that is not possible. As your C# code is converted it MSIL language which is different that the conventional machine code. So you can't mix up assembly with MSIL... Oh!! And sorry! You can't call BIOS interrupts in any other language than assembly. PS. This is a forum post. All the info above were ment to be as accurate as possible, but I had to omit a lot of details -Yes I did... Don't ROTFL-. So any inaccuracy in the info was not meant, and anyone is welcomed to explain/correct any mistake.
Regards:rose:
-
Forgive me if my reply was too shallow.:-> I'll try to fill you with more details, but forgive I still got to be breif as there are too much details that I can't cover in one post. Now, the interrupts you are talking about are in Assembly code which is a very low level language very close to machine code. These are some sort of a very low level functions that are hardcoded in the processor. Some sort of a processor specific API that should be called at the lowest level of programming... The machine code. Before the DotNet emergance, all exe files were in assembly/machine code. Every compiler was to compile any code into assembly/machine code. Now in DotNet the compiler actually compiles you code into MS Intermediate Language, which is not machine code. When you double click a DotNet exe file, the DotNet framework actually does the compilation into the machine code in the memory. This is called JIT -Just In Time- compilation. Why did they do that?? It's quite long to say. The assembly language itself has something similar to a compiler that is called assembler, in which you could write your assembly code directly and convert it to exe file. When C++ emerged they made a feature in MS C++; That is to write assembly code either within your C++ code in asm blocks -something like the unsafe, or try blocks of C#-. Ans Since they all will turn into machine code in the end, it didn't really matter. Yet using this method -i.e. inline assembly block-, didn't support interrupt calls -remember, interrupts are like functions hardcoded in the processor-. The other way is to write your assembly code as you would in an assembler. Put it in a asm file, and link -something like referencing- that asm file in your C++ project. This was the way if you want to write large code blocks in assembly, and keep the main bulk of your program in C++. Again all the .cpp and .asm file wil be mixed up in one big .exe file written in machine code. Now, in C# that is not possible. As your C# code is converted it MSIL language which is different that the conventional machine code. So you can't mix up assembly with MSIL... Oh!! And sorry! You can't call BIOS interrupts in any other language than assembly. PS. This is a forum post. All the info above were ment to be as accurate as possible, but I had to omit a lot of details -Yes I did... Don't ROTFL-. So any inaccuracy in the info was not meant, and anyone is welcomed to explain/correct any mistake.
Regards:rose:
you gave very deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep info..I wanted to know the libraries that can be used to create c++ dll files coz you had done this before. anyway thanx for your deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee....................................................................................................................................................................................................p information nishu
-
you gave very deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep info..I wanted to know the libraries that can be used to create c++ dll files coz you had done this before. anyway thanx for your deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee....................................................................................................................................................................................................p information nishu
Your welcome. You don't need any special libraries to make a C++ library. You can make an MFC library and do as I said. The way I did it was to make an empty project totally from the scratch. and change the compile output to dll. This had more work to do, but give you more control -also the way to do it in MFC gave me headache-. I'll look in my HDD for that old project. If I find it I'll give you more details. There were some compiler options that had to be set -I don't remember them right now-. PS. Do you know how to program in Assembly language?
Regards:rose: