This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux-c6x: how to change kernel configuration ?

Hi,

I start to work with linux on a evmc6678 board, i have installed and build linux-c6x-2.0.0.63-src.tar.gz

Now I want to build a personnalized kernel and rootfs:

1) how to change some kernel configurations (like preempt mode/tick frequency) ?

2) how to add new libs / applications ( ncurses, lua , .... etc )? how to personnalize the rootfs ?


thanks,

Christophe
  • Hi, Christophe,

    The kernel configuration can be done by running "make menuconfig" in linux-c6x directory, and select "Processor type and features" submenu. Be sure the environment variables are set by sourcing the setenv in linux-c6x-project before menuconfig. It seems that the release has done testing under preemptive set to none, and not tested under preemptive mode. I am not sure what impact it may have.

    To add new applications/libraries, please take a look at the Software Ecosystem features in linux-c6x.org wiki page and take them under projects/packages directory as examples. The new libraries and applications should be in the same directory and ported to linux-c6x and spec file created as those done in the projects/packages.

    To personalize the rootfs, please refer to section 4.8, Creating bootblobs and file system images, in the Linux-c6x release notes and Using the bootblob utility mentioned at the end of the section.

    If this answers your questions, please mark it resolved. Thanks!

     

     

  • Hi Rex,

    If i do  "make menuconfig" in linux-c6x , i dont have the config file for evmc6678 selected by default, and when i do ./prj build i have the error below :

    user@user-laptop:~/MAQXP3/linux-c6x-2.0.0.63/linux-c6x-project$ ./prj build
    [ -d /home/user/MAQXP3/my-linux-c6x/product ] || mkdir -p /home/user/MAQXP3/my-linux-c6x/product
    cp -a /home/user/MAQXP3/my-linux-c6x/linux-c6x-project/scripts/bootblob /home/user/MAQXP3/my-linux-c6x/product/
    cp -a /home/user/MAQXP3/my-linux-c6x/linux-c6x-project/bootblob-templates /home/user/MAQXP3/my-linux-c6x/product/
    cp -a /home/user/MAQXP3/my-linux-c6x/linux-c6x-project/scripts/make-filesystem /home/user/MAQXP3/my-linux-c6x/product/
    ********** sdk0 ENDIAN=little FLOAT=hard
    [ -d /home/user/MAQXP3/my-linux-c6x/product ] || mkdir -p /home/user/MAQXP3/my-linux-c6x/product
    ********** kernel evmc6678 ENDIAN=little
    make -f /home/user/MAQXP3/my-linux-c6x/linux-c6x-project/Makefile -C /home/user/MAQXP3/my-linux-c6x/linux-c6x CROSS_COMPILE=/home/user/MAQXP3/my-linux-c6x/opt/gcc-c6x/bin/c6x-uclinux- KNAME=evmc6678 kernel-sub ; \

    [ -d /home/user/MAQXP3/my-linux-c6x/Build/kobjs/evmc6678.el ] || mkdir -p /home/user/MAQXP3/my-linux-c6x/Build/kobjs/evmc6678.el
    cp arch/c6x/configs/ti_evmc6678_defconfig /home/user/MAQXP3/my-linux-c6x/Build/kobjs/evmc6678.el/.config
    [ -z "" ] || patch -p1 -d /home/user/MAQXP3/my-linux-c6x/Build/kobjs/evmc6678.el -i /home/user/MAQXP3/my-linux-c6x/linux-c6x-project/kbuilds/
    [ -z "" ] || /home/user/MAQXP3/my-linux-c6x/linux-c6x-project/kbuilds/ /home/user/MAQXP3/my-linux-c6x/Build/kobjs/evmc6678.el/.config
    [ "little" == "little" ] || \
    sed -i -e 's,# CONFIG_CPU_BIG_ENDIAN is not set,CONFIG_CPU_BIG_ENDIAN=y,' /home/user/MAQXP3/my-linux-c6x/Build/kobjs/evmc6678.el/.config
    [ "yes" != "yes" ] || \
    sed -i -e 's,CONFIG_TI_C6X_COMPILER=y,# CONFIG_TI_C6X_COMPILER is not set,' \
    -e 's,CONFIG_TI_C6X_LINKER=y,# CONFIG_TI_C6X_LINKER is not set,' \
    /home/user/MAQXP3/my-linux-c6x/Build/kobjs/evmc6678.el/.config
    [ -z "-evmc6678.el-dev-user-20120127" ] || \
    sed -i -e 's,CONFIG_LOCALVERSION=.*,CONFIG_LOCALVERSION="-evmc6678.el-dev-user-20120127",' /home/user/MAQXP3/my-linux-c6x/Build/kobjs/evmc6678.el/.config
    [ -z "console=ttyS0,115200 ip=dhcp root=/dev/nfs nfsroot=158.218.100.25:/opt/min-root-c6x-le-netcp,v3,tcp rw" ] || \
    sed -i -e 's%CONFIG_CMDLINE=.*%CONFIG_CMDLINE="console=ttyS0,115200 ip=dhcp root=/dev/nfs nfsroot=158.218.100.25:/opt/min-root-c6x-le-netcp,v3,tcp rw"%' /home/user/MAQXP3/my-linux-c6x/Build/kobjs/evmc6678.el/.config
    make ARCH=c6x O=/home/user/MAQXP3/my-linux-c6x/Build/kobjs/evmc6678.el/ oldconfig
    GEN /home/user/MAQXP3/linux-c6x-2.0.0.63/Build/kobjs/evmc6678.el/Makefile
    scripts/kconfig/conf -o arch/c6x/Kconfig
    #
    # configuration written to .config
    #
    make ARCH=c6x O=/home/user/MAQXP3/my-linux-c6x/Build/kobjs/evmc6678.el/
    GEN /home/user/MAQXP3/linux-c6x-2.0.0.63/Build/kobjs/evmc6678.el/Makefile
    scripts/kconfig/conf -s arch/c6x/Kconfig
    Using /home/user/MAQXP3/linux-c6x-2.0.0.63/linux-c6x as source for kernel
    /home/user/MAQXP3/linux-c6x-2.0.0.63/linux-c6x is not clean, please run 'make mrproper'
    in the '/home/user/MAQXP3/linux-c6x-2.0.0.63/linux-c6x' directory.
    make[5]: *** [prepare3] Erreur 1
    make[4]: *** [sub-make] Erreur 2
    make[3]: *** [kernel-sub] Erreur 2
    make[2]: *** [one-kernel] Erreur 2
    Build of kernel evmc6678 Failed
    make[1]: *** [one-kernels] Erreur 2
    make: *** [kernels] Erreur 2

  • Hi,

    are there a documentation of the directory tree of the linux-c6x-2.0.0.63-src.tar.gz ?

    thanks,

    Christophe

  • Hi, Christophe,

    When you run "make menuconfig" from a subprject directory, linux-c6x, the environment has not been set up yet. You should source the setenv file in linux-c6x-project. Then run "make ti_evmc6678_defconfig" to set c6678 default configuration, and menuconfig to alter it. The error you get is because the previous unsuccessful menuconfig. Just run "make mrproper" as indicated in the messages to clean it up.

     

  • Hi, Christophe,

    I don't think there is one. Looking from the top level, linux-c6x is the kernel directory, busybox for busybox,  linux-c6x-project, the top level of linux-c6x-2.0 project top level. projects are the applications/packages have been ported to c6x platform, Products are where all built images are located. Hope these info help.

    Rex

  • Hi Rex,

    Today, to try to change the kernel options,  I do this below:

    user@user-laptop:~/MAQXP3/linux-c6x-2.0.0.63$ pwd
    /home/user/MAQXP3/linux-c6x-2.0.0.63
    user@user-laptop:~/MAQXP3/linux-c6x-2.0.0.63$ cd linux-c6x-project/
    user@user-laptop:~/MAQXP3/linux-c6x-2.0.0.63/linux-c6x-project$ source setenv
    user@user-laptop:~/MAQXP3/linux-c6x-2.0.0.63/linux-c6x-project$ cd ../linux-c6x
    user@user-laptop:~/MAQXP3/linux-c6x-2.0.0.63/linux-c6x$ make ti_evmc6678_defconfig
    HOSTCC scripts/basic/fixdep
    HOSTCC scripts/basic/docproc
    HOSTCC scripts/basic/hash
    HOSTCC scripts/kconfig/conf.o
    scripts/kconfig/conf.c: In function ‘conf_askvalue’:
    scripts/kconfig/conf.c:105: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
    scripts/kconfig/conf.c: In function ‘conf_choice’:
    scripts/kconfig/conf.c:307: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
    HOSTCC scripts/kconfig/kxgettext.o
    SHIPPED scripts/kconfig/zconf.tab.c
    SHIPPED scripts/kconfig/lex.zconf.c
    SHIPPED scripts/kconfig/zconf.hash.c
    HOSTCC scripts/kconfig/zconf.tab.o
    HOSTLD scripts/kconfig/conf
    #
    # configuration written to .config
    #
    user@user-laptop:~/MAQXP3/linux-c6x-2.0.0.63/linux-c6x$ make menuconfig
    <----------------- i change the timer frequency to 1000Hz, and save the conf file ----------------------->
    
    
    user@user-laptop:~/MAQXP3/linux-c6x-2.0.0.63/linux-c6x$ cd ../linux-c6x-project/
    user@user-laptop:~/MAQXP3/linux-c6x-2.0.0.63/linux-c6x-project$ ./prj build
    <.................................>
    #
    # configuration written to .config
    #
    make ARCH=c6x O=/home/user/MAQXP3/linux-c6x-2.0.0.63/Build/kobjs/evmc6678.el/
    GEN /home/user/MAQXP3/linux-c6x-2.0.0.63/Build/kobjs/evmc6678.el/Makefile
    scripts/kconfig/conf -s arch/c6x/Kconfig
    Using /home/user/MAQXP3/linux-c6x-2.0.0.63/linux-c6x as source for kernel
    /home/user/MAQXP3/linux-c6x-2.0.0.63/linux-c6x is not clean, please run 'make mrproper'
    in the '/home/user/MAQXP3/linux-c6x-2.0.0.63/linux-c6x' directory.
    make[5]: *** [prepare3] Erreur 1
    make[4]: *** [sub-make] Erreur 2
    make[3]: *** [kernel-sub] Erreur 2
    make[2]: *** [one-kernel] Erreur 2
    Build of kernel evmc6678 Failed
    make[1]: *** [one-kernels] Erreur 2
    make: *** [kernels] Erreur 2
    
    
    => I have the same PB .....
    
    
    can you give me the entire process to change kernel option and regenerate a linux kernel + rootfs ?
    
    
    thanks,
    Christophe
  • Hi Rex,

    thank you for this short description, but I need information more precise about how use these different directories.

    Christophe

  • Hi, Christophe,

    There are several ways to do it.

    1) (a) After getting your .config file from menuconfig, just run 'make' and the result is in vmlinux. (b) cp vmlinux ../product/vmlinux-myconfig (c) c6x-uclinux-objcopy -o binary ../product/vmlinux-myconfig.bin.  By doing this way, you can not run './prj build' until the kernel directory is throughly cleaned (make mrproper).

    2) To integrate with prj the easiest way: (a) cp .config arch/c6x/configs/ti_evmc6678_defconfig (save the original file before overwritting it) (b) make mrproper (c) cd ../linux-c6x-project (d) ./prj build

    3) To integrate with prj the correct way: (a) cd ../linux-c6x-project (b) need to create a new kbuild: cp kbuilds/evmc6678.mk kbuilds/evmc6678-custom.mk (c) edit evmc6678-custom.mk and set CONFIGPATH=patch/evmc6678-custom.patch (d) create the config patch: (mkdir -p scrap/stdconfig; mkdir -p scrap/myconfig; cp ../linux-c6x/arch/c6x/configs/ti_evmc6678_defconfig scrap/stdconfig/.config; cp ../linux-c6x/.config scrap/myconfig/.config; cd scrap; diff -uNr stdconfig myconfig > kbuilds/patches/evmc6678-custom.patch) (e) edit setenv and re-enable EXTRA_KERNELS_TO_BUILD="evmc6678-custom" (f) ./prj build (the kernel needs to be cleaned first from menuconfig (make mrproper) )

    Rex

  • Hi, Christophe,

    I can only suggest the best way to get these info is to go through/read the Makefiles.  They contains a lot more info.

    If the info for kernel configuration change helps you to proceed your project, could you mark this thread as resolved? Thanks!

    Rex

  • Hi everybody,

    I want to ask you for advices, how to solve my problems.

    1. First one is similar to Christophe's problem: I'm not able to build c6x linux by using ./prj build command after I manually alter kernel configuration (using make menuconfig in linux-c6x dir).

    end of my listing:

    …....

    # configuration written to .config

    #

    make ARCH=c6x O=/DataLinux/ti/c6xLinux/linux-c6x-2.0.0.63/Build/kobjs/evmc6678.el/

    GEN /DataLinux/ti/c6xLinux/linux-c6x-2.0.0.63/Build/kobjs/evmc6678.el/Makefile

    scripts/kconfig/conf -s arch/c6x/Kconfig

    Using /DataLinux/ti/c6xLinux/linux-c6x-2.0.0.63/linux-c6x as source for kernel

    /DataLinux/ti/c6xLinux/linux-c6x-2.0.0.63/linux-c6x is not clean, please run 'make mrproper'

    in the '/DataLinux/ti/c6xLinux/linux-c6x-2.0.0.63/linux-c6x' directory.

    make[5]: *** [prepare3] Error 1

    make[4]: *** [sub-make] Error 2

    make[3]: *** [kernel-sub] Error 2

    make[2]: *** [one-kernel] Error 2

    Build of kernel evmc6678 Failed

    make[1]: *** [one-kernels] Error 2

    make: *** [kernels] Error 2

    I've read Rex's solution performed by replacing ti_evmc6678_defconfig with created .config file but it seems to be little bit strange solution. Same behavior occurs when I alter something in busybox menuconfig.

     2. How to correctly load linux into EVM (directly into DSP not into NAND)? I've tried to load there ..../product/vmlinux-2.6.34evmc6678...20120808 file (default settings built). I used CCS and it seems to be working, but I can't see any listing in console during boot and telnet is not working too. But I can ping EVM.

    Thank you in advance for you advices

    Ondrej

  • Hi, Ondrej,

    1) The error in your build says linux-c6x is not clean, and need to run 'make mrproper'. Have you tried to clean it up and re-make?

    2) The file you loaded to DSP may have default boot command line set. You can do a "./bootblob get-cmdline <corresponding bin file>" to see what command line was set. You can either rebuild the image by modifying the corresponding .mk file under kbuilds driectory to get the ELF linux kernel file, or use bootblob to modify the command line setting in the bin file. With the modified bin file in CCS, instead of "load program", but "load mememory" and set the PC register in the core register group to 0x80001000, and run.

  • Hi Rex,

    thanks for your fast response.

    1) To the first point.... You are right, that this way helps to build it successfully. But you can't change anything and you have to use default settings. This is the issue I solve.

    2) Thanks, this solution really helped. I only note, that there is necessary to select TypeSize=32bits in the Load Memory window and I used PC address 0x80000000 (same as --abs-base parameter passed to make-image)

    Ondrej

  • Hi Rex,

    I want to know how to create my own 'hello world' application on evm6670 in Linux SDK environment? could you tell me some instruction or steps?

    Additionally, if I will set up my own cross compile environment by Linux c6x SDK, how to do it? and I get latest Linux c6x software pack,  I can't compile the hello application in hello folder.

    Could you give me some comments? thanks~

  • Hi, Hao,

    After you have the CodeSourcery tool chain downloaded, you need to add it to your PATH. Don't use the mk script to build, but use the cross compiler, c6x-uclinux-gcc, to compile the hello.c.  You can ftp the executable to c6670 using ftpget from c6670 console and run it on the EVM.

    Rex