arch/mips/kernel/setup.c
1 | static void __init bootmem_init(void) |
1 | static void __init bootmem_init(void) |
1 | 936 static int __devinit e1000_probe(struct pci_dev *pdev, |
1 | 53 #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) |
1 | 365 struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs, |
1 | 5821 struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, |
1 | 334 void ether_setup(struct net_device *dev) |
IPv6 route tree 原理.
IPv6路由采用二叉树的形式进行存储, 查找任意路由最多需要128次比较(128次,说法不太严格)。
因此其算法复杂度为常数,因此IPv6里没有像IPv4那样的cache。
When we compile a glibc(or eglibc), we need generated the timezone data file with it. although, it is stable and no change almost in every version update.
Today a problem is met about it.
We use the old glibc’s timezone file, which is used by many different toolchain for several paltforms.
unfortunately.the data file has been change after 2007 year by GNU official. but I did not found the exact version(date) of glibc, which change the timezone data file.
btw: toolchain = binutils + gcc + glibc(eglic) + kernel(header)
###af_key.c
linux kernel provide 3 method to manager SA/SP,
such as add/del/flush/dump SAs/SPs.
The af_key.c implement the pf_key socket.
###part 1. pf_key socket defination about socket opertion.
important function is
pfkey_create,pfkey_sendmsg,pfkey_recvmsg,
pfkey_release,datagram_poll,
1 | static const struct proto_ops pfkey_ops = { |
###part 2. pf_key kernel message
1 | static struct xfrm_mgr pfkeyv2_mgr = |
in kernel 3.0, pf_key message format
A traditional TLV format.
header + (extenion-header + extention_value)*n
The header is sadb_msg.
extention header is sadb_ext.
extention value is different according the extention header.
Such as sadb_sa,sadb_x_policy and so on.
1 | struct sadb_msg { |
The application program(such as setkey) sent a command to kernel by sendmsg system API.
Thus in kernel pf_key will call pfkey_sendmsg.
pfkey_sendmsg will call pfkey_get_base_msg to do some simple check, and
then call pfkey_process.
pfkey_process will first pfkey_broadcast, then divid the extention message
to a pointer array one by one.void *ext_hdrs\[SADB_EXT_MAX\];
SADB_EXT_SA
—->SADB_EXT_ADDRESS_SRC
—->SADB_EXT_ADDRESS_DST
—->
this pointer array will be used by the following handler.
and then call the pfkey_handler according the sadb_msg_type in the pf_key messag header.
typedef int (*pfkey_handler)(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs);
1 | typedef int (*pfkey_handler)(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs); |
The policy related function was done in xfrm_policy.c and xfrm_state.c
3.1 policy add handler: pfkey_spdadd
3.2 polcy dump handler: pfkey_spddump
function pfkey_xfrm_policy2msg
3.3 policy flush handler: pfkey_spdflush.
3.4 SA add handler:pfkey_add
3.2 SA dump handler:pfkey_dump
3.3 SA flush handler:pfkey_flush
目标: 在mipsel架构的嵌入式linux系统上支持USB盘的读写。
思路: 使用可加载模块的形式增加 scsimod.ko, sdmod.ko, usbstorage.ko, fat.ko, vfat.ko.
##具体实现:
###步骤I 准备必须的驱动(可加载模块)
###示例
1 |
|
###输出
sizeof(char) = 1
##项目背景
公司有台测试设备是基于嵌入式linux的, 支持framebuff。该测试设备自带显卡,并且绝大多数的操作需要据需要本地键盘操作,所有运行结果均显示在本机屏幕。公司现基于同一管理的需要。所有的物理设备均需要放入机房。这给在该设备进行开发和测试的人员以很大的不方便。因此尝试开发一套基于嵌入式linux远程控制软件,并命名mini-vnc。
http://hi.baidu.com/oscarbj/item/22432cd8054a8014d90e440a
安装 Manual pages about using GNU/Linux for developmentapt-get install manpages-dev