sysml / mini-os

Minimalistic Operating System for Xen
Other
65 stars 23 forks source link

Missing xenstore.h #18

Closed wenhuizhang closed 8 years ago

wenhuizhang commented 8 years ago

Hi, I think it is because of the Xen version I used is lower than 4.2, after updating Xen version, the issue I am facing turns different,

/home/wenhui/ClickOS/mini-os/lib/sys.c:35:22: fatal error: xenstore.h: No such file or directory

include < xenstore.h >

I searched the Makefile, it is pointing to /xen/tools/ folder, and the problem is that, there is no xenstore.h file found either within source code of minios nor xen.

While, the other header files could be found within minios, which is a little wired.

fmanco commented 8 years ago

Hi

xenstore.h should be under xen/tools/xenstore. Which version of xen are you using now?

Can you please try to re-download xen sources and rebuild. If that doesn't work please build with verbose and put here the command that is failing.

wenhuizhang commented 8 years ago

I think Xen version is 4.5-stable

wenhuizhang commented 8 years ago

Thanks so much @fmanco , just redid it again, and get XXX_ROOT hard coded in all Makefiles, and changed one directory , export XEN_ROOT=/home/wenhui/ClickOS/xen export MINIOS_ROOT=/home/wenhui/ClickOS/mini-os export NEWLIB_ROOT=/home/wenhui/ClickOS/toolchain/x86_64-root/x86_64-xen-elf export LWIP_ROOT=/home/wenhui/ClickOS/toolchain/x86_64-root/x86_64-xen-elf

https://github.com/cnplab/toolchain/blob/master/Makefile#L96 into NEWLIB_CFLAGS += -isystem $(MINIOS_ROOT)/include/arch NEWLIB_CFLAGS += -isystem $(MINIOS_ROOT)/include/arch/x86 , and it works now.

fmanco commented 8 years ago

Hi

There should still be something wrong with your build environment, given you don't need to hardcode the XXX_ROOT variables, and the line you added should be covered by https://github.com/cnplab/toolchain/blob/master/Makefile#L97.

Anyway, I'm glad it works.

wenhuizhang commented 8 years ago

Got it, thanks so much @fmanco , I think I put all environment variables in ~/.bashrc , and used $source ~/.bashrc to activate them. Wired that they were not read, Thanks for your help!

god14fei commented 8 years ago

Hi, wenhui!

I get stuck in the same problem with you. But from the description above, I still have no ideas about how you solve the problem.

What do you mean in the following. https://github.com/cnplab/toolchain/blob/master/Makefile#L96 into NEWLIB_CFLAGS += -isystem $(MINIOS_ROOT)/include/arch NEWLIB_CFLAGS += -isystem $(MINIOS_ROOT)/include/arch/x86

Could you make it more clear? Many thanks!

fmanco commented 8 years ago

Hi

The problem was that environment variables were not being set properly. What he describes is a work-around, so you can ignore it. Just make sure that environment variables like MINIOS_ROOT are properly exported.

Best

god14fei commented 8 years ago

Thanks a lot @fmanco

I think those environment variables like XEN_ROOT, MINIOS_ROOT, CLICKOS_ROOT, TOOLCHAIN_ROOT, COSMOS_ROOT have been properly exported. But when I try to build ClickOS kernel, it always tells me "fatal error: xenstore.h: No such file or directory".

The commands are as follows:

cd $CLICKOS_ROOT ./configure --enable-minios --with-xen=$XEN_ROOT --with-minios=$MINIOS_ROOT make minios

It confused me so much. Given that environment variables are properly set, how could I solve it?

BTW, my Xen version is 4.7.0.

Tanks again.

fmanco commented 8 years ago

Hi

That is indeed a problem in ClickOS. The include paths changed and we didn't push a patch yet. For the time being just add the following line to MiniOS`stub.mk.

CINCLUDES              += -isystem $(XEN_ROOT)/tools/xenstore/include

Best

god14fei commented 8 years ago

Hi, @fmanco

I have added the above line to the corresponding file, but it still doesn't work.

Best regards.