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

merging 1.11 with 1.10h9



Hi!

I'm in the process of merging all the MiNT diffs and versions.  I
started with merging 1.10h9 and 1.11beta into a single source tree
(with the help of CVS, this went pretty smoothly).

Appended after my .sig are the relevant differences between 1.11beta
and the current source tree (patches to 1.11 have not yet been
applied).  As I'm not as a big MiNT hacker as some of you, I'm asking
you to compare those differences and help me decide whether they are
tolerable.

Thanks,
Michael
-- 
Email: hohmuth@inf.tu-dresden.de
WWW:   http://www.inf.tu-dresden.de/~mh1/

diff -cr --exclude=*~ --exclude=.#* --exclude-from=merger/mint/.cvsignore --show-c-function 1.11beta/mint/biosfs.c merger/mint/biosfs.c
*** 1.11beta/mint/biosfs.c	Tue Aug  9 13:33:26 1994
--- merger/mint/biosfs.c	Wed Aug 24 16:31:53 1994
*************** bios_fscntl(dir, name, cmd, arg)
*** 902,907 ****
--- 902,910 ----
  		}
  		b->drvsize = 0;
  		b->device = &bios_tdevice;
+ 		if (b->device->readb)
+ 			/* device has DEVDRV calls beyond unselect */
+ 			b->drvsize = offsetof (DEVDRV, readb) + sizeof (long);
  		b->private = arg;
  		b->flags = O_TTY;
  		*b->tty = default_tty;
*************** set_auxhandle(p, dev)
*** 2378,2383 ****
--- 2381,2387 ----

  	f = new_fileptr();
  	if (f) {
+ 		struct tty *tty;
  		f->links = 1;
  		f->flags = O_RDWR;
  		f->pos = 0;
*************** found_device:
*** 2413,2418 ****
--- 2417,2432 ----
  			f->links = 0;
  			dispose_fileptr(f);
  			return 0;
+ 		}
+ /* special code for opening a tty */
+ 		if (NULL != (tty = (struct tty *)f->devinfo)) {
+ 			extern struct tty default_tty;	/* in tty.c */
+ 
+ 			/* first open for this device? */
+ 			if (tty->use_cnt == 0) {
+ 				*tty = default_tty;
+ 			}
+ 			tty->use_cnt++;
  		}
  	} else {
  /* no memory! use the fake FILEPTR we
diff -cr --exclude=*~ --exclude=.#* --exclude-from=merger/mint/.cvsignore --show-c-function 1.11beta/mint/console.c merger/mint/console.c
*** 1.11beta/mint/console.c	Fri May 20 18:27:32 1994
--- merger/mint/console.c	Fri May 20 18:36:05 1994
*************** All rights reserved.
*** 8,13 ****
--- 8,15 ----

  #include "mint.h"

+ extern char vt52xkey[];
+ 
  /*
   * These routines are what Cconout, Cauxout, etc. ultimately call.
   * They take an integer argument which is the user's file handle,
*************** file_instat(f)
*** 28,33 ****
--- 30,43 ----
  	}
  	r = 1;		/* default is to assume input waiting (e.g. TOS files)*/
  	(void)(*f->dev->ioctl)(f, FIONREAD, &r);
+ 
+ 	if (!r && is_terminal(f)) {
+ 		struct tty *tty = (struct tty *)f->devinfo;
+ 		int scan = tty->state & TS_ESC;
+ 
+ 		if (scan && (tty->xkey ? tty->xkey[scan] : vt52xkey[scan]))
+ 			r = 1;
+ 	}
  	return r;
  }

diff -cr --exclude=*~ --exclude=.#* --exclude-from=merger/mint/.cvsignore --show-c-function 1.11beta/mint/dos.c merger/mint/dos.c
*** 1.11beta/mint/dos.c	Tue Aug  9 13:33:31 1994
--- merger/mint/dos.c	Wed Aug 24 17:26:40 1994
*************** s_ysconf(which)
*** 728,734 ****
  		case 2:
  			return MAX_OPEN;
  		case 3:
! 			return 0;
  		case 4:
  			return UNLIMITED;
  		default:
--- 728,734 ----
  		case 2:
  			return MAX_OPEN;
  		case 3:
! 			return NGROUPS_MAX;
  		case 4:
  			return UNLIMITED;
  		default:
Only in merger/mint: dos.o
diff -cr --exclude=*~ --exclude=.#* --exclude-from=merger/mint/.cvsignore --show-c-function 1.11beta/mint/dosdir.c merger/mint/dosdir.c
*** 1.11beta/mint/dosdir.c	Tue Aug  9 13:33:32 1994
--- merger/mint/dosdir.c	Wed Aug 24 16:38:24 1994
*************** long ARGS_ON_STACK
*** 729,738 ****
  f_delete(name)
  	const char *name;
  {
  	fcookie dir, fc;
  	long r;
  	char temp1[PATH_MAX];
- 	XATTR	xattr;

  	TRACE(("Fdelete(%s)", name));

--- 729,742 ----
  f_delete(name)
  	const char *name;
  {
+ #if 0
  	fcookie dir, fc;
+ 	XATTR	xattr;
+ #else
+ 	fcookie dir;
+ #endif
  	long r;
  	char temp1[PATH_MAX];

  	TRACE(("Fdelete(%s)", name));

*************** f_delete(name)
*** 751,756 ****
--- 755,761 ----
  		return EACCDN;
  	}

+ #if 0
  /* now get the file attributes */
  /* TOS domain processes can only delete files if they have write permission
   * for them
*************** f_delete(name)
*** 778,784 ****
  		}
  		release_cookie(&fc);
  	}
! 
  	r = (*dir.fs->remove)(&dir,temp1);

  	release_cookie(&dir);
--- 783,789 ----
  		}
  		release_cookie(&fc);
  	}
! #endif
  	r = (*dir.fs->remove)(&dir,temp1);

  	release_cookie(&dir);
diff -cr --exclude=*~ --exclude=.#* --exclude-from=merger/mint/.cvsignore --show-c-function 1.11beta/mint/dosfile.c merger/mint/dosfile.c
*** 1.11beta/mint/dosfile.c	Tue Aug  9 13:33:32 1994
--- merger/mint/dosfile.c	Wed Aug 24 16:40:08 1994
*************** All rights reserved.
*** 8,13 ****
--- 8,16 ----

  #include "mint.h"

+ extern char vt52xkey[];
+ MEMREGION *tofreed;	/* to-be-freed shared text region (set in denyshare) */
+ 
  static long do_dup P_((int,int));
  static void unselectme P_((PROC *));

*************** do_open(name, rwmode, attr, x)
*** 37,43 ****
  	unsigned perm;
  	int creating;
  	char temp1[PATH_MAX];
! 	extern FILESYS proc_filesys;

  /* for special BIOS "fake" devices */
  	extern DEVDRV fakedev;
--- 40,46 ----
  	unsigned perm;
  	int creating;
  	char temp1[PATH_MAX];
! 	extern FILESYS proc_filesys, pipe_filesys;

  /* for special BIOS "fake" devices */
  	extern DEVDRV fakedev;
*************** do_open(name, rwmode, attr, x)
*** 62,70 ****

  /*
   * file found: this is an error if (O_CREAT|O_EXCL) are set
   */

! 	if ( (r == 0) && ( (rwmode & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL) ) ) {
  		DEBUG(("do_open(%s): file already exists",name));
  		mint_errno = EACCDN;
  		release_cookie(&fc);
--- 65,76 ----

  /*
   * file found: this is an error if (O_CREAT|O_EXCL) are set
+  *	...or if this is Fcreate with nonzero attr on the pipe filesystem
   */

! 	if ( (r == 0) && ( (rwmode & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL) ||
! 			(attr && fc.fs == &pipe_filesys &&
! 			(rwmode & (O_CREAT|O_TRUNC)) == (O_CREAT|O_TRUNC)))) {
  		DEBUG(("do_open(%s): file already exists",name));
  		mint_errno = EACCDN;
  		release_cookie(&fc);
*************** do_open(name, rwmode, attr, x)
*** 236,241 ****
--- 242,253 ----
  		return NULL;
  	}

+ 	if (tofreed) {
+ 		tofreed->links = 0;
+ 		free_region(tofreed);
+ 		tofreed = 0;
+ 	}
+ 
  /* special code for opening a tty */
  	if (is_terminal(f)) {
  		extern struct tty default_tty;	/* in tty.c */
*************** f_cntl(fh, arg, cmd)
*** 935,940 ****
--- 947,960 ----
  		r = (*f->dev->ioctl)(f, cmd, (void *)arg);
  		if (r == EINVFN && is_terminal(f)) {
  			r = tty_ioctl(f, cmd, (void *)arg);
+ 		} else if (cmd == FIONREAD && !r && !(*(long *)arg) &&
+ 				is_terminal(f)) {
+ 			struct tty *tty = (struct tty *)f->devinfo;
+ 			int scan = tty->state & TS_ESC;
+ 
+ 			if (scan && (tty->xkey ? tty->xkey[scan] :
+ 					vt52xkey[scan]))
+ 				*(long *)arg = 1;
  		}
  		return r;
  	}
*************** retry_after_collision:
*** 1038,1043 ****
--- 1058,1066 ----
  	
  	for (i = 0; i < MAX_OPEN; i++) {
  		if (rfd & mask) {
+ 			struct tty *tty;
+ 			int scan;
+ 
  			f = p->handle[i];
  			if (is_terminal(f))
  				rsel = tty_select(f, (long)p, O_RDONLY);
diff -cr --exclude=*~ --exclude=.#* --exclude-from=merger/mint/.cvsignore --show-c-function 1.11beta/mint/dosmem.c merger/mint/dosmem.c
*** 1.11beta/mint/dosmem.c	Tue Aug  9 13:33:33 1994
--- merger/mint/dosmem.c	Wed Aug 24 16:43:42 1994
*************** TRACE(("Checking for memory for new PROC
*** 441,446 ****
--- 441,473 ----
  		}
  	}

+ /* make a local copy of the name, in case we are overlaying the current
+  * process
+  */
+ 	if (mkname) {
+ 		lastslash = 0;
+ 		newname = ptr1;
+ 		while (*newname) {
+ 			if (*newname == '\\' || *newname == '/')
+ 				lastslash = newname;
+ 			++newname;
+ 		}
+ 		if (!lastslash)
+ 			lastslash = ptr1;
+ 		else
+ 			lastslash++;
+ 
+ 		i = 0; newname = localname;
+ 		while (i++ < PNAMSIZ) {
+ 			if (*lastslash == '.' || *lastslash == 0) {
+ 				*newname = 0; break;
+ 			}
+ 			else
+ 				*newname++ = *lastslash++;
+ 		}
+ 		*newname = 0;
+ 	}
+ 
  TRACE(("creating environment"));

  	if (mkload || mkbase) {
*************** TRACE(("Pexec: basepage region(%lx) is %
*** 511,543 ****
                        text = NULL;
                }
  #endif
- 	}
- 
- /* make a local copy of the name, in case we are overlaying the current
-  * process
-  */
- 	if (mkname) {
- 		lastslash = 0;
- 		newname = ptr1;
- 		while (*newname) {
- 			if (*newname == '\\' || *newname == '/')
- 				lastslash = newname;
- 			++newname;
- 		}
- 		if (!lastslash)
- 			lastslash = ptr1;
- 		else
- 			lastslash++;
- 
- 		i = 0; newname = localname;
- 		while (i++ < PNAMSIZ) {
- 			if (*lastslash == '.' || *lastslash == 0) {
- 				*newname = 0; break;
- 			}
- 			else
- 				*newname++ = *lastslash++;
- 		}
- 		*newname = 0;
  	}

  	if (mkload || mkbase) {
--- 538,543 ----
diff -cr --exclude=*~ --exclude=.#* --exclude-from=merger/mint/.cvsignore --show-c-function 1.11beta/mint/main.c merger/mint/main.c
*** 1.11beta/mint/main.c	Tue Aug  9 13:33:39 1994
--- merger/mint/main.c	Wed Aug 24 17:32:23 1994
*************** main(argc, argv)
*** 680,686 ****

  /* greetings */
  	Cconws(greet1);
! 	ksprintf(buf, VERS_STRING, MAJ_VERSION, MIN_VERSION);
  	Cconws(buf);
  	Cconws(greet2);

--- 680,686 ----

  /* greetings */
  	Cconws(greet1);
! 	ksprintf(buf, VERS_STRING, MAJ_VERSION, MIN_VERSION, PATCH_LEVEL);
  	Cconws(buf);
  	Cconws(greet2);

*************** main(argc, argv)
*** 762,767 ****
--- 762,771 ----
  		has_bconmap = (Bconmap(0) == 0);
  	}

+ /* ts: init these here, so that filesystems can use them */
+ 	timestamp = Tgettime();
+ 	datestamp = Tgetdate();
+ 
  /* initialize memory */
  	init_mem();

*************** main(argc, argv)
*** 853,859 ****
  /* note that load_filesys changed the
   * directory on us!!
   */
! 	(void)d_setpath(curpath);
  	
  /* load the configuration file */
  	load_config();
--- 857,863 ----
  /* note that load_filesys changed the
   * directory on us!!
   */
! 	d_setpath(curpath);
  	
  /* load the configuration file */
  	load_config();
*************** main(argc, argv)
*** 880,885 ****
--- 884,892 ----

  /* run any programs appearing after us in the AUTO folder */
  	run_auto_prgs();
+ 
+ /* prepare to run the init program as PID 1. */
+ 	set_pid_1();

  /* run the initial program */
  /* if that program is in fact GEM, we start it via exec_os, otherwise
diff -cr --exclude=*~ --exclude=.#* --exclude-from=merger/mint/.cvsignore --show-c-function 1.11beta/mint/pipefs.c merger/mint/pipefs.c
*** 1.11beta/mint/pipefs.c	Tue Aug  9 13:33:43 1994
--- merger/mint/pipefs.c	Wed Aug 24 16:58:49 1994
*************** pipe_open(f)
*** 553,562 ****
  		}
  		p->flags &= ~O_HEAD;
  	} else {
! 		if (f->flags & O_CREAT) {
  			DEBUG(("pipe_open: fifo already exists"));
  			return EACCDN;
  		}
  	}
  /*
   * check for file sharing compatibility. note that O_COMPAT gets mutated
--- 553,564 ----
  		}
  		p->flags &= ~O_HEAD;
  	} else {
! #if 0
! 		if (f->flags & O_TRUNC) {
  			DEBUG(("pipe_open: fifo already exists"));
  			return EACCDN;
  		}
+ #endif
  	}
  /*
   * check for file sharing compatibility. note that O_COMPAT gets mutated
diff -cr --exclude=*~ --exclude=.#* --exclude-from=merger/mint/.cvsignore --show-c-function 1.11beta/mint/proc.c merger/mint/proc.c
*** 1.11beta/mint/proc.c	Tue Aug  9 13:33:44 1994
--- merger/mint/proc.c	Wed Aug 24 17:01:09 1994
*************** void
*** 332,340 ****
  fresh_slices(slices)
  	int slices;
  {
  	curproc->slices = 0;
  	curproc->curpri = MAX_NICE+1;
! 	proc_clock = slices;
  }

  /*
--- 332,341 ----
  fresh_slices(slices)
  	int slices;
  {
+ 	reset_priorities();
  	curproc->slices = 0;
  	curproc->curpri = MAX_NICE+1;
! 	proc_clock = TIME_SLICE+slices;
  }

  /*
*************** sleep(_que, cond)
*** 576,583 ****
  	/* p is our victim */

  	rm_q(READY_Q, p);
- 
- 	spl(sr);

  	if (save_context(&(curproc->ctxt[CURRENT]))) {
  /*
--- 577,582 ----
diff -cr --exclude=*~ --exclude=.#* --exclude-from=merger/mint/.cvsignore --show-c-function 1.11beta/mint/signal.c merger/mint/signal.c
*** 1.11beta/mint/signal.c	Tue Aug  9 13:33:49 1994
--- merger/mint/signal.c	Wed Aug 24 16:19:21 1994
*************** handle_sig(sig)
*** 305,312 ****
  	long oldstack, newstack;
  	long *stack;
  	CONTEXT *call, contexts[2];
! #define oldsysctxt (contexts[0])
! #define newcurrent (contexts[1])

  	extern void sig_return();

--- 305,312 ----
  	long oldstack, newstack;
  	long *stack;
  	CONTEXT *call, contexts[2];
! #define newcurrent (contexts[0])
! #define oldsysctxt (contexts[1])

  	extern void sig_return();

*************** _default:
*** 397,405 ****
  		++curproc->nsigs;
  		call = &curproc->ctxt[SYSCALL];
  /*
!  * what we do is build two fake stack frames; the bottom one is
   * for a call to the user function, with (long)parameter being the
!  * signal number; the top one is for sig_return.
   * When the user function returns, it returns to sig_return, which
   * calls into the kernel to restore the context in prev_ctxt
   * (thus putting us back here). We can then continue on our way.
--- 397,405 ----
  		++curproc->nsigs;
  		call = &curproc->ctxt[SYSCALL];
  /*
!  * what we do is build two fake stack frames; the top one is
   * for a call to the user function, with (long)parameter being the
!  * signal number; the bottom one is for sig_return.
   * When the user function returns, it returns to sig_return, which
   * calls into the kernel to restore the context in prev_ctxt
   * (thus putting us back here). We can then continue on our way.
*************** _default:
*** 407,413 ****

  /* set a new system stack, with a bit of buffer space */
  		oldstack = curproc->sysstack;
! 		newstack = ((long) ( (&newcurrent) - 2 )) - 12;

  		if (newstack < (long)curproc->stack + ISTKSIZE + 256) {
  			ALERT("stack overflow");
--- 407,413 ----

  /* set a new system stack, with a bit of buffer space */
  		oldstack = curproc->sysstack;
! 		newstack = ((long) &newcurrent) - 0x40 - 12;

  		if (newstack < (long)curproc->stack + ISTKSIZE + 256) {
  			ALERT("stack overflow");
*************** _default:
*** 417,427 ****
  			FATAL("system stack not in proc structure");
  		}

- /* unwound_stack is set by p_sigreturn() */
- 		if (sig == 0 && unwound_stack)
- 			curproc->sysstack = unwound_stack;
- 		else
- 			curproc->sysstack = newstack;
  		oldsysctxt = *call;
  		stack = (long *)(call->sr & 0x2000 ? call->ssp :
  				call->usp);
--- 417,422 ----
*************** _default:
*** 450,459 ****
  		call->pc = (long) curproc->sighandle[sig];
  		call->sfmt = call->fstate[0] = 0;	/* don't restart FPU communication */

- 		((long *)curproc->sysstack)[1] = FRAME_MAGIC;
- 		((long *)curproc->sysstack)[2] = oldstack;
- 		((long *)curproc->sysstack)[3] = sig;
- 
  		if (curproc->sigflags[sig] & SA_RESET) {
  			curproc->sighandle[sig] = SIG_DFL;
  			curproc->sigflags[sig] &= ~SA_RESET;
--- 445,450 ----
*************** _default:
*** 469,474 ****
--- 460,479 ----
  			newcurrent.regs[0] = CTXT_MAGIC;
  				/* set D0 so next return is different */
  			assert(curproc->magic == CTXT_MAGIC);
+ 
+ /* unwound_stack is set by p_sigreturn() */
+ 			if (sig == 0 && unwound_stack)
+ 				stack = (long *) unwound_stack;
+ 			else
+ /* newstack points just below our current sp, much less than ISTKSIZE away
+  * so better set it up with interrupts off...  -nox */
+ 				stack = (long *) newstack;
+ 			spl7();
+ 			curproc->sysstack = (long) stack;
+ 			++stack;
+ 			*stack++ = FRAME_MAGIC;
+ 			*stack++ = oldstack;
+ 			*stack = sig;
  			leave_kernel();
  			restore_context(call);
  		}
*************** top:
*** 534,540 ****
  	}
  	else {
  		valid_return = 0;
! 		oldctxt = ((CONTEXT *)(&frame[2])) + 2;
  		if (oldctxt->regs[0] != CTXT_MAGIC) {
  			FATAL("p_sigreturn: corrupted context");
  		}
--- 539,545 ----
  	}
  	else {
  		valid_return = 0;
! 		oldctxt = (CONTEXT *) (((long)&frame[2]) + 0x40);
  		if (oldctxt->regs[0] != CTXT_MAGIC) {
  			FATAL("p_sigreturn: corrupted context");
  		}
diff -cr --exclude=*~ --exclude=.#* --exclude-from=merger/mint/.cvsignore --show-c-function 1.11beta/mint/tosfs.c merger/mint/tosfs.c
*** 1.11beta/mint/tosfs.c	Tue Aug  9 13:33:51 1994
--- merger/mint/tosfs.c	Wed Aug 24 17:40:06 1994
*************** around:
*** 687,692 ****
--- 687,694 ----
  		xattr->blksize = clsizb[fc->dev];
  	
  	xattr->nblocks = (xattr->size + xattr->blksize - 1) / xattr->blksize;
+ 	if (!xattr->nblocks && (ti->attr & FA_DIR))
+ 		xattr->nblocks = 1;	/* no dir takes 0 blocks... */
  	xattr->mdate = xattr->cdate = xattr->adate = ti->date;
  	xattr->mtime = xattr->ctime = xattr->atime = ti->time;
  	xattr->mode = (ti->attr & FA_DIR) ? (S_IFDIR | DEFAULT_DIRMODE) :
diff -cr --exclude=*~ --exclude=.#* --exclude-from=merger/mint/.cvsignore --show-c-function 1.11beta/mint/tty.c merger/mint/tty.c
*** 1.11beta/mint/tty.c	Tue Aug  9 13:33:53 1994
--- merger/mint/tty.c	Wed Aug 24 17:13:01 1994
*************** stuff_it:
*** 255,261 ****

  /* for RAW mode, if there are no more characters then break */
  		if ( (mode & (T_RAW|T_CBREAK)) &&
! 		    !((rdmode & ESCSEQ) && (tty->state & TS_ESC))) {
  			r = 1;
  			(void)(*f->dev->ioctl)(f, FIONREAD, &r);
  			if (r <= 0) break;
--- 255,261 ----

  /* for RAW mode, if there are no more characters then break */
  		if ( (mode & (T_RAW|T_CBREAK)) &&
! 		    !(tty->state & TS_ESC)) {
  			r = 1;
  			(void)(*f->dev->ioctl)(f, FIONREAD, &r);
  			if (r <= 0) break;
*************** tty_write(f, buf, nbytes)
*** 473,479 ****
   *		28-31 are shift+cursor up, down, right, and left
   */

! static char vt52xkey[256] = {
  '\033', 'P', 0, 0, 0, 0, 0, 0,
  '\033', 'Q', 0, 0, 0, 0, 0, 0,
  '\033', 'R', 0, 0, 0, 0, 0, 0,
--- 473,479 ----
   *		28-31 are shift+cursor up, down, right, and left
   */

! char vt52xkey[256] = {
  '\033', 'P', 0, 0, 0, 0, 0, 0,
  '\033', 'Q', 0, 0, 0, 0, 0, 0,
  '\033', 'R', 0, 0, 0, 0, 0, 0,
*************** we should return EIO instead of signalli
*** 808,826 ****
  /* we may be in the middle of an escape sequence */
  	scan = (tty->state & TS_ESC);
  	if (scan != 0) {
! 		if (mode & ESCSEQ) {
! 			tab = tty->xkey ? tty->xkey : vt52xkey;
! 			r = (unsigned char) tab[scan++];
! 			if (r) {
! 				c = UNDEF;
! 				if (tab[scan] == 0) scan = 0;
! 			}
! 			else
! 				scan = 0;
! 			tty->state = (tty->state & ~TS_ESC) | scan;
  		}
  		else
! 			tty->state &= ~TS_ESC;
  	}

  	while (c != UNDEF) {
--- 808,822 ----
  /* we may be in the middle of an escape sequence */
  	scan = (tty->state & TS_ESC);
  	if (scan != 0) {
! 		tab = tty->xkey ? tty->xkey : vt52xkey;
! 		r = (unsigned char) tab[scan++];
! 		if (r) {
! 			c = UNDEF;
! 			if (tab[scan] == 0) scan = 0;
  		}
  		else
! 			scan = 0;
! 		tty->state = (tty->state & ~TS_ESC) | scan;
  	}

  	while (c != UNDEF) {