Changeset 1057 for Whitix

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

Update Makefile, clean the .deps directory as well.

Location:
Whitix/branches/keobject/devices/storage
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/keobject/devices/storage/Makefile

    r660 r1057  
    1212clean: 
    1313        $(MAKE) -C ata clean 
    14         $(RM) *.o *.sys 
     14        $(RM) *.o *.sys .deps/*.d 
    1515 
    1616include $(DEPTH)make.inc 
  • Whitix/branches/keobject/devices/storage/ata/ata-identify.c

    r1001 r1057  
    2323#include <i386/pit.h> 
    2424#include <typedefs.h> 
    25 #include <sdevice.h> 
    2625#include <i386/irq.h> 
    2726#include <malloc.h> 
  • 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                        { 
  • Whitix/branches/keobject/devices/storage/ata/ata.h

    r608 r1057  
    2121 
    2222#include <request.h> 
    23 #include <sdevice.h> 
     23#include <devices/sdevice.h> 
    2424#include <i386/ioports.h> 
    2525#include <typedefs.h> 
  • Whitix/branches/keobject/devices/storage/ramdisk.c

    r959 r1057  
    1 #include <sdevice.h> 
     1#include <devices/sdevice.h> 
    22#include <llist.h> 
    33#include <error.h> 
     
    99#include <module.h> 
    1010#include <i386/virtual.h> 
     11#include <devices/class.h> 
    1112 
    1213/* Globals */ 
     
    1415KE_OBJECT_TYPE(ramDiskType, NULL, NULL); 
    1516 
    16 struct KeSet ramDiskSet; 
     17struct DevClass ramDiskClass; 
    1718 
    1819struct RamDisk 
     
    8990         
    9091        /* Create the ramdisk set */ 
    91         err = KeSetCreate(&ramDiskSet, NULL, &ramDiskType, "RAM"); 
     92        err = DevClassCreate(&ramDiskClass, &ramDiskType, "Ram"); 
    9293         
    9394        if (err) 
     
    9697        for (i=0; i<MAX_RAMDISKS; i++) 
    9798        { 
    98                 char buf[32]; 
    99  
    100                 sprintf(buf,"Storage/RamDisk%d",i); 
    10199                disks[i].sDev=&rdDevices[i]; 
    102100                disks[i].data=NULL; 
     
    110108                StorageDeviceInit(&rdDevices[i], DEV_ID_MAKE(RAMDISK_MAJOR,  i)); 
    111109                 
    112                 StorageDeviceAdd(&rdDevices[i], "RamDisk%d"); 
     110                StorageDeviceAdd(&rdDevices[i], "RamDisk%d", i); 
    113111        } 
    114112 
    115         KePrint("%d ramdisks loaded, of size %d\n",MAX_RAMDISKS,RAMDISK_SIZE); 
     113        KePrint("RAM: %dMB %d ramdisks loaded\n",RAMDISK_SIZE/1024/1024, MAX_RAMDISKS); 
    116114 
    117115        return 0; 
    118116} 
    119117 
    120 DeviceInit(RamDiskInit); 
     118ModuleInit(RamDiskInit);