Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

ATA TRIM (Developers)

posted by RayeR(R) Homepage, CZ, 09.08.2017, 14:24
(edited by RayeR on 09.08.2017, 16:54)

So I tried to test TRIM command with this parameters:
ide_exec_command: I/O=1F0h, drv=0-W, cmd=06h, data=00h, feat=01h, LBA=0, scnt=1
rangelist[0] = 0001000000000003 (LBA start=3, sectors=1)
(rest of range 512B list sector was zeroed)

outportb(io_base+IDE_CMR_DATA, 0); // set data reg.
outportb(io_base+IDE_CMR_FEAT_ERR, 0x01); // set features reg.
outportb(io_base+IDE_CMR_SECCNT, 1); // set sector count reg.
outportb(io_base+IDE_CMR_SECNUM, 0); // set sector number reg.
outportb(io_base+IDE_CMR_CYLLO, 0); // set cylinder low reg.
outportb(io_base+IDE_CMR_CYLHI, 0); // set cylinder high reg.
outportb(io_base+IDE_CMR_DRVSEL_HD, 0|(0<<4)|0xA0|0x40); // bit3:0 = head=0, bit4 = drive=0, bit5 = sect. size (1=512B), bit6 LBA/CHS (1=LBA), bit7 = 1
outportb(io_base+IDE_CMR_CMD_STAT, 0x06); // send IDE command (will be performed immediatelly)

But it doesn't work, I got:
ERROR: CMD_ABORT
STATUS: ERROR SEEK_DONE DRV_READY
RETURN: LBA=00000000h, scnt=00h, err=04h

The SSD ended in a bad state where disk activity LED was lighting and I have to restart PC. When I looked at test LBA sector 3 with disk editor the content remained unchanged.

---
DOS gives me freedom to unlimited HW access.

 

Complete thread:

Back to the forum
Board view  Mix view
15108 Postings in 1358 Threads, 246 registered users, 15 users online (1 registered, 14 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum