home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
148.lha
/
Install_II
/
BootCode2.asm
< prev
next >
Wrap
Assembly Source File
|
1988-04-25
|
2KB
|
109 lines
*
* BootCode2.asm - give preference to MEMF_CHIP and deactivate external drives
* Copyright (C) 1987 Ralph Babel, Falkenweg 3, D-6204 Taunusstein
* all rights reserved - alle Rechte vorbehalten
*
* 07-Aug-1987 created
* 30-Mar-1988 cleanup
*
nolist
include "exec/types.i"
include "exec/execbase.i"
include "exec/memory.i"
include "exec/resident.i"
include "devices/bootblock.i"
include "resources/disk.i"
list
*
* registers
*
REG_SysBase equr a6
*
* macros
*
xlib macro
xref _LVO\1
endm
callsys macro
jsr _LVO\1(REG_SysBase)
endm
*
* IMPORT, external symbol references
*
xlib Forbid
xlib Permit
xlib Remove
xlib Enqueue
xlib OpenResource
xlib FindResident
*
* constants
*
ROOT equ 880 ;default AmigaDOS root block (3.5 inch)
NEW_PRI equ 10 ;priority for MEMF_CHIP regions
*
* code section
*
section "text",code
*
* magic constants
*
BBID_DOS
dc.l 0 ;checksum
dc.l ROOT
*
* boot code, called on system start-up
*
* In:
*
* A1: IOStdReq for TD_NAME, UNIT_0
* A6: SysBase
*
* Out:
*
* A0: start address to jump to (D0 == zero)
* D0: failure code, null if successful
*
move.l d2,-(sp)
callsys Forbid
movea.l LH_HEAD+MemList(REG_SysBase),a1
bra.s 3$
1$ btst.b #MEMB_CHIP,MH_ATTRIBUTES+1(a1) ;hi .. lo
beq.s 2$
move.l a1,-(sp)
callsys Remove
movea.l (sp)+,a1
move.b #NEW_PRI,LN_PRI(a1)
lea MemList(REG_SysBase),a0
callsys Enqueue
2$ movea.l d2,a1
3$ move.l (a1),d2 ;move.l LN_SUCC(a1),d2
bne.s 1$
callsys Permit
move.l (sp)+,d2
lea diskName(pc),a1
callsys OpenResource
tst.l d0
beq.s error
movea.l d0,a0
lea DR_UNITID+4(a0),a0
moveq #DRT_EMPTY,d0
move.l d0,(a0)+ ;unit 1
move.l d0,(a0)+ ;unit 2
move.l d0,(a0) ;unit 3
lea dosName(pc),a1
callsys FindResident
tst.l d0
beq.s error
movea.l d0,a0
movea.l RT_INIT(a0),a0
moveq #0,d0
rts
error moveq #-1,d0
rts
diskName:
dc.b 'disk.resource',0
dosName:
dc.b 'dos.library',0
end