From: "=?GB2312?B?yO6wsrDu?=" Subject: Writing C program on Stubdom Date: Fri, 12 Dec 2008 17:01:06 +0800 Message-ID: <98207b4f0812120101y5aca4632m73dd48208ce886be@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1978090674==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============1978090674== Content-Type: multipart/alternative; boundary="----=_Part_95297_6852391.1229072466939" ------=_Part_95297_6852391.1229072466939 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, list! Currently I am trying to write C programs on Stubdom. In my understanding, the c-stubdom is trying to show us that we can just write standard C programs, linking it to mini-os,(with the APP_OBJS points to the appropriate obj files), then we can run the program as a separate Xen Domain, am I right? I successfully compiled the c-stubdom ( by "make c-stubdom" in XEN_ROOT/stubdom ), and i got the mini-os.gz. Does it mean that i can use it as a kernel to create a new domain, and what it would do is simply out put "hello wolrd" then hangs up? But i get the VMWare crash when i tried to do this. ( Yes, i deployed XEN 3.3 in VMware). On the other hand, to find out how stubdom links applications (such ioemu, grub) with MiniOS, I examined the Makefile in XEN_ROOT/stubdom, I noticed that it is achieved by passing "APP_OBJ= target objects" to the make command of miniOS. In the Makefile of MiniOS, I found the following scripts: $(OBJ_DIR)/$(TARGET)_app.o: $(APP_OBJS) app.lds $(LD) -r -d $(LDFLAGS) -\( $^ -\) $(APP_LDLIBS) --undefined main -o $@ Is the purpose of this scrpits to adjust the APP_OBJS according to app.lds, so it can be linked to MiniOS? then: $(OBJ_DIR)/$(TARGET): links $(OBJS) $(OBJ_DIR)/$(TARGET)_app.o arch_lib $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJ_DIR)/$(TARGET)_app.o $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o Above scripts replaces the "__attribute__((weak)) int app_main(start_info_t *si)" within XEN_ROOT/Extra/Mini-os/Kernel.c with the adjusted APP_OBJS? Thanks! -- Regards! Ryan ------=_Part_95297_6852391.1229072466939 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, list!

          Currently I am trying to write C programs on Stubdom. In my understanding, the c-stubdom is trying to show us that we can just write standard C programs,  linking it to mini-os,(with the APP_OBJS points to the appropriate obj files), then we can run the program as a separate Xen Domain, am I right?

          I successfully compiled the c-stubdom ( by "make c-stubdom" in XEN_ROOT/stubdom ), and i got the mini-os.gz. Does it mean that i can use it as a kernel to create a new domain, and what it would do is simply out put "hello wolrd" then hangs up? But i get the VMWare crash when i tried to do this. ( Yes, i deployed XEN 3.3 in VMware).

         On the other hand, to find out how stubdom links applications (such ioemu, grub) with MiniOS, I examined the Makefile in XEN_ROOT/stubdom, I noticed that it is achieved by passing "APP_OBJ= target objects" to the make command of miniOS. In the Makefile of MiniOS, I found the following scripts:

$(OBJ_DIR)/$(TARGET)_app.o: $(APP_OBJS) app.lds
    $(LD) -r -d $(LDFLAGS) -\( $^ -\) $(APP_LDLIBS) --undefined main -o $@
         
         Is the purpose of this scrpits to adjust the APP_OBJS according to app.lds, so it can be linked to MiniOS?

then:

$(OBJ_DIR)/$(TARGET): links $(OBJS) $(OBJ_DIR)/$(TARGET)_app.o arch_lib
    $(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJ_DIR)/$(TARGET)_app.o $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o
    $(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o

         Above scripts replaces the "__attribute__((weak)) int app_main(start_info_t *si)" within XEN_ROOT/Extra/Mini-os/Kernel.c with the adjusted APP_OBJS?

         Thanks!
        
--
Regards!
Ryan
------=_Part_95297_6852391.1229072466939-- --===============1978090674== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1978090674==--