Changeset 128 for trunk


Ignore:
Timestamp:
Oct 14, 2011, 10:22:12 PM (14 years ago)
Author:
cjm
Message:
  • Added IBMS506$ character device driver to support existing SMART tools
  • Finishing touches to SMART support
  • Updated READNE with information around "/f" command line parameter and SMART support
Location:
trunk/src/os2ahci
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/README

    r120 r128  
    5757 - ALP Assembler (part of DDK)
    5858 - link.exe (part of DDK)
     59
     60Please note that builds other than the official binary delivered as
     61part of eComStation releases or downloaded from ecomstation.nl are
     62not officially supported by Mensys.
    5963
    6064
     
    101105/t                     Perform thorough PCI ID scan; default = on, can be
    102106                       turned off with /!t to perform only a PCI class scan
     107/f                     Force the use of the HW write cache when using NCQ
     108                       commands; see "Native Command Queuing" below for
     109                       further explanation
    103110/r                     Reset ports during initialization (default = off
    104111                       unless the [Intel] AHCI controller was found to be
    105                        initialized by the BIOS to SATA mode)
     112                       initialized by the BIOS in SATA mode)
    106113/a                     Set adapter for adapter-specific options
    107114                       (default = -1, all adapters)
     
    173180option "/n" to OS2AHCI.ADD.
    174181
     182NCQ and HW Caches
     183-----------------
     184
     185In NCQ mode, OS2AHCI supports a request flag which allows upstream code
     186(e.g. file systems) to force writes to go directly to the disk instead
     187of being buffered in the HW disk cache. However, at least JFS doesn't
     188support this flag properly which effectively disables the HW disk cache
     189for write operations across the board, resulting in a substantial
     190performance loss. In order to prevent OS2AHCI from disabling the HW
     191cache when so requested by upstream code, please use the command line
     192option "/f".
     193
     194This may, of course, result in data loss in case of power failures but
     195apparently this was the situation with previous IDE drivers as well thus
     196shouldn't make much difference in the field. The JFS code also seems to
     197imply that this flag has never been widely supported by [IDE] drivers;
     198otherwise, the JFS developers should have stumbled over the performance
     199loss a long time ago and fixed the code.
     200
     201NOTES:
     202
     203 - Without NCQ, OS2AHCI behaves like former IDE drivers, i.e. the HW
     204   cache will always be enabled (on modern disks).
     205
     206 - When suspending, rebooting or shutting down, OS2AHCI always flushes
     207   the HW disk cache regardless of the "/f" or "/n" command line options.
     208
    175209
    176210Interoperability With IDE Drivers
     
    278312always done via DMA.
    279313
     314
     315SMART Support
     316=============
     317
     318Starting with version 1.22, OS2AHCI supports the IOCTL interface required by
     319existing SMART monitoring tools. Since those tools are hard-coded to open
     320the character device named "IBMS506$", OS2AHCI will now register a device
     321with this name, too.
     322
     323NOTES:
     324
     325 - If multiple drivers exporting this character device name are loaded at
     326   the same time, the driver loaded last will receive all [SMART] requests.
     327   This means that if both DANIS506 and OS2AHCI are loaded and SMART support
     328   for OS2AHCI-controlled hard disks is desired, OS2AHCI will have to be
     329   loaded after DANIS506. It also means that DANIS506 may have to be told
     330   to ignore type 2 controllers (i.e. controllers supporting both SATA and
     331   AHCI) using the command line options "/A:x /I".
     332 
     333 - The IOCTL interface for SMART is based on the idea of IDE controllers
     334   with a master and a slave drive. OS2AHCI maps all devices (ATA or ATAPI)
     335   sequentially to this pattern. If, for example, you have 4 hard disks and
     336   one CDROM attached to a single controller on ports 1, 2, 5, 7, and 11,
     337   SMART tools will see 3 controllers as follows:
     338
     339    - controller 0, master: HD on port 1
     340    - controller 0, slave:  HD on port 2
     341    - controller 1, master: HD on port 5
     342    - controller 1, slave:  HD on port 7
     343    - controller 2, master: CDROM on port 11
     344
     345 - The DSKSP_GEN_GET_COUNTERS interface is currently unsupported; calls to
     346   the corresponding IOCTL will return 0 for all counters. SMART counters
     347   are not affected by this limitation, i.e. SMART tools will be able to
     348   report counters from the physical disk; this limitation only affects
     349   the software counters maintained by ADD drivers which do support the
     350   DSKSP_GEN_GET_COUNTERS IOCTL request.
     351
  • trunk/src/os2ahci/init.asm

    r79 r128  
    2828
    2929DEVHDR          SEGMENT WORD PUBLIC 'DATA'
    30 _dev_hdr        dd      -1                      ; no headers after this one
     30_dev_hdr        dd      _legacy_hdr             ; next device header
    3131                dw      DEVLEV_3 + DEV_CHAR_DEV ; flags for ADD drivers
    32                 dw      _asm_strat              ; strategy routine
     32                dw      OFFSET _asm_strat       ; strategy routine
    3333                dw      0                       ; no IDC routine
    3434                db      "OS2AHCI$"              ; name of character device
    3535                dq      0                       ; 8 reserved bytes
    3636                dd      DEV_IOCTL2 + DEV_ADAPTER_DD + DEV_INITCOMPLETE + 20h ; ADD flags
     37                dw      0
     38
     39_legacy_hdr     dd      -1                      ; no headers after this one
     40                dw      DEVLEV_3 + DEV_CHAR_DEV ; flags for ADD drivers
     41                dw      OFFSET _asm_strat       ; strategy routine
     42                dw      0                       ; no IDC routine
     43                db      "IBMS506$"              ; name of character device
     44                dq      0                       ; 8 reserved bytes
     45                dd      0
    3746                dw      0
    3847DEVHDR          ENDS
  • trunk/src/os2ahci/ioctl.c

    r126 r128  
    462462  UCHAR parm;
    463463
    464   /* this is not sufficiently tested so far */
    465   return(STDON | STATUS_ERR_UNKCMD);
    466 
    467464  /* verify addressability of parm buffer (DSKSP_CommandParameters) */
    468465  if (DevHelp_VerifyAccess((SEL) ((ULONG) cp >> 16),
  • trunk/src/os2ahci/os2ahci.c

    r125 r128  
    161161USHORT init_drv(RPINITIN _far *req)
    162162{
     163  static int init_drv_called;
     164  static int init_drv_failed;
    163165  RPINITOUT _far *rsp = (RPINITOUT _far *) req;
    164166  DDD_PARM_LIST _far *ddd_pl = (DDD_PARM_LIST _far *) req->InitArgs;
     
    172174  u16 vendor;
    173175  u16 device;
     176
     177  if (init_drv_called) {
     178    /* This is the init call for the second (legacy IBMS506$) character
     179     * device driver. If the main driver failed initialization, fail this
     180     * one as well.
     181     */
     182    rsp->CodeEnd = (u16) end_of_code;
     183    rsp->DataEnd = (u16) &end_of_data;
     184    return(STDON | ((init_drv_failed) ? ERROR_I24_QUIET_INIT_FAIL : 0));
     185  }
     186  init_drv_called = 1;
    174187
    175188  /* set device helper entry point */
     
    375388  rsp->CodeEnd = 0;
    376389  rsp->DataEnd = 0;
     390  init_drv_failed = 1;
    377391
    378392  /* free context hooks */
  • trunk/src/os2ahci/version.h

    r125 r128  
    1414
    1515
    16 #define VERSION            121       /* driver version (2 implied decimals) */
     16#define VERSION            122       /* driver version (2 implied decimals) */
    1717
Note: See TracChangeset for help on using the changeset viewer.