Author: wmb Date: Tue Jul 12 11:05:21 2011 New Revision: 2343 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2343
Log: OLPC XO-1.75 trac #10997 - added emacs to XO-1.75 build.
Added: clients/emacs/arm/ clients/emacs/arm/Makefile clients/emacs/arm/config.h clients/emacs/arm/emacs.lds Modified: clients/emacs/x86/emacs.rc clients/lib/mem.c cpu/arm/olpc/1.75/olpc.bth
Added: clients/emacs/arm/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ clients/emacs/arm/Makefile Tue Jul 12 11:05:21 2011 (r2343) @@ -0,0 +1,55 @@ +# Makefile for MicroEMACS 3.7 for use with Open Firmware. +# +# To make emacs, type: make emacs +# or just: make +# + +TOOLPREFIX=/usr/local/arm/bin/arm-linux- +CC=$(TOOLPREFIX)gcc +LD=$(TOOLPREFIX)ld +STRIP=$(TOOLPREFIX)strip + +BP=../../.. +SRCDIR=.. +HLIBDIR=$(BP)/clients/lib +LIBDIR=$(HLIBDIR)/arm +GLIBDIR=$(dir $(shell $(CC) -print-libgcc-file-name)) + +INCS=-I. -I$(SRCDIR) -I$(HLIBDIR) +MODES=-g -O2 -fno-inline +CFLAGS= $(INCS) $(MODES) + +LFLAGS= -T emacs.lds -N -e _start + +HFILES= ../estruct.h edef.h efunc.h epath.h ebind.h + +OFILES= ansi.o basic.o bind.o buffer.o display.o \ + exec.o file.o fileio.o \ + input.o isearch.o line.o lock.o main.o \ + random.o region.o search.o spawn.o termio.o \ + window.o word.o + +LIBS= $(LIBDIR)/libobp.a + +emacs: emacs.elf + @$(STRIP) $< -o $@ + +emacs.elf: $(LIBDIR)/start.o $(OFILES) $(LIBS) Makefile emacs.lds + $(LD) $(LFLAGS) -o $@ $(LIBDIR)/start.o $(OFILES) $(LIBS) -L$(GLIBDIR) -lgcc + + @# size $@ + @# nm -n $@ >emacs.nm + +$(LIBDIR)/start.o: $(LIBDIR)/start.s + (cd $(LIBDIR); make start.o) + +$(LIBDIR)/libobp.a: $(HLIBDIR)/lib.c + (cd $(LIBDIR); make libobp.a) + +%.o:$(SRCDIR)/%.c + $(CC) $(CFLAGS) -c $< + +main.o: $(SRCDIR)/ebind.h + +clean: + -rm -f *.o *.a emacs
Added: clients/emacs/arm/config.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ clients/emacs/arm/config.h Tue Jul 12 11:05:21 2011 (r2343) @@ -0,0 +1,55 @@ +/* Machine/OS definitions */ + +#define OFW 1 /* Open Boot Prom */ +#define AMIGA 0 /* AmigaDOS */ +#define ST520 0 /* ST520, TOS */ +#define MSDOS 0 /* MS-DOS */ +#define V7 0 /* V7 UN*X or Coherent or BSD4.2*/ +#define BSD 0 /* UNIX BSD 4.2 and ULTRIX */ +#define USG 0 /* UNIX system V */ +#define VMS 0 /* VAX/VMS */ +#define CPM 0 /* CP/M-86 */ + +/* Compiler definitions */ +#define GCC 1 /* Gnu C Compiler */ +#define MWC86 0 /* marc williams compiler */ +#define LATTICE 0 /* either lattice compiler */ +#define LAT2 0 /* Lattice 2.15 */ +#define LAT3 0 /* Lattice 3.0 */ +#define AZTEC 0 /* Aztec C 3.20e */ +#define MSC 0 /* MicroSoft C compile version 3 */ + +/* Profiling options */ +#define APROF 0 /* turn Aztec C profiling on? */ +#define NBUCK 100 /* number of buckets to profile */ + +/* Special keyboard definitions */ + +#define WANGPC 0 /* WangPC - mostly escape sequences */ + +/* Terminal Output definitions */ + +#define ANSI 1 /* ansi escape sequences */ +#define HP150 0 /* HP150 screen driver */ +#define VMSVT 0 /* various VMS terminal entries */ +#define VT52 0 /* VT52 terminal (Zenith). */ +#define VT100 0 /* Handle VT100 style keypad. */ +#define LK201 0 /* Handle LK201 style keypad. */ +#define RAINBOW 0 /* Use Rainbow fast video. */ +#define TERMCAP 0 /* Use TERMCAP */ +#define IBMPC 0 /* IBM-PC specific driver */ +#define DG10 0 /* Data General system/10 */ + +/* Configuration options */ + +#define CVMVAS 1 /* arguments to page forward/back in pages */ +#define NFWORD 0 /* forward word jumps to begining of word */ +#define CLRMSG 0 /* space clears the message line with no insert */ +#define TYPEAH 1 /* type ahead causes update to be skipped */ +#define FILOCK 0 /* file locking under unix BSD 4.2 */ +#define REVSTA 0 /* Status line appears in reverse video */ +#define COLOR 1 /* color commands and windows */ +#define ACMODE 1 /* auto CMODE on .C and .H files */ +#define CFENCE 1 /* fench matching in CMODE */ +#define ISRCH 1 /* Incremental searches like ITS EMACS */ +#define WORDPRO 1 /* Advanced word processing features */
Added: clients/emacs/arm/emacs.lds ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ clients/emacs/arm/emacs.lds Tue Jul 12 11:05:21 2011 (r2343) @@ -0,0 +1,16 @@ +OUTPUT_FORMAT("elf32-littlearm"); +OUTPUT_ARCH(ARM); + +ENTRY(_start); +SECTIONS { + . = 0x100000; + .text : { + *(.text) + } + .rodata : { + *(.rodata*) + } + .data : { + *(.data) + } +}
Modified: clients/emacs/x86/emacs.rc ============================================================================== --- clients/emacs/x86/emacs.rc Tue Jul 12 00:02:40 2011 (r2342) +++ clients/emacs/x86/emacs.rc Tue Jul 12 11:05:21 2011 (r2343) @@ -37,7 +37,7 @@ add-mode "red" begining-of-file 2 resize-window - insert-string " F1 Help on/off F5 Open File F6 Save File F7 Exit" + insert-string " F1 Help on/off F6 Open File F7 Save File F8 Exit" newline insert-string " Move with arrow keys, PageUp, PageDown, Home, and End" begining-of-file
Modified: clients/lib/mem.c ============================================================================== --- clients/lib/mem.c Tue Jul 12 00:02:40 2011 (r2342) +++ clients/lib/mem.c Tue Jul 12 11:05:21 2011 (r2343) @@ -15,3 +15,12 @@ while (len--) *(cp + len) = c; } + +int +memcmp(void *s1, void *s2, int len) +{ + for (; len--; ++s1, ++s2) + if (*(unsigned char *)s1 != *(unsigned char *)s2) + return *(unsigned char *)s1 - *(unsigned char *)s2; + return 0; +}
Modified: cpu/arm/olpc/1.75/olpc.bth ============================================================================== --- cpu/arm/olpc/1.75/olpc.bth Tue Jul 12 00:02:40 2011 (r2342) +++ cpu/arm/olpc/1.75/olpc.bth Tue Jul 12 11:05:21 2011 (r2343) @@ -14,6 +14,7 @@ in: ${BP}/dev/usb2/device/serial/build/usbserial.fc in: ${BP}/dev/usb2/device/storage/build/usbstorage.fc in: testicons.bin +in: ${BP}/clients/emacs/arm/emacs build-now
fload ${BP}/cpu/arm/olpc/1.75/fw-version.fth @@ -56,6 +57,9 @@ end-reserved end-tim
+h# e.0000 to reserved-start +h# f.0000 to reserved-end + .( --- Saving as ) " ${FW_VERSION}.rom" expand$ 2dup lower ( adr len ) 2dup type cr ( adr len ) @@ -152,6 +156,9 @@ " ${BP}/cpu/x86/pc/olpc/images/settings.565" " settings.565" $add-deflated-dropin [then] " ec.img" " ecimage.bin" $add-deflated-dropin + " ${BP}/clients/emacs/x86/emacs.rc" " emacs.rc" $add-deflated-dropin + " ${BP}/clients/emacs/emacs.hlp" " emacs.hlp" $add-deflated-dropin + " ${BP}/clients/emacs/arm/emacs" " emacs" $add-deflated-dropin
.( Dropin top is ) ofd @ fsize .x cr