The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: anuradha on March 20, 2008, 03:11:00 AM

Title: port programming
Post by: anuradha on March 20, 2008, 03:11:00 AM
hi people
I'm trying to learn port programming.
I'm currently using interfacing-with-c-programming-real-world-applications it a  E-book.
but Its codes doesn't work properly.gives me strange errors.it users inportb() and outportb() to input and output
all I can come up with this problem is that User mode applications can not write or read directly to port.

so how can I do this??
why is this restrictions??
is their any good reference  on this???

thanks
Title: Re: port programming
Post by: Tedd on March 20, 2008, 10:50:08 AM
Yes, ports are protected in 'protected mode' (i.e. win32) - so you can't just write to any you choose. It would be a major security hazard to allow that: direct control over a device; for a disk this means you could bypass any filesystem protections/access-rights.

That said, there is a direct-i/o driver available that gives you port access from a protected-mode application. You'll have to search for it though :P