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

Kernel: Make device generate their own names

Besides removing the monolithic DevFSDeviceInode::determine_name()
method, being able to determine a device's name inside the /dev
hierarchy outside of DevFS has its uses.
This commit is contained in:
Jean-Baptiste Boric 2021-01-21 18:49:56 +01:00 committed by Andreas Kling
parent a2601e1308
commit f64e287b82
29 changed files with 76 additions and 69 deletions

View file

@ -87,6 +87,11 @@ KResultOr<size_t> SerialDevice::write(FileDescription&, size_t, const UserOrKern
return (size_t)nread;
}
String SerialDevice::device_name() const
{
return String::formatted("ttyS{}", minor() - 64);
}
void SerialDevice::initialize()
{
set_interrupts(0);