[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] kernel moduler?



"Thomas M." wrote:
> 
> Hejsa
> 
>  Nogen der har nogle gode referencer, vedr. kernel programmering? Altså
> lave et nyt modul til en ny/speciel enhed? Hvordan kommunikerer man med
> sådan en driver?

Det mest logiske er en char driver. Du finder et ubrugt major:minor og
sætter dit device til denne. 

Så vil man kunne lave en:

f = open ("/dev/lcd");

write(f, "Hej med dig");

og en 

ioctl(f,SET_MODE, 1);

Du forstår nok meningen.

Eller du vil kunne lave en "cat msg.txt > /dev/lcd" og så lade din
driver fortolke ESC sekvenser som kommandoer.

I bogen "Linux Device Drivers" er der udførlige vejledninger i at lave
char devices, omend den snart er forældet (kerne 2.0, med en smule
omkring 2.1)

Men det bedste er at gå ind i /usr/src/linux/driver/char og simpelthen
kigge på den simpleste.

Mvh Morten


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *