2001-04-27 14:31:36

by Matt

[permalink] [raw]
Subject: Can the kernel access /?

I'm writing a device driver for a DSP card that requires some software
loaded onto the card for it to function, currently I'm copying the
software to the /dev node and the driver is doing the magic in it's
write() handler.

Can the driver pull the file from the filesystem if I were to pass the
path of the file as an argument on loading the module?

I'm not sure it can, but perhaps someone could settle my curiosity and
perhaps point me to some code that does this in the kernel?

I'm thinking that if it could, things like the P6 Microcode driver would
be perhaps done this way too...

Cheers

Matt


2001-04-27 15:18:03

by Xavier Bestel

[permalink] [raw]
Subject: Re: Can the kernel access /?

Le 27 Apr 2001 15:28:04 +0100, Matt a ?crit :
> I'm writing a device driver for a DSP card that requires some software
> loaded onto the card for it to function, currently I'm copying the
> software to the /dev node and the driver is doing the magic in it's
> write() handler.
>
> Can the driver pull the file from the filesystem if I were to pass the
> path of the file as an argument on loading the module?

It's generally considered a better idea to load your firmware with a
userspace app doing an ioctl or a mmap on your driver - no nasty races
to take care of, only proven codepaths used.

Xav

2001-04-30 18:34:38

by Alan

[permalink] [raw]
Subject: Re: Can the kernel access /?

> Can the driver pull the file from the filesystem if I were to pass the
> path of the file as an argument on loading the module?

Yes but its a bad idea. You dont want to force pathnames into the kernel