English Amiga Board

Go Back   English Amiga Board > Support > support.Other

Thread Tools
Old 30 January 2014, 21:03   #1
Registered User
Join Date: Jan 2009
Location: Norway
Age: 44
Posts: 73
Turn off external drives bootblock

Hi guys,

I know there exists a bootblock tool (many actually) to disable external df1 diskdrive.....which is okey. But, is there a command to run from cli later (at any given point) that will enable it again?

I couldn't find source code for Bootblocks that turned off external drives, but my guess its just a tiny little bit set somewhere, where 1=on, 0=off. In which case the already mentioned bootblock simply set it to off.

I believe scoopex bootblock utility or nomad? has a option for turn on/off....so it has to be an easy thing...

Have You seen such a code snippet? In assembly, c, e, amos or similar?
StoneOakvalley is offline  
AdSense AdSense  
Old 30 January 2014, 23:31   #2
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 771
hmm... I made a bootblock that could do this (among other things) called "The Boot" back in 1990 or something... have to go and see if I can find the source for it, because I don't remember how it worked..
hooverphonique is offline  
Old 31 January 2014, 00:16   #3
Registered User
Join Date: Jan 2009
Location: Norway
Age: 44
Posts: 73
Indeed, found the bootblock "The Boot v1.0" * DELIGHT * - AN OVERBOY'S CODE in the Amiga Bootblock Reader: http://eab.abime.net/showthread.php?t=39978

Now, I'm looking forward to the source if it still exists, at least the toggle drive part :-)
StoneOakvalley is offline  
Old 02 February 2014, 20:16   #4
Registered User
Join Date: Aug 2004
Posts: 2,937
There's an installer for another drive-disabling bootblock in the SuperDuper archive. (SuperDuper is an excellent system-friendly disk copier/formatter.)

The code in that bootblock calls disk.resource/AllocUnit() for drives 1-3. I'm not sure if there's any way to undo that properly after the system has booted.

Last edited by mark_k; 02 February 2014 at 20:22.
mark_k is offline  
Old 03 February 2014, 21:02   #5
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 771
Originally Posted by StoneOakvalley View Post
Indeed, found the bootblock "The Boot v1.0" * DELIGHT * - AN OVERBOY'S CODE in the Amiga Bootblock Reader: http://eab.abime.net/showthread.php?t=39978

Now, I'm looking forward to the source if it still exists, at least the toggle drive part :-)
That's not me, I was never in Delight, but in Trash at the time..

I found the source..

 * The Boot V2.0
 * Nice boot-code by
 * Bigmama of Trash! (C) Copyright 1992

OpenFont    = -72

FindResident    = -96
DoIO        = -456
Exec_Complement    = $26
CHIP_End    = $3E
FAST_End    = $4E
ColdCapture    = $2A
CoolCapture    = $2E
AttnFlags    = $128
MemList        = $142
VBlankFreq    = $212
KickCheckSum    = $22A

TimeBeforeExit    = 30 seconds
Delay         = timebeforeexit*50
ScreenSize    = 80*160
ResidentSize    = screensize+1024+1024

        dc.l    $444F5300
        dc.l    0
        dc.l    880

        movem.l    d1-d7/a0-a5,-(SP)
        lea    start(pc),a4
        lea    $6f800,a5
        move.w    #1024/4-1,d0
Copy:        move.l    (a4)+,(a5)+
        dbf    d0,copy
        move.w    #(screensize+1024)/4-1,d0
Clear:        clr.l    (a5)+
        dbf    d0,clear

        lea    $dff004,a4
        moveq    #10,d6
        move.l    a1,(a5)

        move.l    $14(a1),a1
        move.l    $3C(a1),a1
        lea    52(a1),a1
        move.l    a1,-(sp)

GetFont:    move.l    156(a6),a6
        lea    textattr(pc),a0
        move.l    a0,(a0)
        addq.l    #8,(a0)
        jsr    -72(a6)
        move.l    d0,a0
        move.l    34(a0),a2
        move.l    4.w,a6

        lea    text(pc),a3

        moveq    #102,D2
        bsr.w    write

        moveq    #3,D0
        move.w    attnflags(a6),d4
GetCPU:        lsr.b    d4
        bcc.b    dontadd
        addq.b    #1,(chiptype-memtype)+3(a3)
DontAdd:    dbf    D0,getcpu

        move.l    memlist(a6),a0
MemLoop:    tst.l    (a0)
        beq.b    nomoreentries
        movem.l    $12(A0),D1-D2    D1: lower bound, D2: upper bound
        cmp.w    #$20,D1        test for $200000
        blo.b    nextentry
        cmp.w    #$A0,D1        test for $A00000
        bhi.b    nextentry
        sub.w    D1,D2
        add.w    D2,D3
NextEntry:    move.l    (A0),A0
        bra.b    memloop
NoMoreEntries:    swap    D3
        move.w    #$113C,D2
        bsr.w    bintoascii

        lea    memtype+4(PC),a3
        lea    chiptype(PC),A0
        move.l    #$38383100,2(A0)    * "881",0
        lsr.b    D4
        bcs.b    setupfpu
        move.l    #$4E2F4100,(A0)        * "N/A",0
SetupFPU:    and.b    #$1,D4
        add.b    D4,4(A0)
        addq.b    #"F"-"C",(showagnus-memtype)-4(A3)
        moveq    #$60,D5
        move.l    fast_end(A6),D3
        beq.b    dontonfast
        move.w    #"N ",(fastonoff-memtype)-4(A3)
        sub.l    #$C00000,D3
        moveq    #$46,D5
DontOnFast:    move.w    #$1460,D2
        bsr.b    bintoascii

        lea    memtype+4(PC),A3
        move.l    #"CHIP",(A3)
        subq.b    #"F"-"C",(showagnus-memtype)-4(A3)
        move.l    #"hips",(showagnus-memtype)-3(A3)
        move.l    #$41474100,(a0)        * "AGA",0
        btst    #1,(a4)
        bne.b    chipsaga
        move.l    #$45435300,(a0)        * "ECS",0
ChipsAGA    btst    #5,(a4)+
        bne.b    chipsecs
        move.l    #$53746400,(a0)        * "Std",0

ChipsECS    move.l    chip_end(a6),d3
        move.w    #$1780,d2
        bsr.b    bintoascii
        bra.b    checkdrives

BinToAscii:    lsr.l    D6,D3
        moveq    #125,D0
        moveq    #16,D1
        moveq    #3,D7
        lsl.w    D7,D0        calculate #1000
        lea    memsize(PC),A1
BTA_Loop:    divu    D0,D3
        add.b    #"0",D3
        move.b    D3,(A1)+
        lsr.l    D1,D3
        divu    D6,D0
        dbf    D7,bta_loop

Write:        moveq    #7,D7
        moveq    #0,D3
FetchNew:    lea    -screensize(A5),A1
        add.w    D2,A1
        move.b    (A3)+,D3
        beq.b    endwrite
        cmp.b    #31,D3
        bhi.b    charloop
        add.w    D3,D2
        bra.b    fetchnew
CharLoop:    move.b    -32(A2,D3.w),(A1)
        add.w    #192,D3
        lea    80(A1),A1
        dbf    D7,charloop
        addq.w    #1,D2
        bra.b    write
EndWrite:    rts

CheckDrives:    moveq    #2,d0
        move.w    #$1156,d4
        move.l    (sp),a0
        addq.l    #2,a3
        move.l    a3,-(sp)

        moveq    #-1,d1
CheckLoop:    tst.l    (a0)+
        bne.b    nodrive
        move.w    d4,d2
        bsr.b    write
        move.w    #"N ",(drivesonoff-fkeys)(A3)
        moveq    #0,d1
NoDrive:    move.l    (sp),a3
        addq.b    #1,2(a3)
        add.w    #800,d4
        dbf    d0,checkloop
        move.l    d1,(sp)

FKeySetup:    lea    fkeys(PC),A3
        moveq    #3,d1
        move.w    #$1dca,d4
F_Setup:    move.w    d4,d2
        add.w    #800,d4
        bsr.b    write
        dbf    D1,f_setup

        move.w    #$2fdf,D2
        bsr.b    write

        move.l    coldcapture(a6),d0
        add.l    coolcapture(a6),d0
        add.l    kickchecksum(a6),d0
        beq.b    checkntsc
        move.w    #$800,d5
        move.w    #$6f9,d2
        bsr.w    write

CheckNTSC    cmp.b    #50,vblankfreq(A6)
        beq.b    turnonscreen
        or.w    #$860,D5

TurnOnScreen:    lea    -residentsize+(copperlist-start)(a5),a1
        move.l    a1,$80-5(a4)
        move.w    #$83c0,$96-5(a4)

        bsr.b    stopdrive

Loop1:        move.w    #delay,d4
Loop2:        tst.b    (a4)
        beq.b    loop2
Rast:        tst.b    (a4)
        bne.b    rast
        move.w    d5,$180-5(a4)
        subq.w    #1,d4
        beq.b    exitboot
        lea    $bfe001,a3
        btst    d6,$16-5(a4)
        beq.w    reconfigure
        btst    #6,(a3)
        beq.b    exitboot

NotPressed:    move.b    3072(a3),d1
        cmp.b    d0,d1
        beq.b    loop2
        move.b    d1,d0
        sub.b    #$5F,d1
        beq.b    togglefast
NotF1:        addq.b    #$2,d1
        bne.b    notf2
        not.l    (sp)
        lea    drivesonoff(pc),a3
        eor.w    #$866,(a3)
        move.w    #$2104,d2
        bsr.w    write
NotF2:        addq.b    #$2,d1
        bne.b    notf3
        lea    -residentsize+(dosboot-start)(a5),a3
        bsr.b    writeboot
NotF3:        addq.b    #$2,d1
        bne.b    loop1
        lea    -residentsize(a5),a3
        bsr.b    writeboot
        bra.b    loop1

WriteBoot:    moveq    #3,d2
        moveq    #$1,d3
        lsl.l    d6,d3
        bsr.b    trackdisk
        moveq    #4,d2
        bsr.b    trackupdate
StopDrive:    moveq    #9,d2
        moveq    #0,d3

TrackDisk:    move.l    (a5),a1
        move.l    d3,36(a1)
        move.l    a3,40(a1)
        clr.l    44(a1)
TrackUpdate:    move.w    d2,28(a1)
        jsr    doio(a6)

ExitBoot:    movem.l    (sp)+,d0/a0
        or.l    d0,(a0)+
        or.l    d0,(a0)+
        or.l    d0,(a0)
        move.l    156(a6),a0
        move.l    38(a0),$80-5(a4)
        movem.l    (sp)+,d1-d7/a0-a5
        bra.w    getdoslibrary

ToggleFast:    tst.l    fast_end(A6)
        beq.b    reconfigure
        move.b    #$03,$200(A3)
        move.l    #$7FFF7FFF,D0
        move.l    D0,$9A-5(A4)
        move.w    D0,$96-5(A4)
        clr.w    $100-5(A4)
        lea    $0676.w,A6
        sub.l    A4,A4
        lea    $40000,A7
        moveq    #-1,D6
        jmp    $FC0208

ReConfigure:    clr.w    exec_complement(a6)
        move.l    #$f80002,$10.w

        ;clr.l    4.w
        ;lea    $1000000,a0
        ;sub.l    20(a0),a0
        ;move.l    a0,$10.w

Text:        dc.b    "The",1,"Boot",1,"V2.0-"
DelayString:    dc.b    "30",3,"By",1,"Bigmama/Trash",0
MemType:    dc.b    "RealFAST",2
MemSize:    dc.b    "0000",1,"KB",24
ShowAgnus:    dc.b    "CPU",1,1,":",1
ChipType:    dc.b    "68000",0
Drives:        dc.b    "DF1:",0
FKeys:        dc.b    "F1",3,"FAST",16,"O"
FastOnOff:    dc.b    "FF",0
        dc.b    "F2",3,"Drives",14,"O"
DrivesOnOff:    dc.b    "FF",0
        dc.b    "F3",3,"Write",1,"DOS-boot",0
        dc.b    "F4",3,"Write",1,34,"The",1,"Boot",34,0
        dc.b    "LMB:",1,"Exit",30,"RMB:",1,"Reset",0
        dc.b    "Possible",1,"VIRUS!",1,"RMB",1,"kills..",0
TextAttr    dc.l    0
        dc.w    8
        dc.w    0
Topaz        dc.b    "topaz.font"

CopperList:    dc.w    $00e0,$0007,$00e2,$0000
        dc.w    $0100,$9200,$0108,$0000
        dc.w    $008e,$5c81,$0090,$fcc1
        dc.w    $0092,$003c,$0094,$00d4
        dc.w    $0182,$0fff
        dc.w    $ffff,$fffe

        dcb.b    6,0

DosBoot:    dc.l    $444F5300
        dc.l    $6B9AE72B
        dc.l    880

GetDosLibrary:    lea    dosname(pc),a1
        jsr    findresident(a6)
        move.l    D0,A0
        move.l    22(A0),A0
        moveq    #$00,D0

DosName:    dc.b    "dos.library",0       * must be last address of program
I don't remember how it works, but in line 43, A1 contains the IORequest and in line 46, the address stored on the stack points to 3 longs which are either 0 or $FFFFFFFF depending on, if DF1-DF3 are present or not. This value is written back in lines 254-256 (possibly inverted by pressing F2)..

I don't know the exact layout of the positive part of trackdisk.device, so I can't really tell what goes on in lines 43-46.

Note that the code can be a bit tricky to understand as a lot of stuff goes on to make it fit inside the bootblock.

The bootblock assembles with AsmOne/Trash'mOne with ucase=lcase on and ; comment off, so you can try it if you like..

Last edited by hooverphonique; 03 February 2014 at 21:43.
hooverphonique is offline  
Old 04 February 2014, 23:49   #6
Registered User
Join Date: Jan 2009
Location: Norway
Age: 44
Posts: 73
Wow, thanks hooverphonique!!

In the meantime I managed to create a startup-sequence to deal with automation in WinUAE where some disks came up with a requester of "Validating error", and none of the known "kill requesters" type of programs managed to kill it. That is why I wanted to control the DF1 (turn off by boot), then turn on again by startup-sequence command at any time, so that some of the known "kill requesters" (System Request) programs *might/could* work.....

However, I managed to use ActivateWindow and fakekey programs together to let my script run along and not "pausing" WinUAE during my automation needs.


But, your boot source is still valuable for others and myself for possible other projects.

Nice to see sources like these surface from the beyond :-)
StoneOakvalley is offline  
AdSense AdSense  

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quirky External Floppy Drives diablothe2nd support.Hardware 8 09 September 2013 21:42
Need help fixing external floppy drives. trydowave support.Hardware 14 27 February 2013 00:33
Daisy Chaining External Drives Djay support.Hardware 15 08 December 2011 11:07
external floppy drives are..? gracie Retrogaming General Discussion 5 04 March 2007 03:47
How have you boxed your external IDE drives? DDNI support.Hardware 19 08 July 2006 14:33

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 09:05.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.06481 seconds with 13 queries