- 博客(32)
- 资源 (2)
- 收藏
- 关注
原创 linux gpio驱动示例
#include <linux/fs.h>#include <linux/module.h>#include <linux/kernel.h>#include <linux/init.h>#include <linux/ioctl.h>#include <linux/uaccess.h>#include <linux/device.h>#include <linux/gpio.h>#
2020-02-09 15:30:11
1499
原创 linuxrw
#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <errno.h>#include <signal.h>#include <fcntl.h>#include <ctype.h>#include <termios.h>#include <sys
2020-02-09 15:28:28
789
原创 驱动报告uevent示例
#include <linux/module.h>#include <linux/init.h>#include <linux/gpio.h>#include <linux/slab.h>#include <linux/kobject.h>#include <linux/sysfs.h>#include <linux/kernel.h>#include <linux/interrupt
2020-02-09 15:26:56
2255
1
原创 Linux平台RTL8188CUS驱动移植及测试
Linux平台RTL8188CUS驱动移植及测试 一 内核配置以及驱动编译: 1.配置内核wireless选项 进入内核目录,make menuconfig , [*] Networking support —> [*] Wireless —> — Wireless -*- Wireless extensi
2020-02-02 10:06:55
4733
原创 Initramfs制作
1 uboot的修改: vi commo/cmd_bootm.c’;将CFG_BOOTM_LEN 改为0x5000000 vi include/configs/grus. h 修改bootargs 为: “mem=256M console=ttyS3 57600n8 ip=off root=/dev/ram0 rdinit=/linuxrc” 修改bootcmd为: “nand
2020-02-02 09:57:51
904
原创 重采样库示例
#include <fcntl.h>#define BUFFER_LEN30*48000*2static void simple_test (int converter, double ratio) ;int main(int argc ,char ** argv ){ printf("usage : ./a.out type file\n");...
2020-02-02 09:57:21
1021
原创 RT3070驱动移植及测试
一 驱动移植: 1 配置内核wireless选项 进入内核目录,make menuconfig , [*] Networking support —> [*] Wireless —> — Wireless -*- Wireless extensions [*] Wireles
2020-02-02 09:54:58
1298
原创 arm linux无线路由
一块arm开发板,带有以太网口,还有一个在京东上买的usbwifi模块,wifi模块在ubuntu上直接可以用,输入lsusb,发现其使用的wifi模块竟然是realtek的8192,于是想用这两个网口实现无线路由的转发功能,即板子的以太网接到局域网,以太网与wifi的wlan0直接存在一定转发规则,然后手机或者笔记本连上8192的AP即可上网。 实现这一功能稍微有...
2020-02-02 09:54:03
2087
原创 SD卡测试脚本
!/bin/bashcp /mnt/sdcard/appfs.cramfs /tmp/a.bin umount /usr/fs md5a=md5sum /tmp/a.bin | awk '{print $1 }' asize=ls -l /tmp/a.bin | awk '{print $5 }' cnt=1 echo “asize asize”while:doecho“————————”
2020-02-02 09:53:25
1185
原创 linpack-linux
/* * Linpack 100x100 Benchmark In C/C++ For PCs * ******************************************************************** * * Original Source from NETLIB * * Translated ...
2020-02-02 09:52:56
2126
原创 ppc qemu
qemu-img create -f raw disk-img.raw 2.5Gsudo losetup /dev/loop7 disk-img.rawsudo losetup -o $((2048*512)) /dev/loop6 /dev/loop7sudo mkfs.ext3 /dev/loop6sudo qemu-system-ppc -cpu G4 -nographic -k...
2020-02-02 09:52:16
675
1
原创 make grub udisk manually
Below is the steps how to make grub udisk manuallymy udisk is /dev/sdcclean udisk information(mbr and partition information)sudo dd if=/dev/zero of=/dev/sdc bs=1M count=1024 oflag=directcr...
2020-02-02 09:49:42
314
原创 宏函数的返回值
宏函数,在定义时不需要指明返回类型及返回值宏函数中最后一个表达式的值,即为宏函数的返回值。该值的类型,即为宏函数的返回类型。#define Min(x, y) ((x)<(y)?(x):(y)int main(){int a = 10;int b = 20;int c = Min(10, 20);return 0;}...
2020-02-02 09:44:30
2274
原创 spin_lock为什么要关闭抢占?
The reason that preemption is disabled on a uniprocessor system is:If not:P1 holds the lock and after a time is scheduled out.Now P2 starts executing and let’s say requests the same spinlock. Since...
2020-02-02 09:39:46
946
原创 自旋锁的使用
自旋锁有两个版本:spin_lock()spin_lock_irqsave()个人理解,如果只在ISR中,使用spin_lock();如果在进程上下文,或者进程上下文或者中断上下文都用到,或者在某个函数中用到,而这个函数会被其它函数调用则用spin_lock_irqsave()....
2020-02-01 20:55:48
419
原创 linux添加网桥
sudo ip link add brtest0 type bridge;ip tuntap add tap0 mode tap user wrsadmin ;ip link set tap0 up ;ip link set tap0 master brtest0 ;ip link set brtest0 up
2020-02-01 20:46:16
1006
原创 linux4.9内核PCIe的一个问题
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.cindex f30ca75b5b6c…d87876fb8f90 100644— a/drivers/pci/setup-bus.c+++ b/drivers/pci/setup-bus.c@@ -197,7 +197,8 @@ static void __dev_so...
2020-02-01 20:44:22
720
原创 C函数与栈的理解
栈是内存中的空间,用来存储函数内部的变量,sp寄存器值是这片空间的基址下面的例子直观的说明了这一点:test.c:#include <stdio.h>#include <stdlib.h>int sum2(int a, int b){ return a + b;}int sum1(int a, int b){ return (sum2(...
2020-02-01 20:42:41
333
原创 C指针的理解
test.c:#include <stdio.h>#include <stdlib.h>int main(int argc, char **argv){ int a = 5; int *p1 = &a; int **p2 = &p1; return 0;}arm-cortexa9-linux-gnueabih...
2020-02-01 20:37:58
301
原创 linux内核宏的阅读方法
通过预编译的方法将内核代码中的宏替换掉,再把得到的c代码格式化下面是预编译后的一个例子:extern void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);extern void thread_group_cputime_adjusted(struct task_struct *p, ...
2020-02-01 20:33:45
580
原创 一种调试方法
在芯片验证期间,会在palladium上调试driver,早期只起了个ramdisk文件系统,网络,sd卡,u盘可能都不能使用,如何将ko传到文件系统里?如果把ko直接编译进内核,再用jtag烧录,这也是一种办法,但是由于palladium这个平台非常的慢,这样做每debug一次都会耗费1个多小时。这里介绍另外一种方法,先将driver编译成ko,然后通过jtag讲ko下载到一段内核不用的内存空...
2020-02-01 20:29:22
412
原创 qemu添加网卡
ip link add brtest0 type bridgeip tuntap add tap0 mode tap user woodip link set tap0 upip link set tap0 master brtest0ip tuntap add tap1 mode tap user woodip link set tap1 upip link set tap1 mas...
2020-02-01 20:27:38
2052
原创 重采样库示例
功能:使用重采样库对音频数据重采样,适用于单声道16位音频数据。#include <fcntl.h>#define BUFFER_LEN30*48000*2static void simple_test (int converter, double ratio) ;int main(int argc ,char ** argv ){ printf("us...
2020-02-01 20:25:21
498
原创 NFS4 mount
sudo mount -o vers=4,tcp -t nfs4 128.224.166.113:/ tmp/buildarea1 *(async,rw,insecure,insecure_locks,no_root_squash,fsid=1)这里的fsid=1在nfs文件系统里再mount nfs是必须要的/nfs *(rw,sync,no_root_squash,no_subt...
2018-12-17 15:17:00
2083
转载 SSH 免秘钥登录
假设要登录的机器为192.168.1.100,当前登录的机器为192.168.1.101。首先在101的机器上生成密钥(如果已经生成可以跳过):$ ssh-keygen -t rsa一路回车。然后在将生成的公钥复制到机器100上的~/.ssh/authorized_keys中,使用如下命令:$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.1...
2018-12-17 00:41:25
273
原创 Linux ram挂载jffs2文件系统
参考链接:http://www.linuxdiyf.com/viewarticle.php?id=58126 http://blog.chinaunix.net/uid-26683644-id-3394110.html如何将一个mtd ram 设备格式化为jffs2文件系统并且正常使用?1kernel 配置: (1)jffs2文件系统支持: File systems —&gt;...
2018-07-13 14:55:23
1379
原创 回声消除数据对齐软件方法
待写-----------------------------------------------------------------...
2018-07-05 13:31:18
1079
原创 Image拼接脚本
#!/bin/bashOFFSET_UBOOT=0OFFSET_NV=262144OFFSET_USER=393216OFFSET_ZIMAGE=1048576OFFSET_UPDATER=4194394OFFSET_APPFS=8912896TARGET=img.bindd if=/dev/zero of=$TARGET bs=1M count=16dd if
2016-11-02 09:29:37
611
原创 ubuntu nfs服务器
cd ~mkdir nfs mkdir tmpchmod 777 nfssudo apt-get install nfs-kernel-server nfs-common portmapsudo vi /etc/exports //加一行 ~/nfs *(rw,sync,no_root_squash) sudo /etc/init.d/nfs-kerne...
2015-01-24 18:03:42
665
原创 ubuntu tftp服务器
1 sudo apt-get install tftpd-hpa tftp-hpa2.配置TFTP服务器sudo vim /etc/default/tftpd-hpa mkdir ~/tftpchmod 777 ~/tftpcp test.c ~/tftp ifconfig eth0 Link encap:以太网 硬件地址 8c:73
2015-01-24 17:49:26
622
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人