[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] printk() is not triggered with the data passed in the application program
hi all
Now I am getting printk() to
trigger the correct data. Some other corrections were required for
that. "int data" in the application program had to be replaced by
unsigned char data. Also if (copy_from_user(&data, buf,
sizeof(data))) in the driver program had to be replaced by if
(copy_from_user(&data, (u8 *)buf, 1) . But now can anyone tell me
why still my program fails to write on leds. Has anybody done so in the
past. i feel there is some serious flaw in my driver or application
program. Can someone help me out?
On 22/08/06, Brettschneider Falk <
fbrettschneider@xxxxxxxxxxxxxxxxx> wrote:Hi Kunal,
Kunal Kishore wrote:
> WRITE Data from user 0 hex
...
> static ssize_t MY_Driver_write(struct file *file, const char *buf, size_t
count, loff_t *ppos)
> {
> u8 data;
>
> if (copy_from_user(&data, buf, sizeof(data)))
> return -EFAULT;
> printk("WRITE Data from user %x hex\n", data);
> outb(data, OUTPORT);
> return 0;
> }
...
> data="">...
> if(write(handle, &data, 1, 0) < 0)
...
printk with %i or %d in the format string definitely works here.
1) Try to use %i instead of your %x
2) Try to printk your buf in MY_Driver_write
3) copy_from_user isn't necessary since there's no MMU on this platform.
I think outb(0) doesn't switch on any LED.
CU, F@lk
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive :
http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/