Hi all,
I do need your help because of being totally stuck on the following issue. I have been writing Linux software that runs in User Space mode under root user. It works with AHCI controller and 4 SATA drives attached to it. I use Intel SATA AHCI Specification (http://www.intel.com/content/www/us/en/ ... ev1_3.html) and hints from http://wiki.osdev.org/AHCI.
I managed to map successfully physical address ABAR5 via mmap command. Now I have all 4 SATA ports and their live values of registers working well. For instance, PxTFD shows changes of status and error registers per each drive correctly.
PROBLEM:
Can't understand how I can map physical memory address from PxCLB. It's needed for sending Register FISes containing ATA Commands to HDD. I just can't access that memory anyhow. Tried to use mmap but all my mapping attemts were failed with MAP_FAILED (-1).
Any hints?
How to access HBA_PORT PxCLB from User Space?
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: How to access HBA_PORT PxCLB from User Space?
May I ask why you are writing an AHCI driver in the linux userland? When linux has a working SATA driver already.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Re: How to access HBA_PORT PxCLB from User Space?
It's a part of my company's product that should work with HDDs in very native way via AHCI ports. We support damaged drives, and have somewhat patched kernel for that.thepowersgang wrote:May I ask why you are writing an AHCI driver in the linux userland? When linux has a working SATA driver already.
By the way, I am trying now to recompile linux kernel (2.6.32) with disabled CONFIG_STRICT_DEVMEM options. It seems it may help.
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: How to access HBA_PORT PxCLB from User Space?
I would instead make a kernel module that does the driver actions, and have a userland process send it command sets.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Re: How to access HBA_PORT PxCLB from User Space?
Thanks a lot! Could you hint any kind of short guide that could help to do that?thepowersgang wrote:I would instead make a kernel module that does the driver actions, and have a userland process send it command sets.
I know I am able to google that by myself but suppose your experience can direct me at the best way.