摘要:出错代码行如下:struct my_attribute val_attribute = __ATTR(val, 0666, val_show, val_store); 解决方法 是__ATTR宏的权限问题,将上述的0666改为0664,问题迎刃而解。 In file included from ./
阅读全文
摘要:一、Linux工作队列与Linux小任务机制的区别 工作队列(work queue)是另外一种将工作推后执行的形式,tasklet(小任务机制)有所不同。工作队列可以把工作推后,交由一个内核线程去执行,也就是说,这个下半部分可以在进程上下文中执行。这样,通过工作队列执行的代码能占尽进程上下文的所有优
阅读全文
摘要:Linux 内核 网络地址转换函数 in_aton、 in4_pton 和 in6_pton #ifndef _LINUX_INET_H #define _LINUX_INET_H #include <linux/types.h> /* * These mimic similar macros de
阅读全文
摘要: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
阅读全文
摘要:linux kernel的设备驱动模型在linux kernel引入统一设备模型之后,bus、driver和device形成了设备模型中的铁三角。在驱动初始化的时候会将代表该driver的一个数据结构挂入bus上的driver链表,device的数据结构挂入bus上的devie链表,那么如何让dev
阅读全文
摘要:通常将设备树源码(dts/dtsi)编译成设备树二进制文件(dtb)可以使用DTC(Device Tree Compiler)工具编译。 单文件编译 对于单文件的dts,可以采用下面的命令: # dtc命令使用方法见文末 dtc -O dtb -b 0 -o [dest_dtb_file] [src
阅读全文
摘要:# # ls /sys/bus/platform/drivers/macb/ 20030000.ethernet bind uevent unbind # # cd /sys/bus/platform/drivers/macb/ # # ls 20030000.ethernet bind ueven
阅读全文
摘要:linux driver write writel_relaxed readb()和writeb()系列函数 1 #define readb_relaxed(c) ({ u8 __r = __raw_readb(c); __r; }) 2 #define readw_relaxed(c) ({ u1
阅读全文
摘要:[ 0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [2] [ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max
阅读全文
摘要:[ 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 #
阅读全文
摘要:一般CPU频率(FCLK)高于内存、网卡等设备频率(HCLK),而串口、USB、I2C等设备频率(PCLK)更低。 分频: CPU工作于FCLK时钟;FCLK分倍频1/2或1/4等给内存、网卡、Nand flash等设备使用,即HCLK时钟;HCLK分倍频给串口、USB、I2C等低速设备,即PCLK
阅读全文
摘要:[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
阅读全文
摘要:cat hello.s .data /* Data segment: define our message string and calculate its length. */ msg: .ascii "Hello, ARM64!\n" len = . - msg .text /* Our app
阅读全文
摘要:特权模式(privilege mode) /* * Only the HART supporting privilege mode specified in the * scratch->next_mode should be allowed to become the coldboot * HAR
阅读全文
摘要:for i in `find -type f`; do [ -x $i ] && echo "$i is executable"; done
阅读全文
摘要:[root@centos7 linux-5.14]# ls /dev/watchdog /dev/watchdog [root@centos7 opensbi]# ls /sys/bus/amba/ devices drivers drivers_autoprobe drivers_probe ue
阅读全文