⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hello.c

📁 我自己写的2.4版本下的驱动程序
💻 C
字号:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
#include <linux/fb.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/mount.h>
#include <sys/mman.h>

#include "type.h"

#define hello_open 1

int main(void)
{
	int fd_hello;
	//open the driver
	fd_hello =open("/dev/hello", O_RDWR);
	if(fd_hello<0)
	{
		printf("hello open error\n");
		return 1;
	}
		
	ioctl(fd_hello,hello_open,0);
	printf("hello_open\n");
	close(fd_hello);
	
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -