15 lines
398 B
C++
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;
|
||
|
}
|