# x86cncbuild **Repository Path**: john-ppx/x86cncbuild ## Basic Information - **Project Name**: x86cncbuild - **Description**: The scripe is auto build linux kernal+xenomai for linuxcnc - **Primary Language**: Shell - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-16 - **Last Updated**: 2023-09-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # x86cncbuild The scripe is auto build linux kernal+xenomai for linuxcnc - install all nessary software - build linux kernel - build xenomai - build linuxcnc 实验过的版本(不带RTnet) xenomai 3.0.8 ipipe 4.4.43-x86-8 kernel 4.4.43 实验过的版本(不带RTnet) xenomai 3.0.8 ipipe 4.14.128-x86-5 kernel 4.14.128 在ubuntu20.04上编译4.14.128内核,需要降级gcc8之后才能编译通过 sudo apt-get install dwarves zstd xenomai 3.2.1 linux-dovetail-v5.10.95-dovetail1 在ubuntu20.04上编译5.10.95内核,需要降级gcc8之后才能编译通过 Recommended options: * General setup --> Local version - append to kernel release: -xenomai-3.0.5 --> Timers subsystem --> High Resolution Timer Support (Enable) * Xenomai/cobalt --> Sizes and static limits --> Number of registry slots (512 --> 4096) --> Size of system heap (Kb) (512 --> 4096) --> Size of private heap (Kb) (64 --> 256) --> Size of shared heap (Kb) (64 --> 256) --> Maximum number of POSIX timers per process (128 --> 512) --> Drivers --> RTnet --> RTnet, TCP/IP socket interface (Enable) --> Drivers --> New intel(R) PRO/1000 PCIe (Enable) --> Realtek 8169 (Enable) --> Loopback (Enable) --> Add-Ons --> Real-Time Capturing Support (Enable) * Power management and ACPI options --> CPU Frequency scaling --> CPU Frequency scaling (Disable) --> ACPI (Advanced Configuration and Power Interface) Support --> Processor (Disable) --> CPU Idle --> CPU idle PM support (Disable) * Pocessor type and features --> Enable maximum number of SMP processors and NUMA nodes (Disable) // Ref : http://xenomai.org/pipermail/xenomai/2017-September/037718.html --> Processor family --> Core 2/newer Xeon (if "cat /proc/cpuinfo | grep family" returns 6, set as Generic otherwise) // Xenomai will issue a warning about CONFIG_MIGRATION, disable those in this order --> Transparent Hugepage Support (Disable) --> Allow for memory compaction (Disable) --> Contiguous Memory Allocation (Disable) --> Allow for memory compaction --> Page Migration (Disable) * Device Drivers --> Staging drivers --> Unisys SPAR driver support --> Unisys visorbus driver (Disable) # 错误及解决办法汇总 ## 编译出现错误arch_mangle_irq_bits时,修改如下配置即可 * Device Drivers --> Microsoft Hyper-V guest support --> Microsoft Hyper-V client drivers (Disable) ## 编译出现错误 error: ‘uv_bau_message_interrupt’ undeclared 在文件arch/x86/kernel/ipipe.c中添加extern void uv_bau_message_interrupt(struct pt_regs *regs); ## Linux内核编译错误:make[1]: *** 没有规则可制作目标“debian/canonical-certs.pem”,由“certs/x509_certificate_list” 需求。 停止 拷贝 cp -v /boot/config-$(uname -r) .config 在系统内核配置基础上修改 ## 编译内核报错BTF:.tmp_vmlinux.btf:pahole (pahole) is not available 缺少软件包,安装dwarves sudo apt-get install dwarves #"FAILED unresolved symbol udp_sock" 禁止CONFIG_DEBUG_INFO_BTF sudo scripts/config --disable CONFIG_DEBUG_INFO_BTF ## 内核模块编译不通过,报错没有规则生成xxx.o make[1]: 进入目录“/usr/src/linux-headers-5.10.95-xenomai-3.2.1” make[2]: *** 没有规则可制作目标“/home/syshil/work/tmp/hello.o”,由“/home/syshil/work/tmp/hello.mod” 需求。 停止。 make[1]: *** [Makefile:1822:/home/syshil/work/tmp] 错误 2 make[1]: 离开目录“/usr/src/linux-headers-5.10.95-xenomai-3.2.1” make: *** [Makefile:10:all] 错误 2 增加配置项 make CONFIG_STACK_VALIDATION= 或者 安装 sudo apt-get install libelf-dev之后,重新编译内核安装(未实验是否正确) 或者 /usr/src/linux-headers-4.14.128-xenomai-3.0.8/tools/objtool/目录下没有东西,把原始编译的kenrnel目录下的这个目录拷贝进去即可 ## 5.9以后内核模块使用不了sched_setscheduler 5.9以后内涵删除了一些内核函数的导出,因此内核模块不能使用这些调用了 删除了原有的sched_setschedule() / sched_setattr() 接口,增加了 sched_set_fifo(p) sched_set_fifo_low(p) sched_set_normal(p, nice) 其中调用sched_set_fifo()会将指定进程放到SCHED_FIFO类中,其优先级为50——这只是min和max之间的一半位置。 对于需求不那么迫切的线程,sched_set_fifo_low()将优先级设置为最低值(1)。 而调用sched_set_normal()会将线程返回给定好的值SCHED_NORMAL类。 参考https://www.virtualbox.org/ticket/19845 参考https://www.elecfans.com/d/1227560.html # Ubuntu20.04下,Xenomai3.2.1+Linux5.10.76安装 https://blog.csdn.net/weixin_44445507/article/details/121995239