kernel

Possible de-reference of private data using net_device

▼魔方 西西 提交于 2019-12-24 05:54:21
问题 I have a specific question regarding using net_device module in linux kernel. Lets address this code example please. When i init my device, i call alloc_netdev and provide it with the private data size , so it will properly allocate it. Now, What happens when i call snull_cleanup when i wish to stop using this device. i see it basically free's the structure (including the private data). The question is, what if the code currently running is an inside function inside my device module which

What is the Mutex acquire and release order?

一曲冷凌霜 提交于 2019-12-24 04:16:12
问题 I know the functionality of Mutex. But now I am confused about its timing. I specially mean in the Linux kernel code. For example, we have 3 threads (let's say they are on the same processor and are all normal tasks with the same priorities). Thread 1 ,2 and 3 try to acquire the Mutex and only Thread 1 gets it. Thread 2 and 3 are blocked and go to sleep. Then Thread 1 has done his job and unlock the Mutex. So here is my question: At this very moment, what will happen? Will Thread 1 continue

嵌入式系统烧写uboot/bootloader/kernel的一般方法

只谈情不闲聊 提交于 2019-12-24 03:54:02
嵌入式系统烧写uboot/bootloader/kernel的一般方法 本文介绍了在嵌入式系统中烧写uboot/bootloader/kernel 的一般方法,以及如果uboot或者内核出现错误, www.2cto.com 引导失败等情况时如何重新烧写uboot/kernel. 烧写uboot/kernel的方式一般有两种,一种是在linux本身(shell中),直接将uboot/kernel的影像文件(二进制文件)使用操作烧写flash的命令烧写到flash特定分区上, 另一种是在uboot界面上,通过配置serverip,ipaddr,使用tftp命令 下载 uboot/kernel到flash上 例子如下: //一,在linux的shell中烧写uboot/kernel mtd write命令是自定义的烧写flash命令。 //烧写uboot ,/dev/mtd0 是bootloader 的特定分区 mtd write u-boot.bin /dev/mtd0 //烧写kernel, mtd1 是kernel的特定分区 mtd write vmlinux.elf /dev/mtd1 //重启 reboot //二,在uboot界面中烧写uboot/kernel,以kernel为例子 //在bootloader 界面中 //本机uboot 的ip地址 setenv ipaddr

由zImage生成uImage

帅比萌擦擦* 提交于 2019-12-24 03:52:57
一、手动使用mkimage命令 mkimage -A arm -O linux -T kernel -C none -a 30007fc0 -e 30007fc0 -n uImage -d /work/jz2440/kernel/linux-2.6.22.6/arch/arm/boot/zImage uImage 我的内核目录:/work/jz2440/kernel/linux-2.6.22.6 我的tftpboot:/work/tftpboot uboot——bootm地址: 30007fc0 U-boot mkimage指定Linux内核地址时的两种方式 http://blog.csdn.net/embededswordman/article/details/6704197 uImage的制作是使用的u-boot工具mkimage,build完u-boot后也会将mkimage build出來到/tools目录下,可以直接拿來用,它的作用就是在zImage的前面加上64个字节的头,让u-boot能够识别要加载内核的类型、加载地址等。 基本格式:mkimage -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image -A 指定CPU的体系结构:(u

unevictable page

柔情痞子 提交于 2019-12-24 03:51:27
问题 I getting a kernel crash as below. Here I can observe large memory is present in unevictablle page. I wish to know when exactly memory is added to unevictable page list. Also, from the below message I can understand only 1724kB is available in the system. is it correct? kswapd0: page allocation failure. order:0, mode:0xd0 [<c002aed4>] (unwind_backtrace+0x0/0xdc) from [<c006d5b0>] (__alloc_pages_nodemask+0x490/0x4ec) [<c006d5b0>] (__alloc_pages_nodemask+0x490/0x4ec) from [<c008416c>] (cache

unevictable page

旧城冷巷雨未停 提交于 2019-12-24 03:51:12
问题 I getting a kernel crash as below. Here I can observe large memory is present in unevictablle page. I wish to know when exactly memory is added to unevictable page list. Also, from the below message I can understand only 1724kB is available in the system. is it correct? kswapd0: page allocation failure. order:0, mode:0xd0 [<c002aed4>] (unwind_backtrace+0x0/0xdc) from [<c006d5b0>] (__alloc_pages_nodemask+0x490/0x4ec) [<c006d5b0>] (__alloc_pages_nodemask+0x490/0x4ec) from [<c008416c>] (cache

Accessing IRQ description array within a module and displaying action names

家住魔仙堡 提交于 2019-12-24 03:21:57
问题 I am programming a kernel module in C which is struggling to access IRQ description array elements and to display all action names of these elements. At the beginning, I thought that this irq_desc array is sonething like a macro but after compiling i understood it is not. Then I used for_each_irq_desc(irq, desc) function. but this time it returned a warning: WARNING: "irq_to_desc" [/home/samet/Masaüstü/Assignment3/Ass-1.ko] undefined! and after this warning, i tried to insmod the module into

Installing ArangoDB on Windows Server 2008

你说的曾经没有我的故事 提交于 2019-12-24 03:01:29
问题 I'm having difficulty getting Arango 1.4.9 working on my Windows 2008 Standard (SP2) server. It's a fresh install. When I try to start Arango Server I receive this message: The procedure entry point TryAcquireSRWLockExclusive could not be located in the dynamic link library KERNEL32.dll I have tried both the 64bit and 32bit versions. I have run the installer as an administrator and vice versa. Any ideas? 回答1: TryAcquireSRWLockExclusive is from a newer Windows API. The Windows 2008r2 build

Installing ArangoDB on Windows Server 2008

偶尔善良 提交于 2019-12-24 03:01:09
问题 I'm having difficulty getting Arango 1.4.9 working on my Windows 2008 Standard (SP2) server. It's a fresh install. When I try to start Arango Server I receive this message: The procedure entry point TryAcquireSRWLockExclusive could not be located in the dynamic link library KERNEL32.dll I have tried both the 64bit and 32bit versions. I have run the installer as an administrator and vice versa. Any ideas? 回答1: TryAcquireSRWLockExclusive is from a newer Windows API. The Windows 2008r2 build

Linux kernel idle loop

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 02:53:10
问题 Inside the linux kernel idle loop, for quite a few architectures (SH, ARM, X86 etc.. afaik) are the following lines: if(cpuidle_idle_call()) pm_idle(); My doubt: At-least for ARM, The default pm_idle function consists of WFI (Wait for interrupt) instruction but the confusing part is, interrupts are disabled then and are enabled after the WFI instruction executes, How does a CPU get back online from WFI when interrupts were disabled ? I tried searching for my answers in various versions of