Not able to add EFI related functionality when configuring U-Boot based on efi-x86_app64_defconfig or efi-x86_payload64_defconfig - u-boot

I cannot extend the default U-Boot EFI functionality provided by the default configurations files x86_app64_defconfig or x86_payload64_defconfig with for example CONFIG_EFI_LOADER, CONFIG_EFI_SECURE_BOOT, CONFIG_CMD_NVEDIT_EFI, etc.
I'm simply not allowed to add them. Trying to work my way around the problem by modifying some kconfig files just end up in failed builds.
Seems like it is possible with the corresponding 32-bit default configuration files x86_app32_defconfig or x86_payload32_defconfig but that is not what I want.

Related

How to invoke POCO's PageCompiler?

I feel stupid.
https://pocoproject.org/pro/docs/PageCompilerUserGuide.html
It says:
Invoking the Page Compiler
The Page Compiler is invoked from the command line. The file names of the CPSP files to be compiled are specified as arguments.
A number of options control the code generation. Options are specified using the usual command-line option syntax for the current operating system (e.g., <[/help on Windows, <[--help or <[-h on Unix).
help (h): display usage information
define (D): define a configuration property
config-file (f): load configuration properties from a file
osp (O): add factory class definition/implementation for use with OSP
apache (A): add factory class definition/implementation and shared library manifest for use with ApacheConnector
escape (e): make HTML-escape mode default for all pages
Run the PageCompiler with the —help option to see all available options.
Ok, cool. But what/where is the actual executable? I have all POCO libs installed on Ubuntu 18.04 LTS from the default repository.
POCO seems to be great library, but I find the documentation (not only this) severely lacking. Mainly due to non-existent examples.
I installed and built POCO from source.
PageCompiler is in Poco-x.x.x.x-all/PageCompiler/bin/Linux/x86_64.
It is called cpspc and cpspcd.
When installed it is copyed in /usr/local/bin/, in the path.
Done on Fedora 31.

Changing program start address

I've exported mbed_blinky project for keil uvision 5 and i want to develop a program for another board, so I need to change the start address of program. I change the start in IROM1 in options for target window but it doesn't work. It must be defined in somewhere but I can't find it. Can anyone help?
My target is LPC1768
In uVision, the linker script (or scatter file as Keil refers to it) is either generated from the target settings that you have tried to change or can be overridden on the linker tab with a "scatter file"; it is possible that the mbed export does not generate a uVision target tab compatible scatter file or requires settings not available in uVision's basic target dialog, so is using a custom scatter file.
On the linker tab, check whether or not the "Use memory layout from target dialog" is checked or not. If you want to use the "Target" tab settings it must be checked, otherwise the file in the "Scatter file" setting on the linker tab is used and you will need to edit that, and check all other settings on teh linker tab are correct for your target..
I've used mbed in Eclipse/GCC and am less familiar with Keil. If you want to change target boards/micro's, you are better off doing a new Export from either the online compiler or from mbed-cli tool with the new target selected. The start address is only one of many things that have to change for a new target. The files required to compile for the new target are all on the disc inside the mbed-os folder, but when you exported the original project, they helpfully excluded unnecessary files from the project items. Files are on the disc, just not part of Keil project setup. You would have to also edit the Device on the options tab and the C/C++ include paths and compiler flags as these relate to specific target. Then you will need to locate the correct linker file and startup file for the new target. Again, it is easier to just export a new project for the new target.

Include tcl.h into C project

I need to use tcl.h in my C project (VS 2012) for registering function in SQLite. I have downloaded Tcl for windows and installed it. But my project still doesn't recognize when I write #include . What should I do to get access to this header?
Thanks in advance.
Open the project properties and do :
Right click on your project, go to properties, go to C/C++ session. On the field Additional Include Directories, add the path to the header you want, and use the header with "".
After that, you should go to the Linker session. On General, go to the Additional Library directories and add the path to the libs you need to add. Then go to Input and add the lib.
Sometimes you will need to copy a dll to the same folder of your executable. You can do that on Custom Build Step - Post Build Events.
You need to do it for each configuration and platform you want to build - one tip to make it easier is to use those variables $(Configuration) and $(Platform) when you are specifying the paths, and select on the dropdown list of the top of the properties window All configurations and All platforms, so you don't need to do it several times per project.

Eclipse: choosing a default debugger for all new C projects

Whenever I start a new project, I have to go through setting up the debugger with Eclipse time and time again before I can use it. Isn't there a default setting for all new C projects I can change?
I'm not sure exactly what you mean by "setting up the debugger" (perhaps you can clarify), but under "Preferences -> Run/Debug -> Launching -> Default Launchers" you should be able to select your preferred launcher for different kind of launch modes. This can also be selected individually for each launch configuration.
Typically it is up to the toolchain and/or project to determine which debugger/launcher is suitable to use for that specific project, but I know there is a bug in CDT which prevents toolchains from properly specifying the default launcher to use.
I only use Eclipse for Java, so I can't give you an authoritative answer. But since no one else seems to be answering:
Java projects have a (more or less) hidden file in the project directory called .project and another one called .settings . I'm not sure if this would apply to the C environment as well, but it seems likely. You may want to look at the set of such "hidden" files for a well set up project and a virginal project side by side to find out which settings make the difference.
Given that information, you may be able to simply edit (perhaps with some assistance from a script you can write yourself) the file(s) in question to do the configuration textually without a lot of mouse clicking.

Setting up Netbeans/Eclipse for Linux Kernel Development

I'm doing some Linux kernel development, and I'm trying to use Netbeans. Despite declared support for Make-based C projects, I cannot create a fully functional Netbeans project. This is despite compiling having Netbeans analyze a kernel binary that was compiled with full debugging information. Problems include:
files are wrongly excluded: Some files are incorrectly greyed out in the project, which means Netbeans does not believe they should be included in the project, when in fact they are compiled into the kernel. The main problem is that Netbeans will miss any definitions that exist in these files, such as data structures and functions, but also miss macro definitions.
cannot find definitions: Pretty self-explanatory - often times, Netbeans cannot find the definition of something. This is partly a result of the above problem.
can't find header files: self-explanatory
I'm wondering if anyone has had success with setting up Netbeans for Linux kernel development, and if so, what settings they used. Ultimately, I'm looking for Netbeans to be able to either parse the Makefile (preferred) or extract the debug information from the binary (less desirable, since this can significantly slow down compilation), and automatically determine which files are actually compiled and which macros are actually defined. Then, based on this, I would like to be able to find the definitions of any data structure, variable, function, etc. and have complete auto-completion.
Let me preface this question with some points:
I'm not interested in solutions involving Vim/Emacs. I know some people like them, but I'm not one of them.
As the title suggest, I would be also happy to know how to set-up Eclipse to do what I need
While I would prefer perfect coverage, something that only misses one in a million definitions is obviously fine
SO's useful "Related Questions" feature has informed me that the following question is related: https://stackoverflow.com/questions/149321/what-ide-would-be-good-for-linux-kernel-driver-development. Upon reading it, the question is more of a comparison between IDE's, whereas I'm looking for how to set-up a particular IDE. Even so, the user Wade Mealing seems to have some expertise in working with Eclipse on this kind of development, so I would certainly appreciate his (and of course all of your) answers.
Cheers
Eclipse seems to be pretty popular for Linux kernel development:
http://cdtdoug.blogspot.com/2008/12/linux-kernel-debugging-with-cdt.html
http://jakob.engbloms.se/archives/338
http://revver.com/video/606464/debugging-the-linux-kernel-using-eclipsecdt-and-qemu/
I previously wrote up an answer. Now I come up with all the details of the solution and would like to share it. Unfortunately stackoverflow does not allow me to edit the previous answer. So I write it up in this new answer.
It involves a few steps.
[1] The first step is to modify linux scripts to leave dep files in. By default after using them in the build, those dep files are removed. Those dep files contains exact dependency information about which other files a C file depends. We need them to create a list of all the files involved in a build. Thus, modify files under linux-x.y.z/scripts to make them not to remove the dep files like this:
linux-3.1.2/scripts
Kbuild.include: echo do_not_rm1 rm -f $(depfile);
Makefile.build: echo do_not_rm2 rm -f $(depfile);
The other steps are detailed in my github code project file https://github.com/minghuascode/Nbk/blob/master/note-nbkparse. Roughly you do:
[2] Configure with your method of configuration, but be sure use "O=" option to build the obj files into a separate directory.
[3] Then use the same "O=" option and "V=1" option to build linux, and save make output into a file.
[4] Run my nbkparse script from the above github project. It does:
[4.1] Read in the make log file, and the dep files. Generate a mirroring command.
[4.2] Run the mirroring command to hard-link the relevant source files into a separate tree, and generate a make-log file for NetBeans to use.
Now create a NetBeans C project using the mirrored source tree and the generated log file. NetBeans should be able to resolve all the kernel symbols. And you will only see the files involved in the build.
The Eclipse wiki has a page about this: HowTo use the CDT to navigate Linux kernel source
I have been doing some embedded linux development. Including kernel module development and have imported the entire linux kernel source code into Eclipse, as a separate project. I have been building the kernel itself outside of Eclipse(so far), but I don't any reason why I shouldn't be able to set up the build environment within Eclipse to build the kernel. For my projects, as long as I setup the PATH properties to point to the appropriate linux source include directories, it seems to be pretty good about name completion for struct fields, etc.
I can't really comment, on if it is picking up the correct defines and not greying out the correspond sections, as I haven't really paid to much attention to the files within the kernel itself.(so far)
I was also wondering about using Netbeans as a linux 'C' IDE, as I do prefer Netbean's for Java GUI development.
I think this would work (done each step for various projects):
[1] Modify kernel build scripts to leave .d files. By default they are removed.
[2] Log the build process to a file.
[3] Write a script to parse the build log.
[3.1] From the build log, you know every .c files.
[3.2] From the .c file, you know which is the corresponding .d file.
[3.3] Look into .d files to find out all the included .h files.
[3.4] Form a complete .c and .h file list.
[4] Now create a new dir, and use "ln -s" or "ln" to pick files of interest.
Now, create a Netbeans project for existing source code in the [4].
Configure code assistance to use make-log file. You should see
exactly the effective source code as when you build it at [2].
Some explanations to the above steps:
At [2], do a real build so the log file contains the exact files and flags of interest.
Later netbeans will be able to use the exact flags to parse.
At [4], pick only the files you want to see. Incorporating the whole kernel tree into netbeans will be unpractical.
There is a trick to parsing .d files: Many of the depended items are not real paths to a .h file, they are a modified entry for part of the linux config sections in the auto config file. You may need to reverse the modification to figure out which is the real header file.
Actually there is a topic on netbeans site. This is the discussion url: http://forums.netbeans.org/ntopic3075.html . And there is a wiki page linked from the discussion: wiki.netbeans.org/CNDLinuxKernel . Basically it asks you to prefix make with CFLAGS="-g3 -gdwarf-2" .
I found this link very helpful in setting up proper indexing in Eclipse. It requires running a script to alter Eclipse environment to match your kernel options, in my case
$ autoconf-to-eclipse.py ./include/generated/autoconf.h .
An illustrated guide to indexing the linux kernel in eclipse

Resources