Show
Ignore:
Timestamp:
10/03/08 12:12:20 (3 months ago)
Author:
mwhitworth
Message:

Update Makefile, clean the .deps directory as well.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/keobject/devices/storage/ata/ata.c

    r1001 r1057  
    2323#include <i386/pit.h> 
    2424#include <typedefs.h> 
    25 #include <sdevice.h> 
    2625#include <i386/irq.h> 
    2726#include <module.h> 
     
    329328static int AtaAddPartition(int i,int base,struct StorageDevice* parent,struct AtaPartition* part) 
    330329{ 
    331         char buf[32]; 
    332330        struct Partition* newPart; 
    333331        struct StorageDevice* sDevice; 
     
    356354        sDevice->totalSectors=newPart->secLen; 
    357355 
     356#if 0 
    358357        sprintf(buf,"Storage/HardDrive%c%d",'A'+base,i); 
    359358 
    360         DevAddDevice(buf, 4, (base*64)+i+1, DEVICE_BLOCK, sDevice); 
     359//      DevAddDevice(buf, 4, (base*64)+i+1, DEVICE_BLOCK, sDevice); 
    361360 
    362361        StorageDeviceAdd(sDevice, "HardDrive%c%d", 'A'+base, i); 
    363362 
    364363        KePrint("Partition found: %#X, %u, %u\n",(DWORD)part[i].system,part[i].startSectorAbs,part[i].sectorCount); 
     364#endif 
    365365 
    366366        return 0; 
     
    395395{ 
    396396        struct StorageDevice* sDevice; 
    397         char buf[32]; 
    398         int err; 
    399397        int controlIndex=drive->parent->index, driveIndex=drive->drive; 
    400                  
     398        char* format; 
     399        int index;       
     400 
    401401        sDevice=(struct StorageDevice*)MemAlloc(sizeof(struct StorageDevice)); 
    402402        drive->sDev=sDevice; 
     
    413413                sDevice->sectors=drive->sectors; 
    414414                 
    415                 sprintf(buf, "AtaDisk%d", hdIndex); 
     415                format = "AtaDisk%u"; 
     416                index = hdIndex++; 
    416417        }else{ 
    417418                sDevice->cylinders=sDevice->heads=sDevice->sectors=0; 
    418                 sprintf(buf, "AtaCd%d", cdRomIndex++); 
    419         } 
     419                format = "AtaCd%u"; 
     420                index = cdRomIndex++; 
     421        } 
     422 
     423        /* And add the device */ 
     424        StorageDeviceInit(sDevice, DEV_ID_MAKE(ATA_MAJOR, 0)); 
    420425         
    421         KePrint("ATA: Found %s\n", buf); 
    422  
    423         /* And add the device */ 
    424         err = StorageDeviceInit(sDevice, DEV_ID_MAKE(ATA_MAJOR, 0)); 
    425          
    426         if (err) 
    427                 return err; 
    428          
    429         err = StorageDeviceAdd(sDevice, buf); 
    430          
    431         if (err) 
    432                 return err; 
    433  
     426        StorageDeviceAdd(sDevice, format, index); 
     427 
     428        KePrint("ATA: Found %s\n", StorageDeviceGetName(sDevice)); 
    434429 
    435430        if (drive->type & ATA_DISK) 
    436         { 
    437431                AtaPartitionDevice(drive,(controlIndex*2)+driveIndex); 
    438                 hdIndex++; 
    439         } 
    440432} 
    441433 
     
    448440 
    449441        /* Create the ATA device set. */ 
    450         err = StorageSetCreate(&ataSet, &ataType, "Ata"); 
     442//      err = StorageSetCreate(&ataSet, &ataType, "Ata"); 
    451443         
    452         if (err) 
    453                 return err; 
     444//      if (err) 
     445//              return err; 
    454446 
    455447        for (i=0; i<2; i++) 
     
    476468                        err=AtaTryToIdentifyDrive(drive); 
    477469                        AtaCtrlEnableInts(controller); 
    478  
     470                         
    479471                        if (err) 
    480472                        {