1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:28:12 +00:00

Add a simple IDEDiskDevice class that implements DiskDevice from VFS.

This commit is contained in:
Andreas Kling 2018-10-16 14:17:43 +02:00
parent 8293a0ff36
commit 12e515735b
6 changed files with 88 additions and 11 deletions

41
Kernel/IDEDiskDevice.cpp Normal file
View file

@ -0,0 +1,41 @@
#include "IDEDiskDevice.h"
#include "Disk.h"
RetainPtr<IDEDiskDevice> IDEDiskDevice::create()
{
return adopt(*new IDEDiskDevice);
}
IDEDiskDevice::IDEDiskDevice()
{
}
IDEDiskDevice::~IDEDiskDevice()
{
}
const char* IDEDiskDevice::className() const
{
return "IDEDiskDevice";
}
unsigned IDEDiskDevice::blockSize() const
{
return 512;
}
bool IDEDiskDevice::readBlock(unsigned index, byte* out) const
{
Disk::readSectors(index, 1, out);
return true;
}
bool IDEDiskDevice::writeBlock(unsigned index, const byte* data)
{
(void) index;
(void) data;
kprintf("[IDEDiskDevice] writeBlock not implemented()\n");
notImplemented();
return false;
}