Article View: comp.sys.atari.st
Article #35440Re: Setting default environment from auto folder
From: Thomas_E_Zerucha
Date: Sat, 10 Dec 1988 05:30
Date: Sat, 10 Dec 1988 05:30
82 lines
2316 bytes
2316 bytes
I managed to do it - it was fairly simple, but what you have to do is find
the pointer in the environment of the parent of the process from the auto
folder (or the parent of the parent - the one that the desktop gets).
A short assembly program follows (the one I use)
---cut here---
.text
*housekeeping
move.l a7,a5
move.l 4(a5),a5 ;compute size for TSR call
move.l $c(a5),d6 ;text
add.l $14(a5),d6 ;data
add.l $1c(a5),d6 ;bss
add.l #$100,d6 ;basepage
add.l #$40,d6 ;saftey
* alter vector
move.l #doit,-(sp) ;point to the vector changer code
move.w #38,-(sp) ;we want to do it in supervisor mode!
trap #14 ;execute it!
addq.l #6,sp
* tell everyone we are here
pea msg1
move.w #9,-(sp)
trap #1
addq.l #6,sp
* TSR
clr -(sp) ;exit but stay
move.l d6,-(sp)
move #$31,-(sp)
trap #1
bexit: move #0,-(sp)
trap #1
* set env upon startup
movenv:
move.l a7,a5
move.l 4(a5),a5
move.l a5,a4
linkup:
move.l $24(a4),a4
movea.l $2c(a4),a3
cmp.w #0,(a3)
beq.s setwork
move.l a4,a5
bra.s linkup
setwork:
move.l #workar,$2c(a5)
move.l shlsav,a5
jmp (a5)
***
* install (in super) vector
doit: move.l $4fe,shlsav ;move
move.l #movenv,$4fe ;move
rts ;and return
***
*************************
.data
msg1: dc.b 'GEM Resource Path Set\r\n',0
shlsav: dc.l 0
workar: dc.b 'PATH=;D:\\RESOURCE;D:\\;D:\\BIN'
dc.b ';d:\\LANG;D:\\SCRIPTS;D:\\USRBIN;.',0
dc.b 'TEMP=c:\\tmp\\',0
dc.b 'INCLUDE=d:\\include\\',0
dc.b 'SYMB=d:\\lang\\',0
dc.b 'LIB=d:\\lib\\',0
dc.b 'STARTUP=d:\\lib\\gemstart',0
dc.b 'RUNTIME=d:\\lib\\gemlib',0
dc.b 'SUFF=,.prg,.ttp,.tos',0
dc.b 'LIBPATH=d:\\mwlib,d:\\lang,.',0
dc.b 'INCDIR=d:\\mwinc\\',0
dc.b 'TMPDIR=c:\\tmp\\',0
dc.b 'TIMEZONE=EST:0:EDT',0
dc.b 'M2SBM=d:\\modlibs',0
dc.b 'M2OBM=d:\\modlibs',0
dc.b 'EDITOR=stedt.ttp',0
dc.b 'SEDT=d:\\include\\',0
dc.b 'SHELL=csh.tos',0
dc.b 0,0
.end
Technical Details
Message-ID:
<12409@cup.portal.com>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!portal!cup.portal.com!Thomas_E_ZeruchaReferences:
<528@gould.doc.ic.ac.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!portal!cup.portal.com!Thomas_E_Zerucha From: Thomas_E_Zerucha@cup.portal.com Newsgroups: comp.sys.atari.st Subject: Re: Setting default environment from auto folder Message-ID: <12409@cup.portal.com> Date: 10 Dec 88 05:30:51 GMT References: <528@gould.doc.ic.ac.uk> Organization: The Portal System (TM) Lines: 82