Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. BIOS interrupt call from c#

BIOS interrupt call from c#

Scheduled Pinned Locked Moved C#
csharptutorialquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Niiiissssshhhhhuuuuu
    wrote on last edited by
    #1

    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

    N 1 Reply Last reply
    0
    • N Niiiissssshhhhhuuuuu

      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

      N Offline
      N Offline
      Nader Elshehabi
      wrote on last edited by
      #2

      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:

      N 1 Reply Last reply
      0
      • N Nader Elshehabi

        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:

        N Offline
        N Offline
        Niiiissssshhhhhuuuuu
        wrote on last edited by
        #3

        can you please explain me in depth. nishu

        N 1 Reply Last reply
        0
        • N Niiiissssshhhhhuuuuu

          can you please explain me in depth. nishu

          N Offline
          N Offline
          Nader Elshehabi
          wrote on last edited by
          #4

          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:

          N 1 Reply Last reply
          0
          • N Nader Elshehabi

            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:

            N Offline
            N Offline
            Niiiissssshhhhhuuuuu
            wrote on last edited by
            #5

            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

            N 1 Reply Last reply
            0
            • N Niiiissssshhhhhuuuuu

              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

              N Offline
              N Offline
              Nader Elshehabi
              wrote on last edited by
              #6

              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:

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups