* [PATCH] Integrating applications into Mini-OS
@ 2006-05-11 16:34 John D. Ramsdell
2006-05-15 12:18 ` Jacob Gorm Hansen
0 siblings, 1 reply; 12+ messages in thread
From: John D. Ramsdell @ 2006-05-11 16:34 UTC (permalink / raw)
To: xen-devel
I sent this patch directly to Gregor, and neglected to CC this list.
Sorry about that.
I'd like to make it so that there is no need to modify any Mini-OS
source files when extending it with an application. All that is
required is a change to Makefile, and a small change to kernel.c,
printf.c, and string.c. I have enclosed the patch.
With this patch, one could write an application in a file called, say,
app.c, and add it to the Mini-OS directory along with newlib.c and
setjmp_x86_32.S, the two files I use to adapt newlib to the Mini-OS
environment. One would compile and link it with newlib, with the
command:
#! /bin/sh
COMP_HOME=${HOME}/opt/cross/i386-elf
CPPFLAGS="-DINIT_APP -DHAVE_LIBC"
LDLIBS="-lc -lnosys"
export PATH=${COMP_HOME}/bin:$PATH
exec make CPPFLAGS="${CPPFLAGS}" LDLIBS="${LDLIBS}" "$@"
The patch changes Makefile so that it needs no modification to
handle an application. It also fixes some problems with the original
Makefile. The original defined LDFLAGS, but did not use the
definition in the linker command. There was some odd whitespace
after the last update to OBJS, which has been removed. I also changed
the rules for compiling C and assembler files, so they more closely
match the default rules built into GNU Make.
John
Only in xen-unstable/extras/mini-os: app.c
Only in xen-unstable/extras/mini-os: app.h
Only in xen-unstable/extras/mini-os: app.lua
Only in xen-unstable/extras/mini-os: bin2c
Only in xen-unstable/extras/mini-os: bin2c.mk
Only in xen-unstable/extras/mini-os: crmake
diff -ur oxen-unstable/extras/mini-os/kernel.c xen-unstable/extras/mini-os/kernel.c
--- oxen-unstable/extras/mini-os/kernel.c 2006-05-09 00:51:19.000000000 -0400
+++ xen-unstable/extras/mini-os/kernel.c 2006-05-09 08:18:33.000000000 -0400
@@ -38,6 +38,10 @@
#include <xen/features.h>
#include <xen/version.h>
+#if defined INIT_APP
+ void init_app(void);
+#endif
+
/*
* Shared page for communicating with the hypervisor.
* Events flags go here, for example.
@@ -171,6 +175,10 @@
/* Init XenBus from a separate thread */
create_thread("init_xs", init_xs, NULL);
+#if defined INIT_APP
+ init_app();
+#endif
+
/* Everything initialised, start idle thread */
run_idle_thread();
}
diff -ur oxen-unstable/extras/mini-os/lib/printf.c xen-unstable/extras/mini-os/lib/printf.c
--- oxen-unstable/extras/mini-os/lib/printf.c 2006-05-09 00:51:19.000000000 -0400
+++ xen-unstable/extras/mini-os/lib/printf.c 2006-05-09 08:33:17.000000000 -0400
@@ -54,6 +54,8 @@
* $FreeBSD: src/sys/libkern/divdi3.c,v 1.6 1999/08/28 00:46:31 peter Exp $
*/
+#if !defined HAVE_LIBC
+
#include <os.h>
#include <types.h>
#include <hypervisor.h>
@@ -789,4 +791,4 @@
return i;
}
-
+#endif
Only in xen-unstable/extras/mini-os/lib: printf.c~
diff -ur oxen-unstable/extras/mini-os/lib/string.c xen-unstable/extras/mini-os/lib/string.c
--- oxen-unstable/extras/mini-os/lib/string.c 2006-05-09 00:51:19.000000000 -0400
+++ xen-unstable/extras/mini-os/lib/string.c 2006-05-09 08:33:01.000000000 -0400
@@ -18,6 +18,8 @@
****************************************************************************
*/
+#if !defined HAVE_LIBC
+
#include <os.h>
#include <types.h>
#include <lib.h>
@@ -153,3 +155,5 @@
}
return NULL;
}
+
+#endif
Only in xen-unstable/extras/mini-os/lib: string.c~
diff -ur oxen-unstable/extras/mini-os/Makefile xen-unstable/extras/mini-os/Makefile
--- oxen-unstable/extras/mini-os/Makefile 2006-05-09 00:51:18.000000000 -0400
+++ xen-unstable/extras/mini-os/Makefile 2006-05-09 08:03:47.000000000 -0400
@@ -6,18 +6,23 @@
override TARGET_ARCH := $(XEN_TARGET_ARCH)
# NB. '-Wcast-qual' is nasty, so I omitted it.
-CFLAGS := -fno-builtin -Wall -Werror -Iinclude/ -Wredundant-decls -Wno-format
+CFLAGS := -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format
CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
+override CPPFLAGS := -Iinclude $(CPPFLAGS)
+ASFLAGS = -D__ASSEMBLY__
+
+LDFLAGS := -N -T minios-$(TARGET_ARCH).lds
+
ifeq ($(TARGET_ARCH),x86_32)
CFLAGS += -m32 -march=i686
-LDFLAGS := -m elf_i386
+LDFLAGS += -m elf_i386
endif
ifeq ($(TARGET_ARCH),x86_64)
CFLAGS += -m64 -mno-red-zone -fpic -fno-reorder-blocks
CFLAGS += -fno-asynchronous-unwind-tables
-LDFLAGS := -m elf_x86_64
+LDFLAGS += -m elf_x86_64
endif
ifeq ($(debug),y)
@@ -28,12 +33,12 @@
TARGET := mini-os
-OBJS := $(TARGET_ARCH).o
+OBJS := $(patsubst %.S,%.o,$(wildcard *$(TARGET_ARCH).S))
OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
OBJS += $(patsubst %.c,%.o,$(wildcard console/*.c))
-
+
HDRS := $(wildcard include/*.h)
HDRS += $(wildcard include/xen/*.h)
@@ -45,7 +50,7 @@
[ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
$(TARGET): links $(OBJS)
- $(LD) -N -T minios-$(TARGET_ARCH).lds $(OBJS) -o $@.elf
+ $(LD) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $@.elf
gzip -f -9 -c $@.elf >$@.gz
.PHONY: clean
@@ -55,10 +60,10 @@
find . -type l | xargs rm -f
%.o: %.c $(HDRS) Makefile
- $(CC) $(CFLAGS) -c $< -o $@
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
%.o: %.S $(HDRS) Makefile
- $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@
+ $(CC) $(ASFLAGS) $(CPPFLAGS) -c $< -o $@
define all_sources
( find . -follow -name SCCS -prune -o -name '*.[chS]' -print )
Only in xen-unstable/extras/mini-os: newlib.c
Only in xen-unstable/extras/mini-os: setjmp_x86_32.S
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] Integrating applications into Mini-OS
2006-05-11 16:34 [PATCH] Integrating applications into Mini-OS John D. Ramsdell
@ 2006-05-15 12:18 ` Jacob Gorm Hansen
2006-05-15 12:46 ` Ian Campbell
2006-05-15 13:45 ` John D. Ramsdell
0 siblings, 2 replies; 12+ messages in thread
From: Jacob Gorm Hansen @ 2006-05-15 12:18 UTC (permalink / raw)
To: John D. Ramsdell; +Cc: xen-devel
[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]
On 11 May 2006 12:34:49 -0400, John D. Ramsdell <ramsdell@mitre.org> wrote:
> I'd like to make it so that there is no need to modify any Mini-OS
> source files when extending it with an application. All that is
> required is a change to Makefile, and a small change to kernel.c,
> printf.c, and string.c. I have enclosed the patch.
>
> With this patch, one could write an application in a file called, say,
> app.c, and add it to the Mini-OS directory along with newlib.c and
> setjmp_x86_32.S, the two files I use to adapt newlib to the Mini-OS
> environment. One would compile and link it with newlib, with the
> command:
hi,
I think it would be more elegant to link the mini-os C files as a
'libminios.a' lib, and then you can replace main() with your own by
linking libminios.a from a separate Makefile somewhere else in you
tree.
I have attached a small patch to mini-os which changes the mini-os
Makefile and adds a dummy main function which you can override by
linking with your own main() first, as in:
OBJS := mymain.o
myapp: $(OBJS)
$(LD) -N -T myapp.lds ../mini-os/x86_32.o $(OBJS) -o myapp.elf
-lminios -L../mini-os
regards,
Jacob
[-- Attachment #2: miniosappsupport --]
[-- Type: application/octet-stream, Size: 1901 bytes --]
diff -r 61d87e0b0ea7 extras/mini-os/Makefile
--- a/extras/mini-os/Makefile Sun May 14 16:33:10 2006 +0200
+++ b/extras/mini-os/Makefile Mon May 15 14:08:46 2006 +0200
@@ -28,7 +28,7 @@ endif
TARGET := mini-os
-OBJS := $(TARGET_ARCH).o
+HEAD := $(TARGET_ARCH).o
OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
@@ -42,13 +42,17 @@ links:
links:
[ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
-$(TARGET): links $(OBJS)
- $(LD) -N -T minios-$(TARGET_ARCH).lds $(OBJS) -o $@.elf
+libminios.a: $(OBJS)
+ ar r libminios.a $(HEAD) $(OBJS)
+
+$(TARGET): links libminios.a $(HEAD)
+ $(LD) -N -T minios-$(TARGET_ARCH).lds $(HEAD) -L. -lminios -o $@.elf
gzip -f -9 -c $@.elf >$@.gz
clean:
find . -type f -name '*.o' | xargs rm -f
rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
+ rm -f libminios.a
find . -type l | xargs rm -f
%.o: %.c $(HDRS) Makefile
diff -r 61d87e0b0ea7 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c Sun May 14 16:33:10 2006 +0200
+++ b/extras/mini-os/kernel.c Mon May 15 14:08:46 2006 +0200
@@ -88,6 +88,7 @@ static void init_xs(void *ign)
/*
* INITIAL C ENTRY POINT.
*/
+extern int main(void);
void start_kernel(start_info_t *si)
{
static char hello[] = "Bootstrapping...\n";
@@ -146,6 +147,8 @@ void start_kernel(start_info_t *si)
/* Init XenBus from a separate thread */
create_thread("init_xs", init_xs, NULL);
+
+ main();
/* Everything initialised, start idle thread */
run_idle_thread();
diff -r 61d87e0b0ea7 extras/mini-os/dummymain.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/dummymain.c Mon May 15 14:08:46 2006 +0200
@@ -0,0 +1,8 @@
+#include <types.h>
+#include <lib.h>
+
+int main(void)
+{
+ printk("using dummy main.\n");
+ return 0;
+}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] Integrating applications into Mini-OS
2006-05-15 12:18 ` Jacob Gorm Hansen
@ 2006-05-15 12:46 ` Ian Campbell
2006-05-15 13:08 ` Jacob Gorm Hansen
2006-05-15 13:45 ` John D. Ramsdell
1 sibling, 1 reply; 12+ messages in thread
From: Ian Campbell @ 2006-05-15 12:46 UTC (permalink / raw)
To: Jacob Gorm Hansen; +Cc: John D. Ramsdell, xen-devel
On Mon, 2006-05-15 at 14:18 +0200, Jacob Gorm Hansen wrote:
> I have attached a small patch to mini-os which ... adds a dummy main
Should it be marked with __attribute__((weak))?
http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Function-Attributes.html#Function-Attributes
...
weak
The weak attribute causes the declaration to be emitted as a
weak symbol rather than a global. This is primarily useful in
defining library functions which can be overridden in user code,
though it can also be used with non-function declarations. Weak
symbols are supported for ELF targets, and also for a.out
targets when using the GNU assembler and linker.
Ian.
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] Integrating applications into Mini-OS
2006-05-15 12:46 ` Ian Campbell
@ 2006-05-15 13:08 ` Jacob Gorm Hansen
2006-05-15 13:20 ` Jacob Gorm Hansen
[not found] ` <ogtpsifqtkz.fsf@divan.mitre.org>
0 siblings, 2 replies; 12+ messages in thread
From: Jacob Gorm Hansen @ 2006-05-15 13:08 UTC (permalink / raw)
To: Ian Campbell; +Cc: John D. Ramsdell, xen-devel
[-- Attachment #1: Type: text/plain, Size: 348 bytes --]
On 5/15/06, Ian Campbell <Ian.Campbell@xensource.com> wrote:
> On Mon, 2006-05-15 at 14:18 +0200, Jacob Gorm Hansen wrote:
> > I have attached a small patch to mini-os which ... adds a dummy main
>
> Should it be marked with __attribute__((weak))?
Probably a good idea, makes link order less important. Revised patch
is attached.
Jacob
[-- Attachment #2: miniosappsupport --]
[-- Type: application/octet-stream, Size: 1922 bytes --]
diff -r 61d87e0b0ea7 extras/mini-os/Makefile
--- a/extras/mini-os/Makefile Sun May 14 16:33:10 2006 +0200
+++ b/extras/mini-os/Makefile Mon May 15 15:06:35 2006 +0200
@@ -28,7 +28,7 @@ endif
TARGET := mini-os
-OBJS := $(TARGET_ARCH).o
+HEAD := $(TARGET_ARCH).o
OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
@@ -42,13 +42,17 @@ links:
links:
[ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
-$(TARGET): links $(OBJS)
- $(LD) -N -T minios-$(TARGET_ARCH).lds $(OBJS) -o $@.elf
+libminios.a: $(OBJS)
+ ar r libminios.a $(HEAD) $(OBJS)
+
+$(TARGET): links libminios.a $(HEAD)
+ $(LD) -N -T minios-$(TARGET_ARCH).lds $(HEAD) -L. -lminios -o $@.elf
gzip -f -9 -c $@.elf >$@.gz
clean:
find . -type f -name '*.o' | xargs rm -f
rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
+ rm -f libminios.a
find . -type l | xargs rm -f
%.o: %.c $(HDRS) Makefile
diff -r 61d87e0b0ea7 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c Sun May 14 16:33:10 2006 +0200
+++ b/extras/mini-os/kernel.c Mon May 15 15:06:35 2006 +0200
@@ -88,6 +88,7 @@ static void init_xs(void *ign)
/*
* INITIAL C ENTRY POINT.
*/
+extern int main(void);
void start_kernel(start_info_t *si)
{
static char hello[] = "Bootstrapping...\n";
@@ -146,6 +147,8 @@ void start_kernel(start_info_t *si)
/* Init XenBus from a separate thread */
create_thread("init_xs", init_xs, NULL);
+
+ main();
/* Everything initialised, start idle thread */
run_idle_thread();
diff -r 61d87e0b0ea7 extras/mini-os/dummymain.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/dummymain.c Mon May 15 15:06:35 2006 +0200
@@ -0,0 +1,8 @@
+#include <types.h>
+#include <lib.h>
+
+__attribute__((weak)) int main(void)
+{
+ printk("using dummy main.\n");
+ return 0;
+}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] Integrating applications into Mini-OS
2006-05-15 13:08 ` Jacob Gorm Hansen
@ 2006-05-15 13:20 ` Jacob Gorm Hansen
[not found] ` <ogtpsifqtkz.fsf@divan.mitre.org>
1 sibling, 0 replies; 12+ messages in thread
From: Jacob Gorm Hansen @ 2006-05-15 13:20 UTC (permalink / raw)
To: Ian Campbell; +Cc: John D. Ramsdell, xen-devel
[-- Attachment #1: Type: text/plain, Size: 679 bytes --]
On 5/15/06, Jacob Gorm Hansen <jacobg@diku.dk> wrote:
> On 5/15/06, Ian Campbell <Ian.Campbell@xensource.com> wrote:
> > On Mon, 2006-05-15 at 14:18 +0200, Jacob Gorm Hansen wrote:
> > > I have attached a small patch to mini-os which ... adds a dummy main
> >
> > Should it be marked with __attribute__((weak))?
>
> Probably a good idea, makes link order less important. Revised patch
> is attached.
One more change: When providing one's own linker script (e.g. for
changing the memory layout, my boot loader cannot exist at 0xc0000000
but likes to live at 0x0), use &_text for the VIRT_START constant
instead of hardcoded value.
New version attached.
Jacob
[-- Attachment #2: miniosappsupport --]
[-- Type: application/octet-stream, Size: 3263 bytes --]
Signed-off-by: Jacob Gorm Hansen <jacobg@diku.dk>
diff -r 61d87e0b0ea7 extras/mini-os/Makefile
--- a/extras/mini-os/Makefile Sun May 14 16:33:10 2006 +0200
+++ b/extras/mini-os/Makefile Mon May 15 15:16:20 2006 +0200
@@ -28,7 +28,7 @@ endif
TARGET := mini-os
-OBJS := $(TARGET_ARCH).o
+HEAD := $(TARGET_ARCH).o
OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
@@ -42,13 +42,17 @@ links:
links:
[ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
-$(TARGET): links $(OBJS)
- $(LD) -N -T minios-$(TARGET_ARCH).lds $(OBJS) -o $@.elf
+libminios.a: $(OBJS)
+ ar r libminios.a $(HEAD) $(OBJS)
+
+$(TARGET): links libminios.a $(HEAD)
+ $(LD) -N -T minios-$(TARGET_ARCH).lds $(HEAD) -L. -lminios -o $@.elf
gzip -f -9 -c $@.elf >$@.gz
clean:
find . -type f -name '*.o' | xargs rm -f
rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
+ rm -f libminios.a
find . -type l | xargs rm -f
%.o: %.c $(HDRS) Makefile
diff -r 61d87e0b0ea7 extras/mini-os/include/mm.h
--- a/extras/mini-os/include/mm.h Sun May 14 16:33:10 2006 +0200
+++ b/extras/mini-os/include/mm.h Mon May 15 15:16:20 2006 +0200
@@ -130,6 +130,7 @@
#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
extern unsigned long *phys_to_machine_mapping;
+extern char _text, _etext, _edata, _end;
#define pfn_to_mfn(_pfn) (phys_to_machine_mapping[(_pfn)])
static __inline__ unsigned long phys_to_machine(unsigned long phys)
{
@@ -147,11 +148,7 @@ static __inline__ unsigned long machine_
return phys;
}
-#if defined(__x86_64__)
-#define VIRT_START 0xFFFFFFFF00000000UL
-#elif defined(__i386__)
-#define VIRT_START 0xC0000000UL
-#endif
+#define VIRT_START ((unsigned long)&_text)
#define to_phys(x) ((unsigned long)(x)-VIRT_START)
#define to_virt(x) ((void *)((unsigned long)(x)+VIRT_START))
diff -r 61d87e0b0ea7 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c Sun May 14 16:33:10 2006 +0200
+++ b/extras/mini-os/kernel.c Mon May 15 15:16:20 2006 +0200
@@ -88,6 +88,7 @@ static void init_xs(void *ign)
/*
* INITIAL C ENTRY POINT.
*/
+extern int main(void);
void start_kernel(start_info_t *si)
{
static char hello[] = "Bootstrapping...\n";
@@ -146,6 +147,8 @@ void start_kernel(start_info_t *si)
/* Init XenBus from a separate thread */
create_thread("init_xs", init_xs, NULL);
+
+ main();
/* Everything initialised, start idle thread */
run_idle_thread();
diff -r 61d87e0b0ea7 extras/mini-os/mm.c
--- a/extras/mini-os/mm.c Sun May 14 16:33:10 2006 +0200
+++ b/extras/mini-os/mm.c Mon May 15 15:16:20 2006 +0200
@@ -50,7 +50,6 @@
unsigned long *phys_to_machine_mapping;
extern char *stack;
-extern char _text, _etext, _edata, _end;
extern void page_walk(unsigned long virt_addr);
/*********************
diff -r 61d87e0b0ea7 extras/mini-os/dummymain.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/dummymain.c Mon May 15 15:16:20 2006 +0200
@@ -0,0 +1,8 @@
+#include <types.h>
+#include <lib.h>
+
+__attribute__((weak)) int main(void)
+{
+ printk("using dummy main.\n");
+ return 0;
+}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread[parent not found: <ogtpsifqtkz.fsf@divan.mitre.org>]
* Re: [PATCH] Integrating applications into Mini-OS
[not found] ` <ogtpsifqtkz.fsf@divan.mitre.org>
@ 2006-05-15 14:40 ` Jacob Gorm Hansen
2006-05-15 14:45 ` John D. Ramsdell
2006-05-15 15:09 ` John D. Ramsdell
0 siblings, 2 replies; 12+ messages in thread
From: Jacob Gorm Hansen @ 2006-05-15 14:40 UTC (permalink / raw)
To: John D. Ramsdell; +Cc: xen-devel, Ian Campbell
[-- Attachment #1: Type: text/plain, Size: 621 bytes --]
On 15 May 2006 09:57:16 -0400, John D. Ramsdell <ramsdell@mitre.org> wrote:
> I didn't want to say this on the list, but another feature about the
> patch I submitted is I cleaned up various problems with the Makefile.
> It adds CPPFLAGS and ASFLAGS, for example, and its use of LDFLAGS is
> broken. Please apply my patch to the base Makefile, and then make
> your changes. Submit the combined patch to the list. Let's use this
> opportunity to fix many problems at once. Gregor will appreciate a
> well thought out change.
New version incorporating most of your changes to the Makefile attached.
Jacob
[-- Attachment #2: miniosappsupport-unstable --]
[-- Type: application/octet-stream, Size: 4613 bytes --]
diff -r cb70d4f8d718 extras/mini-os/Makefile
--- a/extras/mini-os/Makefile Mon May 15 07:51:07 2006 +0100
+++ b/extras/mini-os/Makefile Mon May 15 16:38:40 2006 +0200
@@ -6,18 +6,23 @@ override TARGET_ARCH := $(XEN_TARGET
override TARGET_ARCH := $(XEN_TARGET_ARCH)
# NB. '-Wcast-qual' is nasty, so I omitted it.
-CFLAGS := -fno-builtin -Wall -Werror -Iinclude/ -Wredundant-decls -Wno-format
+CFLAGS := -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format
CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
+
+override CPPFLAGS := -Iinclude $(CPPFLAGS)
+ASFLAGS = -D__ASSEMBLY__
+
+LDFLAGS := -N -T minios-$(TARGET_ARCH).lds
ifeq ($(TARGET_ARCH),x86_32)
CFLAGS += -m32 -march=i686
-LDFLAGS := -m elf_i386
+LDFLAGS += -m elf_i386
endif
ifeq ($(TARGET_ARCH),x86_64)
CFLAGS += -m64 -mno-red-zone -fpic -fno-reorder-blocks
CFLAGS += -fno-asynchronous-unwind-tables
-LDFLAGS := -m elf_x86_64
+LDFLAGS += -m elf_x86_64
endif
ifeq ($(debug),y)
@@ -28,12 +33,12 @@ endif
TARGET := mini-os
-OBJS := $(TARGET_ARCH).o
-OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
+HEAD := $(patsubst %.S,%.o,$(wildcard *$(TARGET_ARCH).S))
+OBJS := $(patsubst %.c,%.o,$(wildcard *.c))
OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
OBJS += $(patsubst %.c,%.o,$(wildcard console/*.c))
-
+
HDRS := $(wildcard include/*.h)
HDRS += $(wildcard include/xen/*.h)
@@ -44,21 +49,25 @@ links:
links:
[ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
-$(TARGET): links $(OBJS)
- $(LD) -N -T minios-$(TARGET_ARCH).lds $(OBJS) -o $@.elf
+libminios.a: $(OBJS) $(HEAD)
+ ar r libminios.a $(HEAD) $(OBJS)
+
+$(TARGET): links libminios.a $(HEAD)
+ $(LD) $(LDFLAGS) $(HEAD) -L. -lminios -o $@.elf
gzip -f -9 -c $@.elf >$@.gz
.PHONY: clean
clean:
find . -type f -name '*.o' | xargs rm -f
rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
+ rm -f libminios.a
find . -type l | xargs rm -f
%.o: %.c $(HDRS) Makefile
- $(CC) $(CFLAGS) -c $< -o $@
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
%.o: %.S $(HDRS) Makefile
- $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@
+ $(CC) $(ASFLAGS) $(CPPFLAGS) -c $< -o $@
define all_sources
( find . -follow -name SCCS -prune -o -name '*.[chS]' -print )
diff -r cb70d4f8d718 extras/mini-os/include/mm.h
--- a/extras/mini-os/include/mm.h Mon May 15 07:51:07 2006 +0100
+++ b/extras/mini-os/include/mm.h Mon May 15 16:38:40 2006 +0200
@@ -130,6 +130,7 @@
#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
extern unsigned long *phys_to_machine_mapping;
+extern char _text, _etext, _edata, _end;
#define pfn_to_mfn(_pfn) (phys_to_machine_mapping[(_pfn)])
static __inline__ unsigned long phys_to_machine(unsigned long phys)
{
@@ -147,11 +148,7 @@ static __inline__ unsigned long machine_
return phys;
}
-#if defined(__x86_64__)
-#define VIRT_START 0xFFFFFFFF80000000UL
-#elif defined(__i386__)
-#define VIRT_START 0xC0000000UL
-#endif
+#define VIRT_START ((unsigned long)&_text)
#define to_phys(x) ((unsigned long)(x)-VIRT_START)
#define to_virt(x) ((void *)((unsigned long)(x)+VIRT_START))
diff -r cb70d4f8d718 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c Mon May 15 07:51:07 2006 +0100
+++ b/extras/mini-os/kernel.c Mon May 15 16:38:40 2006 +0200
@@ -110,6 +110,7 @@ void setup_xen_features(void)
/*
* INITIAL C ENTRY POINT.
*/
+extern int app_main(start_info_t *);
void start_kernel(start_info_t *si)
{
static char hello[] = "Bootstrapping...\n";
@@ -171,6 +172,10 @@ void start_kernel(start_info_t *si)
/* Init XenBus from a separate thread */
create_thread("init_xs", init_xs, NULL);
+ /* Call (possibly overridden) main() */
+
+ app_main(&start_info);
+
/* Everything initialised, start idle thread */
run_idle_thread();
}
diff -r cb70d4f8d718 extras/mini-os/mm.c
--- a/extras/mini-os/mm.c Mon May 15 07:51:07 2006 +0100
+++ b/extras/mini-os/mm.c Mon May 15 16:38:40 2006 +0200
@@ -50,7 +50,6 @@
unsigned long *phys_to_machine_mapping;
extern char *stack;
-extern char _text, _etext, _edata, _end;
extern void page_walk(unsigned long virt_addr);
/*********************
diff -r cb70d4f8d718 extras/mini-os/dummymain.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/dummymain.c Mon May 15 16:38:40 2006 +0200
@@ -0,0 +1,8 @@
+#include <types.h>
+#include <lib.h>
+
+__attribute__((weak)) int app_main(void)
+{
+ printk("using dummy main.\n");
+ return 0;
+}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] Integrating applications into Mini-OS
2006-05-15 14:40 ` Jacob Gorm Hansen
@ 2006-05-15 14:45 ` John D. Ramsdell
2006-05-15 15:09 ` John D. Ramsdell
1 sibling, 0 replies; 12+ messages in thread
From: John D. Ramsdell @ 2006-05-15 14:45 UTC (permalink / raw)
To: Jacob Gorm Hansen; +Cc: xen-devel, Ian Campbell
"Jacob Gorm Hansen" <jacobg@diku.dk> writes:
> New version incorporating most of your changes to the Makefile
> attached.
Thank you very much. The change is very important to me because I
depend on an overridable CPPFLAGS, so that I can define -DHAVE_LIBC
when compiling lib/printf.c and lib/string.c. This is how I slip in
the full blown C library newlib.
John
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Integrating applications into Mini-OS
2006-05-15 14:40 ` Jacob Gorm Hansen
2006-05-15 14:45 ` John D. Ramsdell
@ 2006-05-15 15:09 ` John D. Ramsdell
2006-05-15 15:15 ` Jacob Gorm Hansen
1 sibling, 1 reply; 12+ messages in thread
From: John D. Ramsdell @ 2006-05-15 15:09 UTC (permalink / raw)
To: Jacob Gorm Hansen; +Cc: xen-devel, Ian Campbell
"Jacob Gorm Hansen" <jacobg@diku.dk> writes:
> New version incorporating most of your changes to the Makefile
> attached.
Opps. I just noticed you took one line too much of my Makefile
patch. This part
-OBJS := $(TARGET_ARCH).o
-OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
+HEAD := $(patsubst %.S,%.o,$(wildcard *$(TARGET_ARCH).S))
+OBJS := $(patsubst %.c,%.o,$(wildcard *.c))
should be replaced with
-OBJS := $(TARGET_ARCH).o
-OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
+HEAD := $(TARGET_ARCH).o
+OBJS := $(patsubst %.c,%.o,$(wildcard *.c))
as with your scheme, I no longer have to add my assembly routine that
provides setjmp and longjmp into the Mini-OS source tree.
John
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Integrating applications into Mini-OS
2006-05-15 15:09 ` John D. Ramsdell
@ 2006-05-15 15:15 ` Jacob Gorm Hansen
0 siblings, 0 replies; 12+ messages in thread
From: Jacob Gorm Hansen @ 2006-05-15 15:15 UTC (permalink / raw)
To: John D. Ramsdell; +Cc: xen-devel, Ian Campbell
[-- Attachment #1: Type: text/plain, Size: 355 bytes --]
On 15 May 2006 11:09:10 -0400, John D. Ramsdell <ramsdell@mitre.org> wrote:
> "Jacob Gorm Hansen" <jacobg@diku.dk> writes:
>
> > New version incorporating most of your changes to the Makefile
> > attached.
>
> Opps. I just noticed you took one line too much of my Makefile
> patch. This part
Fine, new version of the patch attached.
Jacob
[-- Attachment #2: miniosappsupport-unstable --]
[-- Type: application/octet-stream, Size: 4580 bytes --]
diff -r cb70d4f8d718 extras/mini-os/Makefile
--- a/extras/mini-os/Makefile Mon May 15 07:51:07 2006 +0100
+++ b/extras/mini-os/Makefile Mon May 15 17:13:18 2006 +0200
@@ -6,18 +6,23 @@ override TARGET_ARCH := $(XEN_TARGET
override TARGET_ARCH := $(XEN_TARGET_ARCH)
# NB. '-Wcast-qual' is nasty, so I omitted it.
-CFLAGS := -fno-builtin -Wall -Werror -Iinclude/ -Wredundant-decls -Wno-format
+CFLAGS := -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format
CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
+
+override CPPFLAGS := -Iinclude $(CPPFLAGS)
+ASFLAGS = -D__ASSEMBLY__
+
+LDFLAGS := -N -T minios-$(TARGET_ARCH).lds
ifeq ($(TARGET_ARCH),x86_32)
CFLAGS += -m32 -march=i686
-LDFLAGS := -m elf_i386
+LDFLAGS += -m elf_i386
endif
ifeq ($(TARGET_ARCH),x86_64)
CFLAGS += -m64 -mno-red-zone -fpic -fno-reorder-blocks
CFLAGS += -fno-asynchronous-unwind-tables
-LDFLAGS := -m elf_x86_64
+LDFLAGS += -m elf_x86_64
endif
ifeq ($(debug),y)
@@ -28,12 +33,12 @@ endif
TARGET := mini-os
-OBJS := $(TARGET_ARCH).o
-OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
+HEAD := $(TARGET_ARCH).o
+OBJS := $(patsubst %.c,%.o,$(wildcard *.c))
OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
OBJS += $(patsubst %.c,%.o,$(wildcard console/*.c))
-
+
HDRS := $(wildcard include/*.h)
HDRS += $(wildcard include/xen/*.h)
@@ -44,21 +49,25 @@ links:
links:
[ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
-$(TARGET): links $(OBJS)
- $(LD) -N -T minios-$(TARGET_ARCH).lds $(OBJS) -o $@.elf
+libminios.a: $(OBJS) $(HEAD)
+ ar r libminios.a $(HEAD) $(OBJS)
+
+$(TARGET): links libminios.a $(HEAD)
+ $(LD) $(LDFLAGS) $(HEAD) -L. -lminios -o $@.elf
gzip -f -9 -c $@.elf >$@.gz
.PHONY: clean
clean:
find . -type f -name '*.o' | xargs rm -f
rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
+ rm -f libminios.a
find . -type l | xargs rm -f
%.o: %.c $(HDRS) Makefile
- $(CC) $(CFLAGS) -c $< -o $@
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
%.o: %.S $(HDRS) Makefile
- $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@
+ $(CC) $(ASFLAGS) $(CPPFLAGS) -c $< -o $@
define all_sources
( find . -follow -name SCCS -prune -o -name '*.[chS]' -print )
diff -r cb70d4f8d718 extras/mini-os/include/mm.h
--- a/extras/mini-os/include/mm.h Mon May 15 07:51:07 2006 +0100
+++ b/extras/mini-os/include/mm.h Mon May 15 17:13:18 2006 +0200
@@ -130,6 +130,7 @@
#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
extern unsigned long *phys_to_machine_mapping;
+extern char _text, _etext, _edata, _end;
#define pfn_to_mfn(_pfn) (phys_to_machine_mapping[(_pfn)])
static __inline__ unsigned long phys_to_machine(unsigned long phys)
{
@@ -147,11 +148,7 @@ static __inline__ unsigned long machine_
return phys;
}
-#if defined(__x86_64__)
-#define VIRT_START 0xFFFFFFFF80000000UL
-#elif defined(__i386__)
-#define VIRT_START 0xC0000000UL
-#endif
+#define VIRT_START ((unsigned long)&_text)
#define to_phys(x) ((unsigned long)(x)-VIRT_START)
#define to_virt(x) ((void *)((unsigned long)(x)+VIRT_START))
diff -r cb70d4f8d718 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c Mon May 15 07:51:07 2006 +0100
+++ b/extras/mini-os/kernel.c Mon May 15 17:13:18 2006 +0200
@@ -110,6 +110,7 @@ void setup_xen_features(void)
/*
* INITIAL C ENTRY POINT.
*/
+extern int app_main(start_info_t *);
void start_kernel(start_info_t *si)
{
static char hello[] = "Bootstrapping...\n";
@@ -171,6 +172,10 @@ void start_kernel(start_info_t *si)
/* Init XenBus from a separate thread */
create_thread("init_xs", init_xs, NULL);
+ /* Call (possibly overridden) main() */
+
+ app_main(&start_info);
+
/* Everything initialised, start idle thread */
run_idle_thread();
}
diff -r cb70d4f8d718 extras/mini-os/mm.c
--- a/extras/mini-os/mm.c Mon May 15 07:51:07 2006 +0100
+++ b/extras/mini-os/mm.c Mon May 15 17:13:18 2006 +0200
@@ -50,7 +50,6 @@
unsigned long *phys_to_machine_mapping;
extern char *stack;
-extern char _text, _etext, _edata, _end;
extern void page_walk(unsigned long virt_addr);
/*********************
diff -r cb70d4f8d718 extras/mini-os/dummymain.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/dummymain.c Mon May 15 17:13:18 2006 +0200
@@ -0,0 +1,8 @@
+#include <types.h>
+#include <lib.h>
+
+__attribute__((weak)) int app_main(void)
+{
+ printk("using dummy main.\n");
+ return 0;
+}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Integrating applications into Mini-OS
2006-05-15 12:18 ` Jacob Gorm Hansen
2006-05-15 12:46 ` Ian Campbell
@ 2006-05-15 13:45 ` John D. Ramsdell
1 sibling, 0 replies; 12+ messages in thread
From: John D. Ramsdell @ 2006-05-15 13:45 UTC (permalink / raw)
To: Jacob Gorm Hansen; +Cc: xen-devel, Grzegorz Milos
"Jacob Gorm Hansen" <jacobg@diku.dk> writes:
> I have attached a small patch to mini-os which changes the mini-os
> Makefile and adds a dummy main function which you can override by
> linking with your own main() first, as in:
The primary goal of my patch is to change the Mini-OS sources so that
one need not modify source files in the Mini-OS distribution to add an
application. I'm not wedded to the particulars of my patch, however,
your patch is insufficient for my goals. You see, sometimes one wants
to build Mini-OS using the newlib C library, and sometimes one wants
to build Mini-OS so it uses only the subset of the C library that
comes with Mini-OS. I really need #if !defined HAVE_LIBC preprocessor
commands to be added to lib/printf.c and lib/string.c.
John
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH] Integrating applications into Mini-OS
@ 2006-05-15 13:33 Puthiyaparambil, Aravindh
2006-05-15 14:12 ` Jacob Gorm Hansen
0 siblings, 1 reply; 12+ messages in thread
From: Puthiyaparambil, Aravindh @ 2006-05-15 13:33 UTC (permalink / raw)
To: Jacob Gorm Hansen, Ian Campbell
Cc: John D. Ramsdell, xen-devel, Grzegorz Milos
This seems like a really good idea. I have been meaning to fix
VIRT_START. I see your patch shows
-#define VIRT_START 0xFFFFFFFF00000000UL
I remember changing this to 0xFFFFFFFF80000000UL. Are you diffing
against the latest changeset? Could you please check if this works on
x86_64 too?
Thanks,
Aravindh
> -----Original Message-----
> From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-
> bounces@lists.xensource.com] On Behalf Of Jacob Gorm Hansen
> Sent: Monday, May 15, 2006 9:21 AM
> To: Ian Campbell
> Cc: John D. Ramsdell; xen-devel@lists.xensource.com
> Subject: Re: [Xen-devel] [PATCH] Integrating applications into Mini-OS
>
> On 5/15/06, Jacob Gorm Hansen <jacobg@diku.dk> wrote:
> > On 5/15/06, Ian Campbell <Ian.Campbell@xensource.com> wrote:
> > > On Mon, 2006-05-15 at 14:18 +0200, Jacob Gorm Hansen wrote:
> > > > I have attached a small patch to mini-os which ... adds a dummy
main
> > >
> > > Should it be marked with __attribute__((weak))?
> >
> > Probably a good idea, makes link order less important. Revised patch
> > is attached.
>
> One more change: When providing one's own linker script (e.g. for
> changing the memory layout, my boot loader cannot exist at 0xc0000000
> but likes to live at 0x0), use &_text for the VIRT_START constant
> instead of hardcoded value.
>
> New version attached.
>
> Jacob
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Integrating applications into Mini-OS
2006-05-15 13:33 Puthiyaparambil, Aravindh
@ 2006-05-15 14:12 ` Jacob Gorm Hansen
0 siblings, 0 replies; 12+ messages in thread
From: Jacob Gorm Hansen @ 2006-05-15 14:12 UTC (permalink / raw)
To: Puthiyaparambil, Aravindh
Cc: John D. Ramsdell, xen-devel, Grzegorz Milos, Ian Campbell
[-- Attachment #1: Type: text/plain, Size: 772 bytes --]
On 5/15/06, Puthiyaparambil, Aravindh
<aravindh.puthiyaparambil@unisys.com> wrote:
> This seems like a really good idea. I have been meaning to fix
> VIRT_START. I see your patch shows
> -#define VIRT_START 0xFFFFFFFF00000000UL
> I remember changing this to 0xFFFFFFFF80000000UL. Are you diffing
> against the latest changeset? Could you please check if this works on
> x86_64 too?
Hmm no I was on xen-3.0-testing.hg, sorry. Also, I do not have access
to other than vanilla x86 machines :-( However, looking at the linker
script for x86_64 I cannot see why this would not work.
I have attached the patch updated for unstable. This time I also pass
the copied start_info as a parameter to main(), though the dummy
main() ignores it.
Jacob
[-- Attachment #2: miniosappsupport-unstable --]
[-- Type: application/octet-stream, Size: 3341 bytes --]
Signed-off-by: Jacob Gorm Hansen <jacobg@diku.dk>
diff -r cb70d4f8d718 extras/mini-os/Makefile
--- a/extras/mini-os/Makefile Mon May 15 07:51:07 2006 +0100
+++ b/extras/mini-os/Makefile Mon May 15 16:07:14 2006 +0200
@@ -28,7 +28,7 @@ endif
TARGET := mini-os
-OBJS := $(TARGET_ARCH).o
+HEAD := $(TARGET_ARCH).o
OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
OBJS += $(patsubst %.c,%.o,$(wildcard lib/*.c))
OBJS += $(patsubst %.c,%.o,$(wildcard xenbus/*.c))
@@ -44,14 +44,18 @@ links:
links:
[ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
-$(TARGET): links $(OBJS)
- $(LD) -N -T minios-$(TARGET_ARCH).lds $(OBJS) -o $@.elf
+libminios.a: $(OBJS)
+ ar r libminios.a $(HEAD) $(OBJS)
+
+$(TARGET): links libminios.a $(HEAD)
+ $(LD) -N -T minios-$(TARGET_ARCH).lds $(HEAD) -L. -lminios -o $@.elf
gzip -f -9 -c $@.elf >$@.gz
.PHONY: clean
clean:
find . -type f -name '*.o' | xargs rm -f
rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
+ rm -f libminios.a
find . -type l | xargs rm -f
%.o: %.c $(HDRS) Makefile
diff -r cb70d4f8d718 extras/mini-os/include/mm.h
--- a/extras/mini-os/include/mm.h Mon May 15 07:51:07 2006 +0100
+++ b/extras/mini-os/include/mm.h Mon May 15 16:07:14 2006 +0200
@@ -130,6 +130,7 @@
#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
extern unsigned long *phys_to_machine_mapping;
+extern char _text, _etext, _edata, _end;
#define pfn_to_mfn(_pfn) (phys_to_machine_mapping[(_pfn)])
static __inline__ unsigned long phys_to_machine(unsigned long phys)
{
@@ -147,11 +148,7 @@ static __inline__ unsigned long machine_
return phys;
}
-#if defined(__x86_64__)
-#define VIRT_START 0xFFFFFFFF80000000UL
-#elif defined(__i386__)
-#define VIRT_START 0xC0000000UL
-#endif
+#define VIRT_START ((unsigned long)&_text)
#define to_phys(x) ((unsigned long)(x)-VIRT_START)
#define to_virt(x) ((void *)((unsigned long)(x)+VIRT_START))
diff -r cb70d4f8d718 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c Mon May 15 07:51:07 2006 +0100
+++ b/extras/mini-os/kernel.c Mon May 15 16:07:14 2006 +0200
@@ -110,6 +110,7 @@ void setup_xen_features(void)
/*
* INITIAL C ENTRY POINT.
*/
+extern int main(start_info_t *);
void start_kernel(start_info_t *si)
{
static char hello[] = "Bootstrapping...\n";
@@ -171,6 +172,10 @@ void start_kernel(start_info_t *si)
/* Init XenBus from a separate thread */
create_thread("init_xs", init_xs, NULL);
+ /* Call (possibly overridden) main() */
+
+ main(&start_info);
+
/* Everything initialised, start idle thread */
run_idle_thread();
}
diff -r cb70d4f8d718 extras/mini-os/mm.c
--- a/extras/mini-os/mm.c Mon May 15 07:51:07 2006 +0100
+++ b/extras/mini-os/mm.c Mon May 15 16:07:14 2006 +0200
@@ -50,7 +50,6 @@
unsigned long *phys_to_machine_mapping;
extern char *stack;
-extern char _text, _etext, _edata, _end;
extern void page_walk(unsigned long virt_addr);
/*********************
diff -r cb70d4f8d718 extras/mini-os/dummymain.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/dummymain.c Mon May 15 16:07:14 2006 +0200
@@ -0,0 +1,8 @@
+#include <types.h>
+#include <lib.h>
+
+__attribute__((weak)) int main(void)
+{
+ printk("using dummy main.\n");
+ return 0;
+}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2006-05-15 15:15 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-11 16:34 [PATCH] Integrating applications into Mini-OS John D. Ramsdell
2006-05-15 12:18 ` Jacob Gorm Hansen
2006-05-15 12:46 ` Ian Campbell
2006-05-15 13:08 ` Jacob Gorm Hansen
2006-05-15 13:20 ` Jacob Gorm Hansen
[not found] ` <ogtpsifqtkz.fsf@divan.mitre.org>
2006-05-15 14:40 ` Jacob Gorm Hansen
2006-05-15 14:45 ` John D. Ramsdell
2006-05-15 15:09 ` John D. Ramsdell
2006-05-15 15:15 ` Jacob Gorm Hansen
2006-05-15 13:45 ` John D. Ramsdell
-- strict thread matches above, loose matches on Subject: below --
2006-05-15 13:33 Puthiyaparambil, Aravindh
2006-05-15 14:12 ` Jacob Gorm Hansen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.