I'm trying to write a simple device driver, and use the Dev_Read() and Dev_Write() functions, which I have already defined. My driver registers a character device tied to a given major number this way
# mknod /dev/mydev c 250 0
And then, from my user program I open the device this way
int fd;
if ((fd = open("/dev/mydev", O_RDWR)) < 0)
{
perror("open /dev/mydev");
exit(EXIT_FAILURE);
}
after I invoke the Read() function
int read_bytes = read (fd, buffer, 1);
and successfully get kernel space information, that my Dev_Read function works. My problem is that I don't understand how to implement my Dev_Write function. How can I write someting to my file, to see that Dev_Write function works ? THANK YOU for help.