X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fdrv%2Fata_x86.c;h=c2c5205cc895b9c85d7ee5d081dc095b0adc21e5;hb=7180d8e33801a3205012d27ea5ccb80f70695b5d;hp=a4c5306561727672449c5cb112e651d1b5a051e0;hpb=8bc40333b1401d7616b225945fee53d972c2f418;p=tpg%2Facess2.git diff --git a/Kernel/drv/ata_x86.c b/Kernel/drv/ata_x86.c index a4c53065..c2c5205c 100644 --- a/Kernel/drv/ata_x86.c +++ b/Kernel/drv/ata_x86.c @@ -2,6 +2,7 @@ * Acess2 IDE Harddisk Driver * drv/ide.c */ +#define DEBUG 0 #include #include #include @@ -115,6 +116,7 @@ tDevFS_Driver gATA_DriverInfo = { NULL, "ata", { .NumACLs = 1, + .Size = -1, .Flags = VFS_FFLAG_DIRECTORY, .ACLs = &gVFS_ACL_EveryoneRX, .ReadDir = ATA_ReadDir, @@ -247,6 +249,8 @@ void ATA_SetupVFS() for( j = 0; j < gATA_Disks[i].NumPartitions; j ++ ) gATA_Nodes[ k++ ] = &gATA_Disks[i].Partitions[j].Node; } + + gATA_DriverInfo.RootNode.Size = giATA_NumNodes; } /** @@ -604,7 +608,7 @@ Uint16 ATA_GetBasePort(int Disk) char *ATA_ReadDir(tVFS_Node *Node, int Pos) { if(Pos >= giATA_NumNodes || Pos < 0) return NULL; - return gATA_Nodes[Pos]->ImplPtr; + return strdup( gATA_Nodes[Pos]->ImplPtr ); } /** @@ -793,7 +797,7 @@ int ATA_ReadDMA(Uint8 Disk, Uint64 Address, Uint Count, void *Buffer) ATA_int_BusMasterWriteByte( cont << 3, 9 ); // Read and start // Wait for transfer to complete - while( gaATA_IRQs[cont] == 0 ) Proc_Yield(); + while( gaATA_IRQs[cont] == 0 ) Threads_Yield(); // Complete Transfer ATA_int_BusMasterWriteByte( cont << 3, 0 ); // Write and stop