omestre wrote:
>  Hello,
>  I need read some data in kernel mode... Somebody can help me?
>  I have tried with read function, but i got segmentation fault...
>  And i can't use the stdio.h :) then, how can i do this job???

The problem you are having is because you do not have a process
address space context for the copyout() to user space that's built
into the read(2) routine: you can not use the read(2) routine
directly from a kernel context, and you can only use it from an
adopted process context if you expend a great deal of effort.

You probably need to ask yourself three things:

1)      What problem are you really trying to solve here, that
        makes you think you need to do file I/O in the kernel?

2)      Have you considered other solutions to the problem, ones
        which do not require file I/O in the kernel?

3)      Have you looked at the mailing list archives, to see the
        three documented methods of doing this evil thing, which
        people have already hashed out?

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to