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 / C++ / MFC
  4. How to call interrupt function

How to call interrupt function

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
6 Posts 3 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.
  • F Offline
    F Offline
    FlyingDancer
    wrote on last edited by
    #1

    Everybody know that we can call DOS interrupt fuction by using "int" keyword for example: mov ah,4 int 1ah Do you know how to call a interrupt function in VC6 or in a driver? Appreciate for any suggestions!

    P 1 Reply Last reply
    0
    • F FlyingDancer

      Everybody know that we can call DOS interrupt fuction by using "int" keyword for example: mov ah,4 int 1ah Do you know how to call a interrupt function in VC6 or in a driver? Appreciate for any suggestions!

      P Offline
      P Offline
      Peak
      wrote on last edited by
      #2

      the programs you run are in User Mode( ring-3 applications, you can read more about this in intel processors specifications). They cannot run INT commands( and many others, they are called priviledged op codes, see the reference above). And if anyway you could do it (I mean if you write a device driver and call the above INT command), many INTs don't have the functionality you have seen before in old days of real-mode OSs like DOS.

      F 1 Reply Last reply
      0
      • P Peak

        the programs you run are in User Mode( ring-3 applications, you can read more about this in intel processors specifications). They cannot run INT commands( and many others, they are called priviledged op codes, see the reference above). And if anyway you could do it (I mean if you write a device driver and call the above INT command), many INTs don't have the functionality you have seen before in old days of real-mode OSs like DOS.

        F Offline
        F Offline
        FlyingDancer
        wrote on last edited by
        #3

        Somebody said to me that we can use IoConnectInterrupt function but I don't know how to use this function My aim is to get the real date of CMOS At first, I want to call Interrupt 0x1a, function 4. However, this could restart my computer when running to the code Then I read register 0x32 of CMOS to get the century, such as 19 century of 1999. Here exists a problem. Register 0x32 of CMOS can not be the real century of year. Have you some way to make it to be the real century? Or have you some other way to get the real date? Appreciate your answer!

        M P 2 Replies Last reply
        0
        • F FlyingDancer

          Somebody said to me that we can use IoConnectInterrupt function but I don't know how to use this function My aim is to get the real date of CMOS At first, I want to call Interrupt 0x1a, function 4. However, this could restart my computer when running to the code Then I read register 0x32 of CMOS to get the century, such as 19 century of 1999. Here exists a problem. Register 0x32 of CMOS can not be the real century of year. Have you some way to make it to be the real century? Or have you some other way to get the real date? Appreciate your answer!

          M Offline
          M Offline
          Mike Dimmick
          wrote on last edited by
          #4

          If you want the system time, use GetSystemTime. You're out of luck, if you want to read the CMOS data, unless you write a device driver. Even then you'll need to read the addresses directly rather than using the BIOS, because Windows has replaced the interrupt handler table.

          1 Reply Last reply
          0
          • F FlyingDancer

            Somebody said to me that we can use IoConnectInterrupt function but I don't know how to use this function My aim is to get the real date of CMOS At first, I want to call Interrupt 0x1a, function 4. However, this could restart my computer when running to the code Then I read register 0x32 of CMOS to get the century, such as 19 century of 1999. Here exists a problem. Register 0x32 of CMOS can not be the real century of year. Have you some way to make it to be the real century? Or have you some other way to get the real date? Appreciate your answer!

            P Offline
            P Offline
            Peak
            wrote on last edited by
            #5

            if you are using windows 98 or 95 you can call interrupts, but on xp & 2k no way there from user mode applications! that function IoConnectInterrupt is for device drivers, and does not do what you need. anyway, you can use some device drivers like ntport to have direct access to ports, then you can use direct port access and so you can read CMOS. ( so no need to use the interrupt, but you have to know how to read CMOS using in/out OPs) anyway it's a long way. if you have any other alternatives, I recommend you to review them, maybe you are going the hard way...

            F 1 Reply Last reply
            0
            • P Peak

              if you are using windows 98 or 95 you can call interrupts, but on xp & 2k no way there from user mode applications! that function IoConnectInterrupt is for device drivers, and does not do what you need. anyway, you can use some device drivers like ntport to have direct access to ports, then you can use direct port access and so you can read CMOS. ( so no need to use the interrupt, but you have to know how to read CMOS using in/out OPs) anyway it's a long way. if you have any other alternatives, I recommend you to review them, maybe you are going the hard way...

              F Offline
              F Offline
              FlyingDancer
              wrote on last edited by
              #6

              Hi Now I can access to CMOS registers by device driver. Only a pity is that the century value is not very right. For the data read from 0x32 register is not the realtime value. Thanks for your attention!

              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