[net.micro.amiga] Has Anyone written/seen programs like these?

mende@topaz.RUTGERS.EDU (Mende) (06/26/86)

  Earlier today I was talking with a friend of mine who has had his
Amiga for about 3 months and we came to the conclusion that there are
a lot of things that AmigaDos needs.  Since he does not have access to
the net I decided to post and see if anyone out there in netland has
written a program to do either of these two tasks.
  First and most importantly, has anyone written a program that will
kill a process *and* reclaim the memory that it was using.  I have
seen a ps type program and a program to set the priority level of a
process but I have not seen a program to kill one.  I was very
disapointed that there was not one on the 1.2Beta release.
  Second program is a little more difficult.  The program I am
thinking of is a Un*x-like alias command.  Right now I am running off
a three drive amiga and I can afford to copy some commands such as
Delete to Del or rm, but this is a horrible way to run a operation
system.  I know that the csh that came over the net (thanks Matt) has
a alias feature; but his program is a task running *over* the normal
CLI and thus recives the input from the keyboard.  The program I was
thinking of would set up an alias table in ram and have one task
running that takes the input and checks it on the alias table.  If it
was on the table it would pass the alias on to the normal task,
otherwish just let the typed command pass through to the normal task.
The program should accept new a alias at any time and show all set
aliases by typing alias.  The program should only have to be run once
because it can catch any mention of the word alias and preform upon
them.  An option on this would be to have alias run but have a second
program on disk that had all the additon and extended features in it 
to save memory when the alias process is running.


                      Bob Mende

ARPA: MENDE@AIM.RUTGERS.EDU
UUCP: topaz!mende

dillon@PAVEPAWS.BERKELEY.EDU (Matt Dillon) (06/27/86)

>  First and most importantly, has anyone written a program that will
>kill a process *and* reclaim the memory that it was using.  I have
>seen a ps type program and a program to set the priority level of a
>process but I have not seen a program to kill one.  I was very
>disapointed that there was not one on the 1.2Beta release.

	Impossible.  The operating system does not keep resource lists.
You can kill the process easily enough, but you cannot reclaim all of 
its resources.

>  Second program is a little more difficult.  The program I am
>thinking of is a Un*x-like alias command.
>					...
>system.  I know that the csh that came over the net (thanks Matt) has
>a alias feature; but his program is a task running *over* the normal
>CLI and thus recives the input from the keyboard.  The program I was
>thinking of would set up an alias table in ram and have one task
>running that takes the input and checks it on the alias table.  If it
>was on the table it would pass the alias on to the normal task,
>otherwish just let the typed command pass through to the normal task.
>The program should accept new a alias at any time and show all set
>aliases by typing alias.  The program should only have to be run once
>because it can catch any mention of the word alias and preform upon
>them.  An option on this would be to have alias run but have a second
>program on disk that had all the additon and extended features in it 
>to save memory when the alias process is running.

	I don't quite understand what your talking about here.  If I've
got this straight, you want a program that intercepts the CLI (or any
program's) Input() stream, expanding it via an internal, global alias
table?  Seems very strange.

					-Matt

rodney@gitpyr.UUCP (RODNEY RICKS) (06/27/86)

In article <5231@topaz.RUTGERS.EDU> mende@topaz.RUTGERS.EDU (Mende) writes:
>
>  First and most importantly, has anyone written a program that will
>kill a process *and* reclaim the memory that it was using.  I have

Don't hold your breath waiting for this one.  AmigaDOS does not keep track
of all of the resources allocated to a task, so it doesn't know where to
find them when the task is killed.  The task must handle this itself.
(Someone correct me if I'm wrong).


>  Second program is a little more difficult.  The program I am
>thinking of is a Un*x-like alias command.  Right now I am running off

This isn't quite what you asked for, but the ASSIGN command can be used
to simulate an alias command.  For example,

   ASSIGN rm: sys:c/delete

   RM: dead meat

This works (assuming delete is in the c directory of sys:), but since
your are in theory assigning a device, you have to have the colon on
the end of the new command.

Disclaimer:  My opinions in no way represent those of Georgia Tech, Alfie
             the killer rabbit, or any sentient creature in this or any
             other universe.

Rodney Ricks
   Department of Information and Computer Science
   Georgia Insitute of Technology  Atlanta, Georgia 30332

UUCP: ...!{akgua,allegra,amd,hplabs,ihnp4,seismo,ut-ngp}!gatech!gitpyr!rodney
 or :                                                   !gatech!gt-oscar!rodney
Mail: Georgia Tech P.O. Box 36616
      Atlanta, Ga. 30332

mykes@3comvax.UUCP (06/27/86)

How's this for a proposal...

I got the source to the Manx 'C' libraries with my compiler, and as I
scan through the subroutines, at least 90% of them are simple GLUE
routines that call the Kernel routines.  It is said that you can't
kill a process on the Amiga because the system does not keep track of
your memory allocation for you.  I do not claim that this is possible
in the general sense on the amiga, but there is something that could 
come close, at the expense of run-time speed and code size during 
development.

Manx did a wonderful job with the libraries for the Amiga.  It is not 
a port from the Mac (it may have started out that way...) or even worse
the PC (like Lattice).  Manx' libraries are optimized in many ways to
take advantage of tricks that can be pulled on the Amiga.  For example,
malloc() is AllocRemember() internally, and free is FreeRemember().  This
allows programs to allocate all they want, then simply call exit() which
calls free() which cleans up everything.  However, this does not solve
problems with openned libraries or devices...  

So what if these glue routines were expanded a little?  Add to them
the necessary guts to remember ALL the resources used by a program,
setting flags, keeping linked lists, so that exit() could automatically
close all your devices, screens, windows, etc.  This would also allow
the Manx _main() routine to birth a task (not process) that could wait
for a message or signal or whatever and could then cause the entire
program to terminate and free up its resources.  Then all anyone would
need is a new version of break or kill or whatever that could send
this "die" message.

So there you have it... A way that a process might be killable under
AmigaDos...

ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) (07/01/86)

*** REPLACE THIS LINE WITH ANOTHER ONE EXACTLY LIKE IT ***

In article <8606262143.AA06402@pavepaws> dillon@PAVEPAWS.BERKELEY.EDU (Matt Dillon) writes:
>
>>  First and most importantly, has anyone written a program that will
>>kill a process *and* reclaim the memory that it was using.  I have
>>seen a ps type program and a program to set the priority level of a
>>process but I have not seen a program to kill one.  I was very
>>disapointed that there was not one on the 1.2Beta release.
>
>	Impossible.  The operating system does not keep resource lists.
>You can kill the process easily enough, but you cannot reclaim all of 
>its resources.

	This, then, brings up the next logical question:  Why doesn't the
DOS do resource tracking?  How difficult would it be to put this in (very
difficult probably (not actually difficult, just time-consuming))?

	Idea:  Someone could cook up a library that replaces Exec/Intuition/
Graphics calls (or provides equivalents) that track your resources.  By
opening the library, you ask for resource management (the library keeps
track of what you've opened by hanging stuff off your task structure or
something).  If you don't open the library, then you handle resource
tracking yourself.  I still say that the DOS should have done this.

	Interesting caveat:  When the program exits or crashes, how can we
get the library to close itself?

	Thoughts at quarter to three in the morning....

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab				ihnp4!ptsfa!well!ewhac
						..or..
"Work FOR?  I don't work FOR		well ---\
anybody!  I'm just having fun."		dual ----> !unicom!ewhac
					hplabs -/       ("AE-wack")