git-svn-id: https://spexeah.com:8443/svn/Asuro@256 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c

This commit is contained in:
aaron 2017-10-25 23:02:19 +00:00
parent ba511db97b
commit 09c03be521
2 changed files with 13 additions and 9 deletions

View File

@ -74,7 +74,7 @@ implementation
procedure init(_controller : TPCI_device); procedure init(_controller : TPCI_device);
begin begin
console.writestringln('ATA Driver INIT');
isr76.hook(uint32(@callback)); isr76.hook(uint32(@callback));
controller := _controller; controller := _controller;
@ -160,6 +160,8 @@ procedure write(address : uint32); begin
procedure callback(data : void); //need r/w, is last procedure callback(data : void); //need r/w, is last
var var
cb : ATA_Command_Buffer; cb : ATA_Command_Buffer;
ptr : intptr;
tmp : uint32;
begin begin
if(PRD_Table[devices[0].currentIndex - 1].EOT = 1) then begin if(PRD_Table[devices[0].currentIndex - 1].EOT = 1) then begin
//other stuff //other stuff
@ -173,12 +175,13 @@ begin
outb(ports.lba_mid, (((devices[0].device_lba + (64000 * devices[0].currentIndex))) and $0000FF00) SHR 8); outb(ports.lba_mid, (((devices[0].device_lba + (64000 * devices[0].currentIndex))) and $0000FF00) SHR 8);
outb(ports.lba_hi, (((devices[0].device_lba + (64000 * devices[0].currentIndex))) and $0000FF00) SHR 16); outb(ports.lba_hi, (((devices[0].device_lba + (64000 * devices[0].currentIndex))) and $0000FF00) SHR 16);
outb(ports.command, $C8); outb(ports.command, $C8);
end else begin // end else begin
outb(ports.sector_count, PRD_Table[devices[0].currentIndex].data_bytes / 512); // wont work if 64k // tmp := uint8(PRD_Table[devices[0].currentIndex].Byte_Count and $FF) / 512;
outb(ports.lba_low, ((devices[0].device_lba + (64000 * devices[0].currentIndex))) and $000000FF); // outb(ports.sector_count, uint8(tmp); // wont work if 64k
outb(ports.lba_mid, (((devices[0].device_lba + (64000 * devices[0].currentIndex))) and $0000FF00) SHR 8); // outb(ports.lba_low, ((devices[0].device_lba + (64000 * devices[0].currentIndex))) and $000000FF);
outb(ports.lba_hi, (((devices[0].device_lba + (64000 * devices[0].currentIndex))) and $0000FF00) SHR 16); // outb(ports.lba_mid, (((devices[0].device_lba + (64000 * devices[0].currentIndex))) and $0000FF00) SHR 8);
outb(ports.command, $C8); // outb(ports.lba_hi, (((devices[0].device_lba + (64000 * devices[0].currentIndex))) and $0000FF00) SHR 16);
// outb(ports.command, $C8);
end; end;
cb.start_stop_bit := 1; cb.start_stop_bit := 1;

View File

@ -14,7 +14,8 @@ interface
uses uses
util, util,
console, console,
drivertypes; drivertypes,
ATA;
type type