| This file is mainly from Steven Henson's minix file system
| 
| XBRA added by Ulrich Khn
|
| This is a variant of the method use in 'ofake' to use pseudo drives in
| an installable filesystem. Basically mediach, rwabs and getbpb have to
| be faked by intercepting their vectors. It works but it's a kludge, this
| kind of thing shouldn't be necessary.
|

.globl _kludge_rwabs,_kludge_mediach,_kludge_getbpb
.globl _shadmap, _old_rwabs, _old_mediach, _old_getbpb

	.ascii "XBRA"
	.ascii "_XFS"
_old_rwabs:
	.long 0
_kludge_rwabs:
	movel 	_shadmap,d0
	movew	sp@(0xe),d1
	btst	d1,d0
	bne	ret0
	movel	_old_rwabs,a0
	jmp	a0@

	.ascii "XBRA"
	.ascii "_XFS"
_old_mediach:
	.long 0
_kludge_mediach:
	movel	_shadmap,d0
	movew	sp@(4),d1
	btst	d1,d0
	bne	ret0
	movel	_old_mediach,a0
	jmp 	a0@

	.ascii "XBRA"
	.ascii "_XFS"
_old_getbpb:
	.long 0
_kludge_getbpb:
	movel	_shadmap,d0
	movew	sp@(4),d1
	btst	d1,d0
	bne 	ret0
	movel	_old_getbpb,a0
	jmp	a0@

ret0:	clrl	d0
	rts	
