From: ramsdell@mitre.org (John D. Ramsdell)
To: xen-devel@lists.xensource.com
Subject: [PATCH] Allow use of a C library in Mini-OS
Date: 19 May 2006 14:07:52 -0400 [thread overview]
Message-ID: <ogtd5e9opl3.fsf@divan.mitre.org> (raw)
In-Reply-To: <E1Fh7Rx-00087F-4v@host-192-168-0-1-bcn-london>
[-- Attachment #1: Type: text/plain, Size: 655 bytes --]
I noticed many improvements have been made to Mini-OS, and one can now
easily integrate an application into Mini-OS as long as the
application does not depend on a C library. My thanks go to those
responsible.
I'd like to make it so that the following command builds libminios.a
using a cross-compiler that provides a full C library.
$ $PATH=${COMP_HOME}/bin:$PATH make CPPFLAGS=-DHAVE_LIBC libminios.a
The enclosed patch makes small changes to three files. The Makefile
is changed so that the libminios.a target depends on the links target,
and lib/printf.c and lib/string.c are changed so their content is
omitted when HAVE_LIBC is defined.
John
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Allow use of a C library in Mini-OS --]
[-- Type: text/x-patch, Size: 2744 bytes --]
Only in xen-unstable/extras/mini-os/console: console.o
Only in xen-unstable/extras/mini-os/console: xencons_ring.o
Only in xen-unstable/extras/mini-os: events.o
Only in xen-unstable/extras/mini-os: hypervisor.o
Only in xen-unstable/extras/mini-os/include: xen
Only in xen-unstable/extras/mini-os: kernel.o
Only in xen-unstable/extras/mini-os/lib: math.o
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-19 01:02:48.000000000 -0400
+++ xen-unstable/extras/mini-os/lib/printf.c 2006-05-19 11:55:54.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~
Only in xen-unstable/extras/mini-os/lib: printf.o
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-19 01:02:48.000000000 -0400
+++ xen-unstable/extras/mini-os/lib/string.c 2006-05-19 11:56:11.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~
Only in xen-unstable/extras/mini-os/lib: string.o
Only in xen-unstable/extras/mini-os/lib: xmalloc.o
Only in xen-unstable/extras/mini-os: libminios.a
diff -ur oxen-unstable/extras/mini-os/Makefile xen-unstable/extras/mini-os/Makefile
--- oxen-unstable/extras/mini-os/Makefile 2006-05-19 01:02:47.000000000 -0400
+++ xen-unstable/extras/mini-os/Makefile 2006-05-19 12:04:54.000000000 -0400
@@ -12,6 +12,7 @@
override CPPFLAGS := -Iinclude $(CPPFLAGS)
ASFLAGS = -D__ASSEMBLY__
+LDLIBS = -L. -lminios
LDFLAGS := -N -T minios-$(TARGET_ARCH).lds
ifeq ($(TARGET_ARCH),x86_32)
@@ -49,11 +50,11 @@
links:
[ -e include/xen ] || ln -sf ../../../xen/include/public include/xen
-libminios.a: $(OBJS) $(HEAD)
+libminios.a: links $(OBJS) $(HEAD)
ar r libminios.a $(HEAD) $(OBJS)
$(TARGET): links libminios.a $(HEAD)
- $(LD) $(LDFLAGS) $(HEAD) -L. -lminios -o $@.elf
+ $(LD) $(LDFLAGS) $(HEAD) $(LDLIBS) -o $@.elf
gzip -f -9 -c $@.elf >$@.gz
.PHONY: clean
Only in xen-unstable/extras/mini-os: mm.o
Only in xen-unstable/extras/mini-os: sched.o
Only in xen-unstable/extras/mini-os: time.o
Only in xen-unstable/extras/mini-os: traps.o
Only in xen-unstable/extras/mini-os: x86_32.o
Only in xen-unstable/extras/mini-os/xenbus: xenbus.o
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
parent reply other threads:[~2006-05-19 18:07 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <E1Fh7Rx-00087F-4v@host-192-168-0-1-bcn-london>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ogtd5e9opl3.fsf@divan.mitre.org \
--to=ramsdell@mitre.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.