摘要: ![](http://images.cnitblog.com/blog/563391/201502/021132429212888.png)注:其中 A53 架构的是 64 位处理器。## MT6733[魅蓝](http://www.meizu.com/products/meilan/fun.htm... 阅读全文
posted @ 2015-02-02 11:48 sammei 阅读(1196) 评论(0) 推荐(0) 编辑
摘要: # uboot 对 FAT 分区的解析改写 UBOOT 从 U 盘读入固件,然后刷机。发现有的 U 盘无法正确读到分区,跟踪了一下发现自己写的代码有漏洞,只尝试解析分区表里的第一个分区。跟踪的过程中重温了一下 MBR 的格式,这里记录一下 UBOOT 对其中分区表的解析。## MBR主引导记录(Ma... 阅读全文
posted @ 2015-01-30 02:37 sammei 阅读(2504) 评论(0) 推荐(0) 编辑
摘要: # DSL 如何工作http://computer.howstuffworks.com/dsl.htm当你连接到因特网时,你可能是通过一个调制解调器 (modem),或办公室的局域网,或者一个电缆调制解调器,或者数据用户线路(DSL)来建立连接。DSL 是一种非常高速的连接,而且与传统电话线使共用线... 阅读全文
posted @ 2015-01-29 01:26 sammei 阅读(694) 评论(0) 推荐(0) 编辑
摘要: 报出的错误大概为:> Alert! /dev/disk/by-uuid/ ....... does not exist最后进入了 initramdiskfs 的命令行终端 。 输入 blkid 命令却一个分区都找不到。折腾了一下之后,又增加了如下报错:> udevadm trigger is not... 阅读全文
posted @ 2015-01-06 13:31 sammei 阅读(1521) 评论(0) 推荐(0) 编辑
摘要: 接着前面写过的一篇关于 procd 的笔记. procd 在 STATE_INIT 时会运行 /etc/inittab 中描述的几个级别指定程序. ``` procd_inittab_run("respawn"); procd_inittab_run("askconsole"); procd_... 阅读全文
posted @ 2014-12-25 18:07 sammei 阅读(1427) 评论(0) 推荐(0) 编辑
摘要: http://wiki.openwrt.org/doc/howto/wireless.utilities这些工具依赖于驱动的实现. ## 基于 mac80211 的驱动### iwconfigiwconfig 是一个配置工具, 基于 WEXT api. 这套 api 非常陈旧, 即将被废弃.### ... 阅读全文
posted @ 2014-12-17 17:47 sammei 阅读(477) 评论(0) 推荐(0) 编辑
摘要: ```void procd_inittab(void){#define LINE_LEN 128 FILE *fp = fopen(tab, "r"); struct init_action *a; regex_t pat_inittab; regmatch_t matches[5]; char *... 阅读全文
posted @ 2014-12-17 10:38 sammei 阅读(5425) 评论(0) 推荐(0) 编辑
摘要: ``` Ralink RT2860 802.11n AP support [*] LED Support [*] WSC (W... 阅读全文
posted @ 2014-12-17 10:29 sammei 阅读(1741) 评论(0) 推荐(0) 编辑
摘要: 删除 openjdk 时 remove 了一大堆软件. 可能由于这个原因导致使用 git svn 命令时出现类似下面的错误. ```sam@sam-CW65S:pics$ git svn rebase Can't locate SVN/Core.pm in @INC (you may need to... 阅读全文
posted @ 2014-12-05 11:30 sammei 阅读(847) 评论(0) 推荐(0) 编辑
摘要: ``` Busybox Settings ---> Busybox Library Tuning ---> [*] History saving [ ] Save histo... 阅读全文
posted @ 2014-12-04 17:55 sammei 阅读(483) 评论(0) 推荐(0) 编辑
摘要: ```#include #include int main(void){ char s[] = "aa,bb,cc.11,22,33"; char *delim = ",."; char *s1 = s; for (;;) { char *t = strsep(&s1, delim); if (... 阅读全文
posted @ 2014-12-04 15:18 sammei 阅读(483) 评论(0) 推荐(0) 编辑
摘要: ``` [ 147.080000] svc: failed to register lockdv1 RPC service (errno 146).[ 147.090000] lockd_up: makesock failed, error=-146[ 147.090000] CPU 0 Un... 阅读全文
posted @ 2014-12-04 11:33 sammei 阅读(1121) 评论(0) 推荐(0) 编辑
摘要: W25Q16V 是华邦出的一颗 spi flash. 25系列是比较通用的一个系列. 后面的数字 16 跟容量有关, 16 表示 16Mbits, 相当于 2MB.与此类似的还有 W25Q128V 等, 128 就表示容量 16MB.对于 W25Q16V:* page 为最大的编程单位. 1 pag... 阅读全文
posted @ 2014-11-29 16:33 sammei 阅读(21423) 评论(0) 推荐(1) 编辑
摘要: OpenWrt 启动时会执行 rc.d/ 下的脚本. [这篇文章](http://wiki.openwrt.org/doc/techref/initscripts) 介绍了启动脚本里的规则. ```K50dropbear -> ../init.d/dropbearK85odhcpd -> ../in... 阅读全文
posted @ 2014-11-27 15:51 sammei 阅读(1294) 评论(0) 推荐(0) 编辑
摘要: libusb_init(NULL), 如果传入一个NULL, 则libusb 内部会有一个 usbi_default_context 变量在内部保存上下文. 这样以后调用 libusb 函数时可以不指定 context, libusb 使用默认的内部变量.详见 USBI_GET_CONTEXT(c... 阅读全文
posted @ 2014-11-25 23:27 sammei 阅读(2544) 评论(0) 推荐(0) 编辑
摘要: ## 由内核发出 event 事件. 1. kobject_uevent() 产生 uevent 事件(lib/kobject_uevent.c 中), 产生的 uevent 先由 netlink_broadcast_filtered() 发出, 最后调用 uevent_helper[] 所指定的程... 阅读全文
posted @ 2014-11-24 21:30 sammei 阅读(8601) 评论(0) 推荐(1) 编辑
摘要: 默认编译 openwrt 时会先编译一套 toolchain. 这个步骤耗时较长. 使用外部 toolchain 可以多个 project 共用一套 toolchain , 而且也不重再编译它了. 省时省力. `make menuconfig````[*] Advanced configuratio... 阅读全文
posted @ 2014-11-14 12:11 sammei 阅读(4856) 评论(0) 推荐(0) 编辑
摘要: openwrt 烧写完成之后, 第一次启动会设置 network 的相关参数, 如 ip地址, mac地址, 等. 这里跟踪一下启动之后直到网络参数设置的过程. 0. /sbin/init procd "sysinit" /etc/rc.d/xxx 1. /etc/rc.d/S10boot /etc 阅读全文
posted @ 2014-11-12 12:06 sammei 阅读(7829) 评论(4) 推荐(0) 编辑
摘要: # attribute constructor&destructor在看openwrt里libnl-tiny这个库的时候,遇到了C里面的构造函数这个概念。 static void __init init_msg_size(void) { default_msg_size = getpagesize... 阅读全文
posted @ 2014-09-26 13:05 sammei 阅读(404) 评论(0) 推荐(0) 编辑
摘要: # ditaa[ditaa](http://ditaa.sourceforge.net/)是一个把ascii图形转成图片的工具。在查看[zguide](https://github.com/imatix/zguide)时看到这个文档是用[gitdown](https://github.com/ima... 阅读全文
posted @ 2014-09-24 23:52 sammei 阅读(833) 评论(0) 推荐(0) 编辑
摘要: # quilt - 制作patch的工具在尝试为openwrt做一个patch时,查到这个工具。openwrt官方已经有很详细的文档对步骤进行说明了。[quilt](http://en.wikipedia.org/wiki/Quilt_(software))并不是专为openwrt的开发工具。qui... 阅读全文
posted @ 2014-09-24 23:37 sammei 阅读(2791) 评论(0) 推荐(0) 编辑
摘要: [双绞线](http://baike.c114.net/view.asp?id=8809-DD96D2AE)## 概述 双绞线的英文名字叫Twist-Pair。是综合布线工程中最常用的一种传输介质。 双绞线采用了一对互相绝缘的金属导线互相绞合的方式来抵御一部分外界电磁波干扰。把两根绝缘的铜导线按... 阅读全文
posted @ 2014-09-22 01:44 sammei 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 下文来自网络搜集,有些摘自[WiFi工作原理、测试及生产注意事项](http://wenku.baidu.com/view/4edeef3767ec102de2bd8980.html)## 术语* AP : Access Point, 接入点* AC : Access Controller 接入控制... 阅读全文
posted @ 2014-09-21 22:50 sammei 阅读(894) 评论(0) 推荐(0) 编辑
摘要: 淘宝看到一款FIR300M路由器,当时只要19.9元。图便宜就买了。## HardwareArchitecture: MIPSVendor: MediaTek (Ralink)Bootloader: U-Boot 1.1.3System-On-Chip: Ralink MT7620N ver:2 e... 阅读全文
posted @ 2014-09-21 15:22 sammei 阅读(5025) 评论(2) 推荐(0) 编辑
摘要: [A Tutorial on the Device Tree (Zynq) -- Part V](http://xillybus.com/tutorials/device-tree-zynq-5)## Application-specific data之前提过,设备树中是一些特殊信息,这样一个驱动可... 阅读全文
posted @ 2014-09-21 12:58 sammei 阅读(642) 评论(0) 推荐(0) 编辑
摘要: ## 获取资源信息内核模块驱动加载之后,就开始把硬件资源管理起来,如读写寄存器、接收中断。来看看设备树里的一条:``` xillybus_0: xillybus@50000000 { compatible = "xlnx,xillybus-1.00.a"; reg = ; ... 阅读全文
posted @ 2014-09-21 12:40 sammei 阅读(1796) 评论(0) 推荐(0) 编辑
摘要: ## squashfs-sysupgrade.bin 生成过程图![openwrt-image-follow](http://images.cnitblog.com/blog/563391/201409/201856367842550.png)## 路径变量```$(KERNEL_BUILD_DIR... 阅读全文
posted @ 2014-09-20 19:12 sammei 阅读(5744) 评论(0) 推荐(0) 编辑
摘要: ### 删除以ifeq开头的行sed -i "/^ifeq/d" file### 删除空行sed -i '/^$/d' file 阅读全文
posted @ 2014-09-18 17:50 sammei 阅读(214) 评论(0) 推荐(0) 编辑
摘要: [A Tutorial on the Device Tree (Zynq) -- Part III](A Tutorial on the Device Tree (Zynq) -- Part III)## 定义外设可能你读本文是为了给你的设备写一个Linux驱动,在这方面要推荐著名的《Linux D... 阅读全文
posted @ 2014-09-18 10:19 sammei 阅读(611) 评论(0) 推荐(0) 编辑
摘要: [A Tutorial on the Device Tree (Zynq) -- Part II](http://xillybus.com/tutorials/device-tree-zynq-2)## 设备树结构Zynq的设备树如下:```/dts-v1/;/ { #address-cells ... 阅读全文
posted @ 2014-09-18 09:07 sammei 阅读(809) 评论(0) 推荐(1) 编辑
摘要: [A Tutorial on the Device Tree (Zynq) -- Part I](http://xillybus.com/tutorials/device-tree-zynq-1)## 此教程的目的本教程是针对Xilinx' Zynq-7000 EPP设备(一个集成了FPGA的ARM... 阅读全文
posted @ 2014-09-18 03:28 sammei 阅读(1339) 评论(0) 推荐(0) 编辑
摘要: dts的概念是linux kernel中的,跟openwrt的关系不大。只是恰好在学习openwrt的时候碰到了这个东西,所以记录在openwrt名下。## patch-dtbopenwrt对arch/mips/kernel/head.S文件打了补丁,在其中加入了以下几行:``` .ascii "... 阅读全文
posted @ 2014-09-17 18:57 sammei 阅读(2192) 评论(0) 推荐(1) 编辑
摘要: [BMP file format](http://en.wikipedia.org/wiki/BMP_file_format)```typedef struct bmp_header { /* Header */ char signature[2]; uint32_t file_size; uint... 阅读全文
posted @ 2014-09-17 16:35 sammei 阅读(393) 评论(0) 推荐(0) 编辑
摘要: ```# cat /sbin/firstboot #!/bin/sh/sbin/jffs2reset```jffs2reset 是fstools里的工具。做的工作有:1. 在/proc/mtd里找到名为"rootfs_data"的分区, 假如找到的是mtd5,则/dev/mtd5就是该块设备的节点。... 阅读全文
posted @ 2014-09-15 22:44 sammei 阅读(3425) 评论(0) 推荐(0) 编辑
摘要: ## sysupgrade### 用法:sysupgrade [...] sysupgrade [-q] [-i] ### 升级选项:* -d 重启前等待 delay 秒* -f 从 .tar.gz (文件或链接) 中恢复配置文件* -i 交互模式* -c 保留 /etc 中所有修改过的文件*... 阅读全文
posted @ 2014-09-15 17:59 sammei 阅读(12961) 评论(0) 推荐(0) 编辑
摘要: 本篇的主要目的是想通过分析Makefile,了解openwrt编译过程。着重关注以下几点:0. openwrt目录结构1. 主Makefile的解析过程,各子目录的目标生成。2. kernel编译过程3. firmware的生成过程4. 软件包的编译过程## openwrt目录结构官方源下载速度太度... 阅读全文
posted @ 2014-09-14 17:28 sammei 阅读(32442) 评论(0) 推荐(5) 编辑
摘要: ## 单独编译内核: `make V=s target/linux/install`## 相调函数调用流程:```init/main.c : start_kernel() -> setup_arch(&command_line)arch/mips/kernel/setup.c:setup_arch(... 阅读全文
posted @ 2014-09-10 18:15 sammei 阅读(4332) 评论(0) 推荐(0) 编辑
摘要: ### select```#include #include int select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set exceptset, const struct timeval *timeout);```- timeou... 阅读全文
posted @ 2014-09-07 18:09 sammei 阅读(263) 评论(0) 推荐(0) 编辑
摘要: ### signal信号是一种软件中断,异步发生,在进程运行的时候随时可能发生。信号可以:- 由一个进程发给另一个进程,或发给自身- 由内核发给某个进程信号的action:1. signal handler,在信号发生时被调用,这个过程也称为捕获信号。SIGKILL/SIGSTOP两个信号不能被捕获... 阅读全文
posted @ 2014-09-07 02:34 sammei 阅读(238) 评论(0) 推荐(0) 编辑
摘要: ---## 基本函数接口### socket函数```#include int socket(int family, int type, int protocol);```成功时返回一个非负整数,与文件描述符类似,称为套接字描述符 sockfd。各参数的意义:1. family 指明协议族。取值为以... 阅读全文
posted @ 2014-09-06 16:37 sammei 阅读(446) 评论(0) 推荐(0) 编辑