writing parallel port output to file (vmware)

Programming, for all ages and all languages.
Post Reply
sancho1980
Member
Member
Posts: 199
Joined: Fri Jul 13, 2007 6:37 am
Location: Stuttgart/Germany
Contact:

writing parallel port output to file (vmware)

Post by sancho1980 »

hi
im posting this here because in the vmware forum im signed up with no one seemed to have an idea
in my vmware player, i configured all parallel port output to go to a file on my host machine like this:

Code: Select all

parallel0.present = "TRUE"
parallel0.fileName = "/home/sancho/parport.txt"
parallel0.autodetect = "TRUE"
parallel0.bidirectional = "TRUE"
parallel0.fileType = "file"
in my ubuntu guest, i wrote a simple c program that writes something to the parallel port:

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/io.h>
#include <errno.h>
#include <string.h>

#define base 0x378 /* printer port base address */
#define value 'a' /* numeric value to send to printer port */


main(int argc, char **argv)
{
    if (ioperm(base,100,1))
    {
        fprintf(stderr, "Couldn't get the port at %x: %s\n", base, strerror(errno));
        exit(1);
    }
    outb(value, base);
}
but file parport.txt on my host remains empty (i would have expected letter 'a' to appear)
has anyone experience with using vmware to direct parport output to a file? am i doing something wrong here or am i getting something wrong about parport programming in general?
i know this is probably not the right question for this forum, but you never know...
Post Reply