mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:37:35 +00:00
Kernel: Rename BochsVGADevice to BXVGADevice.
This commit is contained in:
parent
10b43f3d1d
commit
bd2fdcbbaa
4 changed files with 22 additions and 22 deletions
|
@ -1,4 +1,4 @@
|
|||
#include <Kernel/BochsVGADevice.h>
|
||||
#include <Kernel/BXVGADevice.h>
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/PCI.h>
|
||||
#include <Kernel/MemoryManager.h>
|
||||
|
@ -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();
|
||||
}
|
|
@ -6,12 +6,12 @@
|
|||
#include <Kernel/types.h>
|
||||
#include <Kernel/BlockDevice.h>
|
||||
|
||||
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;
|
|
@ -29,7 +29,7 @@ KERNEL_OBJS = \
|
|||
ELFLoader.o \
|
||||
KSyms.o \
|
||||
DevPtsFS.o \
|
||||
BochsVGADevice.o \
|
||||
BXVGADevice.o \
|
||||
PCI.o \
|
||||
PS2MouseDevice.o \
|
||||
Socket.o \
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue