English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 18 November 2020, 10:46   #1
litwr
Registered User

 
Join Date: Mar 2016
Location: Ozherele
Posts: 186
Amiga drive list

I need to get all Amiga hardware drive list, e.g., DF0: DF1: DH0: RAM:
I know that 'info' utility can produce such a list. Is it possible to get its sources? Maybe someone knows how it works?
I have tried to use a call to Lock function but it works poorly because it invokes an irritating dialog window "Please insert volume XXX: in any drive" if the pointed disk is not used in the tested system. The same dialog appears when I use a call to Open-function. Is it possible to block this dialog invocation?
It seems that WB has such a list of drives but I don't know how to get it.
Any hints are welcome. Thank you.
litwr is online now  
Old 18 November 2020, 11:13   #2
hooverphonique
ex. demoscener "Bigmama"

 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,194
IIRC, you can block dos dialogs by setting the window pointer of your process (pr_WindowPtr) to -1, but I'm not sure how that helps in getting a drive list.
hooverphonique is online now  
Old 18 November 2020, 11:19   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 24,564
dos.library has list that can be used to find all devices, volumes and assigns.

KS2.0+ has dos library functions to access it (LockDosList etc), under KS 1.x you need to do it manually.
Toni Wilen is online now  
Old 18 November 2020, 13:52   #4
litwr
Registered User

 
Join Date: Mar 2016
Location: Ozherele
Posts: 186
Quote:
Originally Posted by hooverphonique View Post
IIRC, you can block dos dialogs by setting the window pointer of your process (pr_WindowPtr) to -1, but I'm not sure how that helps in getting a drive list.
Thank you very much. It works but I am unsure about a way to get the pr_WindowPtr pointer. I use the next code.
Code:
    SUB.L A1,A1	
    MOVE.L ExecBase.w,A6
    JSR FindTask(A6)
    move.l d0,a4
    move.l #-1,$b8(a4)  ;pr_Windowptr
Is it correct to use plain offset $b8? It is very confusing that documentation says that FindTask returns a pointer to a Task structure not to a Process structure.
Do I need to save an old value of pr_Windowptr? I have read that it is better to restore it before the program finishes but I don't understand a reason for this. Would someone like to help me to clarify this matter?
IMHO there are not many typical disk drive names for Amiga. They are only DFn, DHn, and RAM. So I can just check every possible case while the list is being built.
litwr is online now  
Old 18 November 2020, 14:07   #5
litwr
Registered User

 
Join Date: Mar 2016
Location: Ozherele
Posts: 186
Quote:
Originally Posted by Toni Wilen View Post
dos.library has list that can be used to find all devices, volumes and assigns.

KS2.0+ has dos library functions to access it (LockDosList etc), under KS 1.x you need to do it manually.
Thank you very much. This way seems the best one. But I am confused documentation about driver/dos lists. Would you like to help me a bit more?
I have just tried to traverse the driver list by the next code.
Code:
    lea.l name(pc),a1      ;pointer to a device name, e.g., df0:
    move.l ExecBase,a6 
    lea.l 350(a6),a0        ;pointer to the device list
    jsr FindName(a6)
It doesn't work. I checked the list on which a0 points but it contains only names like 'keyboard.device', 'timer.device', ... How can I get a pointer to a list with disk drive devices?
litwr is online now  
Old 18 November 2020, 15:39   #6
hooverphonique
ex. demoscener "Bigmama"

 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,194
Quote:
Originally Posted by litwr View Post
Is it correct to use plain offset $b8? It is very confusing that documentation says that FindTask returns a pointer to a Task structure not to a Process structure.
Do I need to save an old value of pr_Windowptr? I have read that it is better to restore it before the program finishes but I don't understand a reason for this. Would someone like to help me to clarify this matter?
It is perfectly fine to use a 'plain' offset, but easier to read if you write 'move.l #-1,pr_WindowPtr(a4)'


The first part of the process structure is the task part of the process, so when using FindTask(0) in a process, you get a pointer to a task+process-specific data at the end of it. Have a look here.


You need to save the value in pr_WindowPtr and restore it when done as your process is the same as the CLI process when you start your program from CLI.
hooverphonique is online now  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Workbench 1.3 hard drive games list Bloodwych project.ClassicWB 40 15 September 2015 00:11
Wanted: Amiga External Floppy Drive Case/Housing with Interface (or dead drive) Starglider 2 MarketPlace 1 04 August 2015 16:53
Gotek Drive - Cant press enter on list? ADz support.Other 3 31 August 2014 16:32
List in alphabetical order in dropdown list of Floppy Drives Zed request.UAE Wishlist 1 06 February 2010 18:26
Strange Amiga 1200 floppy drive... PC drive converted to amiga? jbenam support.Hardware 8 30 March 2009 20:24

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 12:17.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.10889 seconds with 15 queries