kernel

Linux kernel模块管理相关详解

谁说胖子不能爱 提交于 2020-01-13 20:17:22
Linux内核模块化设计 1. Linux内核设计:单内核、模块化(动态装载和卸载) (1) Linux:单内核设计,但充分借鉴了微内核体系的设计的优点;为内核引入了模块化机制; (2) 内核的组成部分: kernel:内核核心,一般为bzImage格式,通常位于/boot目录,名称为vmlinuz-VERSION-release; 当系统启动之后该文件就不在使用,因为已经加载到内存,放置/boot下方便管理 kernel object:内核模块,一般放置于/lib/modules/VERSION-release/ 内核模块与内核核心版本一定要严格匹配; 2.内核模块:编译选择模式 [ ]:N,不编译此部分 [M]:Module ,以模块化编译,可以临时装载,占用磁盘空间,不占用内核空间 [*]:Y,编译进内核核心,可以直接调用 3.ramdisk:辅助性文件,并非必须,取决于内核是否能直接驱动rootfs所在的设备 ramdisk:一个简装版的根文件系统,可提供的驱动如下: 目标设备驱动,例如SCSI设备的驱动; 逻辑设备驱动,例如LVM设备的驱动; 文件系统,例如xfs文件系统; 内核模块信息获取和管理命令 1.ldd:打印二进制应用程序所依赖的库文件-print shared library dependencies 格式:ldd [OPTION]... FILE... 显示

kernel: how to find all threads from a process's task_struct?

别等时光非礼了梦想. 提交于 2020-01-13 17:34:28
问题 Given a task struct for a process or a thread, what's the idiom of iterating through all other threads belonging to the same process? 回答1: Linux does not distinguish between a process(task) and a thread. The library calls fork() and pthread_create() use the same system call clone(). The difference between fork() and pthread_create() is the bitmask passed to clone(). This bitmask describes which resources (memory, files, filesystems, signal handler,...). See man clone(2) for the details.

从负无穷学习机器学习(五)支持向量机SVM

天大地大妈咪最大 提交于 2020-01-13 14:15:18
文章目录 一、支持向量机 二、支持向量机的核函数 (一)、线性(linear)内核的SVM的分类器 (二)、RBF内核的SVM的分类器 三、SVM核函数和参数选择 (一)、不同核函数的对比 (二)、不同参数的对比 四、SVM示例——波士顿房价回归分析 (一)、查看数据集 (二)、使用SVR建模 一、支持向量机 如果样本数据是线性不可分的,之前的分类器处理这类数据效果不太好,而SVM(Support Vector Machine)是一种专门处理线性不可分数据的算法。 SVM算法中,训练模型的过程实际上是对每个数据点对于 数据分类决定边界的重要性 进行判断。也就是说在训练数据集中, 只有一部分数据对于边界的确定是有作用的 ,而这些数据点 正好在决定边界上 ,这些数据被称为“ 支持向量 ”。 二、支持向量机的核函数 SVM可以将 二维数据 (2 Dimension)转变成 三维数据 (3 Dimension),这称为 将数据投射至高维空间 。 这正是SVM算法的核函数(kernel trick)功能,用的最普遍的用于将数据投射到高维空间的方法是 多项式内核 (Polynomial kernel)和 径向基内核 (Radial Basis Function kernel,RBF)多项式内核就是 将不同的特征乘方处理 。而RBF内核也称为 高斯内核 (Gaussian kernel)

Monitor kernel registry changes

﹥>﹥吖頭↗ 提交于 2020-01-13 13:12:22
问题 Could people please give me pointers (no pun intended) for topics I will need to research in order to be able to do this? I'm not really an expert on Windows, however I'm very quick at picking up new concepts. I saw the process monitor program which Mark Russinovich and Bryce Cogswell wrote: http://technet.microsoft.com/en-gb/sysinternals/bb896645 which can look at everything happening registry key-wise within the kernel. I've been able to do this sort of thing using C# and user-level

Does anyone know where to define the hardware, revision and serial no. fields of /proc/cpuinfo?

大兔子大兔子 提交于 2020-01-13 09:17:06
问题 I want to ensure my /proc/cpuinfo is accurate. It currently outputs Hardware : am335xevm Revision : 0000 Serial : 0000000000000000 where in the code can I change this to give real values? 回答1: It depends on the version of Linux and processor architecture. Since this is a TI ARM, you can start with: arch/arm/kernel/setup.c. Look for static int c_show() . The Revision and Serial values are set with ATAG_REVISION and ATAG_SERIAL, so an appropriate boot loader can pass them to Linux. Typically

Does anyone know where to define the hardware, revision and serial no. fields of /proc/cpuinfo?

巧了我就是萌 提交于 2020-01-13 09:16:49
问题 I want to ensure my /proc/cpuinfo is accurate. It currently outputs Hardware : am335xevm Revision : 0000 Serial : 0000000000000000 where in the code can I change this to give real values? 回答1: It depends on the version of Linux and processor architecture. Since this is a TI ARM, you can start with: arch/arm/kernel/setup.c. Look for static int c_show() . The Revision and Serial values are set with ATAG_REVISION and ATAG_SERIAL, so an appropriate boot loader can pass them to Linux. Typically

How can the linux bottom halfs execute in interrupt context?

我们两清 提交于 2020-01-13 06:51:25
问题 While understanding the concepts of top halves and bottom halves, I came across with a question. Here is my understanding: Top half and Bottom half executes in interrupt context. The only difference being that the Bottom half executes with interrupt enabled while the top half executes with the corresponding irq disabled(Which can still be overcome by using SA_INTERRUPT flag). The question: Just before return from the top half handler, return_from_intr is called. Now the scheduler is invoked

User space Vs Kernel space program performance difference

巧了我就是萌 提交于 2020-01-13 03:52:11
问题 I have a sequential user space program (some kind of memory intensive search data structure). The program's performance, measured as number of CPU cycles, depends on memory layout of the underlying data structures and data cache size (LLC). So far my user space program is tuned to death, now I am wondering if I can get performance gain by moving the user space code into kernel (as a kernel module). I can think of the following factors that improve the performance in kernel space ... No system

Linux驱动LCD driver学习总结

牧云@^-^@ 提交于 2020-01-13 01:45:26
这篇文章写于13年11月,这里仅记录一下曾经涉猎了这方面的知识,可能对以后的一些知识了解有所帮助 关于platform总线模型,可以参考之前的一篇文章 Linux驱动Platform总线模型 ,这对frameBuffer的驱动注册可能有所帮助 一、LCD硬件框架 二、LCD软件框架 三、LCD初始化流程 四、LCD on与off的流程 五、LCD数据流 六、驱动程序framebuffer 所在文件 /android/kernel/drivers/video/fbmem.c /android/kernel/drivers/video/msm/msm_fb.c 帧缓冲(framebuffer)是linux系统为线索设备提供的一个接口,它将显示缓冲区抽象,屏蔽图像硬件的底层差异,上层应用程序可直接对framebuffer进行读写操作。 调用register_framebuffer(struct fb_info *fb_info)可注册framebuffer,注册framebuffer实际上会把fb_info放到一个全局数组里面,到后面需要用时会到数组里面取相关信息 结构体fb_info中比较重要的有 ①struct fb_var_screeninfo var,记录用户可修改的显示控制器参数 fb_var_screeninfo结构中的颜色位域struct fb_bitfield

module compiling : asm/linkage.h file not found

有些话、适合烂在心里 提交于 2020-01-12 14:05:12
问题 I am trying to compile an example of "hello world" Kernel Module, problems found on ubuntu 11.04, kernel 3.2.6, gcc 4.5.2 and fedora 16, kernel 3.2.7, gcc 4.6.7. code: #include <linux/module.h> #include <linux/init.h> MODULE_LICENSE("GPL"); static int __init hello_init (void) { printk("Hello module init\n"); return 0; } static void __exit hello_exit (void) { printk("Hello module exit\n"); } module_init(hello_init); module_exit(hello_exit); compiled with: gcc -D__KERNEL__ -I /usr/src/linux