I'm writing an experimental kernel-mode program to test some things. I want to do IO to and from a SATA disk attached to an AHCI controller. I have a C driver that previously worked on another similar project that ran on another PC I no longer have. The PC I have now is an HP laptop with the ICH9 chipset. All reads and writes are 2 sectors in size and happen one at a time, so it issues normal LBA48 DMA read/write commands (No NCQ) and gets an interrupt to signal completion. Reading works perfectly as expected, but writing fails 100% of the time. PxSERR remains zero, but the TFES bit lights in PxIS. The device shows 0x84 in the error register (Interface CRC error, command aborted) and 0x51 in the status register (Error, seek complete, device ready). This seems to point to a cabling issue or similar hardware issue, but Linux has no issues reading or writing to the same partition on the same device and the BIOS built-in disk tests report the disk working properly. Sending the device a SET FEATURES command specifying a lower DMA mode makes no difference, and Linux reports putting the device in UDMA/133 mode anyway. (Is this even relevant to SATA?) Anyway, can anyone think of something I'm missing?
Cannot write to SATA disks on AHCI controller in kernel mode program
505 Views Asked by Daniel Seagraves At
0
There are 0 best solutions below
Related Questions in C
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in HARDWARE-INTERFACE
- What could be causing TPM_RC_COMMAND_SIZE error (0x80010000000a00000142) in response to TPM_GETRANDOM?
- Python Serial: WinError 10053 on a hardware connection (DOBOT MG400)
- How can I programmatically decide what class to create an object as?
- Adjust STEM detectors gain
- USBIP appears to send and receive extra URBs compared to what’s actually being sent by the device
- How to create an event listener in java to check hardware changes in MacOS operating systems?
- Is there any way to get serial number of ledger nano devices| Ledger Nano S,Ledger Nano X|Using Golang
- Receive data from serial port on higher baud rates using C#
- CAN Bus RX Errors
- Linux device interaction
- Detect "Windows" key of qwerty keyboard in Android
- tornado blocked by tight loop inside async function on windows but not linux
- What is an OS' HAL?
- Advice dealing with Undefined Behavior in Python using Ctypes - OSError:exception:access violation reading 0x00000000000000000
- CK (tCK, nCK) unit ambiguity in DDR3 standard/datasheets?
Related Questions in KERNEL-MODE
- Kernel API for Reliable Physical Address Validation
- Are PowerPoint, Google Chrome, Visual Studio Code, Photoshop or a C program I write are all examples of Applications/User programs?
- Are the system calls the only way an Application/User program can request OS services for performing privileged operations?
- How to collect WPP traces in realtime by user space app?
- Break on syscalls only from target process in kernel windbg debugging
- Access a character device from kernel space
- Does loadable kernel module(LVM) also need device tree?
- Linux Kernel Module : Invalid output in the file for kernel_write function
- Kernel-mode only operating system
- When do context switches occur in boost.asio?
- Does Instruction Decoder check a mode bit and makes a interrupt?
- Why can a kernel mode driver not allocate and use memory without causing potential instability?
- Why my cpu seems to lose the ability to decode
- How does the CPU know it's executing a Kernel/Ring-0 instruction?
- How to detect which codes of c++ cause mode switch
Related Questions in SATA
- HDD Storage with AHCI configuration is taking long time to respond to ATA commands
- SCSI commands that can benefit from a full duplex SAS connection
- CPU, Disk, RAM, Ethernet Data Flow
- How do I send commands to NVMe drive over USB bridge?
- SATA controller
- print_req_error: critical target error, dev sdb, sector 0
- Does Linux 3.1 support Intel Optane?
- Linux scsi ata cmd write or read sometimes work and sometimes didn't work when transfer length is over 1345
- Is there a way to override libata.force during runtime?
- Accessing block device data beyond reported capacity
- Writing binary files (~12MB) consecutively very fast (30 per second) from a C++ program in Linux
- How to emulate a SATA disk drive in QEMU
- Need Script To Automatically Restart Mac Until Negotiated SATA Link Speed is SATA II
- Folder is empty while data transfer Sata Hard Drive From Laptop Into USB External Enclosure
- SATA driver; AHCI port initialisation; Start (ST) command list;
Related Questions in ATA
- mkfs.fat leave FAT32 fields in BPB at null value
- Retrieve S.M.A.R.T information from ATA, SAS, SATA disk
- Why CPU reset when no `cli`
- ATA read/write sectors in longmode not working
- Ata interrupts fires constantly on real hardware
- Unable to read from status port in ATAPIO mode
- udevadm and ATA Addressing
- Questions about ATA
- Strange data when read disk sector with ATA/IDE PIO
- What does the function insl do in Os Dev's PCI IDE tutorial?
- xv6 boot loader: Reading sectors off disk using CHS
- Overflow error when trying to read drive properties with ioctl in python
- What are the PATA/IDE status codes, and what do they mean?
- Linux scsi ata cmd write or read sometimes work and sometimes didn't work when transfer length is over 1345
- (ATA PIO) Garbage reads from port
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?