How to write a Linux driver
1. wrote driver function file(s) .
2. stored in the proper folder, eg: character driver stored in folder drivers/char/
3. modified Makefile in this folder(eg: drivers/char/)
-added configuration at somewhere: type like that "obj-$(CONFIG_TESTDRIVER) += testdriver.o"
4. modified config.in in the same folder
-added configuration at somewhere: type like that "bool 'Mytestdriver' CONFIG_TESTDRIVER"
5. modified mem.c in the same folder
-added initial function of my driver into mem.c with same rule within it.
5. added device node in Makefile in folder vendors/Samsung/4510B
-added parameters(same as command mknod's parameters) in DEVICES section, eg: test, c, 254, 0, which stands for the register driver name, device type(char), major device number, minor device number
6. used command make menuconfig at linux root folder(eg: uClinux-dist) to let my driver choice available
7. re-compiled linux with some commands
That's all!
Ïà¹ØÎĵµ£º
Ò»¡¢ÈÎÎñ¹ÜÀí
linuxÄں˵Ä3ÖÖµ÷¶È·½·¨¼ò½éÈçÏ£º
@SCHED_OTHER ·Öʱµ÷¶È²ßÂÔ£¬½ø³ÌµÄȱʡÀàÐÍ£¬²ÉÓö¯Ì¬ÓÅÏȵ÷¶È²ßÂÔ£¬Ñ¡Ôñ½ø³ÌµÄÒÀ¾ÝÖ÷ÒªÊǸù¾Ý½ø³ÌgoognessÖµµÄ´óС£¬ÕâÖÖ½ø³ÌÔÚÔËÐÐʱ£¬¿ÉÒÔ±»¸ßgoodnessÖµµÄ½ø³ÌÇÀÏÈ£»
@SCHED_FIFO ʵʱµ÷¶È²ßÂÔ£¬Ïȵ½ÏÈ·þÎñ£¬×ñÊØPOSIX1.b±ê×¼µÄFIFOµ÷¶È¹æÔò£¬Ëü»áÒ»Ö±Ô ......
ÔÚLinuxÉϽ»²æ±àÒëpppd 2.4.4
1. ÏÂÔØpppd 2.4.4µÄÔ´´úÂë
ftp://ftp.samba.org/pub/ppp/
2. Ö±½Ó±àÒë
#./configure
#make clean
#make
3. ½»²æ±àÒë
ÐÞ¸Ä./pppd-2.4.4/pppd/Makefile, ×¢ÊÍÁ½ÐУº
#wenxy comment #LIBS += -lpcap
#wenxy comment #CFLAGS += -DPPP_FILTER
cross compile
......
1¡¢Linux »ù´¡
°²×°Linux²Ù×÷ϵͳ
LinuxÎļþϵͳ
Linux³£ÓÃÃüÁî
LinuxÆô¶¯¹ý³ÌÏê½â
ÊìϤLinux·þÎñÄܹ»¶ÀÁ¢°²×°Linux²Ù×÷ϵͳ
Äܹ»ÊìÁ·Ê¹ÓÃLinuxϵͳµÄ»ù±¾ÃüÁî
ÈÏʶLinuxϵͳµÄ³£Ó÷þÎñ°²×°Linux²Ù×÷ϵͳ
Linux»ù±¾ÃüÁîʵ¼ù
ÉèÖÃLinux»·¾³±äÁ¿
¶¨ÖÆLinuxµÄ·þÎñ Shell ±à³Ì»ù´¡Ê¹ÓÃvi±à¼Îļþ
ʹÓÃEmac ......
ΪÁ˸üºÃµÄ½â¾öÐéÄâ»úÓëÖ÷»úµÄ¹²ÏíÎÊÌ⣬VMware¹«Ë¾ÓÐÒ»¸öVMWare£tools£¬À´ÊµÏÖÎļþ¹²Ïí¡£ÕâÀïÖ÷Òª½²µÄÊÇÔÚWindowsÏÂÓà VmwareÐéÄâLinuxÀ´ÓëwindowsÀ´¹²Ïí¡£
¡¡¡¡1¡¢°²×°¿Í»§»úϵͳ£¬linuxÕâÀïÑ¡ÓÃCentOS5
¡¡¡¡2¡¢Æô¶¯ÐéÄâ»úÖеÄLinuxºó£¬£¨×¢Òâ±ØÐëÊÇÆô¶¯ÐéÄâ»úºó£©¡£Ñ¡Ôñ²Ëµ¥ÀïµÄVMÑ¡ÏÀïÃæÓÐÒ»¸ö×ÓÏîÊÇInstall VM ......
Ô×Ó²Ù×÷£ºUPºÍSMPµÄÒìͬ
Ô×Ó²Ù×÷ÊDz»¿É·Ö¸îµÄ£¬ÔÚÖ´ÐÐÍê±Ï²»»á±»ÈÎºÎÆäËüÈÎÎñ»òʼþÖжϡ£ÔÚµ¥´¦ÀíÆ÷ϵͳ£¨UniProcessor£©ÖУ¬Äܹ»ÔÚµ¥ÌõÖ¸ÁîÖÐÍê³ÉµÄ²Ù×÷¶¼¿ÉÒÔÈÏΪÊÇ"Ô×Ó²Ù×÷"£¬ÒòΪÖжÏÖ»ÄÜ·¢ÉúÓÚÖ¸ÁîÖ®¼ä¡£ÕâÒ²ÊÇijЩCPUÖ¸ÁîϵͳÖÐÒýÈëÁËtest_and_set¡¢test_and_clearµÈÖ¸ÁîÓÃÓÚÁÙ½ç×ÊÔ´»¥³âµÄÔÒò¡£µ«ÊÇ£¬ÔڶԳƶà ......