Luna/kernel/src/fs/devices/UARTDevice.cpp
apio cd6bf745a7
Some checks failed
continuous-integration/drone/push Build is failing
tests+kernel+init: Run tests automatically in a headless way
2023-07-21 14:09:37 +02:00

15 lines
398 B
C++

#include "fs/devices/UARTDevice.h"
#include "arch/Serial.h"
Result<void> UARTDevice::create()
{
auto device = (SharedPtr<Device>)TRY(make_shared<UARTDevice>());
return DeviceRegistry::register_special_device(DeviceRegistry::Serial, 0, device, 0222);
}
Result<usize> UARTDevice::write(const u8* buf, usize, usize length)
{
Serial::write((const char*)buf, length);
return length;
}