From af8a516fc22865abd80d6e26f1541fa3d6bebfdc Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 9 May 2024 00:42:44 +0200 Subject: MHR-23: :boom:, refactors. - Move NewBoot to /Boot, thus making Kernel directory only containing the kernel. Signed-off-by: Amlal El Mahrouss --- Boot/BootKit/Device.hxx | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Boot/BootKit/Device.hxx (limited to 'Boot/BootKit/Device.hxx') diff --git a/Boot/BootKit/Device.hxx b/Boot/BootKit/Device.hxx new file mode 100644 index 00000000..3bdc2829 --- /dev/null +++ b/Boot/BootKit/Device.hxx @@ -0,0 +1,36 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + +------------------------------------------- */ + +#pragma once + +#include + +using namespace NewOS; + +/// @brief Device type. +class Device +{ +public: + Device() = default; + virtual ~Device() = default; + + NEWOS_MOVE_DEFAULT(Device); + + struct Trait + { + SizeT mBase{1024}; + SizeT mSize{1024}; + }; + + virtual Trait& Leak() = 0; + + virtual Device& Read(Char* Buf, const SizeT& SecCount) = 0; + virtual Device& Write(Char* Buf, const SizeT& SecCount) = 0; +}; + +typedef Device BootDevice; +typedef Device NetworkDevice; +typedef Device DiskDevice; -- cgit v1.2.3