以下是DTS文件的摘录.LINUX /拱/的PowerPC /引导/ DTS/[board_name] .dts
memory {
device_type = "memory";
reg = <0x00000000 0x40000000>; // 1GB at 0
};
Run Code Online (Sandbox Code Playgroud)
嵌入式设备有1 GB的内存.
0x40000000 = 1073741824(十进制).
我得到1 GB的唯一方法是当我计算1073741824作为字节.
这意味着1073741824字节= 1GB.
这是否意味着0x00000000指向RAM中的一个字节数据?换句话说,RAM中的每个字节都有一个地址.
为什么会这样?我们读了8位块?为什么不说一句话?
ram memory-management linux-kernel embedded-linux device-tree
如何在bootlog中获取时间戳,如下所示?
[Tue Mar 19 13:46:28.140 2013] U-Boot 1.4.0XXXXXX (Mar 04 2013 - 08:41:02)MPC83XX
[Tue Mar 19 13:46:28.156 2013]
[Tue Mar 19 13:46:28.156 2013] Reset Status:
[Tue Mar 19 13:46:28.156 2013]
[Tue Mar 19 13:46:28.156 2013] CPU: e300c3, MPC8308, Rev: 1.0 at 333.333 MHz, CSB: 133.333 MHz
[Tue Mar 19 13:46:28.187 2013] Board: XXXXX
[Tue Mar 19 13:46:28.187 2013] I2C: ready
[Tue Mar 19 13:46:28.187 2013] ZDRAM: 256 MiB (DDR2, 32-bit, ECC off, 266.667 MHz)
[Tue Mar 19 13:46:28.203 2013] ZDRAM …Run Code Online (Sandbox Code Playgroud) 在linux内核模块中我有下面的代码.
float temp
temp = some_function();
if(temp < 0.0f) {
printk("error");
}
Run Code Online (Sandbox Code Playgroud)
我正在arm使用arm-none-linux-gnueabi-工具链交叉编译平台
我在这条线上得到了以下错误 if(temp < 0.0f) {
未定义的引用`__aeabi_fcmplt
我不明白为什么会发生这种情况.我是否缺少makefile中的任何链接?
在UNIX环境第2版的高级编程,第01章第11节中,有一句话:
例如,printf函数可以使用write系统调用来输出字符串,但是strcpy(复制字符串)和atoi(将ASCII转换为整数)函数根本不涉及内核.
我不明白的是,为什么有可能根本没有内核的参与.并非所有例程都需要内核支持吗?
另外,我可能会发现atoi只需要CPU计算.但是由于strcpy需要内存操作,为什么它也不涉及内核支持?
通常,我如何识别函数不涉及内核?
我正在写一个PCI设备驱动程序,我需要为DMA分配一些内存,我正在使用这个函数:
void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, int flag);
Run Code Online (Sandbox Code Playgroud)
我将dma_handle传递给设备.
这个函数的返回值是我可以在内核中使用的虚拟地址,事情是我不想为每个内存分配保存这个地址.
有没有办法将物理地址dma_handle转换为我可以在内核中使用的地址?像这些函数/宏之一的东西:
virt_to_page(kaddr)
page_to_pfn(page)
Run Code Online (Sandbox Code Playgroud)
是否有phy_to_kvirt宏/函数或任何其他方式将物理地址转换为内核虚拟地址?
谢谢
我已经编写了一个使用SIGALRM和信号处理程序的程序。
我现在正尝试将其添加为内核中的测试模块。
我发现我不得不用其底层的syscalls..examples timer_create与sys_timer_create timer_settimewith sys_timer_settime等替换libc提供的许多功能。
但是,我在遇到问题sigaction。
编译内核会引发以下错误
arch/arm/mach-vexpress/cpufreq_test.c:157:2: error: implicit declaration of function 'sys_sigaction' [-Werror=implicit-function-declaration]
我已经在下面附加了相关的代码块
int estimate_from_cycles() {
timer_t timer;
struct itimerspec old;
struct sigaction sig_action;
struct sigevent sig_event;
sigset_t sig_mask;
memset(&sig_action, 0, sizeof(struct sigaction));
sig_action.sa_handler = alarm_handler;
sigemptyset(&sig_action.sa_mask);
VERBOSE("Blocking signal %d\n", SIGALRM);
sigemptyset(&sig_mask);
sigaddset(&sig_mask, SIGALRM);
if(sys_sigaction(SIGALRM, &sig_action, NULL)) {
ERROR("Could not assign sigaction\n");
return -1;
}
if (sigprocmask(SIG_SETMASK, &sig_mask, NULL) == -1) {
ERROR("sigprocmask failed\n");
return -1;
}
memset …Run Code Online (Sandbox Code Playgroud) 我们可以分配动态内存吗?我知道malloc()需要以字节为单位的内存大小.我们可以编写一个以位为单位分配内存的内核模块吗?用户程序应该调用这个模块来分配内存.如果你们说是的话,我会开始研究它.
嗨,我有驱动程序,但我想使其专有,我该怎么做。是否可以将我的驱动程序设置为.so,然后创建包装驱动程序。通过包装驱动程序,我可以访问我的.so库。
我运行这个命令:
sudo dkms autoinstall -k 3.11.6-1-ARCH
Run Code Online (Sandbox Code Playgroud)
并有错误:
Error! echo
Your kernel headers for kernel 3.11.6-1-ARCH cannot be found at
/usr/lib/modules/3.11.6-1-ARCH/build or /usr/lib/modules/3.11.6-1-ARCH/source.
Error! echo
Your kernel headers for kernel 3.11.6-1-ARCH cannot be found at
/usr/lib/modules/3.11.6-1-ARCH/build or /usr/lib/modules/3.11.6-1-ARCH/source.
Run Code Online (Sandbox Code Playgroud)
我该怎么办?
我正在尝试编译一个Linux驱动USB转串口设备并获得错误
/root/moxa_usb_to_serial/mxu11x0/driver/mxu11x0.c:307: error: ‘usb_serial_probe’ undeclared here (not in a function)
/root/moxa_usb_to_serial/mxu11x0/driver/mxu11x0.c:308: error: ‘usb_serial_disconnect’ undeclared here (not in a function)
Run Code Online (Sandbox Code Playgroud)
我有linux
Linux host 3.10.33-rt32.34.el6rt.x86_64 #1 SMP PREEMPT RT Wed May 28 09:57:12 CEST 2014 x86_64 x86_64 x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)
司机制造商实际上警告说,3.4以上的驱动程序可能不是可分隔的.然而,驱动程序本身相当小,我相信我可以做一些微不足道的修复.怎么解决这个问题?