[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [GSoc] GSoc Introduction : Xen on ARM: create multiple guests from device tree



On Fri, 7 Apr 2017, Wei Liu wrote:
> On Thu, Apr 06, 2017 at 07:29:05PM -0400, Methuku Karthik wrote:
> > Hi Stefano,
> > 
> > I have used attached bin2c.c convert the contents of .config file to hex.
> > 
> > (echo "static const char xen_config_data[] __attribute__((used)) =
> > ./bin2c.o <xen/.config ; echo ";") > xen_config.h
> > 
> > the above command will generate the header file which will contain the
> > contents of config file in hex form.
> > 
> > i wrote a tester code to check if i .config is output correctly.
> > 
> > any inputs on makefile modification would be of great help.
> > 
> > Will addition of below rules to makefile suffice
> > 1.Add rule to compile bin2c.c always.
> > 2.add the above mentioned shell command to make file to generate the
> > header file.
> 
> Why not just fold everything into bin2c?
> 
> > 3. which object file should include the header file ?
> > 
> 
> The file you want to add which contains a hypercall to retrieve the
> content.

I don't have an opinion on which file should be including it. Maybe
xen/common/config.c or xen/common/extra.c? It would be great to have an
hypercall to retrieve it, but for an initial small contribution I think
is OK to skip it and only provide a tool to extract the config from the
binary (see below).


> > I am thinking to add bin2c.c file in scripts folder, access .config
> > file from xen folder to give it as input to bin2.o. and generate
> > xen_config.h
> > 
> 
> xen/tools please.  It is hypervisor only tool.
> 
> > As you mentioned that it would be nice to add hyper call, where should
> > the generated xen_config.h file be added and which file should have
> > the include?
> 
> Other than the hypercall, I would also suggest putting the config file
> into a special section in the elf binary so that it can be retrieved
> without running the binary -- not everyone is up for running random
> binaries from the internet. :-)

Yes, that would be best.


> > 
> > >>
> 
> > #include <stdlib.h>
> > #include <stdio.h>
> > 
> > int main(int argc, char *argv[])
> > {
> >     int ch,total;
> 
> Space after comma please.
> 
> > 
> >     do {
> >             printf("\t\"");
> >             while ((ch = getchar()) != EOF) {
> >                     total++;
> 
> total is not initialised.
> 
> >                     printf("\\x%02x", ch);
> >                     if (total % 16 == 0)
> >                             break;
> >             }
> >             printf("\"\n");
> >     } while (ch != EOF);
> 
> You can simply use one loop here by replacing the "break" with printing
> out the newline.
> 
> Wei.
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.