摘要: 假如要在系统内交互一个二进制数据,忽略大小端;可以将数据定义如下sequence<octet, 255> payload通过from_array赋值,通过get_contiguous_buffer获取buffer。目前已知存在如果二进制定义中间存在0,会导致后续数据为0. 1 idl 2 struc 阅读全文
posted @ 2021-01-27 13:55 sciapex 阅读(341) 评论(0) 推荐(0) 编辑
摘要: 比较讨厌模板,所以都不希望整个类都感染,只让部分函数有模板功能。 所以下面code是一个不需要将类声明为模板类,却又可以保留模板函数为成员变量的一个例子。 第17行声明一个通用指针用于保存每个对象对应不同的函数指针,便于在线程中使用该变量。 第44行将一个模板函数指针转化给一个通用的类指针保存,然后 阅读全文
posted @ 2021-01-26 12:14 sciapex 阅读(661) 评论(0) 推荐(0) 编辑
摘要: insmod: error could not insert module test.ko: -1 Invalid module format 原因:驱动文件编译的内核版本与当前运行系统的内核版本不一致导致。 1. 通过modinfo 查看test.ko的内核版本vermagic 2. 通过unam 阅读全文
posted @ 2020-10-16 11:50 sciapex 阅读(8520) 评论(0) 推荐(0) 编辑
摘要: 高低地址和高低字节都是对于大于8位数据而言,读取的数据是整个数据读取,即使是一个结构体(struct)或者联合体(union)。 比如一个uint16_t num = 0x1234的数据就需要定义一个uint8_t buffer[2], 其中: 高8位DATAH是0x12, 低8位DATAL是0x3 阅读全文
posted @ 2020-05-27 09:43 sciapex 阅读(1475) 评论(0) 推荐(0) 编辑
摘要: 近来看了一个代码,这种代码结构需要设计好一些基础业务功能proc_fns, 有了这些基础proc_fns后,就可以通过xml来配置宏TEST_SCRIPT,生成对应的脚本源文件。 比较多的使用是base_fns的参数,有事件id,事件数据msg,有事件回调函数指针callback。 通过多种结合,代 阅读全文
posted @ 2020-04-30 09:47 sciapex 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 问题,python2在运行时提示如下错误中的一种: 1. UnicodeDecodeError: 'ascii' codec can't decode byte 0x1a in position 0: ordinal not in range(128) 2. UnicodeDecodeError:' 阅读全文
posted @ 2020-03-19 16:07 sciapex 阅读(182) 评论(0) 推荐(0) 编辑
摘要: TAB for more information Boot Entry Linux >root=(hd0,1) #linux img/linux root(hd0, gpt1), (hd1, msdos1) >linux /boot/linuz-X.X.X.img root=/dev/sdb1 >i 阅读全文
posted @ 2020-03-15 10:40 sciapex 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 1. download kernel(5.5.9) mirror:https://mirrors.tuna.tsinghua.edu.cn/kernel/v5.x/ 2. install other soft soft-devel... a. open-ssl, ncurses, ncurses-d 阅读全文
posted @ 2020-03-13 23:21 sciapex 阅读(163) 评论(0) 推荐(0) 编辑
摘要: fatal error: gnu/stubs-32.h: No such file or directory or cannot find -lgcc_s 1. sudo dnf install libstdc++-devel.i686 2. sudo dnf install glibc-devel 阅读全文
posted @ 2020-03-09 21:53 sciapex 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 写一个函数输出一个数的质因数int PrimeFactor(const int a) int PrimeFactor(const int a) { int k = a; if (a <= 2) { return -1; } for (int i = 2; i <= k; ++i) { if ((k 阅读全文
posted @ 2020-02-25 09:18 sciapex 阅读(389) 评论(0) 推荐(0) 编辑