Author Topic: OS2AHCI interface?  (Read 18403 times)

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: OS2AHCI interface?
« Reply #15 on: April 15, 2020, 12:48:13 am »
Hi ivan

The output shown is "as it comes" from smartctl.exe

What "table items" would you like in columns? - a lot of the output is already in columns.


Regards

Pete

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: OS2AHCI interface?
« Reply #16 on: April 15, 2020, 01:33:06 am »
Hi Darriusz

Given that I have seen other posts about you having to switch cores off on your Phenom X6 to get things working at times I suspect there may be a problem somewhere with hardware/acpi interaction(s) on that system - at least it is not just my app :-)

Glad to hear PMsmartcl does not take out the system but Not sure what I can do to help resolve the issues with the Phenom X6...

As regards where the "softlock" occurs with PMsmartctl:

When the path to smartctl.exe has been entered PMsmartctl calls "smartctl --scan > SCAN.TXT" to create a file containing the list of available disks. SCAN.TXT is then read and disk radio buttons  are Enabled for those disks found.

Do the PATA/SATA Radio Buttons corresponding to the installed disks get Enabled? Looking at your previous post it looks like they do... Which could indicate some simple code fails, possibly:-

   // Close text file
      CloseFile(F);

I do not know  a "workaround" if using CloseFile on the SCAN.TXT file is where the "softlock" occurs...

Does the following text get displayed in the top left area of the app?

   1] Locate smartctl.exe
   2] Select Disk
   3] Select Information
   4] Click Show

If "No" then my guess is something goes wrong with CloseFile(F) or thereabouts.

If "Yes" - quite simply, no ideas... The app should be sitting waiting for a user to select disk and information required before clicking the "Show" button.

PMsmartctl uses the following command to get the list of drives:-

   smartctl --scan > SCAN.TXT

Copy'n'Paste the above in a command window opened in your smartctl directory.

The above does not tell you which disk is on what controller though, for that you need to ask the driver what it found at boot ie:-

Copy OS2AHCI$ K:\TEMP\SATA.TRC


Below is the output of both OS2AHC$ (using older 1.32 release as it shows unused ports as well) and smartctl --scan which shows that the disk reported by OS2AHCI$ on Adapter 1 Port 1 is seen as ahci4 by smartctl.exe


OS2AHCI$ output:-

BldLevel: @#Arca Noae LLC:1.32#@##1## 16 Nov 2014 08:16:06     DAZAR1    ::::::@@AHCI Driver (c) 2014 Arca Noae LLC
CmdLine: OS2AHCI.ADD
Adapter 0: PCI=0:17:0 ID=1002:4391 AMD SB700/800 irq=19 addr=0xfeb0b000 version=10200
  Port 0:
    Drive 0: 14593 cylinders, 255 heads, 63 sectors per track (114470MB) (LVM)
  Port 1:
    Drive 0: 60321 cylinders, 255 heads, 127 sectors per track (953855MB) (LVM)
  Port 2:
    Drive 0: atapi removable Drive present but no information available. Not queried by OS.
  Port 3:
    Drive 0: atapi removable Drive present but no information available. Not queried by OS.
  Port 4:
    No drive present
  Port 5:
    No drive present
Adapter 1: PCI=3:0:0 ID=1b4b:9172 Generic Generic irq=47 addr=0xfe810000 version=10000
  Port 0:
    No drive present
  Port 1:
    Drive 0: 30042 cylinders, 255 heads, 255 sectors per track (953848MB) (LVM)


smartctl --scan output:-

ahci0 -d ata # ahci0, ATA device
ahci1 -d ata # ahci1, ATA device
ahci2 -d ata # ahci2, ATA device
ahci3 -d ata # ahci3, ATA device
ahci4 -d ata # ahci4, ATA device


As regards sharing my code: No Problem - was thinking about writing an article on creating a relatively simple WDSibyl application using this app and asking Martin if he wants to "publish" it on os2world so was planning to "open source" PMsmartctl. I suspect your main interest would be the "smartctl --scan" and "copy OS2AHCI$" bits above though.

Incidentially, have you checked whether BS_Info "exposes all the pertinent details a storage device has"  - https://www.wdsibyl.org/index.php?module=Downloads&func=sublevel&cid=24&lang=en


Regards

Pete


ivan

  • Hero Member
  • *****
  • Posts: 1557
  • Karma: +17/-0
    • View Profile
Re: OS2AHCI interface?
« Reply #17 on: April 15, 2020, 01:35:41 am »
Hi Pete,

A couple of examples attached.

The first is as it comes and the second (from Danie's smartmon) is in a much more readable view.

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: OS2AHCI interface?
« Reply #18 on: April 15, 2020, 04:17:15 am »
Hi ivan

Doubt I'll get into the colour side of things - unless I get really bored and decide to write code to display the output rather than using e.exe... OTOH as with Darriusz you are welcome to the source code - just in case you get bored  :-)

Of possible interest is the output I get for Attributes is a bit neater, organised nicely in columns without me coding a thing, see attached Petes_Output.jpg

I currently have no idea why the output on your system is not as neatly organised... Text Editor (e.exe) in use here is AE v1.9.8


Regards

Pete
« Last Edit: April 15, 2020, 04:20:13 am by Pete »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: OS2AHCI interface?
« Reply #19 on: April 15, 2020, 04:37:08 am »
Hi Pete. works well here. The font needs to be monospaced to get the nice columns, system vio seems to work and seems to be the default here for the system text editor. Be nice to pick the editor :)

As for colour output, I quickly looked at the source of smartmontools looking for a ANSI colour option but didn't see one. Might be hidden in Windows source where you have to load ANSI.SYS IIRC to get colours whereas for us, they usually just work. Have to find the source for the older smartmon.

ivan

  • Hero Member
  • *****
  • Posts: 1557
  • Karma: +17/-0
    • View Profile
Re: OS2AHCI interface?
« Reply #20 on: April 15, 2020, 01:09:38 pm »
Hi Pete,

Not worried about the colour, just want the columns.

Here e.exe is actually e.exe so I would echo Dave's statement
Quote
Be nice to pick the editor
.

If I had spare time I would most probably design an AMD based motherboard specifically for use with OS/2.  As it is I am seeing a stack of Win based computers of friends that are working from home and their computers are not up to the task - Bill Gates should be shot for allowing the abomination that is WIN 10 lose on the world.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: OS2AHCI interface?
« Reply #21 on: April 15, 2020, 04:54:37 pm »
Pete,
...PMsmartctl_Test1.zip attached - Simply unzip over previous release and Delete existing PMsmartctl.INI file...

No, that did not make any difference.

I'm curious, what is this written in? I'm trying to make the changes to PMDskmon which is written in C, as is the smartmontools utility. 

I think this is WDSibyl right, so that's PASCAL, or PASCAL-like?

In the meantime I continued on with my debugging here...looks like I'm either not passing the right parameter in my DosDevIOCtl call, or (most likely) the data structure mapping the utility originally had does not account for differences between DANIS506 and OS2AHCI.

So the next step is to pull the OS2AHCI sources (gotta get SVN setup for that first) and review those first.

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: OS2AHCI interface?
« Reply #22 on: April 15, 2020, 10:31:38 pm »
Hi All

Dave and ivans point about choice of editor noted.

I selected to use the Text Editor - either of the e.exe versions - simply because it is likely to exist on most systems. However, as the app develops I see no reason to not offer the user a choice of editor. As the output of smartctl was intended for a command window whatever editor is chosen will have to be set to System VIO font to maintain the output format.

Yes, the IBM e.exe original version can be set to use that font and the smartctl output format is then maintained.


@Dariusz
Sorry PMsmartctl_Test1 has not worked for you, not sure where to look for the problem... Can you post a screenshot of the app suffering a "softlock".
Yes, written using WDSibyl so a sort of Delphi-like version of (Object) Pascal - a fairly easy language/development system to get to grips with.


Regards

Pete

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: OS2AHCI interface?
« Reply #23 on: April 16, 2020, 05:15:01 am »
Hi Pete!

@Dariusz
Sorry PMsmartctl_Test1 has not worked for you, not sure where to look for the problem... Can you post a screenshot of the app suffering a "softlock".
Yes, written using WDSibyl so a sort of Delphi-like version of (Object) Pascal - a fairly easy language/development system to get to grips with...

EUREKA!!!

Yeah, that moment when you've done everything you could think of and then it dawns on you "...I've got that little app running here that's got an EXCEPTION list for a reason...".

That app is X-it, great helper add-on, but it is known for having a potential issue with some applications, most notably those which use VisualREXX DLLs. Not the case for your app, but I gave it a try none the less.

Indeed, that was the fix. Your app now works, no problem. Nice and clean, I can pull up the S.M.A.R.T. details on all the devices.

If there is one suggestion I would make, it is the following: for ATAPI devices (so CD/DVD) perhaps there is a way to identify them accordingly?

In my case I have 3 storage devices on separate AHCI channel ports and a single DVD drive on SATA/IDE channel. But your application shows the DVD as PATA device (which it is not), it is hooked up to a SATA IDE channel after all.

Not sure how easy (or hard) it is to detect this based on smartctl response. I do see it coming back as ATA/ATAPI-7 device with no ATA SMART support, see below.

Code: [Select]
smartctl 7.0 (build date Oct 19 2019) [i386-pc-os2-emx] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     HL-DT-ST DVDRAM GH22NS50
Serial Number:    K2ZA3OC1424
Firmware Version: TN02
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ATA/ATAPI-7 T13/1532D revision 4a
SATA Version is:  SATA 2.6, 1.5 Gb/s
Local Time is:    Wed Apr 15 23:07:44 2020 EDT
SMART support is: Unavailable - Packet Interface Devices [this device: CD/DVD] don't support ATA SMART
AAM feature is:   Unavailable
APM feature is:   Unavailable
Rd look-ahead is: Unavailable
Write cache is:   Unavailable
DSN feature is:   Unavailable
ATA Security is:  Unavailable
Wt Cache Reorder: Unavailable

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

Anyways, thank you, appreciate your willingness to help me in debugging this issue!

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: OS2AHCI interface?
« Reply #24 on: April 16, 2020, 06:14:26 am »
Hi Dariusz

Glad you got PMsmartctl running although why it should need to be on an exception list of some sort I have no idea...

PMsmartctl simply shows whatever "smartctl --scan" finds. If the DVD shows as PATA then it is being reported as PATA by the smartctl output. My guess is a SATA DVD connected to a SATA controller port but using the PATA (danis506) driver could be the cause of that. In which case, for the purposes of both smartctl and the OS, it is considered a PATA drive.

The output you posted contains more lines than I would expect for a SATA connected SATA DVD using the AHCI driver:-

=== START OF INFORMATION SECTION ===
Device Model:     HL-DT-ST DVDRAM GH24NSC0
Serial Number:    K1RE93A5355
LU WWN Device Id: 5 001480 000000000
Firmware Version: LK00
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ATA8-ACS (unknown minor revision code: 0x0210)
SATA Version is:  SATA 3.0, 1.5 Gb/s
Local Time is:    Thu Apr 16 04:43:33 2020 BST
SMART support is: Unavailable - Packet Interface Devices [this device: CD/DVD] don't support ATA SMART


Yes, I use LG DVD drives as well  :-)

Here is a simple way to check the smartctl output is reported "correctly" by PMsmartctl:
After starting PMsmartctl a file will exist in your TEMP directory called SCAN.TXT Open the file with an editor and I think it will show the 3 SATA drives as ahci0 to ahci2 and the DVD as hd0 (presuming it is the only "PATA" drive connected).

Probably should add a note about this to the PMsmartctl readme.


Regards

Pete

« Last Edit: April 16, 2020, 06:19:33 am by Pete »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: OS2AHCI interface?
« Reply #25 on: April 16, 2020, 06:32:11 am »
It's interesting the differences in DVD drive output, mine
Code: [Select]
=== START OF INFORMATION SECTION ===
Device Model:     TSSTcorp CDDVDW SH-S243D
Serial Number:    R4116GDB400519
Firmware Version: SB00
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ATA/ATAPI-7 (unknown minor revision code: 0x0210)
Local Time is:    Wed Apr 15 21:23:48 2020 PDT
SMART support is: Unavailable - Packet Interface Devices [this device: CD/DVD] don't support ATA SMART
AAM feature is:   Unavailable
APM feature is:   Unavailable
Rd look-ahead is: Unavailable
Write cache is:   Unavailable
DSN feature is:   Unavailable
ATA Security is:  Unavailable
Wt Cache Reorder: Unavailable

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

Note nothing about the SATA support.
Meanwhile I just spent an hour trying various drive combinations before DDGing. Smartctl showed my 1 TB drive as the only one hooked up as SATA 3, and I thought that 2 ports were SATA 3. Turned out only port 0 is SATA 3, now with my SSD plugged in. Did slightly slow down the 1TB drive though.

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: OS2AHCI interface?
« Reply #26 on: April 16, 2020, 02:39:37 pm »
Hi Dave

No mention of SATA in your cd/dvd info output certainly stops 1 idea in it's tracks...

Guess I could add a "Drives" button which when clicked would query danis506$ and os2ahci$ to see what physical drives are attached to what controllers and display that info.

I am a bit confused by part of your post. It seems you are saying that your mainboard has a number of SATA ports but only Port 0 is SATA3 capable? Seems strange - all SATA3 controllers on several mainboards here have all ports SATA3 capable but will work with earlier SATA spec drives, obviously at the lower spec speed eg SATA2.


Regards

Pete

ivan

  • Hero Member
  • *****
  • Posts: 1557
  • Karma: +17/-0
    • View Profile
Re: OS2AHCI interface?
« Reply #27 on: April 16, 2020, 03:31:59 pm »
Hi Pete,

I don't know if this info from the DVD drive on my test machine will be of help or not (it is connected to the first SATA port.

smartctl 6.6 2017-04-23 r4424 [i386-pc-os2-emx] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     ATAPI   iHAS124   F
Serial Number:    3524728 2H8806500197
Firmware Version: CL9N
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 2.6, 1.5 Gb/s
Local Time is:    Thu Apr 16 14:01:50 2020 CDT
SMART support is: Unavailable - Packet Interface Devices [this device: CD/DVD] don't support ATA SMART
AAM feature is:   Unavailable
APM feature is:   Unavailable
Rd look-ahead is: Unavailable
Write cache is:   Unavailable
DSN feature is:   Unavailable
ATA Security is:  Unavailable
Wt Cache Reorder: Unavailable

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

Regarding different speed SATA ports, I have seen that especially where there is more than one SATA controller chipset involved - one of them is usually a lower spec unit, hence the lower speed or may require a specific driver to get the higher speed.
 

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: OS2AHCI interface?
« Reply #28 on: April 16, 2020, 04:35:23 pm »
Hi Pete, my question about SATA was answered here, https://www.dell.com/community/Desktops-General-Read-Only/Optiplex-790-What-SATA-Port-is-SATA-3-0/td-p/3966182 seems the Q65 chipset supports 2 SATA 3 ports ot 4 SATA 2 ports and Dell compromised.
As for detecting DVD's, perhaps the fact that none seem to be in the smart database or that they all seem to fail a smart command?

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: OS2AHCI interface?
« Reply #29 on: April 16, 2020, 06:14:51 pm »
Hi Dave

Bit of a naff decision by Dell - cannot have saved them more than a penny or 2.

As I understand it CD/DVD devices do not have SMART support so I would expect them to successfully *fail* to perform a SMART command. Guess it could be used to identify CD/DVD drives but could falsely identify a failing hard disk as CD/DVD - and we would still have Dariusz problem of a PATA detected SATA DVD drive...

Had a busy day so far, not even looked at any coding. Had to clamber up a ladder and replace a broken gutter bracket before gutter fell off. Should have been a quick job but I am still recovering from double hernia repair surgery so had to take it slow and easy.

Just finished the gutter and was having coffee when my replacement monitor power supply board turned up so had a go at fixing my ancient Dell 1707FPf monitor. That went really well, took about 20 minutes and I am currently using it - not sure where the 4 screws left over after reassembly belong but monitor displays DVI or VGA successfully and the USB hub works :-)


Now to try out a few ideas with PMsmartctl - could be a couple of days before all the coding comes together though...


Regards

Pete


« Last Edit: April 16, 2020, 06:50:00 pm by Pete »