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

Re: MiNTOS Distribution World Wide Web page now available.

Scott Kolodzieski writes:
> Hello all, 
> I have a TT 4+16, and just set up MiNTOS on it. I saw some some chatter 
> recently about people starting gem.sys from the MultiTOS distribution up 
> after they login as root. 
> When I login as root and start MultiTOS, it come up fine and appears
> to work as long as I don't touck the keyboard. I can
> drag/drop/launch/copy/move files and the like. If I open TOSWIN, and
> begin typing, or a com program and begin typing, the machine takes 4
> or 5 keystrokes (correctly echoing) then stops accepting input from
> the keyboard. a quik cntrl+alt+f1 shows MiNT(v1.10 + net patches) is
> still alive as the new Minix FS update is being called (I assume by
> addroottimeout()) and the mouse moves, but I cannot type or select
> anything with the mouse. Odd huh?

 sounds like the old GEM SIGTT* hang...  i.e. GEM does some strange
things with its tty that make it end up in state `stop'.  (verify with

 heres a start-GEM thing i made for virtual consoles, the hack is to
reset /dev/consoles process group to 0 like if it was closed... :/

/* execgem -- exec `old' GEM (exec_os) or a gem.sys (-DINITPRG)
   make sure we're on console, zero its pgroup to reduce GEM SIGTTIN/OU
   problems (don't ask), exec.  INITPRG can also be a script so you
   can create an account `gem' in /etc/passwd if you want with this
   as loginshell and put setup things in the script. (last line execs
   the real gem.)

   BUGS: still no way to leave GEM & free all its memory etc. other
   than reboot. :-(  if someone manages to shut down GEM and later
   restart it without spectacular crashes and losing memory _please_
   tell us how...

#include <stdio.h>
#include <string.h>
#include <stat.h>
#include <fcntl.h>
#include <ioctl.h>
#include <unistd.h>
#include <errno.h>
#include <mintbind.h>
#include <basepage.h>
#include <st-out.h>

#ifdef INITPRG
#define init_prg INITPRG
#define init_tail "\0"
#define init_env 0L
#define init_prg 0L
#define init_tail ""
#define init_env 0L

#define EXEC_OS 0x4feL

/* define how to call functions with stack parameter passing */
#ifdef __TURBOC__
#define ARGS_ON_STACK cdecl

#ifndef P_
# ifdef __STDC__
#  define P_(x) x
# else
#  define P_(x) ()
# endif

/* not yet in st-out.h... */
#ifndef F_PROT_P
#define F_PROT_P	0x00		/* no read or write */
#define F_PROT_G	0x10		/* any access OK */
#define F_PROT_S	0x20		/* any super access OK */
#define F_PROT_PR	0x30		/* any read OK, no write */
#define F_PROT_I	0x40		/* invalid page */

main(argc, argv)
	int argc;
	char **argv;
	long stack;
	extern int __mint;

	if (__mint) {
		struct stat sb, st;
		long pgrp, r;
		char tmp[0x100];

		if (Fcntl(-1, &pgrp, TIOCGPGRP) ||
		    Fcntl(-1, &sb, FSTAT) ||
		    (Fxattr(0, "u:\\dev\\ttyv0", &st) &&
			Fxattr(0, "u:\\dev\\vt00", &st) &&
			Fxattr(0, "u:\\dev\\console", &st)) ||
		    ((st.st_dev != sb.st_dev || st.st_ino != sb.st_ino) &&
		     (Fxattr(0, "u:\\dev\\fasttext", &st) ||
		        st.st_dev != sb.st_dev || st.st_ino != sb.st_ino))) {

			Cconws ("Hey GEM is not X! :)  console only...\r\n");
			return 1;

		/* just to be sure... */
		(void) Fclose (0);
		(void) Fcntl(-1, 0L, F_DUPFD);
		(void) Fclose (1);
		(void) Fcntl(-1, 0L, F_DUPFD);
		(void) Fclose (2);
		(void) Fcntl(-1, 0L, F_DUPFD);

		/* `turn off' job control on /dev/console, GEM seems to have
		   problems with it...  apparently even multitos :-(  */
		r = 0;
		(void) Fcntl(0, &r, TIOCSPGRP);

		stack = Super (0L);
		if (init_prg) {
			/* not Pexec so init_prg gets ARGV and can be a script.
			execl (init_prg, init_prg, (char *)0);
			if (errno == ENOEXEC || errno == ENOENT)
				execl ("/bin/sh", "/bin/sh", init_prg, (char *)0);
			r = errno;
		} else {
			bp = (BASEPAGE *)Pexec(7,
			  (char *)((long)F_FASTLOAD | F_ALTLOAD | F_ALTALLOC | F_PROT_S),
			  (char *)"\0", init_env);
			bp->p_tbase = *((char **) EXEC_OS );
			r = -Pexec(206, (char *)"GEM", bp, 0L);
		Super (stack);
		sprintf (tmp, "exec %s failed: %s (%d)\r\n",
			init_prg ? init_prg : "GEM", strerror (r), (int) r);
		(void) Fcntl(0, &pgrp, TIOCSPGRP);
		Cconws (tmp);
		return r;
	} else {
		register void ARGS_ON_STACK (*f) P_((long));

		/* no MiNT -> just jump thru exec_os... */
		stack = Super (0L);
		f = (void ARGS_ON_STACK (*) P_((long))) *((long *)EXEC_OS);
		Super (stack);

		(*f)((long) _base);
		return 0;
> Any tips would be appreciated.
> cheers,
> scott.

 hope this helps, cheers
J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
								...ohne Gewehr
PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA