1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

Kernel+LibC: Add a DebugLogDevice that forwards everything to I/O port 0xe9.

This is then used to implement the userspace dbgprintf() in a far more
efficient way than what we had before. :^)
This commit is contained in:
Andreas Kling 2019-04-18 16:08:52 +02:00
parent 3b986da643
commit 3817f5f619
7 changed files with 61 additions and 7 deletions

View file

@ -0,0 +1,17 @@
#include <Kernel/Devices/CharacterDevice.h>
class DebugLogDevice final : public CharacterDevice {
public:
DebugLogDevice();
virtual ~DebugLogDevice() override;
static DebugLogDevice& the();
private:
// ^CharacterDevice
virtual ssize_t read(Process&, byte*, ssize_t) override { return 0; }
virtual ssize_t write(Process&, const byte*, ssize_t) override;
virtual bool can_write(Process&) const override { return true; }
virtual bool can_read(Process&) const override { return true; }
virtual const char* class_name() const override { return "DebugLogDevice"; }
};