- 博客(52)
- 收藏
- 关注
原创 中断处理函数
.macro vector_stub, name, mode, correction=0.align 5vector_\name:.if \correctionsub lr, lr, #\correction.endif@@ Save r0, lr_ (parent PC) and spsr_@ (parent CPSR)@stmia
2015-09-03 10:20:07
849
原创 linux在ARM平台上的中断流程
当发生中断时,系统跳转到ARM平台的异常向量表(vector_irq位置): .section .vectors, "ax", %progbits__vectors_start: W(b) vector_rst W(b) vector_und W(ldr) pc, __vectors_start + 0x1000 W(b) vector_p
2015-05-10 10:58:21
1759
原创 linux系统调用代码
系统调用有3条调用flow: Flow1:/*============================================================================= * SWI handler *----------------------------------------------------------------------------- */
2015-05-10 09:50:50
948
原创 NPTL进程创建流程
pid_t__libc_fork (void){ pid_t pid; struct used_handler { struct fork_handler *handler; struct used_handler *next; } *allp = NULL; /* Run all the registered preparation
2015-05-09 23:47:21
774
原创 NTPL线程创建流程
这里是用户调用API的入口的地方:int__pthread_create_2_1 (newthread, attr, start_routine, arg) pthread_t *newthread; const pthread_attr_t *attr; void *(*start_routine) (void *); void *arg;
2015-05-09 16:25:39
1318
原创 ECOS对于ARM平台异常的处理分析
首先异常向量表的代码如下:__exception_handlers:#ifdef CYGSEM_HAL_ROM_RESET_USES_JUMP// Assumption: ROM code has these vectors at the hardware reset address.// A simple jump removes any address-space depen
2015-01-18 23:38:01
782
原创 linux启动流程分析(基于ARM架构)
一般我们都会使用编译生成的压缩内核文件作为内核启动文件,所以分析的起点就从arch/arm/boot/compressed目录下的head.S开始。 分析前先看一些宏定义:1、ARM()和THUMB()#ifdef CONFIG_THUMB2_KERNEL#if __GNUC__ < 4#error Thumb-2 kernel requires gcc >= 4#
2014-12-10 17:26:53
1047
原创 时钟树解析
3种类型的时钟树组织方式第一种:基于struct clk_lookup的双向链表第二种:基于struct of_clk_provider的双向链表第三种:基于时钟流向的树形结构,分别为clk_root_list和clk_orphan_list;
2014-12-02 18:15:13
1755
原创 CFS完全公平调度算法
struct sched_avg { /* * These sums represent an infinite geometric series and so are bound * above by 1024/(1-y). Thus we only need a u32 to store them for all * choices of y */ u32
2014-11-26 22:11:16
1254
原创 内核编译选项详解
针对3.14版本内核1、ARM架构1、1 patch physical to virtual translations at runtime在内核映像启动以及内核模块加载时根据内核本身在内存中的地址,修正物理地址/虚拟地址相互转换函数。只针对非XIP方式运行的内核。2、general setup->cross-compiler tool prefix在内核配置阶
2014-11-26 22:07:58
8217
原创 nl80211_iftype接口类型详解
NL80211_IFTYPE_UNSPECIFIED上层协议未指定硬件接口类型,由驱动指定 NL80211_IFTYPE_ADHOCindependent BSS member,各个无线主机之间对等交换数据 NL80211_IFTYPE_STATIONmanaged BSS member NL80211_IFTYPE_AP接入点,通常一端通过有线
2014-11-26 11:36:57
3685
原创 网络数据包发送之dev_hard_start_xmit
int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, struct netdev_queue *txq){ const struct net_device_ops *ops = dev->netdev_ops; int rc = NETDEV_TX_OK; unsigned int skb_
2014-11-24 10:21:35
6867
原创 调度系统浅析
1、struct sched_class调度类有四种,按照优先级依次为:stop_sched_class、rt_sched_class、fair_sched_class、idle_sched_class 2、Scheduling policies#define SCHED_NORMAL 0#define SCHED_FIFO 1#define SCHED_RR 2
2014-02-18 18:19:33
580
转载 Receive flow steering
Today's increasing bandwidth, and faster networking hardware, has made it difficult for a single CPU to keep up. Multiple cores and packages have helped matters on the transmit side, but the receive s
2014-02-11 15:03:24
987
转载 Receive packet steering
Contemporary networking hardware can move a lot of packets, to the point that the host computer can have a hard time keeping up. In recent years, CPU speeds have stopped increasing, but the number of
2014-02-11 15:02:39
832
转载 WWNN和WWPN介绍
A World Wide Name (WWN) or World Wide Identifier (WWID) is aunique identifier used in storage technologies includingFibre Channel,Advanced Technology Attachment (ATA) or Serial Attached SCSI (
2014-02-11 15:01:32
3559
转载 SR-IOV详解
Overview of Single Root I/O Virtualization (SR-IOV) The single root I/O virtualization (SR-IOV) interface is an extension to the PCI Express (PCIe) specification. SR-IOV allows a device, such as a
2014-02-11 11:24:21
10780
1
原创 struct net_device_ops 详解
【ndo_init】注册网络设备时调用,驱动程序一般不使用,虚拟网络设备可能使用【ndo_uninit】网络设备卸载时调用,驱动程序一般使用【ndo_open】1、禁止所有中断、关闭载波(netif_carrier_off);2、分配并初始化传输和接收描述符环内存(使用dma_alloc_coherent分配确保EMAC和CPU都可以访问);3、分配
2014-02-10 18:17:25
18103
1
转载 Introduction to Receive Side Scaling(RSS)
Receive side scaling (RSS) is a network driver technology that enables the efficient distribution of network receive processing across multiple CPUs in multiprocessor systems.Note Because hyper-thr
2014-02-10 16:12:10
1676
原创 struct ethtool_ops详解
【get_settings】【set_settings】supported: SUPPORTED_10baseT_Half系列advertising: ADVERTISED_10baseT_Half系列speed: SPEED_10系列低16位duplex: DUPLEX_HALF系列port: PORT_TP系列phy_address: PHY
2014-02-10 16:09:03
5814
原创 workqueue分析
__queue_work函数1、确保调用时禁止中断;2、选择pwq,如果指定了CPU,则选择wq->cpu_pwqs;否则选择wq->numa_pwq_tbl[node];如果该work_struct上次执行过,则选择上次执行的pwq;3、当前工作着色区需处理的工作数量pwq->nr_in_flight++;4、如果pwq待执行的工作数量没有达到pwq->max_active,则把
2014-02-01 22:48:34
963
转载 系统调用-mprotect
mprotect:系统调用,设置内存访问权限,在内存映射完成后,这些权限仍可以被 mprotect 系统调用所修改。mprotect 的参数分别为内存区间的地址,区间的大小,新的保护标志设置。所指定的内存区间必须包含整个页:区间地址必须和整个系统页大小对齐,而区间长度必须是页大小的整数倍。这些页的保护标记被这里指定的新保护模式替换。
2014-01-29 09:43:37
2380
转载 cleancache
cleancache:允许 tmem 存储少数 rerault 时产生的清洁页缓存页面。当内核回收一个页,而不是丢弃该页面的数据,它把数据放入 tmem 中,标记为 “ephemeral”,这意味着当 tmem 关闭时页的数据可能被丢弃。随后,如果内核决定需要该页的数据,它会要求 tmem 返还此数据。如果 tmem 保留该页,它会返回此数据,否则,内核继续 refault 操作,像平常一样从磁盘
2014-01-29 09:42:23
970
转载 系统调用 mlock
系统调用 mlock 家族允许程序在物理内存上锁住它的部分或全部地址空间。这将阻止Linux 将这个内存页调度到交换空间(swap space),即使该程序已有一段时间没有访问这段空间。一个严格时间相关的程序可能会希望锁住物理内存,因为内存页面调出调入的时间延迟可能太长或过于不可预知。安全性要求较高的应用程序可能希望防止敏感数据被换出到交换文件中,因为这样在程序结束后,攻击者可能从交换文件中恢
2014-01-29 09:41:02
2100
原创 linux内存管理各文件简介
1、内存分配机制page_alloc:伙伴分配系统debug-pagealloc:伙伴分配系统辅助函数slab、slub、slob:基于伙伴系统之上的内存分配算法huge_memory、hugetlb:巨页模式的支持(分配和映射)slob:用于嵌入式的简单内存分配器slab_common:slab和slub共用的功能函数bootmem:启动期间的内存分配器noboo
2014-01-29 09:37:53
3124
原创 驱动的发送接收流程分析
查询方式(发送)netpoll_poll_dev实际上调用netpoll_send_skb_on_dev,后者依次完成以下工作:1、如果该接口上没有待输出的数据包,则直接调用底层驱动的ndo_start_xmit方法发出数据包,此过程重复1个时钟节拍,操作间隔为50us;2、如果在第一步中每一次尝试发出数据包没有获得成功的话,则调用netpoll_poll_dev去处理该接口上的其
2014-01-27 18:12:54
2539
转载 sed用法详解
转载:http://blog.chinaunix.net/u/22677/showart_1076318.html1.简介sed是非交互式的编辑器。它不会修改文件,除非使用shell重定向来保存结果。默认情况下,所有的输出行都被打印到屏幕上。sed编辑器逐行处理文件(或输入),并将结果发送到屏幕。具体过程如下:首先sed把当前正在处理的行保存在一个临时缓存区中(也称为模
2013-12-18 11:46:43
595
原创 GDB调试技巧
1、自动调用当前目录下的.gdbinit文件时需要涉及到安全目录的概念,在命令行指定-iex “set auto-load safe-path .gdbinit文件所在的目录”;
2013-11-20 14:01:52
874
原创 linux驱动子系统--用户层接口
用户可以通过多种方式实现对底层硬件的控制操作,最常见的就是通过/dev进行控制,此外还包括netlink、proc、sys等途径。 一、/dev方式1、驱动探测到硬件并完成初始化后,添加到驱动核心;然后驱动核心通过device_add中的devtmpfs_create_node通知专门的devtmpfs守护进程(kdevtmpfs),由后者完成创建设备文件的操作;注意这里有个前提就是设
2013-11-17 08:55:21
983
转载 linux驱动子系统--USB
何时唤醒hub_thread内核线程处理hub端口插拔事件?usb_hc_died:usb_wakeup_notification:hub_irq:usb_remove_device:usb_port_resume:usb_reset_device:hub_probe:hub第一次被注册时会扫描它的端口状态
2013-11-06 16:27:30
716
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人