![]() |
![]() |
#1 |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 882
|
Best way to check active floppy in bootblock
Is there an easy way to check which disk drive just booted my bootblock ?
|
![]() |
![]() |
#2 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,545
|
Trackloader?
When I initialize my trackloader, then I will check all available drives for disks and read block 0 from them (which also contains my trackloader directory). I can find out the drive with the game disk by checking for an identification on it, like for example a 32-bit ID in the Root-Block field of the boot block (offset 8), which is unused for NDOS disks (880 otherwise). |
![]() |
![]() |
#3 | |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 882
|
Quote:
|
|
![]() |
![]() |
#4 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,545
|
There is a solution for everything, if you dig deep enough.
As you certainly know, the bootblock receives a trackdisk IoStdReq pointer in A1, which was used to load it. You just have to follow the reference to the drive's Unit structure via IO_UNIT(A1), before it gets difficult... The public portion of the trackdisk Unit structure (refer to TDU_PUBLICUNIT from devices/trackdisk.i) unfortunately does not include the actual unit number. You have to rely on the internal part of the structure, which follows at offset TDU_PUBLICUNITSIZE: Code:
*-- Unit Structure STRUCTURE TDU,TDU_PUBLICUNITSIZE ;(000) UBYTE TDU_DRIVETYPE ;(xxx) the type of the drive UBYTE TDU_RESERVED2 ;(XXX) for alignment UWORD TDU_NUMTRACKS ;(xxx) number of tracks on this drive ULONG TDU_MAXOFFSET ;(xxx) max IO_POSITION allowable ; Note: now variable UWORD TDU_MFM_TRKBUF ; used to be MFM_TRKBUF equate UWORD TDU_MFM_MAXTRACK ; used to be MFM_MAXTRACK+2 equate ; (the +2 is for the $aaa8 on the end!) UWORD TDU_MFM_SLOP ; used to be MFM_SLOP equate UWORD TDU_NUMSECS ; used to be 11 ULONG TDU_TDT_DISKSYNC ; used to be TDT_DISKSYNC ULONG TDU_DISKTYPE ;(xxx) as returned from disk resource ; Note: now variable UBYTE TDU_FLAGS ;(xxx) unit flags UBYTE TDU_6522 ;(xxx) word to write to 6522 UBYTE TDU_RETRY ;(xxx) count of retries UBYTE TDU_UNITNUM ;(xxx) the number of our unit (...much more to follow...) |
![]() |
![]() |
#5 | |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 882
|
Quote:
|
|
![]() |
![]() |
#6 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,545
|
Yes, please tell us if it worked. The internal TDU is from 3.1. I don't know if it changed since 1.x.
|
![]() |
![]() |
#7 |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 882
|
|
![]() |
![]() |
#8 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
|
Why do you need to know boot drive? AFAIK disk private part has changed in all KS versions.
|
![]() |
![]() |
#9 |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 882
|
|
![]() |
![]() |
#10 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
Can't selx bits in $bfd100 give that kind of info ?
|
![]() |
![]() |
#11 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
|
If you already have working trackloader, it should be very easy to add extra drive check. Just find first drive that has disk inserted if you want minimal solution and don't want to check if disk contains expected data.
|
![]() |
![]() |
#12 | |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 882
|
Quote:
I just figured that number must be in RAM or the hardware somewhere if the OS has just used the drive to load my bootblock. |
|
![]() |
![]() |
#13 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
|
Unfortunately simple unit number is not available in any public data structures (or even in static private).
It should be easy after dos exists but boot block executes before dos initializes. |
![]() |
![]() |
#14 |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 882
|
|
![]() |
![]() |
#15 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,491
|
I faced this problem for a multifloppy dynamic loader but not solved in a clean/simple way..
So i've fall back to this steps: - derive which floppies are connected in the chain (this can be from A1 in every KS, see my addchip bootblock, http://eab.abime.net/showpost.php?p=...3&postcount=25) - scan and map with a simple ID in sector 0 what drive contain what floppy - if /CHNG detected, repeat scan and remap ![]() |
![]() |
![]() |
#16 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,491
|
|
![]() |
![]() |
#17 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
|
![]() |
![]() |
#18 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,491
|
|
![]() |
![]() |
#19 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
|
This is most likely too timing sensitive and it probably also depends on disk rotational position.
|
![]() |
![]() |
#20 |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 882
|
What happens if you try and turn the motor on in an empty drive ?
I ask as I think that it probably what happens with a lot of trackloaders if you stick them in df1:. They will load the boot block from df1, then the trackloader will try and load the demo/game data from the hard coded df0: |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
A600 and display distortion when floppy is active | mr.spiv | support.Hardware | 6 | 03 January 2016 10:55 |
Active adapter for PC HD floppy drive to be used as Amiga HD | demolition | support.Hardware | 4 | 23 September 2014 21:14 |
boot floppy w/o bootblock | emufan | request.UAE Wishlist | 0 | 12 March 2014 16:57 |
screen flickers when floppy is active | dalton | support.Hardware | 9 | 28 December 2010 22:48 |
BootBlock Virus check on Zany Golf | NfernalNfluence | support.WinUAE | 9 | 17 June 2009 09:47 |
|
|