我用的arm9的板子,编译器是使用的arm-linux-gcc-3.4.1.tar.bz2,linux用的linux 2.6.17.6 我编译后的Linux内核是625k,但是我的驱动.ko文件有700多K, 碰到的问题有以下几点: 1)linux 2.6一般栈的大小设置了多大,考虑到我的驱动很大,函数嵌套函数太多,而且结构体很大,会不会把栈的空间用光了? 2) arm的跳转指令能跳多远,因为我的驱动编译到内核时,出现过,relocation truncated的错误,现在编译成了.ko文件实现模块加载。 ...
by wuiiszsu - 内核/嵌入技术 - 2006-10-30 09:45:42 阅读(897) 回复(0)
首次尝试“运行” arm程序 首先写了一个调整堆栈指针的startfile,调整.text起始位置的ldscript。用交叉编译器编译,编译参数-Wl,-Tldscript start.o hello.c -nostartfiles -static -s -o hello. 然后装载到simics中,单步执行了一下,指令和objdump出来的是相同的,也就是生成的目标文件是对的。这种方式编译出来的文件可以运行在arm上了。 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/132/showart...
and 很好理解,就是逻辑与嘛。
eq 是一个
在驱动程序中我用__get_free_pages申请了1MB的内存,将这1MB内存用remap_page_range映射到用户空间。但应用程序用mmap()的地址读不到数据,但用在驱动中增加一个IOCTL命令用copy_to_user却可以拿到数据。这是为什么?
驱动里面 mmap函数: volatile void *offset=(volatile void *)kmalloc(100,GFP_ATOMIC); vma->vm_flags |= VM_RESERVED; physical_addr=virt_to_phys(offset); if (remap_page_range(vma->vm_start, physical_addr ,vma->vm_end-vma->vm_start, vma->vm_page_prot)) { printk("remap error\n"); return -EAGAIN; } line_addr=offset; 应用程序...
man in.tftpd如下 FILENAME remapPING The -m option specifies a file which contains filename remapping rules. Each non-comment line (comments begin with hash marks, #) contains an operation, specified below; a regex, a regular expression in the style of egrep; and optionally a replacement pattern. The operation indicated by operation is performed if the regex matches al...
static int remap_mmap(struct file *filp, struct vm_area_struct *vma) { int i = 0; int j = 0x0; if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, vma->vm_end - vma->vm_start, vma->vm_page_prot)) return -EAGAIN; vma->vm_ops = &remap_vm_ops; return 0; } 想用上述程序实现mmap,但是发现在用户态调用mmap大于2...