- Timestamp:
- 10/05/08 14:08:18 (2 months ago)
- Location:
- Whitix/branches/keobject
- Files:
-
- 9 modified
-
arch/i386/kernel/ints.c (modified) (1 diff)
-
devices/kedev/sdevice.c (modified) (3 diffs)
-
devices/storage/ata/ata-disk.c (modified) (1 diff)
-
devices/storage/ata/ata.c (modified) (3 diffs)
-
fs/devfs/devfs.c (modified) (1 diff)
-
fs/vfs/bcache.c (modified) (10 diffs)
-
fs/vfs/super.c (modified) (1 diff)
-
user/makefs/fat/main.c (modified) (2 diffs)
-
user/system/startup.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/keobject/arch/i386/kernel/ints.c
r950 r1094 225 225 KePrint("\nNULL POINTER EXCEPTION (address = %#.8X)\n", address); 226 226 else 227 KePrint("KERNEL EXCEPTION\nProcessor exception: %s \n",exceptionName[irq]);227 KePrint("KERNEL EXCEPTION\nProcessor exception: %s (%#X)\n",exceptionName[irq], address); 228 228 ThrArchPrintContext(curr); 229 229 hlt(); -
Whitix/branches/keobject/devices/kedev/sdevice.c
r1081 r1094 173 173 174 174 /* And add to list */ 175 ListAddTail(&request->list, &dev->requestList);175 ListAddTail(&request->list, &dev->requestList); 176 176 177 177 SpinUnlockIrq(&requestLock); … … 180 180 if (isEmpty) 181 181 err=dev->request(dev->priv); 182 182 183 183 return err; 184 184 } … … 194 194 195 195 request->ioStatus=status; 196 197 SpinLockIrq(&requestLock); 196 198 ListRemove(&request->list); 199 SpinUnlockIrq(&requestLock); 197 200 198 201 if (status > 0) -
Whitix/branches/keobject/devices/storage/ata/ata-disk.c
r658 r1094 100 100 return -EIO; 101 101 } 102 103 // KePrint("Copying over: %#X, %#X, %#X %#X\n", command.block, p, drive, drive->parent); 102 104 103 105 for (i=0; i<256; i++) -
Whitix/branches/keobject/devices/storage/ata/ata.c
r1057 r1094 299 299 } 300 300 301 /* Fairly hacky */301 /* Fairly hacky. TODO: Replace with a better data structure. */ 302 302 303 303 static int AtaPartitionRequest(void* data) … … 306 306 struct StorageDevice* partDev=part->partDev; 307 307 struct Request* request=StorageGetCurrRequest(partDev); 308 struct Request newRequest; 308 309 int err; 309 struct ListHead head;310 // struct ListHead head; 310 311 311 312 if (!request) 312 313 return 0; 313 314 315 again: 314 316 if (request->sector > part->secLen) 315 317 return -EIO; 316 318 317 319 request->sector+=part->startSector; 318 memcpy(&head,&request->list, sizeof(struct ListHead)); 319 err=BlockSendRequestRaw(part->sDev, request); 320 memcpy(&request->list,&head, sizeof(struct ListHead)); 320 // memcpy(&head,&request->list, sizeof(struct ListHead)); 321 322 memcpy(&newRequest, request, sizeof(struct Request)); 323 324 newRequest.sector += part->startSector; 325 326 err=BlockSendRequestRaw(part->sDev, &newRequest); 327 // memcpy(&request->list,&head, sizeof(struct ListHead)); 328 329 // request->sector-=part->startSector; 321 330 322 331 StorageEndRequest(partDev,-err); 332 333 request = StorageGetCurrRequest(partDev); 334 335 if (request) 336 goto again; 337 323 338 return err; 324 339 } … … 354 369 sDevice->totalSectors=newPart->secLen; 355 370 356 #if 0 357 sprintf(buf,"Storage/HardDrive%c%d",'A'+base,i); 358 359 // DevAddDevice(buf, 4, (base*64)+i+1, DEVICE_BLOCK, sDevice); 360 361 StorageDeviceAdd(sDevice, "HardDrive%c%d", 'A'+base, i); 362 371 StorageDeviceInit(sDevice, DEV_ID_MAKE(4, ((base*64)+i+1))); 372 StorageDeviceAdd(sDevice, "AtaDisk%c%d", 'A'+base, i); 373 363 374 KePrint("Partition found: %#X, %u, %u\n",(DWORD)part[i].system,part[i].startSectorAbs,part[i].sectorCount); 364 #endif365 375 366 376 return 0; -
Whitix/branches/keobject/fs/devfs/devfs.c
r1063 r1094 79 79 copyOffset+=readSize; 80 80 file->position+=readSize; 81 82 BufferRelease(buff); 81 83 } 82 84 -
Whitix/branches/keobject/fs/vfs/bcache.c
r1061 r1094 31 31 #include <request.h> 32 32 #include <devices/sdevice.h> 33 #include <devices/class.h> 33 34 34 35 /* Speed this all up. It's quite a dumb cache at the moment. Readahead? */ … … 38 39 struct Thread* bufferFlusher=NULL; 39 40 DWORD cacheSize=0; 40 41 extern struct ListHead sDeviceList; 41 extern struct DevClass storageClass; 42 42 43 43 static void BufferWait(struct Buffer* buffer); … … 105 105 ThrSchedule(); 106 106 }while (BufferLocked(buffer)); 107 107 108 108 BufferRelease(buffer); 109 109 } … … 186 186 static void BlockBufferRemove(struct Buffer* buff) 187 187 { 188 WaitForBuffer(buff); 188 // WaitForBuffer(buff); /* TODO: Have a wait parameter. */ 189 189 MemFree(buff->data); 190 190 ListRemove(&buff->list); … … 397 397 if (BufferDirty(buff)) 398 398 { 399 WaitForBuffer(buff);400 401 399 /* For each block, call the respective StorageDevice write function */ 402 400 DoBlockWrite(buff->device,buff); … … 416 414 417 415 /* Sync all vnodes */ 418 extern void VNodeSyncAll(); 419 VNodeSyncAll(); 420 421 // ListForEachEntry(sDevice, &sDeviceList, list) 422 // BlockSyncDevice(sDevice); 416 // extern void VNodeSyncAll(); 417 // VNodeSyncAll(); 418 419 struct StorageDevice* sDevice; 420 struct KeObject* object, *object2; 421 422 ListForEachEntrySafe(object, object2, &storageClass.set.head, next) 423 { 424 sDevice = KeObjectToStorageDev(object); 425 BlockSyncDevice(sDevice); 426 } 423 427 424 428 return 0; … … 439 443 int DoBlockWrite(struct StorageDevice* sDevice,struct Buffer* buffer) 440 444 { 445 BufferLock(buffer); 441 446 return BlockSendRequest(sDevice,buffer,REQUEST_WRITE); 442 447 } … … 451 456 static void BufferFlusher() 452 457 { 453 // struct StorageDevice* sDevice;454 458 ThrSetPriority(currThread,1); 455 459 … … 458 462 ThrSuspendThread(currThread); 459 463 ThrSchedule(); 460 461 /* FIXME: TEMP */ 462 // ListForEachEntry(sDevice,&sDeviceList,list) 463 // BlockSyncDevice(sDevice); 464 465 BlockSyncAll(); 464 466 } 465 467 } … … 512 514 int BlockInit() 513 515 { 514 blockCache=MemCacheCreate("Block cache",sizeof(struct Buffer),NULL,NULL, 0);516 blockCache=MemCacheCreate("Block cache",sizeof(struct Buffer),NULL,NULL, 0); 515 517 if (!blockCache) 516 518 return -ENOMEM; -
Whitix/branches/keobject/fs/vfs/super.c
r1079 r1094 160 160 VNodeRelease(mountNode); 161 161 VNodeRelease(deviceNode); 162 KePrint("VfsMount: Failed to mount %s\n",mountPoint);163 162 return -ENOENT; 164 163 } -
Whitix/branches/keobject/user/makefs/fat/main.c
r608 r1094 97 97 98 98 if (err) 99 { 100 printf("Error: could not retrieve information about the file\n"); 99 101 goto statFailed; 102 } 100 103 101 104 /* Does not make much sense */ … … 114 117 if (stat.mode & _SYS_STAT_BLOCK) 115 118 { 116 err=SysIoCtl(deviceFd,IOCTL_BLOCK_GETBLKSIZE,&blockSize); 117 if (err) 118 return err; 119 printf("Block device: TODO. Get sector size\n"); 120 blockSize=512; 119 121 }else 120 122 blockSize=1024; /* A good default */ -
Whitix/branches/keobject/user/system/startup.c
r1040 r1094 53 53 54 54 /* Move to FS thread? */ 55 ModuleLoad("Filesystems/fatfs"); 55 56 pid=ModuleLoad("Filesystems/icfs"); 56 57
