- Timestamp:
- 10/03/08 12:12:20 (2 months ago)
- Location:
- Whitix/branches/keobject/devices/storage
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/keobject/devices/storage/Makefile
r660 r1057 12 12 clean: 13 13 $(MAKE) -C ata clean 14 $(RM) *.o *.sys 14 $(RM) *.o *.sys .deps/*.d 15 15 16 16 include $(DEPTH)make.inc -
Whitix/branches/keobject/devices/storage/ata/ata-identify.c
r1001 r1057 23 23 #include <i386/pit.h> 24 24 #include <typedefs.h> 25 #include <sdevice.h>26 25 #include <i386/irq.h> 27 26 #include <malloc.h> -
Whitix/branches/keobject/devices/storage/ata/ata.c
r1001 r1057 23 23 #include <i386/pit.h> 24 24 #include <typedefs.h> 25 #include <sdevice.h>26 25 #include <i386/irq.h> 27 26 #include <module.h> … … 329 328 static int AtaAddPartition(int i,int base,struct StorageDevice* parent,struct AtaPartition* part) 330 329 { 331 char buf[32];332 330 struct Partition* newPart; 333 331 struct StorageDevice* sDevice; … … 356 354 sDevice->totalSectors=newPart->secLen; 357 355 356 #if 0 358 357 sprintf(buf,"Storage/HardDrive%c%d",'A'+base,i); 359 358 360 DevAddDevice(buf, 4, (base*64)+i+1, DEVICE_BLOCK, sDevice);359 // DevAddDevice(buf, 4, (base*64)+i+1, DEVICE_BLOCK, sDevice); 361 360 362 361 StorageDeviceAdd(sDevice, "HardDrive%c%d", 'A'+base, i); 363 362 364 363 KePrint("Partition found: %#X, %u, %u\n",(DWORD)part[i].system,part[i].startSectorAbs,part[i].sectorCount); 364 #endif 365 365 366 366 return 0; … … 395 395 { 396 396 struct StorageDevice* sDevice; 397 char buf[32];398 int err;399 397 int controlIndex=drive->parent->index, driveIndex=drive->drive; 400 398 char* format; 399 int index; 400 401 401 sDevice=(struct StorageDevice*)MemAlloc(sizeof(struct StorageDevice)); 402 402 drive->sDev=sDevice; … … 413 413 sDevice->sectors=drive->sectors; 414 414 415 sprintf(buf, "AtaDisk%d", hdIndex); 415 format = "AtaDisk%u"; 416 index = hdIndex++; 416 417 }else{ 417 418 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)); 420 425 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)); 434 429 435 430 if (drive->type & ATA_DISK) 436 {437 431 AtaPartitionDevice(drive,(controlIndex*2)+driveIndex); 438 hdIndex++;439 }440 432 } 441 433 … … 448 440 449 441 /* Create the ATA device set. */ 450 err = StorageSetCreate(&ataSet, &ataType, "Ata");442 // err = StorageSetCreate(&ataSet, &ataType, "Ata"); 451 443 452 if (err)453 return err;444 // if (err) 445 // return err; 454 446 455 447 for (i=0; i<2; i++) … … 476 468 err=AtaTryToIdentifyDrive(drive); 477 469 AtaCtrlEnableInts(controller); 478 470 479 471 if (err) 480 472 { -
Whitix/branches/keobject/devices/storage/ata/ata.h
r608 r1057 21 21 22 22 #include <request.h> 23 #include < sdevice.h>23 #include <devices/sdevice.h> 24 24 #include <i386/ioports.h> 25 25 #include <typedefs.h> -
Whitix/branches/keobject/devices/storage/ramdisk.c
r959 r1057 1 #include < sdevice.h>1 #include <devices/sdevice.h> 2 2 #include <llist.h> 3 3 #include <error.h> … … 9 9 #include <module.h> 10 10 #include <i386/virtual.h> 11 #include <devices/class.h> 11 12 12 13 /* Globals */ … … 14 15 KE_OBJECT_TYPE(ramDiskType, NULL, NULL); 15 16 16 struct KeSet ramDiskSet;17 struct DevClass ramDiskClass; 17 18 18 19 struct RamDisk … … 89 90 90 91 /* Create the ramdisk set */ 91 err = KeSetCreate(&ramDiskSet, NULL, &ramDiskType, "RAM");92 err = DevClassCreate(&ramDiskClass, &ramDiskType, "Ram"); 92 93 93 94 if (err) … … 96 97 for (i=0; i<MAX_RAMDISKS; i++) 97 98 { 98 char buf[32];99 100 sprintf(buf,"Storage/RamDisk%d",i);101 99 disks[i].sDev=&rdDevices[i]; 102 100 disks[i].data=NULL; … … 110 108 StorageDeviceInit(&rdDevices[i], DEV_ID_MAKE(RAMDISK_MAJOR, i)); 111 109 112 StorageDeviceAdd(&rdDevices[i], "RamDisk%d" );110 StorageDeviceAdd(&rdDevices[i], "RamDisk%d", i); 113 111 } 114 112 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); 116 114 117 115 return 0; 118 116 } 119 117 120 DeviceInit(RamDiskInit);118 ModuleInit(RamDiskInit);
