2024年12月15日

OpenWRT的一些初始设置

摘要: 简单记录一下在虚拟机或只有一个以太网接口的设备上开始使用OpenWRT的一些初始设置 使用passwd命令设置root用户密码 编辑/etc/config/network, 添加wan接口 编辑/etc/config/firewall, 添加一条规则,允许wan接口访问80端口,方便通过浏览器进行配 阅读全文

posted @ 2024-12-15 22:27 OrangeGLC 阅读(194) 评论(0) 推荐(0)

2023年11月30日

对C语言数组名的思考

摘要: 定义一个数组: int a[5] = {1,2,3,4,5}; 访问元素5可以通过以下形式的代码: a[4]; /*下标运算符,可理解为数组的访问形式*/ *(a+4); /*指针的加法运算和解引用,可理解为指针的引用形式*/ 实际上这两种访问形式是等价的,即X[m]=*(X+m) 这里不妨再拓展一 阅读全文

posted @ 2023-11-30 10:39 OrangeGLC 阅读(6) 评论(0) 推荐(0)

2022年10月19日

Linux源码编译——添加新模块

摘要: C源码文件(如new_module.c)添加到适当目录 在menuconfig中增加新条目:修改C源码文件所在目录下的Kconfig文件,参考该文件中已有的编译选项照猫画虎,添加新的项 config NEW_MODULE #声明在make menuconfig中新增的选项 bool/tristate 阅读全文

posted @ 2022-10-19 22:08 OrangeGLC 阅读(84) 评论(0) 推荐(0)

2022年10月17日

Linux源码目录简介

摘要: arch 不同平台体系结构(指令集)相关代码, Documentation 文档 firmware 硬件模块(如WiFi flash芯片)固件代码 init 内核通用入口(main),挂载文件系统 security 安全相关代码(SELinux) usr 测试相关代码 block 块设备相关代码 d 阅读全文

posted @ 2022-10-17 20:19 OrangeGLC 阅读(109) 评论(0) 推荐(0)

2022年9月8日

Linux定时任务——crontab

摘要: 常用crontab -e命令添加用户定时任务,语法格式非常简单,可以在下面的在线工具去测试格式是否正确以及具体的任务执行时间。 crontab执行时间计算 该命令适用于时间精度要求不高的任务,仅能精确到分钟。要实现秒级甚至更高精度的定时任务执行还是老老实实写守护进程吧。 阅读全文

posted @ 2022-09-08 00:22 OrangeGLC 阅读(39) 评论(0) 推荐(0)

2022年8月31日

进程间通信之匿名管道

摘要: Linux手册中对匿名管道的描述如下: DESCRIPTION pipe() creates a pipe, a unidirectional data channel that can be used for interprocess communication. The array pipefd 阅读全文

posted @ 2022-08-31 16:24 OrangeGLC 阅读(128) 评论(0) 推荐(0)

2022年8月26日

进程间通信之命名管道

摘要: 与匿名管道相比,命名管道通信的两个进程可以脱离父子关系。即任意两个进程都能通过该方式通信。 测试代码如下。 发送端 #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include 阅读全文

posted @ 2022-08-26 14:10 OrangeGLC 阅读(50) 评论(0) 推荐(0)

2022年3月31日

正则表达式基础

摘要: .- 除换行符以外的所有字符。 ^ - 字符串开头。 $ - 字符串结尾。 \D,\W,\S - 匹配数字、字符、空格。 \D,\W,\S - 匹配非数字、非字符、非空格。 [ABC] - 匹配 A、B 或 C 中的一个字母。 [A-Z] - 匹配 A 到 Z 中的一个字母。 [^ABC] - 匹配 阅读全文

posted @ 2022-03-31 23:47 OrangeGLC 阅读(47) 评论(0) 推荐(0)

2022年3月29日

uboot文件——crt0_64.S

摘要: 简单翻译一下文件里的注释,加深理解和记忆。 ##一、概述 This file handles the target-independent stages of the U-Boot start-up where a C runtime environment is needed. Its entry 阅读全文

posted @ 2022-03-29 23:17 OrangeGLC 阅读(197) 评论(0) 推荐(0)

2022年3月6日

为树莓派4B编译uboot

摘要: 1.编译环境 OS Ubuntu 20.04 uboot源码 https://github.com/u-boot/u-boot.git 2.安装交叉编译工具链以及相关库 sudo apt install gcc-aarch64-linux-gnu make bison flex libssl-dev 阅读全文

posted @ 2022-03-06 23:51 OrangeGLC 阅读(1489) 评论(0) 推荐(0)

< 2025年4月 >
30 31 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 1 2 3
4 5 6 7 8 9 10

导航

统计

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