11 2021 档案

sys 文件 sysfs_create_file negative width in bit-field
摘要:出错代码行如下:struct my_attribute val_attribute = __ATTR(val, 0666, val_show, val_store); 解决方法 是__ATTR宏的权限问题,将上述的0666改为0664,问题迎刃而解。 In file included from ./ 阅读全文

posted @ 2021-11-29 10:32 tycoon3 阅读(431) 评论(0) 推荐(0) 编辑

Linux设备驱动workqueue(工作队列)案例实现
摘要:一、Linux工作队列与Linux小任务机制的区别 工作队列(work queue)是另外一种将工作推后执行的形式,tasklet(小任务机制)有所不同。工作队列可以把工作推后,交由一个内核线程去执行,也就是说,这个下半部分可以在进程上下文中执行。这样,通过工作队列执行的代码能占尽进程上下文的所有优 阅读全文

posted @ 2021-11-26 10:07 tycoon3 阅读(517) 评论(0) 推荐(0) 编辑

内核arp请求
摘要:Linux 内核 网络地址转换函数 in_aton、 in4_pton 和 in6_pton #ifndef _LINUX_INET_H #define _LINUX_INET_H #include <linux/types.h> /* * These mimic similar macros de 阅读全文

posted @ 2021-11-24 16:45 tycoon3 阅读(234) 评论(0) 推荐(0) 编辑

clk_enable
摘要:When implementing support for a new type of clock it is only necessary to include the following header:: #include <linux/clk-provider.h> To construct 阅读全文

posted @ 2021-11-24 11:53 tycoon3 阅读(85) 评论(0) 推荐(0) 编辑

Linux设备树
摘要:linux kernel的设备驱动模型在linux kernel引入统一设备模型之后,bus、driver和device形成了设备模型中的铁三角。在驱动初始化的时候会将代表该driver的一个数据结构挂入bus上的driver链表,device的数据结构挂入bus上的devie链表,那么如何让dev 阅读全文

posted @ 2021-11-24 09:42 tycoon3 阅读(180) 评论(0) 推荐(0) 编辑

编译设备树
摘要:通常将设备树源码(dts/dtsi)编译成设备树二进制文件(dtb)可以使用DTC(Device Tree Compiler)工具编译。 单文件编译 对于单文件的dts,可以采用下面的命令: # dtc命令使用方法见文末 dtc -O dtb -b 0 -o [dest_dtb_file] [src 阅读全文

posted @ 2021-11-18 16:22 tycoon3 阅读(941) 评论(0) 推荐(0) 编辑

Linux设备与驱动的手动解绑与手动绑定
摘要:# # ls /sys/bus/platform/drivers/macb/ 20030000.ethernet bind uevent unbind # # cd /sys/bus/platform/drivers/macb/ # # ls 20030000.ethernet bind ueven 阅读全文

posted @ 2021-11-18 09:45 tycoon3 阅读(439) 评论(0) 推荐(0) 编辑

linux 驱动寄存器读写
摘要:linux driver write writel_relaxed readb()和writeb()系列函数 1 #define readb_relaxed(c) ({ u8 __r = __raw_readb(c); __r; }) 2 #define readw_relaxed(c) ({ u1 阅读全文

posted @ 2021-11-16 17:58 tycoon3 阅读(970) 评论(0) 推荐(0) 编辑

Failed to initialize ' timer@0'
摘要:[ 0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [2] [ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max 阅读全文

posted @ 2021-11-16 16:56 tycoon3 阅读(205) 评论(0) 推荐(0) 编辑

could not get #clock-cells for
摘要:[ 0.431010] OF: tracing soc __of_get_address 1 [ 0.447918] OF: timer0: could not get #clock-cells for clk@1 [ 0.461946] OF: watchdog0: could not get # 阅读全文

posted @ 2021-11-16 15:50 tycoon3 阅读(583) 评论(0) 推荐(0) 编辑

linux 时钟
摘要:一般CPU频率(FCLK)高于内存、网卡等设备频率(HCLK),而串口、USB、I2C等设备频率(PCLK)更低。 分频: CPU工作于FCLK时钟;FCLK分倍频1/2或1/4等给内存、网卡、Nand flash等设备使用,即HCLK时钟;HCLK分倍频给串口、USB、I2C等低速设备,即PCLK 阅读全文

posted @ 2021-11-14 11:00 tycoon3 阅读(1104) 评论(0) 推荐(0) 编辑

QEMU OpenSBI 裸机开发之定时器中断
摘要:[root@centos7 lesson14]# make riscv64-unknown-elf-gcc -c -o entry.o entry.S riscv64-unknown-elf-gcc -Wall -Werror -O -fno-omit-frame-pointer -ggdb -mc 阅读全文

posted @ 2021-11-08 18:07 tycoon3 阅读(213) 评论(0) 推荐(0) 编辑

'Hello World' in ARM64 Assembly
摘要:cat hello.s .data /* Data segment: define our message string and calculate its length. */ msg: .ascii "Hello, ARM64!\n" len = . - msg .text /* Our app 阅读全文

posted @ 2021-11-08 11:25 tycoon3 阅读(642) 评论(0) 推荐(0) 编辑

opensbi smp同步
摘要:特权模式(privilege mode) /* * Only the HART supporting privilege mode specified in the * scratch->next_mode should be allowed to become the coldboot * HAR 阅读全文

posted @ 2021-11-04 16:50 tycoon3 阅读(174) 评论(0) 推荐(0) 编辑

find 可执行
摘要:for i in `find -type f`; do [ -x $i ] && echo "$i is executable"; done 阅读全文

posted @ 2021-11-02 19:18 tycoon3 阅读(25) 评论(0) 推荐(0) 编辑

watchdog module_amba_driver
摘要:[root@centos7 linux-5.14]# ls /dev/watchdog /dev/watchdog [root@centos7 opensbi]# ls /sys/bus/amba/ devices drivers drivers_autoprobe drivers_probe ue 阅读全文

posted @ 2021-11-01 15:23 tycoon3 阅读(291) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示