2017-08-15 66 views
0

我的目標是在Linux內核中實現一個啓用/禁用CPU內核的系統調用。實現CPU熱插拔的系統調用

首先,我實現了一個系統調用,它在4核系統中反對CPU3。

系統調用代碼如下:

#include <linux/kernel.h> 
#include <linux/slab.h> 
#include <asm/uaccess.h> 
#include <asm/unistd.h> 
#include <linux/cpumask.h> 
#include <linux/smp.h> 

asmlinkage long sys_new_syscall(void) 
{ 
    unsigned int cpu3; 

    set_cpu_online (cpu3, false) ;   /* clears the CPU in the cpumask */ 
    printk ("CPU%u is offline\n", cpu3); 


    return 0; 
} 

系統調用在內核中正確註冊和我的內核配置過程中啓用了「CPU熱插拔」功能。見圖片

Kernel configuratione

但是,內核沒能在最後階段進行編譯,我得到這個錯誤:

gzip: stdout: No space left on device 
E: mkinitramfs failure cpio 141 gzip 1 
update-initramfs: failed for /boot/initrd.img-4.6.7-rt13-v7+ with 1. 
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1 
arch/arm/boot/Makefile:99: recipe for target 'install' failed 
make[1]: *** [install] Error 1 
arch/arm/Makefile:333: recipe for target 'install' failed 
make: *** [install] Error 2 

我在做什麼錯?

回答

2
gzip: stdout: No space left on device 

此問題與您的代碼無關。您的/boot文件系統已滿。

+0

謝謝你的回答。我正在編譯樹莓派pi3/ModelB上的Linux。任何想法如何解決這個問題? –

+1

您需要更多空間。我認爲你應該在其他硬件上更好地編譯內核。 –