diff -urN linux-1.2.0/Configure linux/Configure --- linux-1.2.0/Configure Thu Dec 29 12:58:40 1994 +++ linux/Configure Sun Mar 12 14:10:00 1995 @@ -21,7 +21,7 @@ # better string handling, but alas, bash is the only scripting language # that I can be reasonable sure everybody has on their linux machine. # -[ -z "$BASH" ] && { echo "Configure requires bash" 1>&2; exit 1; } +[ -z "$BASH" ] && exec bash $0 "$@" # Disable filename globbing once and for all. # Enable function cacheing. diff -urN linux-1.2.0/Makefile linux/Makefile --- linux-1.2.0/Makefile Tue Mar 7 10:50:24 1995 +++ linux/Makefile Tue Mar 14 20:45:01 1995 @@ -11,15 +11,20 @@ else echo sh; fi ; fi) TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) -AS =as -LD =ld -HOSTCC =gcc -I$(TOPDIR)/include -CC =gcc -D__KERNEL__ -I$(TOPDIR)/include -MAKE =make -CPP =$(CC) -E -AR =ar -NM =nm -STRIP =strip +# To cross-compile a kernel, uncomment the CROSS_PREFIX line and put +# the path to the cross-compiler & utils here. It must end with a / +CROSS_PREFIX = /tmp/linux/bin/ + +AS = $(CROSS_PREFIX)as +LD = $(CROSS_PREFIX)ld +HOSTCC = gcc -I$(TOPDIR)/include +CC = $(CROSS_PREFIX)gcc -I$(TOPDIR)/include -D__KERNEL__ +MAKE = make +CPP = $(CC) -E +AR = $(CROSS_PREFIX)ar +NM = $(CROSS_PREFIX)nm +STRIP = $(CROSS_PREFIX)strip +RANLIB = $(CROSS_PREFIX)ranlib all: do-it-all @@ -129,7 +134,7 @@ symlinks: rm -f include/asm - ( cd include ; ln -sf asm-$(ARCH) asm) + ( cd include ; ln -s asm-$(ARCH) asm) oldconfig: symlinks $(CONFIG_SHELL) Configure -d arch/$(ARCH)/config.in @@ -164,7 +169,10 @@ else \ echo \#define LINUX_COMPILE_DOMAIN \"`domainname`\"; \ fi >> include/linux/version.h - @echo \#define LINUX_COMPILER \"`$(HOSTCC) -v 2>&1 | tail -1`\" >> include/linux/version.h + @echo \#define LINUX_COMPILER \"`$(CC) -v 2>&1 | tail -1`\" >> include/linux/version.h + @if [ \! \"$(CROSS_PREFIX)\" = \"\" ]; then \ + echo \#define LINUX_HOST_COMPILER \"`$(HOSTCC) -v 2>&1 | tail -1`\"; \ + fi >> include/linux/version.h @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> include/linux/version.h init/version.o: init/version.c include/linux/version.h diff -urN linux-1.2.0/arch/i386/boot/Makefile linux/arch/i386/boot/Makefile --- linux-1.2.0/arch/i386/boot/Makefile Tue Jan 3 06:57:26 1995 +++ linux/arch/i386/boot/Makefile Sun Mar 12 14:30:48 1995 @@ -8,8 +8,8 @@ # Copyright (C) 1994 by Linus Torvalds # -AS86 =as86 -0 -a -LD86 =ld86 -0 +AS86 =$(CROSS_PREFIX)as86 -0 -a +LD86 =$(CROSS_PREFIX)ld86 -0 zImage: $(CONFIGURE) bootsect setup compressed/vmlinux tools/build tools/build bootsect setup compressed/vmlinux $(ROOT_DEV) > zImage @@ -32,7 +32,7 @@ sh ./install.sh $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) zImage $(TOPDIR)/System.map "$(INSTALL_PATH)" tools/build: tools/build.c - $(HOSTCC) $(CFLAGS) -o $@ $< -I$(TOPDIR)/include + $(HOSTCC) -DARCH_$(ARCH) -o $@ $< setup: setup.o $(LD86) -s -o $@ $< diff -urN linux-1.2.0/arch/i386/boot/compressed/Makefile linux/arch/i386/boot/compressed/Makefile --- linux-1.2.0/arch/i386/boot/compressed/Makefile Tue Jan 31 01:58:00 1995 +++ linux/arch/i386/boot/compressed/Makefile Sun Mar 12 14:10:00 1995 @@ -31,11 +31,11 @@ piggy.o: $(SYSTEM) xtract piggyback ./xtract $(SYSTEM) | gzip -9 | ./piggyback > piggy.o -xtract: xtract.c - $(HOSTCC) $(CFLAGS) -o xtract xtract.c +xtract: xtract.c ../tools/hostcvt.h + $(HOSTCC) $(CFLAGS) -DARCH_$(ARCH) -o $@ xtract.c -piggyback: piggyback.c - $(HOSTCC) $(CFLAGS) -o piggyback piggyback.c +piggyback: piggyback.c ../tools/hostcvt.h + $(HOSTCC) $(CFLAGS) -DARCH_$(ARCH) -o $@ piggyback.c clean: rm -f xtract piggyback vmlinux diff -urN linux-1.2.0/arch/i386/boot/compressed/piggyback.c linux/arch/i386/boot/compressed/piggyback.c --- linux-1.2.0/arch/i386/boot/compressed/piggyback.c Thu Dec 29 12:58:41 1994 +++ linux/arch/i386/boot/compressed/piggyback.c Sun Mar 12 14:10:01 1995 @@ -11,7 +11,8 @@ #include #include -#include +#include +#include "../tools/hostcvt.h" int main(int argc, char *argv[]) { @@ -31,6 +32,9 @@ } }; + hostcvt_init(); + var_names[0].n_un.n_strx=cvt_ul(var_names[0].n_un.n_strx,1); + var_names[1].n_un.n_strx=cvt_ul(var_names[1].n_un.n_strx,1); len = 0; while ((n = read(0, &tmp_buf[len], sizeof(tmp_buf)-len+1)) > 0) @@ -55,6 +59,7 @@ */ obj.a_data = len + sizeof(long); obj.a_syms = sizeof(var_names); + cvt_exec(&obj,1); write(1, (char *)&obj, sizeof(obj)); /* @@ -61,6 +66,7 @@ * Output data segment (compressed system & len) */ write(1, tmp_buf, len); + len=cvt_ul(len,1); write(1, (char *)&len, sizeof(len)); /* @@ -73,6 +79,7 @@ * Output string table */ len = sizeof(string_names) + sizeof(len); + len=cvt_ul(len,1); write(1, (char *)&len, sizeof(len)); write(1, string_names, sizeof(string_names)); diff -urN linux-1.2.0/arch/i386/boot/compressed/xtract.c linux/arch/i386/boot/compressed/xtract.c --- linux-1.2.0/arch/i386/boot/compressed/xtract.c Thu Jan 5 06:55:40 1995 +++ linux/arch/i386/boot/compressed/xtract.c Sun Mar 12 14:10:01 1995 @@ -15,7 +15,8 @@ #include #include /* contains read/write */ #include -#include +#include +#include "../tools/hostcvt.h" #define N_MAGIC_OFFSET 1024 @@ -43,6 +44,8 @@ struct exec *ex = (struct exec *)buf; + hostcvt_init(); + if (argc != 2) usage(); @@ -50,6 +53,7 @@ die("Unable to open 'system'"); if (read(id,buf,GCC_HEADER) != GCC_HEADER) die("Unable to read header of 'system'"); + cvt_exec(ex,0); if (N_MAGIC(*ex) == ZMAGIC) { GCC_HEADER = N_MAGIC_OFFSET; lseek(id, GCC_HEADER, SEEK_SET); diff -urN linux-1.2.0/arch/i386/boot/tools/build.c linux/arch/i386/boot/tools/build.c --- linux-1.2.0/arch/i386/boot/tools/build.c Thu Jan 5 10:29:01 1995 +++ linux/arch/i386/boot/tools/build.c Sun Mar 12 14:10:01 1995 @@ -30,6 +30,7 @@ #include #include #include +#include "hostcvt.h" #define MINIX_HEADER 32 @@ -94,6 +95,8 @@ struct stat sb; unsigned char setup_sectors; + hostcvt_init(); + if ((argc < 4) || (argc > 5)) usage(); if (argc > 4) { @@ -192,6 +195,7 @@ die("Unable to open 'system'"); if (read(id,buf,GCC_HEADER) != GCC_HEADER) die("Unable to read header of 'system'"); + cvt_exec(ex,0); if (N_MAGIC(*ex) == ZMAGIC) { GCC_HEADER = N_MAGIC_OFFSET; lseek(id, GCC_HEADER, SEEK_SET); diff -urN linux-1.2.0/arch/i386/boot/tools/hostcvt.h linux/arch/i386/boot/tools/hostcvt.h --- linux-1.2.0/arch/i386/boot/tools/hostcvt.h +++ linux/arch/i386/boot/tools/hostcvt.h Tue Mar 14 20:37:29 1995 @@ -0,0 +1,59 @@ +/* + * arch/i386/boot/tools/hostcvt.h + * + * Gerd Rausch - eedger@eed.ericsson.se + * + * This has functions used to correct for different endian host and + * target machines when cross compiling + * + * this file works for 32bit machines only + * + */ + +#include +#include + +#if defined(ARCH_i386) +#define DEST_ORDER 0x01020304 +static char dest_cp[]="\x01\x02\x03\x04"; +#else +#error "Please specify destination architecture" +#endif + +static unsigned long host_probe=0x04030201; +static char *host_cp=(char *)&host_probe; +static unsigned long host_order; + +static inline void hostcvt_init(void) +{ + char *cp=(char *)&host_probe; + host_order=cp[0]<<24|cp[1]<<16|cp[2]<<8||cp[3]; +} + +static inline unsigned long cvt_ul(unsigned long l,int export_it) +{ + char *dest,*src; + int i,j; + unsigned long result; + if(host_order==DEST_ORDER) + return l; + result=0; + src=(char *)&l; + dest=(char *)&result; + if(export_it) + for(i=0;i<4;i++) + dest[dest_cp[host_cp[i]-1]-1]=src[i]; + else + for(i=0;i<4;i++) + dest[host_cp[dest_cp[i]-1]-1]=src[i]; + return result; +} + +/* lets assume exec contains only 32 bit values */ +static inline void cvt_exec(struct exec *dst,int export_it) +{ + unsigned long *lp; + int i; + for(i=0,lp=(unsigned long *)dst;i ../../modules/NET_MODULES cd ../../modules; \ - for i in $(MODULES); do ln -sf ../drivers/net/$$i .; done + for i in $(MODULES); do ln -s ../drivers/net/$$i .; done else diff -urN linux-1.2.0/drivers/scsi/Makefile linux/drivers/scsi/Makefile --- linux-1.2.0/drivers/scsi/Makefile Mon Mar 6 04:22:09 1995 +++ linux/drivers/scsi/Makefile Sun Mar 12 14:10:01 1995 @@ -195,7 +195,7 @@ modules: $(SCSI_MODULE_OBJS) echo $(SCSI_MODULE_OBJS) > ../../modules/SCSI_MODULES - (cd ../../modules;for i in $(SCSI_MODULE_OBJS); do ln -sf ../drivers/scsi/$$i .; done) + (cd ../../modules;for i in $(SCSI_MODULE_OBJS); do ln -s ../drivers/scsi/$$i .; done) dep: $(CPP) -M $(AHA152X) $(SCSI_SRCS) > .depend diff -urN linux-1.2.0/drivers/sound/Makefile linux/drivers/sound/Makefile --- linux-1.2.0/drivers/sound/Makefile Fri Jan 13 10:25:07 1995 +++ linux/drivers/sound/Makefile Tue Mar 14 20:48:37 1995 @@ -22,6 +22,13 @@ sb16_midi.o sound_switch.o midi_synth.o uart6850.o sound_timer.o \ sys_timer.o ics2101.o ad1848.o pss.o +SRCS = soundcard.c audio.c dmabuf.c sb_dsp.c dev_table.c \ + opl3.c sequencer.c midibuf.c sb_card.c pas2_card.c adlib_card.c \ + pas2_pcm.c pas2_mixer.c pas2_midi.c gus_card.c gus_wave.c mpu401.c \ + gus_midi.c gus_vol.c patmgr.c sb_mixer.c sb16_dsp.c sb_midi.c \ + sb16_midi.c sound_switch.c midi_synth.c uart6850.c sound_timer.c \ + sys_timer.c ics2101.c ad1848.c pss.c + all: local.h sound.a /usr/include/sys/soundcard.h: @@ -47,7 +54,7 @@ $(MAKE) config $(MAKE) dep -config: configure /usr/include/sys/soundcard.h +config: configure @echo Compiling Sound Driver v $(VERSION) for Linux @./configure > local.h @echo \#define SOUND_VERSION_STRING \"$(VERSION)\" >> local.h @@ -63,13 +70,15 @@ clrconf: rm -f local.h .depend -configure: configure.c /usr/include/sys/soundcard.h - $(HOSTCC) -o configure configure.c +configure: configure.c + $(HOSTCC) -D$(TARGET_OS) -o configure configure.c @cat .blurb dep: - $(MAKE) /usr/include/sys/soundcard.h - $(CPP) -M *.c > .depend + @if [ \"$(CROSS_PREFIX) = \"\" ]; then \ + $(MAKE) /usr/include/sys/soundcard.h; \ + fi + $(CPP) -M $(OBJS) > .depend modules: diff -urN linux-1.2.0/drivers/sound/os.h linux/drivers/sound/os.h --- linux-1.2.0/drivers/sound/os.h Tue Aug 23 02:48:52 1994 +++ linux/drivers/sound/os.h Sun Mar 12 14:10:01 1995 @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include #include diff -urN linux-1.2.0/fs/Makefile linux/fs/Makefile --- linux-1.2.0/fs/Makefile Mon Jan 23 03:38:28 1995 +++ linux/fs/Makefile Sun Mar 12 14:10:02 1995 @@ -97,9 +97,9 @@ modules: $(MODULE_OBJS) for i in $(MODULE_FS_SUBDIRS); do $(MAKE) -C $$i modules; done - cd ../modules;for i in $(MODULE_OBJS); do ln -sf ../fs/$$i .; done + cd ../modules;for i in $(MODULE_OBJS); do ln -s ../fs/$$i .; done cd ../modules;for i in $(MODULE_FS_SUBDIRS); \ - do echo $$i.o; ln -sf ../fs/$$i/$$i.o .; done > ../modules/FS_MODULES + do echo $$i.o; ln -s ../fs/$$i/$$i.o .; done > ../modules/FS_MODULES depend dep: $(CPP) -M *.c > .depend diff -urN linux-1.2.0/fs/isofs/Makefile linux/fs/isofs/Makefile --- linux-1.2.0/fs/isofs/Makefile Tue Jan 10 10:02:17 1995 +++ linux/fs/isofs/Makefile Sun Mar 12 14:10:02 1995 @@ -20,7 +20,7 @@ $(LD) -r -o isofs.o $(OBJS) modules: isofs.o - ln -sf ../fs/isofs/isofs.o $(TOPDIR)/modules + ln -s ../fs/isofs/isofs.o $(TOPDIR)/modules dep: $(CPP) -M *.c > .depend diff -urN linux-1.2.0/fs/msdos/Makefile linux/fs/msdos/Makefile --- linux-1.2.0/fs/msdos/Makefile Tue Jan 10 10:02:18 1995 +++ linux/fs/msdos/Makefile Sun Mar 12 14:10:02 1995 @@ -20,7 +20,7 @@ $(LD) -r -o msdos.o $(OBJS) modules: msdos.o - ln -sf ../fs/msdos/msdos.o $(TOPDIR)/modules + ln -s ../fs/msdos/msdos.o $(TOPDIR)/modules dep: $(CPP) -M *.c > .depend diff -urN linux-1.2.0/fs/sysv/Makefile linux/fs/sysv/Makefile --- linux-1.2.0/fs/sysv/Makefile Tue Jan 10 10:02:18 1995 +++ linux/fs/sysv/Makefile Sun Mar 12 14:10:02 1995 @@ -21,7 +21,7 @@ $(LD) -r -o sysv.o $(OBJS) modules: sysv.o - ln -sf ../fs/sysv/sysv.o $(TOPDIR)/modules + ln -s ../fs/sysv/sysv.o $(TOPDIR)/modules dep: $(CPP) -M *.c > .depend diff -urN linux-1.2.0/fs/umsdos/Makefile linux/fs/umsdos/Makefile --- linux-1.2.0/fs/umsdos/Makefile Tue Jan 10 10:02:18 1995 +++ linux/fs/umsdos/Makefile Sun Mar 12 14:10:02 1995 @@ -21,7 +21,7 @@ $(LD) -r -o umsdos.o $(OBJS) modules: umsdos.o - ln -sf ../fs/umsdos/umsdos.o $(TOPDIR)/modules + ln -s ../fs/umsdos/umsdos.o $(TOPDIR)/modules clean: rm -f core *.o *.a *.s diff -urN linux-1.2.0/fs/xiafs/Makefile linux/fs/xiafs/Makefile --- linux-1.2.0/fs/xiafs/Makefile Tue Jan 10 10:02:18 1995 +++ linux/fs/xiafs/Makefile Sun Mar 12 14:10:02 1995 @@ -21,7 +21,7 @@ $(LD) -r -o xiafs.o $(OBJS) modules: xiafs.o - ln -sf ../fs/xiafs/xiafs.o $(TOPDIR)/modules + ln -s ../fs/xiafs/xiafs.o $(TOPDIR)/modules dep: $(CPP) -M *.c > .depend diff -urN linux-1.2.0/init/version.c linux/init/version.c --- linux-1.2.0/init/version.c Thu Jan 5 06:55:40 1995 +++ linux/init/version.c Sun Mar 12 14:23:25 1995 @@ -17,4 +17,8 @@ char *linux_banner = "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@" - LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n"; + LINUX_COMPILE_HOST ") (" LINUX_COMPILER +#ifdef LINUX_HOST_COMPILER + "/" LINUX_HOST_COMPILER +#endif + ") " UTS_VERSION "\n"; diff -urN linux-1.2.0/net/Makefile linux/net/Makefile --- linux-1.2.0/net/Makefile Wed Jan 11 10:57:40 1995 +++ linux/net/Makefile Sun Mar 12 14:10:02 1995 @@ -30,8 +30,8 @@ network.a: subdirs rm -f $@ - ar rc $@ $(SUBOBJS) - ranlib $@ + $(AR) rc $@ $(SUBOBJS) + $(RANLIB) $@ subdirs: dummy set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done