diff --git a/Kernel/BochsVGADevice.cpp b/Kernel/BXVGADevice.cpp similarity index 83% rename from Kernel/BochsVGADevice.cpp rename to Kernel/BXVGADevice.cpp index 0ce9c60a01..c37ff59707 100644 --- a/Kernel/BochsVGADevice.cpp +++ b/Kernel/BXVGADevice.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -29,27 +29,27 @@ struct BXVGAResolution { int height; }; -static BochsVGADevice* s_the; +static BXVGADevice* s_the; -BochsVGADevice& BochsVGADevice::the() +BXVGADevice& BXVGADevice::the() { return *s_the; } -BochsVGADevice::BochsVGADevice() +BXVGADevice::BXVGADevice() : BlockDevice(82, 413) { s_the = this; m_framebuffer_address = PhysicalAddress(find_framebuffer_address()); } -void BochsVGADevice::set_register(word index, word data) +void BXVGADevice::set_register(word index, word data) { IO::out16(VBE_DISPI_IOPORT_INDEX, index); IO::out16(VBE_DISPI_IOPORT_DATA, data); } -void BochsVGADevice::set_resolution(int width, int height) +void BXVGADevice::set_resolution(int width, int height) { set_register(VBE_DISPI_INDEX_ENABLE, VBE_DISPI_DISABLED); set_register(VBE_DISPI_INDEX_XRES, (word)width); @@ -63,13 +63,13 @@ void BochsVGADevice::set_resolution(int width, int height) m_framebuffer_size = { width, height }; } -void BochsVGADevice::set_y_offset(int offset) +void BXVGADevice::set_y_offset(int offset) { ASSERT(offset <= m_framebuffer_size.height()); set_register(VBE_DISPI_INDEX_Y_OFFSET, (word)offset); } -dword BochsVGADevice::find_framebuffer_address() +dword BXVGADevice::find_framebuffer_address() { static const PCI::ID bochs_vga_id = { 0x1234, 0x1111 }; static const PCI::ID virtualbox_vga_id = { 0x80ee, 0xbeef }; @@ -83,7 +83,7 @@ dword BochsVGADevice::find_framebuffer_address() return framebuffer_address; } -Region* BochsVGADevice::mmap(Process& process, LinearAddress preferred_laddr, size_t offset, size_t size) +Region* BXVGADevice::mmap(Process& process, LinearAddress preferred_laddr, size_t offset, size_t size) { ASSERT(offset == 0); ASSERT(size == framebuffer_size_in_bytes()); @@ -102,7 +102,7 @@ Region* BochsVGADevice::mmap(Process& process, LinearAddress preferred_laddr, si return region; } -int BochsVGADevice::ioctl(Process& process, unsigned request, unsigned arg) +int BXVGADevice::ioctl(Process& process, unsigned request, unsigned arg) { switch (request) { case BXVGA_DEV_IOCTL_SET_Y_OFFSET: @@ -122,22 +122,22 @@ int BochsVGADevice::ioctl(Process& process, unsigned request, unsigned arg) }; } -bool BochsVGADevice::can_read(Process&) const +bool BXVGADevice::can_read(Process&) const { ASSERT_NOT_REACHED(); } -bool BochsVGADevice::can_write(Process&) const +bool BXVGADevice::can_write(Process&) const { ASSERT_NOT_REACHED(); } -ssize_t BochsVGADevice::read(Process&, byte*, size_t) +ssize_t BXVGADevice::read(Process&, byte*, size_t) { ASSERT_NOT_REACHED(); } -ssize_t BochsVGADevice::write(Process&, const byte*, size_t) +ssize_t BXVGADevice::write(Process&, const byte*, size_t) { ASSERT_NOT_REACHED(); } diff --git a/Kernel/BochsVGADevice.h b/Kernel/BXVGADevice.h similarity index 85% rename from Kernel/BochsVGADevice.h rename to Kernel/BXVGADevice.h index 8d40841b7a..a1d9375d38 100644 --- a/Kernel/BochsVGADevice.h +++ b/Kernel/BXVGADevice.h @@ -6,12 +6,12 @@ #include #include -class BochsVGADevice final : public BlockDevice { +class BXVGADevice final : public BlockDevice { AK_MAKE_ETERNAL public: - static BochsVGADevice& the(); + static BXVGADevice& the(); - BochsVGADevice(); + BXVGADevice(); PhysicalAddress framebuffer_address() const { return m_framebuffer_address; } void set_resolution(int width, int height); @@ -24,7 +24,7 @@ public: Size framebuffer_size() const { return m_framebuffer_size; } private: - virtual const char* class_name() const override { return "BochsVGADevice"; } + virtual const char* class_name() const override { return "BXVGA"; } virtual bool can_read(Process&) const override; virtual bool can_write(Process&) const override; virtual ssize_t read(Process&, byte*, size_t) override; diff --git a/Kernel/Makefile b/Kernel/Makefile index 0b66818c36..f43c946d95 100644 --- a/Kernel/Makefile +++ b/Kernel/Makefile @@ -29,7 +29,7 @@ KERNEL_OBJS = \ ELFLoader.o \ KSyms.o \ DevPtsFS.o \ - BochsVGADevice.o \ + BXVGADevice.o \ PCI.o \ PS2MouseDevice.o \ Socket.o \ diff --git a/Kernel/init.cpp b/Kernel/init.cpp index 312dc13498..e47897cb2d 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -22,7 +22,7 @@ #include "PS2MouseDevice.h" #include "PTYMultiplexer.h" #include "DevPtsFS.h" -#include "BochsVGADevice.h" +#include "BXVGADevice.h" //#define SPAWN_GUITEST //#define SPAWN_LAUNCHER @@ -86,7 +86,7 @@ VFS* vfs; vfs->register_device(*tty2); vfs->register_device(*tty3); - vfs->register_device(BochsVGADevice::the()); + vfs->register_device(BXVGADevice::the()); auto dev_hd0 = IDEDiskDevice::create(); auto e2fs = Ext2FS::create(dev_hd0.copy_ref()); @@ -170,7 +170,7 @@ VFS* vfs; MemoryManager::initialize(); PIT::initialize(); - new BochsVGADevice; + new BXVGADevice; auto new_procfs = ProcFS::create(); new_procfs->initialize();