Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel Configuration #35

Open
Kendidi opened this issue Aug 5, 2020 · 2 comments
Open

Kernel Configuration #35

Kendidi opened this issue Aug 5, 2020 · 2 comments

Comments

@Kendidi
Copy link

Kendidi commented Aug 5, 2020

Hi,

I have some questions regarding configurating the Kernel build for vmlinux.

I was under the impression that changes made in ".../ariane-sdk/configs/linux_defconfig" and in ".../ariane-sdk/configs/buildroot_defconfig" will be copied to ".../ariane-sdk/buildroot/.config" or applied somehow during "make vmlinux". Is that how it's supposed to work? Please correct me if I am wrong.

  1. I want to add debug symbols to the build, so I added "CONFIG_DEBUG_INFO=y" to file, "linux_defconfig". I can see that the resulted vmlinux size grew a lot. So I assume it was successful and debug symbols have added to the ELF file. But then when I look at ".config", I do not see that option there.

  2. I want to add DTS info to the kernel, so I ran "make menuconfig" at ".../ariane-sdk/buildroot/", and added a path to option, "Kernel --->Build a Device Tree Blob (DTB) ". After running "make vmlinux", I found that my changes made to ".config" is gone. And vmlinux file size did not seem to have changed.
    I also tried adding, "#BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="/home/aie/ariane-sdk/ariane.dts" to "buildroot_defconfig" but that didn't seem to do anything as well. Would you please advise what's the proper way to config Kernel? And how to config options like BR2_LINUX_KERNEL_CUSTOM_DTS_PATH?

  3. I found "CONFIG_PAGE_OFFSET=0xffffffe000000000" in ".../ariane-sdk/buildroot/output/build/linux-ariane-v0.7/arch/riscv/configs/defconfig" after running "make menuconfig". I think the address was generated on the run. Where and how can we change the value to something else? (E.g. CONFIG_PAGE_OFFSET=0x200000000".)

  4. After vmlinux is loaded via GDB, I saw the following:
    ra 0xdeadbeefdeadbeef -2401053088876216593
    sp 0x0000000083fffff0 2214592496
    How do we config stack point (SP) in Kernel config to a more reasonable address corresponds to PAGE_OFFSET? (E.g. 0x207FFFFF0)
    And does register RA looks OK at startup?

  5. I am planning to run Kernel loaded onto beginning of DRAM (0x2_0000_0000). In "ariane.dts" that's used to build Ariane ROM, memory is set as "memory@0x200000000". Will that be OK? Or should I load kernel to a DRAM region outside the region described in ariane.dts so Kernel can use DRAM properly?

Many thanks in advance!

@Moschn
Copy link
Contributor

Moschn commented Aug 7, 2020

General comment: The linux kernel and buildroot use a local .config file. However this file is huge and they also provide a way to save a 'defconfig' which is basically all to the config file from a stock one. These defconfig files are a lot shorter in size. We use the defconfig files. During the compilation, the .config files get overwritten. So If you want to change anything, it is easier if you do it in the defconfig file. You can also make changes to linux or buildroot with menuconfig and then after that run make savedefconfig to export the new defconfig. You still might have to copy it to the correct location.

The detailed questions are mostly linux or buildroot related. I would advise to ask in a forum/chat for these specific tools. I sadly do not have enough experience to answer all of your questions.

  1. I believe the initial stack pointer is set up by the bootloader. Independent of your openOCD or GDB session. As such you would have to change it there.

@Kendidi
Copy link
Author

Kendidi commented Aug 8, 2020 via email

yvantor pushed a commit to pulp-platform/cva6-sdk that referenced this issue Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants