Matrix

CarlyleLiu‘s Blog

西江月·遣兴

醉里且贪欢笑,要愁那得工夫。

近来始觉古人书。信著全无是处。

昨夜松边醉倒,问松我醉何如。

只疑松动要来扶。以手推松曰去。

阅读全文 »

频谱划分

  • IEEE 802.11b/g 标准工作在 2.4G 频段,频率范围为 2.400—2.4835GHz,共 83.5M 带宽
  • 划分为 14 个子信道
  • 每个子信道宽度为 22MHz
  • 相邻信道的中心频点间隔 5MHz
  • 相邻的多个信道存在频率重叠(如 1 信道与 2、3、4、5 信道有频率重叠)
  • 整个频段内只有 3 个(1、6、11)互不干扰信道
阅读全文 »

临江仙

夜饮东坡醒复醉,归来仿佛三更。家童鼻息已雷鸣。敲门都不应,倚杖听江声。

长恨此身非我有,何时忘却营营?夜阑风静縠纹平。小舟从此逝,江海寄余生。

阅读全文 »

安装并开启SSR

1
2
3
4
5
6
7
8
9
10
11
12
13
14
git clone -b master https://github.com/flyzy2005/ss-fly

ss-fly/ss-fly.sh -ssr
...
Congratulations, ShadowsocksR server install completed!
Your Server IP : xxx.xxx.xxx.xxx
Your Server Port : 12210
Your Password : password
Your Protocol : origin
Your obfs : plain
Your Encryption Method: aes-256-cfb

Welcome to visit:https://shadowsocks.be/9.html
Enjoy it!

相关操作ssr命令

1
2
3
4
5
6
7
8
启动:/etc/init.d/shadowsocks start
停止:/etc/init.d/shadowsocks stop
重启:/etc/init.d/shadowsocks restart
状态:/etc/init.d/shadowsocks status

配置文件路径:/etc/shadowsocks.json
日志文件路径:/var/log/shadowsocks.log
代码安装目录:/usr/local/shadowsocks

卸载ssr服务

1
./shadowsocksR.sh uninstall
阅读全文 »

启动流程

Linux 系统当前的启动流程如下:

1
brom --> boot0 --> (monitor/secure os) --> uboot --> rootfs --> app

brom 固化在 IC 内部,芯片出厂后就无法更改。后续将从 boot0 开始分阶段介绍启动优化的方法。

对于某些方案,会存在 monitor 或 secure os,这两者耗时很短,略过。

阅读全文 »

一剪梅·红藕香残玉簟秋

红藕香残玉簟秋。轻解罗裳,独上兰舟。云中谁寄锦书来,雁字回时,月满西楼。

花自飘零水自流。一种相思,两处闲愁。此情无计可消除,才下眉头,却上心头。

阅读全文 »

系统裁剪简介

固件中通常包含 boot0、 uboot、 kernel、 rootfs 等镜像。基于经验,各个镜像尺寸的量级如下表所示:

Image size
boot0 < 100k
uboot < 1M
kernel 3-15M
rootfs > 4M

可以看到 boot0、 uboot、 kernel、 rootfs 的尺寸是依次增大的。对于大尺寸的裁剪效果往往比小尺寸的裁剪效果明显,比如 rootfs 裁剪 1M 可能很容易,对于 uboot 来说,则非常困难。因此,后续主要介绍 kernel 以及 rootfs 的裁剪。

阅读全文 »

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_FRAMES 10

int myfunc1(int);
int myfunc2(int);
int myfunc3(int);

void printCallers()
{
int layers = 0, i = 0;
char ** symbols = NULL;

void * frames[MAX_FRAMES];
memset(frames, 0, sizeof(frames));
layers = backtrace(frames, MAX_FRAMES);
for (i=0; i<layers; i++) {
printf("Layer %d: %p\\n", i, frames[i]);
}
printf("------------------\\n");

symbols = backtrace_symbols(frames, layers);
if (symbols) {
for (i=0; i<layers; i++) {
printf("SYMBOL layer %d: %s\\n", i, symbols[i]);
}
free(symbols);
}
else {
printf("Failed to parse function names\\n");
}
}

int myfunc1(int a)
{
int b = a + 5;
int result = myfunc2(b);
return result;
}

int myfunc2(int b)
{
int c = b * 2;
int result = c + myfunc3(c);
return result;
}

int myfunc3(int c)
{
printCallers();
return 0;
}

int main()
{
int result = 0;
result = myfunc1(1);
printf("result = %d\\n", result);

return 0;
}
阅读全文 »
0%