1. inline cpu PORT opcode
- Posted by useless Feb 05, 2011
- 1550 views
Has anyone used the intel PORT opcodes for OUT/IN to any hardware ports on a wintel computer running windows? I just heard that despite everything, if windoze is told in system setting to not use a device, some inline assembler can use that device, and windows won't virtualise it. Is this true?
useless
2. Re: inline cpu PORT opcode
- Posted by bruce1961 Feb 06, 2011
- 1523 views
A good discussion and quite a number of useful links about IN/OUT opcodes etc on this StackOverflow page.
3. Re: inline cpu PORT opcode
- Posted by useless Feb 07, 2011
- 1477 views
Well, people keep asking about using USB, and the parport, and i'd like to use the pata ports, but it's been 10 years since i did any assy programming. When i saw http://hackaday.com/2011/02/03/stk200-pocket-change-programmer/ and talked to the guy who did it on irc, seems it's just as easy to do on windows, but no one has! You just specify the int for the port you want to use, he spec'd a pata int, and did some linux voodoo.
Naturally, if it's not set to "do not use" in windows, then windows will screw with it every time you don't want it to, or windows may try to virtualise it away. Or so i am told. I don't know. So i asked if anyone has done it yet.
useless
4. Re: inline cpu PORT opcode
- Posted by jimcbrown (admin) Feb 07, 2011
- 1477 views
Well, people keep asking about using USB, and the parport, and i'd like to use the pata ports, but it's been 10 years since i did any assy programming. When i saw http://hackaday.com/2011/02/03/stk200-pocket-change-programmer/ and talked to the guy who did it on irc, seems it's just as easy to do on windows, but no one has! You just specify the int for the port you want to use, he spec'd a pata int, and did some linux voodoo.
Naturally, if it's not set to "do not use" in windows, then windows will screw with it every time you don't want it to, or windows may try to virtualise it away. Or so i am told. I don't know. So i asked if anyone has done it yet.
katsmeow
Well, the int for the port is a parameter to an OS/HW driver that runs in the kernel. Therefore, technically the following
Has anyone used the intel PORT opcodes for OUT/IN to any hardware ports on a wintel computer running windows? I just heard that despite everything, if windoze is told in system setting to not use a device, some inline assembler can use that device, and windows won't virtualise it. Is this true?
katsmeow
Is not applicable here.
If the same system setting for Windows's Parallel Port or Parport driver (I'm not sure what it'd be named) exists, then all you'd have to do is change the IO port and disable the IRQ (or something akin to that) and you'd be able to accomplish the exact same thing. I'm not sure how to do this, but as a starting point my best guess would be to check Device Manager (from System Properties in Control Panel).
Now, we both know exactly how to reserve an I/O port on Windows NT and make it accessible in user space via a special driver and then directly access that port from a normal process, so I won't bother describing how to do this here.
I don't know much about parallel ports, but assuming that you could handle the parallel port specific processing (if any is necessary) in your user space process, then using the special driver might be a working solution if Windows's builtin Parallel Port driver is found lacking in configurability compared to Linux's kernel.