diff -urP sash-3.4/Makefile sash-3.4-eota/Makefile
--- sash-3.4/Makefile	Sat Sep 25 14:21:56 1999
+++ sash-3.4-eota/Makefile	Wed Jan  9 11:52:29 2002
@@ -5,21 +5,29 @@
 # The HAVE_EXT2 definition adds the -chattr and -lsattr comamnds.
 #
 
-CFLAGS = -O3 -Wall -Wmissing-prototypes -DHAVE_GZIP -DHAVE_EXT2
-LDFLAGS = -static -s
-LIBS = -lz
-
+STARTADDR=0x00001000
+NENTRY=_start
+NEWLIB=../../libc/newlib-1.8.1-eota/eota/newlib
+NLIBS=$(NEWLIB)/crt0.o $(NEWLIB)/libc.a
+NKERNLIBS=../../EOTA-CUR/kernel/POSIX/libc/libnative.a
+
+# CFLAGS = -O3 -Wall -Wmissing-prototypes -DHAVE_GZIP -DHAVE_EXT2
+CFLAGS = -O2 -fno-builtin -Wall -Wmissing-prototypes -I$(NEWLIB)/targ-include -I$(NEWLIB)/libc/include -DHAVE_EXT2 -DEOTA
+# LDFLAGS = -static -s
+LDFLAGS = -Bstatic -s
+# LIBS = -lz
+LIBS = 
 
 BINDIR = /bin
 MANDIR = /usr/man/man1
 
 
 OBJS = sash.o cmds.o cmd_dd.o cmd_ed.o cmd_grep.o cmd_ls.o cmd_tar.o \
-	cmd_gzip.o cmd_find.o cmd_file.o cmd_chattr.o cmd_ar.o utils.o
+	cmd_gzip.o cmd_find.o cmd_file.o cmd_chattr.o cmd_ar.o utils.o eota.o
 
 
-sash:	$(OBJS)
-	$(CC) $(LDFLAGS) -o sash $(OBJS) $(LIBS)
+sash:	$(OBJS) $(LIBS) $(NLIBS) $(NKERNLIBS)
+	$(LD) $(LDFLAGS) -o sash -e ${NENTRY} -Ttext=$(STARTADDR) $(OBJS) $(LIBS) $(NLIBS) $(NKERNLIBS)
 
 clean:
 	rm -f $(OBJS) sash
@@ -29,3 +37,4 @@
 	cp sash.1 $(MANDIR)/sash.1
 
 $(OBJS):	sash.h
+
diff -urP sash-3.4/README.EOTA sash-3.4-eota/README.EOTA
--- sash-3.4/README.EOTA	Thu Jan  1 09:00:00 1970
+++ sash-3.4-eota/README.EOTA	Fri Feb  8 00:58:24 2002
@@ -0,0 +1,4 @@
+sash-3.4 を EOTA 上で動作させるための patch は，最初，豊福さん
+(toyofuku@juice.or.jp) によって作成され，公開されました．
+
+http://www.geocities.co.jp/SiliconValley-Oakland/4477/eota/sash-eota.tgz
diff -urP sash-3.4/cmd_ls.c sash-3.4-eota/cmd_ls.c
--- sash-3.4/cmd_ls.c	Wed Jun 16 20:01:43 1999
+++ sash-3.4-eota/cmd_ls.c	Sat Nov 10 21:59:56 2001
@@ -194,7 +194,6 @@
 		 * Collect all the files in the directory.
 		 */
 		dirp = opendir(name);
-
 		if (dirp == NULL)
 		{
 			perror(name);
@@ -204,7 +203,6 @@
 
 		if (flags & LSF_MULT)
 			printf("\n%s:\n", name);
-
 		while (!intFlag && ((dp = readdir(dirp)) != NULL))
 		{
 			fullName[0] = '\0';
@@ -218,7 +216,6 @@
 			}
 
 			strcat(fullName, dp->d_name);
-
 			/*
 			 * Save the file name in the list.
 			 */
@@ -229,7 +226,6 @@
 				return;
 			}
 		}
-
 		closedir(dirp);
 
 		/*
diff -urP sash-3.4/cmd_tar.c sash-3.4-eota/cmd_tar.c
--- sash-3.4/cmd_tar.c	Sun Apr 18 21:33:59 1999
+++ sash-3.4-eota/cmd_tar.c	Sun Nov 11 13:42:49 2001
@@ -245,7 +245,6 @@
 	 * Open the tar file for reading.
 	 */
 	tarFd = open(tarName, O_RDONLY);
-
 	if (tarFd < 0)
 	{
 		perror(tarName);
diff -urP sash-3.4/cmds.c sash-3.4-eota/cmds.c
--- sash-3.4/cmds.c	Fri Jun  4 06:42:39 1999
+++ sash-3.4-eota/cmds.c	Sat Jan 19 19:17:55 2002
@@ -10,7 +10,11 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifndef EOTA
 #include <sys/mount.h>
+#else
+extern mount(char *, char *, int, char *);
+#endif
 #include <signal.h>
 #include <pwd.h>
 #include <grp.h>
@@ -511,8 +515,8 @@
 
 	argc--;
 	argv++;
-	type = "ext2";
-	flags = MS_MGC_VAL;
+	type = "sfs";
+	flags = 0;
 
 	while ((argc > 0) && (**argv == '-'))
 	{
@@ -555,7 +559,7 @@
 		return;
 	}
 
-	if (mount(argv[0], argv[1], type, flags, 0) < 0)
+	if (mount(argv[0], argv[1], flags, type) < 0)
 		perror("mount failed");
 }
 
diff -urP sash-3.4/eota.c sash-3.4-eota/eota.c
--- sash-3.4/eota.c	Thu Jan  1 09:00:00 1970
+++ sash-3.4-eota/eota.c	Fri Feb  8 00:42:56 2002
@@ -0,0 +1,65 @@
+int ioctl() { return -1; }
+int fchmod() { return -1; }
+int fchown() { return -1; }
+int getpwnam() { return 0; }
+int getpwuid() { return 0; }
+int mknod() { return -1; }
+int readlink() { return 0; }
+int symlink() { return -1; }
+int sync() { return -1; }
+
+#include <stdio.h>
+
+int
+__putc(int ch, FILE *port)
+{
+	putchar(ch);
+	fflush(stdout);
+}
+
+#define C(x)            (x & 0x1f)
+
+char *
+myfgets(char *line, int length, FILE *fp)
+{
+  int i;
+  int ch;
+  
+  if (fp != stdin) {
+	return fgets(line, length, fp);
+  }
+
+  for (i = 0; i < length-1;) {
+    ch = getc(stdin);
+    if ((ch == C('m')) || (ch == C('j'))) {
+      __putc(ch, stdout);
+      line[i++] = '\n';
+      break;
+    }
+    else if (ch == '\b') {
+      if (i > 0) {
+        --i; line[i] = 0;
+	__putc(ch, stdout);
+      }
+    }
+    else if (ch == C('u')) {
+      while (i > 0) {
+        --i;
+	__putc('\b', stdout);
+      }
+    }
+    else if (isprint (ch)) {
+      __putc(ch, stdout);
+      line[i++] = ch;
+    }
+  }
+  line[i] = '\0';
+
+  return (line);
+}
+
+int lstat(const char *file_name, struct stat *buf)
+{
+  return stat(file_name, buf);
+}
+
diff -urP sash-3.4/sash.c sash-3.4-eota/sash.c
--- sash-3.4/sash.c	Sat Sep 25 13:03:51 1999
+++ sash-3.4-eota/sash.c	Fri Nov 30 17:44:01 2001
@@ -490,10 +490,8 @@
 		if (aliasFlag)
 			printf("Built-in commands are aliased to standard commands\n");
 	}
-
 	signal(SIGINT, catchInt);
 	signal(SIGQUIT, catchQuit);
-
 	/*
 	 * Execute the user's alias file if present.
 	 */
diff -urP sash-3.4/sash.h sash-3.4-eota/sash.h
--- sash-3.4/sash.h	Sat Sep 25 13:03:51 1999
+++ sash-3.4-eota/sash.h	Fri Nov 30 17:43:35 2001
@@ -22,7 +22,7 @@
 
 
 #define	PATH_LEN	1024
-#define	CMD_LEN		10240
+#define	CMD_LEN		1024
 #define	ALIAS_ALLOC	20
 #define	EXPAND_ALLOC	1024
 #define	STDIN		0
@@ -141,6 +141,26 @@
  * This is used to stop processing.
  */
 extern	BOOL	intFlag;
+
+#if 0
+/* for EOTA */
+#define	O_NONBLOCK	0
+#define S_ISVTX		001000
+#define		_IFLNK	0120000	/* symbolic link */
+#define		_IFSOCK	0140000	/* socket */
+#define		_IFIFO	0110000	/* fifo */
+typedef struct _dirdesc {
+	int	dd_fd;
+	long	dd_loc;
+	long	dd_size;
+	char	*dd_buf;
+	int	dd_len;
+	long	dd_seek;
+} DIR;
+#endif
+
+#define fgets(x,y,z)	myfgets(x,y,z)
+extern char *myfgets(char *, int, FILE*);
 
 #endif
 
diff -urP sash-3.4/utils.c sash-3.4-eota/utils.c
--- sash-3.4/utils.c	Wed Apr 21 23:21:27 1999
+++ sash-3.4-eota/utils.c	Wed Feb  6 15:02:09 2002
@@ -183,6 +183,7 @@
 	struct	stat	statBuf1;
 	struct	stat	statBuf2;
 	struct	utimbuf	times;
+	int i;
 	
 	if (stat(srcName, &statBuf1) < 0)
 	{
@@ -224,6 +225,7 @@
 		return FALSE;
 	}
 
+	i = 0;
 	while ((rcc = read(rfd, buf, sizeof(buf))) > 0)
 	{
 		if (intFlag)
@@ -295,8 +297,10 @@
 	if (cp)
 		fileName = cp + 1;
 
+	cp = strrchr(dirName, '/');
+
 	strcpy(buf, dirName);
-	strcat(buf, "/");
+	if ((cp == NULL) || *(cp+1)) strcat(buf, "/");
 	strcat(buf, fileName);
 
 	return buf;
@@ -1075,7 +1079,6 @@
 	while (len > 0)
 	{
 		cc = read(fd, buf, len);
-
 		if (cc < 0)
 			return -1;
 
