home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!psinntp!viper!news
- From: brett@visix.com (Brett Bourbin)
- Subject: Re: HostileTakeOver of Amiga OS
- Sender: news@visix.com
- Message-ID: <C0Hsvs.AH4@visix.com>
- Date: Thu, 7 Jan 1993 16:38:15 GMT
- Reply-To: brett@visix.com
- References: <H9aywB8w165w@lakes.trenton.sc.us>
- Organization: Visix Software, Reston, Virginia
- Lines: 42
-
- In article <H9aywB8w165w@lakes.trenton.sc.us> rock@lakes.trenton.sc.us
- (Rockerboy) writes:
- > mcuddy@fensende.Rational.COM (Mike Cuddy) writes:
- >
- > > the biggest gotcha when taking over the machine is that on >68000
- machines,
- > > the exception vector table is not always at 0. The VBR (vector base
- > > register) is used to move the exception table into fast ram to avoid
- > > contention with the custom chips.
- >
- > Speaking of this, what is the proper way to find the base of the
- vectors?
-
- move.l (_AbsExecBase).W,A6 ; EXEC.library base pointer
- sub.l A1,A1 ; initialize offset to zero
- btst.b #AFB_68010,AttnFlags+1(A6)
- ; check if you need it
- beq.s .noVBR
-
- lea .getVBR(PC),A5 ; get your VBR routine
- jsr _LVOSupervisor(A6) ; switch to Supervisor mode
- ; On return A1 holds the VBR:
- noVBR:
- move.l VEC_xx(A1),myVEC_xx ; save old vector "xx"
- ...
- move.l #myNewVEC_xx,VEC_xx(A1) ; install my new vector handler
- ...
- .your code.
- ...
- rts
-
- getVBR:
- OPT P=68010 ; make sure you can generate it
- movec VBR,A1 ; get the VBR
- rte ; return from Supervisor mode
- OPT P=68000
-
- All system legal. 8^)
- -- _ _ _ _
- Brett Bourbin (_ |_ | /__ | |(_ 4431 Lehigh Road, Suite 151
- brett@visix.com __)|_ |_\_/ \_/__) College Park, Maryland 20740
- ..uupsi!visix!brett LIMITED 703.758.2733
-