Initial kernel allocator

This commit is contained in:
Ivan Chikish 2023-07-04 19:19:17 +03:00
parent 0f76e72de1
commit d7a34f0904
25 changed files with 247 additions and 144 deletions

View file

@ -1,4 +1,5 @@
#include "io-device.hpp"
#include "orbis/KernelAllocator.hpp"
#include <cstring>
struct ZeroDevice : public IoDevice {
@ -17,7 +18,7 @@ static std::int32_t zero_device_open(IoDevice *device,
orbis::Ref<IoDeviceInstance> *instance,
const char *path, std::uint32_t flags,
std::uint32_t mode) {
auto *newInstance = new ZeroInstance{};
auto *newInstance = orbis::knew<ZeroInstance>();
newInstance->read = zero_device_read;
io_device_instance_init(device, newInstance);
@ -26,7 +27,7 @@ static std::int32_t zero_device_open(IoDevice *device,
}
IoDevice *createZeroCharacterDevice() {
auto *newDevice = new ZeroDevice();
auto *newDevice = orbis::knew<ZeroDevice>();
newDevice->open = zero_device_open;
return newDevice;
}