Article View: comp.sys.atari.st
Article #27145Re: _shell_p standardization: a suggest
From: braner
Date: Tue, 26 May 1987 23:26
Date: Tue, 26 May 1987 23:26
31 lines
1669 bytes
1669 bytes
[]
Another solution to the shell-existance checking is to keep the _shell_p
vector pointing to executable code (as described here recently) but
put some ID info just before that code. (That is of course impossible
if you write your shell in C with a compiler that does not allow in-line
assembly. End of plug :-)
This is similar to my protocol for RAM-resident utilities. I suggest that
the long word starting at offset -8 from [the address _shell_p points to]
hold an ID string, and the next long word hold a magic number. So a
calling program can do: (loose syntax here)
struct shellid {
long id
long magic
};
struct shellid *sp;
long addr;
typedef int fri(); /* function returning an int */
...
addr = *(long *) SHELL_P;
sp = (struct shellid *) (addr-8);
if (sp->magic != MAGIC) CrashAndBurn();
if (sp->id == JOHN) say("hi, john!");
return ((fri *)addr(command));
Now how do we choose the value of MAGIC? (How about ASCII of "!SH!"?)
- Moshe Braner
Technical Details
Message-ID:
<-115000@batcomputer.tn.cornell.edu>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!clyde!cbosgd!ihnp4!inuxc!pur-ee!uiucdcs!convex!batcomputer.tn.cornell.edu!seefromlineReferences:
<2124@cwruecmp.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!clyde!cbosgd!ihnp4!inuxc!pur-ee!uiucdcs!convex!batcomputer.tn.cornell.edu!seefromline From: braner@batcomputer.UUCP Newsgroups: comp.sys.atari.st Subject: Re: _shell_p standardization: a suggest Message-ID: <-115000@batcomputer.tn.cornell.edu> Date: Tue, 26-May-87 19:26:00 EDT Article-I.D.: batcompu.-115000 Posted: Tue May 26 19:26:00 1987 Date-Received: Wed, 10-Jun-87 06:18:26 EDT References: <2124@cwruecmp.UUCP> Lines: 31 Nf-ID: #R:cwruecmp.UUCP:-212400:batcomputer.tn.cornell.edu:-115000:37777777600:965 Nf-From: batcomputer.UUCP!braner May 26 18:26:00 1987