上一页 1 2 3 4 5 6 7 8 ··· 12 下一页
  2013年8月27日
摘要: 1.Makefile的作用(1)决定编译哪些文件(2)怎样编译这些文件(3)怎样连接这些文件,最重要的是它们的顺序如何2.Linux内核Makefile分类*********************************************************************顶层Makefile:它是所有Makefile文件的核心,从总体上控制着内核的编译、连接.config:配置文件,在配置内核时生成,所有Makefile文件(包括顶层目录及各级子目录)都是根据.config来决定使用哪些文件arch/$(ARCH)/Makefile:对应于体系结构的Makefile,它用 阅读全文
posted @ 2013-08-27 14:25 Daniel.G 阅读(6017) 评论(0) 推荐(0) 编辑
摘要: 当执行#make menuconfig时会出现内核的配置界面,所有配置工具都是通过读取"arch/$(ARCH)Kconfig"文件来生成配置界面,这个文件就是所有配置的总入口,它会包含其他目录的KconfigKconfig的作用:Kconfig用来配置内核,它就是各种配置界面的源文件,内核的配置工具读取各个Kconfig文件,生成配置界面供开发人员配置内核,最后生成配置文件.configKconfig的语法可以参考“Documentation/kbuild/kconfig-language.txt”Kconfig文件的基本要素:1.config条目(entry)confi 阅读全文
posted @ 2013-08-27 14:11 Daniel.G 阅读(29998) 评论(0) 推荐(0) 编辑
摘要: 驱动模块可以内核编译好后动态加载进去,也可以在编译内核的时候就直接添加。下面是将驱动程序静态编译进内核的方法:以一个字符设备为例:1.修改/drivers/char下的Kconfig文件在Kconfig中增加如下代码:config MY_HELLO bool "this is test"a. 保存后回到内核根目录进行make menuconfig 你会在字符驱动选项中得到如下图,选择保存退出b. 在内核根目录的.config 文件中你会发现CONFIG_MY_HELLO=y2.修改/drivers/char下的Makefile文件,增加如下obj-$(CONFIG_MY_H 阅读全文
posted @ 2013-08-27 11:11 Daniel.G 阅读(816) 评论(0) 推荐(0) 编辑
  2013年8月7日
摘要: 定义:int getpeername(int s, struct sockaddr *name, socklen_t *namelen);描述:获取socket的对方地址得到对方的地址struct sockaddr_in sa;int len = sizeof(sa);if(!getpeername(sockfd, (struct sockaddr *)&sa, &len)){ printf( "对方IP:%s ", inet_ntoa(sa.sin_addr)); printf( "对方PORT:%d ", ntohs(sa.sin_p 阅读全文
posted @ 2013-08-07 14:55 Daniel.G 阅读(792) 评论(0) 推荐(0) 编辑
  2013年7月26日
摘要: TCP/IP socket programmingThis is a quick guide/tutorial to learning socket programming in C language on a Linux system. "Linux" because the code snippets shown over here will work only on a Linux system and not on Windows. Thewindows api to socket programmingis called winsock and we shall 阅读全文
posted @ 2013-07-26 15:01 Daniel.G 阅读(7173) 评论(0) 推荐(0) 编辑
摘要: Typically two processes communicate with each other on a single system through one of the following inter process communication techniques.PipesMessage queuesShared memoryThere are several other methods. But the above are some of the very classic ways of interprocess communication.But have you ever 阅读全文
posted @ 2013-07-26 14:51 Daniel.G 阅读(1281) 评论(0) 推荐(0) 编辑
摘要: Characteristics of the UDP protocolThe UDP protocol (User Datagram Protocol) is a connectionless orientated protocol of thetransport layerof theTCP/IPmodel. This protocol is very simple given that it does not provide error detection (it is not connection orientated...).The UDP segment header is ther 阅读全文
posted @ 2013-07-26 09:30 Daniel.G 阅读(447) 评论(0) 推荐(0) 编辑
摘要: he characteristics of TCP protocolTCP(which meansTransmission Control Protocol) is one of the main protocols of the transport layer of theTCP/IPmodel. It makes it possible, at application level, to manage data coming from (or going to) the lower layer of the model (i.e. theIPprotocol). When data is 阅读全文
posted @ 2013-07-26 09:29 Daniel.G 阅读(786) 评论(0) 推荐(0) 编辑
  2013年7月25日
摘要: To learn device driver development, like any other new knowledge, the bestapproachfor me is to learn first thetheoryand then to do somepractice.If you don't know about operating systems, Irecommend"Willam Stalling's OS book" [1]. This book has a more hardwareorientedapproach unlike 阅读全文
posted @ 2013-07-25 17:31 Daniel.G 阅读(797) 评论(0) 推荐(0) 编辑
  2013年7月14日
摘要: 我们通常把一些公用函数制作成函数库,供其它程序使用。函数库分为静态库和动态库两种。静态库在程序编译时会被连接到目标代码中,程序运行时将不再需要该静态库。动态库在程序编译时并不会被连接到目标代码中,而是在程序运行是才被载入,因此在程序运行时还需要动态库存在。本文主要通过举例来说明在Linux中如何创建静态库和动态库,以及使用它们。在创建函数库前,我们先来准备举例用的源程序,并将函数库的源程序编译成.o文件。第1步:编辑得到举例的程序--hello.h、hello.c和main.c;hello.h(见程序1)为该函数库的头文件。hello.c(见程序2)是函数库的源程序,其中包含公用函数hello 阅读全文
posted @ 2013-07-14 23:34 Daniel.G 阅读(244) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 12 下一页