OS4 DepotLogo by Liksmaskaren 
(anonymous IP: 3.133.159.224,0) 
 HomeRecentStatsSearchMirrorsContactInfoDisclaimerConfigAdmin
 Menu

 Features
   Crashlogs
   Bug tracker
   Locale browser
 

 Categories

   o Audio (343)
   o Datatype (51)
   o Demo (203)
   o Development (596)
   o Document (22)
   o Driver (97)
   o Emulation (147)
   o Game (1005)
   o Graphics (497)
   o Library (115)
   o Network (232)
   o Office (66)
   o Utility (923)
   o Video (69)

Total files: 4366

Full index file
Recent index file

 Links

  Amigans.net
  OpenAmiga
  Aminet
  UtilityBase
  IntuitionBase
  AmigaBounty


Support the site


 Readme for:  Driver » Storage » nvme_driver.lha

NVMe driver

Description: Device driver for NVMe SSDs
Download: nvme_driver.lha       (TIPS: Use the right click menu if your browser takes you back here all the time)
Size: 24kb
Version: 53.1
Date: 26 Mar 23
Author: H Kanning
Submitter: H Kanning
Category: driver/storage
License: Other
Distribute: no
Min OS Version: 4.1
FileID: 12487
 
Snapshots:
 
Comments: 6
Snapshots: 3
Videos: 0
Downloads:  (Current version)
 (Accumulated)

[Show comments] [Show snapshots] [Show videos] [Show content] [Show crashlogs] 
NVMe driver for AmigaOS4 (C) H Kanning
-----------------------------------------------------------------------

First off all: !! DON'T USE THIS DRIVER. I HAVE NO IDEA WHAT I AM DOING SO YOU
WILL MOST LIKELY LOSE ALL YOUR DATA. !!

With that being said this is the first public release of the NVMe driver for
AmigaOS4.

-----------------------------------------------------------------------
What is NVMe:
NVMe is short for Non-Volatile Memory express.  It's basically a transfer
protocol for attachment of mass storage to a computer. 
Unlike SATA, NVMe is specifically designed for solid state flash memory. There
is no separate storage controller. Instead the NVMe SSD is directly connected to
the PCIe bus through an M.2 slot.
The PCIe interface and NVMe protocol offer bandwidth and "IOs per seconds" which
go way beyond anything that SATA can deliver. This high bandwidth is achieved
because NVMe drives connect to a M.2 slots with 4 PCIe lanes. At the time of
writing, the first PCIe 5.0 drives are emerging. These drives have a  maximum
interface speed of 16Gbyte/s while the actual peak performance is already
approaching 10GByte/s.
Eventually, NVMe SSDs will replace SATA SSDs as the new industry standard. But
since modern notebooks and PCs are not shipped with CD/DVD players (modern PC
cases don't even have an external 5.25" bay anymore). And NVMe SSDs are rapidly
becoming larger and cheaper. This will happen sooner rather then later.  

How to attach NVMe to a NG system:
None of the current NG systems offer a M.2 slot directly on the mainboard. But
since an NVMe M.2 slot is basically a PCIe x4 slot with a different form-factor,
we can use a widely available passive PCIe<->M.2 adapter card.
These adapter cards are available with a PCIe x1 or PCIe x4 connector. Don't use
the adapter cards with multiple M.2 slots because they will not work.

The X5000 has both x1 slots and a x4 slot available but there are some
drawbacks:
- The x4 slot is blocked by a double slot GFX card. But with a PCIe extender
cable for either the PCIe x4 slot or PCIe grapgics cards, this slot becomes
accessible.
- All PCIe slots, except the x16 Graphics card slot,  are connected behind a
PCIe switch. Which means additional latency.
- The PCIe slots are limited to version 2.0. This means an interface speed of
"only" 500MB/s (x1) or 2000MB/s (x4). But either way this is still faster then
SATA (300MB/s).

Which NVMe SSDs work with this driver:
This driver should work with any NVMe drive. It was developed to be compliant
with the latest NVMe specification (2.0c).
A lot optional features are not implemented yet. Like the Host Memory Buffer for
cacheless drives. But given the speed of our memory subsystem, I doubt that this
will lead to any noticeable performance increase.
For now, the driver has been tested on a X5000 and in the x4 slot with the
following drives:
- Samsung 970 EVO 1TB
- WD Black SN770 1TB

-----------------------------------------------------------------------
Installation:
Copy "nvme.device" to sys:kickstart/ and add "MODULE Kickstart/nvme.device" to
your sys:devs/kicklayout file.

Alternatively you can copy nvme.device" to DEVS: and mount your partitions
manually with sys:system/Mounter. (Don't forget to set the tooltypes)

-----------------------------------------------------------------------
FAQ: (Forseeable asked questions; This is a first release afteral )

Q: Yessss!! I will get >Gigabyte/s seconds transfer speeds, right?
A: Erm, no. NVMe is designed for multi-threaded and streaming access. Streaming
as in: It takes some overhead to setup a transfer but then we get this train
moving.
You will most likely use NGFS. This filesystem is single threaded and limits the
maximum transfer internally to 32kbyte-128kb. The overhead needed to start those
small transfers will kill speed in a single threaded environment.
The Amiga's slow message port system and the fact that it was decided that
>AmigaOS3.9 drivers have to do gatekeeping for misaligned transfers is also not
helping. (to say the least).
In short: Speed will be higher then a SATA drive with the same filesystem. But
no miracles.

Q: So how fast is it?
A: With NGFS, barely faster than a SATA drive. SFS2 uses a maximum transfer size
of 16MByte. I was able to measure speeds up to 384 MB/s while transferring a
1000MByte file between ram and a SFS2 partition. This beats SATA speeds but
nowhere near its potential.
There is room for improvement but don't expect miracles.

Q: I don't believe you, I will play in media toolbox with blocksize, buffers,
Maxtransfer and the Mask. Or?
A: Nope, these settings are completely ignored by PPC filesystems. So don't
bother changing them. Apparently they are still there for legacy reasons only. 
Everything is decided by the filesystems for you.

Q: Wait a minute. Weren't modern SSD like NVMe SSDs not supposed to drop 512
byte blocksizes and require 4096 instead?
A: That's an urban myth. NVMe drives require at least 4k host memory pages. The
drive itself can support up to 64 different block sizes. The drive will tell
which blocksize will give optimum speed. But so far my Samsung 970 EVO supports
512 bytes only. The more modern WD black SN770 support 512 and 4k as but is
formatted as 512 bytes. Anyways, my driver will report back the formatted
blocksize to the filesystem.
    In future updates I might provide a tool which allows you to change
blocksize and reformat the drive accordingly. (Notice the "might")

Q: Ok, that is all disappointing. But I will be able to boot from this drive,
right?
A: Wrong again. Currently, none of the NG systems support booting from NVMe
drives. U-boot itself supports NVMe since 2017 with three isolated source files
but I was told that it will take a complete rewrite of the X5000 U-boot to add
support. In other words. Never.

Q: Then what is the purpose of this driver?
A: Next time, I will ask myself this question before I start the development.

-----------------------------------------------------------------------
Todo:

A lot. Like:
- A monitoring and control tool
- HMB for cacheless drives
- Support for more than one drive. 
- .....

But I am not in a hurry.

----------------------------------------------------------------------
DISCLAIMER: 

ALL RIGHTS RESERVED.

THIS DRIVER IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. USE IT AT 
YOUR OWN RISK. ANY HARM OR COST AS A RESULT OF USING THIS DRIVER IS 
ENTIRELY AT YOUR OWN EXPENSE.

IN NO EVENT THE AUTHOR OF THIS DRIVER WILL BE LIABLE TO YOU FOR YOUR
DAMAGES.

THIS DRIVER IS FOR NON-COMMERCIAL PERSONAL USE ONLY. IT IS NOT ALLOWED
TO COPY, DISTRIBUTE, PUBLISH, MODIFY, CREATE DERIVATIVE WORKS, SELL OR 
OFFER IT FOR SALE (EITHER PREINSTALLED, INCLUDED OR ANY OTHER FORM OF
DISTRIBUTION) OR IN ANY WAY EXPLOIT THIS DRIVER WITHOUT WRITTEN PERMISSION
BY THE AUTHOR. 

All trademarks are the property of their respective owners.
-----------------------------------------------------------------------
History:

53.1: (26 Mar 2023)
 - First public release



Copyright (c) 2004-2024 by Björn Hagström All Rights Reserved
Amiga OS and its logos are registered trademarks of Hyperion Entertainment