|
From: | Johan Rydberg |
Subject: | RFC: PowerPC support for laden |
Date: | Tue, 30 Sep 2003 03:05:35 +0200 |
Hi, 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 file.) 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 +if ARCH_POWERPC + # FIXME noinst == bin? + noinst_SCRIPS = build-piggyback +endif + 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 endif +if ARCH_POWERPC + ARCH_SOURCES = powerpc-crt0.S powerpc-cmain.c powerpc-output.c \ + output-of.c powerpc-shutdown.c +endif 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 +endif +if ARCH_POWERPC + laden_LDFLAGS = -Wl,-r -u_start -e_start -nostdlib -Ttext=0x200000 +endif 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]) +else + AC_MSG_RESULT([$LD]) +fi +AC_SUBST(LD) + # 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]) +fi + +if test "$arch" = "powerpc"; then + AC_CONFIG_FILES([laden/build-piggyback]) + AC_CONFIG_COMMANDS([x-mode-piggyback], + [chmod +x laden/build-piggyback]) fi # Checks for library functions.
build-piggyback.in
Description: Binary data
output-of.c
Description: Binary data
powerpc-cmain.c
Description: Binary data
powerpc-crt0.S
Description: Binary data
powerpc-output.c
Description: Binary data
powerpc-shutdown.c
Description: Binary data
ieee1275.h
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |