[Top][All Lists]

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

RFC: PowerPC support for laden

From: Johan Rydberg
Subject: RFC: PowerPC support for laden
Date: Tue, 30 Sep 2003 03:05:35 +0200


This is not a finished patch yet, but I would really like some 
comments on the code (ams, are you out there?) before I submit
a full patch with ChangeLog entries and all.

The patches needed are inlined in this mail, but all new files
is attached.  There are two patches needed, one for the laden
directory, and one for the top directory (just the configure.ac

Some notes: The PowerPC platform doesn't currently have a 
bootloader that supports modules (to my knowledge anyway), 
therefor all modules must be embedded into one single binary
which is loaded the the bootloader.  This binary, the piggyback,
must parse the embedded binaries and start them.  

The build-piggyback script does exactly what the name tells you:
it builds a finished piggyback binary from the laden binary and
a set of modules given to the script.

I've started porting wortel+physmem to PowerPC aswell, but 
they are far from done.

I hope I haven't missed anything now.  It's really time for bed.

Index: Makefile.am
RCS file: /cvsroot/hurd/hurd-l4/laden/Makefile.am,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile.am
--- Makefile.am 21 Sep 2003 18:12:46 -0000      1.8
+++ Makefile.am 30 Sep 2003 00:52:43 -0000
@@ -20,10 +20,20 @@
 AM_CPPFLAGS = -I$(top_builddir)/include
+# The build-piggyback script is only installed on PowerPC hosts
+  # FIXME noinst == bin?
+  noinst_SCRIPS = build-piggyback
 if ARCH_IA32
   ARCH_SOURCES = multiboot.h ia32-crt0.S ia32-cmain.c \
     ia32-output.c output-vga.c output-serial.c ia32-shutdown.c
+  ARCH_SOURCES = powerpc-crt0.S powerpc-cmain.c powerpc-output.c \
+  output-of.c powerpc-shutdown.c
 noinst_PROGRAMS = laden
@@ -37,6 +47,11 @@ laden_SOURCES =  $(ARCH_SOURCES)                             
        laden.h laden.c kip-fixup.c
 /* FIXME: Make linkbase configurable.  */
-laden_LDFLAGS = -u_start -e_start -N -nostdlib -Ttext=0x180000
+if ARCH_IA32
+  laden_LDFLAGS = -u_start -e_start -N -nostdlib -Ttext=0x180000
+  laden_LDFLAGS = -Wl,-r -u_start -e_start -nostdlib -Ttext=0x200000
 laden_LDADD = -lgcc ../libc-parts/libc-parts.a

Index: configure.ac
RCS file: /cvsroot/hurd/hurd-l4/configure.ac,v
retrieving revision 1.12
diff -u -p -r1.12 configure.ac
--- configure.ac        24 Sep 2003 20:32:42 -0000      1.12
+++ configure.ac        30 Sep 2003 00:53:31 -0000
@@ -38,6 +38,17 @@ AC_CHECK_TOOL([NM], [nm], :)
 AC_PATH_PROG([SED], [sed], :)
 AC_PATH_PROG([SORT], [sort], :)
+# Check for linker used by compiler
+AC_MSG_CHECKING([for linker used by $CC])
+LD=`$CC -print-prog-name=ld`
+if test "x$LD" = "xld"; then
+  AC_MSG_RESULT([non found])
+  AC_MSG_ERROR([The compiler is insane])
 # Required for building the documentation
 AC_PATH_PROG([LATEX], [latex], no)
 if test "x$LATEX" = xno; then
@@ -97,6 +108,12 @@ m4_include([libhurd-cap/headers.m4])
 if test "x$missing_progs" != "x"; then
   AC_MSG_ERROR([The following programs were not found:$missing_progs])
+if test "$arch" = "powerpc"; then
+  AC_CONFIG_FILES([laden/build-piggyback])
+  AC_CONFIG_COMMANDS([x-mode-piggyback], 
+                     [chmod +x laden/build-piggyback])
 # Checks for library functions.

Attachment: build-piggyback.in
Description: Binary data

Attachment: output-of.c
Description: Binary data

Attachment: powerpc-cmain.c
Description: Binary data

Attachment: powerpc-crt0.S
Description: Binary data

Attachment: powerpc-output.c
Description: Binary data

Attachment: powerpc-shutdown.c
Description: Binary data

Attachment: ieee1275.h
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]