16 February 2023, 01:38 | #21 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,043
|
It's only to determine the boot device. To get a list of all (floppy) devices I was using disk.resource to check unit IDs: empty if -1, 3.5' if 0, 5.25' if $55555555 (or something like that, it's been ~30 years ;P ).
|
17 February 2023, 09:24 | #22 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,251
|
A second, more sever problem of this approach is that it is not at all clear that the boot device is a floppy in first place. Clearly, the boot block is only executed for boot-block booting, and not for boot-point-booting, the latter being the mechanism by which hard-disks are booted. However, there are other devices such as CC0: (i.e. the carddisk.device) which may offer boot-point booting. Thus, in general, you *can* use the IORequest passed into the boot block code to read further blocks from the device being booted from, but you should not depend on what this device actually is.
Which brings me to the next question: Why exactly is the information on the unit actually particularly needed? It should not. |
17 February 2023, 09:42 | #23 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,480
|
Quote:
Ok ok, you could scan active drives and look for a pattern on any inserted disks to figure out where you're running from. But why complicate life? Better to let the system do it and then focus on the important things I know I gave you a tummy ache, but that's the way it is And anyway a/b had warned about the side effects of this approach. |
|
17 February 2023, 12:56 | #24 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,043
|
The whole thing is not meant for "serious" software, but for demos/games that exclusively run from a non-DOS floppy disk, as far as I'm concerned. Typically you want the bootblock code to be as short and possible, and that then implies (ab)using the OS to get the required info and wiping it out afterwards.
Back in the day people would go a long way just to 100% avoid using the OS (e.g. AttnFlags don't care, I can detect the cpu on my own, memory list don't care, I'll just write patterns to memory and scan, etc.), so this is a happy medium. You just have to put it in the correct context.... |
17 February 2023, 17:09 | #25 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,633
|
Just like the longer OpenDevice() approach, it will only check the 4 floppy units. If you somehow booted from a different type of unit and reach this code, it will not be in the list or be openable with trackdisk.device, and so simply return -1 not found.
If someone rips boot code from a floppy and manually writes it to a different type of unit, they should expect a different outcome, shouldn't they? The topic is nice and specific Checking every type of unit would be ambitious and I guess requires some imagination to check all possible ways to boot, and not miss one. On KS2+, you can boot from a different floppy than DF0. To check which boot floppy unit to continue loading from was missing from virtually every game and demo back in the day; they assumed DF0: since KS2.0 wasn't out yet. The games and demos have not been re-released with a fix. It would be gracious and proper to support it now. Last edited by Photon; 17 February 2023 at 17:27. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Determining boot drive from custom bootblock | Keir | Coders. General | 0 | 15 July 2017 10:16 |
boot floppy w/o bootblock | emufan | request.UAE Wishlist | 0 | 12 March 2014 16:57 |
How to find Exec device name and unit number for boot drive | mark_k | Coders. System | 3 | 16 February 2013 19:52 |
uaehf.device and HDToolbox: Error 224 reading device description | Ebster | support.WinUAE | 3 | 16 September 2008 09:24 |
Using a partition as an Amiga Boot Device for UAE | JeffreyUS | support.WinUAE | 6 | 09 February 2006 01:36 |
|
|