![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux
LittleAshes
这个作者很懒,什么都没留下…
展开
-
【驱动】Linux下字符设备驱动开发流程
确定主设备号 实现对应的open/read/write等函数,填入file_operations结构体 定义自己的file_operations结构体 把file_operations结构体告诉内核:注册驱动程序 谁来注册驱动程序啊?得有一个入口函数:安装驱动程序时,就会去调用这个入口函数 有入口函数就应该有出口函数:卸载驱动程序时,就会去调用这个出口函数 其他完善:提供设备信息,自动创建设备节点 #include <linux/module.h> #include <linux/f.原创 2021-03-19 22:11:01 · 214 阅读 · 0 评论 -
[NFS]NFS服务器搭建和配置
一、服务器端 1.1 安装NFS服务 #apt会自动安装nfs-common、rpcbind等13个软件包 sudo apt install nfs-kernel-server 在没有安装nfs相关软件包的机器上,直接执行nfsstat和rpcinfo命令时,会给出安装提示 在没有安装nfs相关软件包的机器上,直接执行exportfs和showmount命令时,会给出的安装提示 在NFS服务器上使用apt命令,安装nfs-kernel-server软件包,系统提示同时安装nfs-common,rpci原创 2020-11-08 17:03:41 · 232 阅读 · 0 评论 -
【工具】dnsmasq
原创 2020-11-04 15:41:53 · 98 阅读 · 0 评论 -
【工具】hexdump
选项 Usage: hexdump [-bcCdefnosvx] [FILE]... Display FILEs (or stdin) in a user specified format -b 1-byte octal display -c 1-byte character display -d 2-byte decimal display -o原创 2020-11-04 15:41:03 · 213 阅读 · 0 评论 -
c文件编译过程
预处理(Pre-Processing) --> 编译(Compiling) --> 汇编(Assembing) --> 链接(Linking) 这里以helloworld.c为例 1 #include <stdio.h> 2 #define LEN 111 3 4 int main() 5 { 6 int a = LEN; 7 printf("hello world\n"); 8 return 0原创 2020-07-26 12:51:40 · 382 阅读 · 0 评论 -
静态链接库和动态链接库
制作静态链接库并使用 源代码编写 #include <stdio.h> void func1(void) { printf("func1 in demo.c\n"); } int func2(int a,int b) { printf("func2 in demo.c\n"); return a+b; } 头文件编写 void func1(void); int fun...原创 2019-10-06 20:11:37 · 118 阅读 · 0 评论 -
基础概念学习
Linux内核功能包括——进程调度、内存管理、进程间通信、虚拟文件系统和网络接。 文件系统包括:与文件管理有关的软件、被管理文件以及实施文件管理所需的数据结构。 ...原创 2019-09-04 22:10:30 · 100 阅读 · 0 评论 -
进程和线程
进程和线程区别 首先先区分一些概念——任务、函数、程序、进程、线程。 任务——某个功能是实现,是一种认识上的概念,方便理解。 函数——一种代码段。用来表示一个要完成的任务单元。当然,这个任务里可能也包含了其它多个子任务。 程序——程序的主体部分是函数,包括一个程序的入口函数以及其它一些自己编写的函数。是源代码堆起来的东西。相当于一个一动不动没有生命的机器人主体。是灵与肉中的肉! 进程——程序在系统...原创 2019-08-31 16:00:14 · 116 阅读 · 0 评论 -
TCP:TCP服务器搭建
*1、int socket(int domain,int type,int protocol);—创建socket *2、int bind(int sockfd,const struct sockaddr *addr, socklen_t addrlen);—绑定ip地址,端口信息 *3、int listen(int sockfd ,int backlog);—设定最大连接数 *4、int acc...原创 2019-08-20 21:18:56 · 2934 阅读 · 0 评论