How to call interrupt function
-
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!
-
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!
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.
-
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.
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!
-
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!
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. -
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!
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...
-
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...
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!