- 博客(13)
- 资源 (8)
- 收藏
- 关注
原创 导出符号使用demon
导出符号使用demon第一种:文件:math.c math.h module.c思路:在math.c中定义需要导出的函数,然后导出。 在module.c中使用导出的函数。代码如下:math.h#include<linux/init.h>#include<linux/module.h>int add(int a,int b){ return a+b;}EXPORT_SYMBOL(add);//导出后才能供外部使用int sub(int a,int
2020-07-19 16:33:51
355
1
原创 input子系统(与平台总线结合)②
数据结构:#ifndef __PLAT_INPUT_H__#define __PLAT_INPUT_H__//定义按键信息struct btn_info{ char * name; int gpiono; struct input_event event;};//设计一个平台自定义数据的类型struct btn_platdata { struct btn_info * key_set; int key_size;};struct btn_input_dev{ stru
2020-07-15 13:40:51
236
原创 input 子系统①
app代码:#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <linux/input.h>int main(int argc, char *argv[]){ int fd; int ret;
2020-07-15 10:33:03
155
原创 内核源码中的平台总线
arch\arm\mach-s5pv210\mach-smdkv210.c | static void __init smdkv210_machine_init(void) | platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices)); | int platform_add_devices(struct platform_device **devs, int num) { in.
2020-07-14 20:52:13
127
原创 平台总线第一天③
app代码:#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <stdlib.h>int main(void){ int fd; int on; fd = open("/dev/led_plat",O_RDWR); if(fd < 0) {
2020-07-14 20:42:38
101
原创 平台总线第一天②
app代码:#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <stdlib.h>int main(void){ int fd; int on; fd = open("/dev/led_plat",O_RDWR);//led_palt在驱动层创建设备
2020-07-14 20:13:10
94
原创 平台总线第一天①
驱动层#include <linux/init.h>#include <linux/module.h>#include <linux/platform_device.h>int led_pdrv_probe(struct platform_device *pdev)//匹配成功之后调用这个函数,默认传参匹配成功之后的pdev{ struct resource * addr_res1, *addr_res2; struct resource * irq_re
2020-07-14 19:26:46
99
原创 samba服务作用,安装,配置和使用
1,samba服务的作用用于将linux系统中的文件或者文件夹共享给Windows系统2,安装: sudo apt-get install samba3,配置:第一步:先指定linux中需要共享的文件夹peter@ubuntu:~$ pwd/home/peter第二步:打开配置文件: sudo vim /etc/samba/smb.conf第三步:配置: [pxxy] path = /home/peter/ available = yes browseable =
2020-07-07 19:23:00
2391
3
原创 tftp服务器的安装与配置:
tftp主要用于嵌入式交叉开发环境的搭建,传输文件。0、创建tftp的工作目录,并修改权限 sudo mkdir /tftpboot sudo chmod 777 /tftpboot //修改工作目录权限1、安装: sudo apt-get install tftp tftpd openbsd-inetd2、打开配置文件 /etc/inetd.conf : sudo vim /etc/inetd.conf 3、添加以下内容: tftp dgram udp wait nobod
2020-07-07 19:10:43
611
原创 nfs服务器的安装配置和使用
将已经制作好的文件系统rootfs.tar.gz拷贝到 /opt,并解压tar -xvf rootfs.tar.gz安装nfs服务器安装NFSserver端口映射和服务 :sudo apt-get install nfs-kernel-server先重启portmap服务:sudo /etc/init.d/portmap restart编辑/etc/exports,添加目标系统的根文件系统映射目录,假如目标系统的根文件系统最后映射到/opt/rootfs,则----》打开文件.
2020-07-07 19:07:20
250
原创 Ubuntu12.04配置静态IP
初级驱动第一天Ubuntu12.04配置静态ip使用ifconfig查看网卡名称eth0 Link encap:Ethernet HWaddr 00:0c:29:28:be:0f inet addr:192.168.30.54 Bcast:192.168.30.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe28:be0f/64 Scope:Link UP BRO
2020-07-07 18:57:37
596
原创 hello你好
hello world#include<stdio.h>int main(){ printf("helloworld"); return 0;}
2020-07-07 14:05:09
92
单片机实验,串口通信
2019-01-12
单片机实验
2019-01-12
单片机实验,内有代码。
2019-01-12
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人