OS2 World Community Forum
OS/2, eCS & ArcaOS - Technical => Programming => Topic started by: Pete on November 04, 2019, 05:47:31 pm
-
Hi All
I had a look at using DosPhysicalDisk but that seems to return almost the number of partitions available rather than disks.
Regards
Pete
-
Hi Pete,
In what form do you want that information?
If you want to know how many disks then the first page of Sysinfo/2 will tell you. I don't think that RMVIEW gives the actual disks with the /HW switch.
-
Hi ivan
I was looking to do this with some code.
On thinking a little more about the problem I realised I could simply check what the loaded driver shows. As I am only interested in PATA/SATA drives I can simply run
Copy IBM1S506$ PATA.txt
and
Copy OS2AHCI$ SATA.txt
Then parse the resulting files to find out what, if any, disks are controlled by the driver.
Still interested in knowing if there is a c/c++/pascal function that returns the number of disks attached rather than almost the number of partitions available to the system.
Regards
Pete
-
Hi Pete,
The following is from the Sysinfo/2 readme;
Alexey Smirnov SysInfo/2 - Beta 0.8.26
-------------------------------------
NAME
SysInfo.exe - OS/2 PM System Information utility, a ground-up clone of
the Symantec NU for Win 95/NT SysInfo concept.
SYNOPSIS
SysInfo/2 is a useful PM tool for any person who wants to know
more about their machine and understand how OS/2 uses the
hardware resources of their PC. It is doesn't contain *any*
Symantec code (except of some grabbed pictures ;-), In the future, I
will replace these with my own)
DESCRIPTION
Because the original system information and analyse tools
provided by IBM and other manufacturers are less informative, I
wanted to fill this "outer space" by writing my own PM tool in
accordance with a modern view on the requirements.
SysInfo/2 was written using SpeedSoft Sibyl compiler
(evaluation copy ;-)). To collect information about running
processes and memory utilization IBM Theseus API was used.
List of features:
1st page - total information material:
- CPU & FPU type and quantity,
- BIOS information,
- Memory amount and utilization,
- System Bus information,
- HDD information,
- Floppy info,
- Video subsystem info,
- MMOS2 (Multimedia) info,
- LPT and Com port info,
- OS/2 version,
- Fixpack level,
- DOS, WinOS/2, Win32s support.
---------------------------------------------------------------------
Since it is written in SpeedSoft Sibyl you might be able to find something that will do what you want.
-
Hello Pete
Maybe it will serve you
LVM /QUERY
Saludos
-
The LVM toolkit has the Get_Drive_Control_Data function which does what you want.
http://www.altsan.org/os2/toolkits/lvm/lvmref/LVMREF.html (http://www.altsan.org/os2/toolkits/lvm/lvmref/LVMREF.html)
The number of drives is returned in the Count field.
-
Hi All
Thanks for the suggestions.
In the end I went with querying the IBM1S506$ and OS2AHCI$ files as it seems to be the only way to ascertain how many of what type of ?ATA disks are attached and to which ports.
Regards
Pete
-
Interesting. The log is named here ibms506$, without the '1'.
-
Hi Andreas
Yes, Sorry, my typo...
Regards
Pete
-
Under rexx, you have rxlvm
RxLvmGetDisks Gets a list of all physical disk drives recognized by the system
-
Hi Remy
Does RxLvmGetDisks also return the type of disks - PATA or SATA - and port numbers in use?
Regards
Pete
-
Hi Remy
Does RxLvmGetDisks also return the type of disks - PATA or SATA - and port numbers in use?
Regards
Pete
Hi Pete
rxlvm inf extrat:
Parameters
stem
The name of the stem variable in which the list of disks will be stored. After RxLvmGetDisks returns successfully, stem.0 will contain an integer n, indicating the number of disks found; and stem.1 through stem.n will each contain data describing a single disk, in the format:
handle number size unuseable corrupt removeable serial name
The meanings of the various fields are:
handle The disk's handle (a unique 8-digit hexadecimal string).
number The number assigned to the disk drive by LVM. This is a positive integer, where 1 represents the first disk.
size The total size of the disk, in megabytes (1 megabyte = 1,048,576 bytes).
unuseable A flag indicating whether the disk drive is reported "unuseable" (i.e. inaccessible) by LVM. This is one of the following values:
0 The disk drive is useable
1 The disk drive is currently being reported as unuseable
corrupt A flag indicating whether the disk drive has a corrupted partition table (as reported by LVM). This is one of the following values:
0 The partition table is correct
1 The partition table is being reported as corrupt
removeable This flag indicates whether or not the disk drive is a removeable media device. This is one of the following values:
0 Normal disk drive
1 Partitionable removeable media device
2 "Big floppy" type removeable media (e.g. LS-120 super-diskette)
serial The serial number reported by the disk drive. This is an integer value.
name The disk's name. This is a string of up to 20 characters, and may contain spaces and punctuation marks.
Returns
RxLvmGetDisks returns 1, or an LVM error message.
Example
qd = RxLvmGetDisks("disks.")
IF LEFT( qd, 6 ) == 'ERROR:' THEN DO
PARSE VAR qd 'ERROR: ' lvm_error
SAY 'LVM.DLL returned error code' lvm_error
RETURN lvm_error
END
SAY disks.0 'disks found:'
DO i = 1 TO disks.0
SAY ' ' disks.i
END
The following is a sample of output from the example above:
3 volumes found:
FC047717 1 156327 0 0 0 890692272 [ D1 ]
FC047767 2 156327 0 0 0 700276006 [ D2 ]
FC0477B7 3 0 1 0 1 0 [ D3 ]
The RxLvmGetVolumes( stem ) provides the device type (for the volume and not disk)
device The type of device on which the volume resides. This is one of the following values:
HDD Hard disk drive
PRM Partitionable removeable media
CD CD/DVD drive (not controlled by LVM)
LAN LAN drive (not controlled by LVM)
? Unknown device type (not controlled by LVM)
Regards
Rémy
-
Does RxLvmGetDisks also return the type of disks - PATA or SATA - and port numbers in use?
No. That is not information the LVM engine provides (or cares about), as it takes place at a lower level in the OS. The only distinctions LVM cares about are partitionable DASD, removable DASD, or non-LVM-managed device.