mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-05 09:52:54 +00:00
Kernel: Make TextModeConsole store VGA window base as VirtualAddress
This commit is contained in:
parent
3e07b04564
commit
6f2c7ecbbb
Notes:
sideshowbarker
2024-07-18 04:25:42 +09:00
Author: https://github.com/awesomekling
Commit: 6f2c7ecbbb
2 changed files with 4 additions and 3 deletions
|
@ -113,7 +113,7 @@ void TextModeConsole::show_cursor()
|
||||||
void TextModeConsole::clear(size_t x, size_t y, size_t length)
|
void TextModeConsole::clear(size_t x, size_t y, size_t length)
|
||||||
{
|
{
|
||||||
SpinlockLocker lock(m_vga_lock);
|
SpinlockLocker lock(m_vga_lock);
|
||||||
auto* buf = (u16*)(m_current_vga_window + (x * 2) + (y * width() * 2));
|
auto* buf = (u16*)m_current_vga_window.offset((x * 2) + (y * width() * 2)).as_ptr();
|
||||||
for (size_t index = 0; index < length; index++) {
|
for (size_t index = 0; index < length; index++) {
|
||||||
buf[index] = 0x0720;
|
buf[index] = 0x0720;
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ void TextModeConsole::write(size_t x, size_t y, char ch, Color background, Color
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* buf = (u16*)(m_current_vga_window + (x * 2) + (y * width() * 2));
|
auto* buf = (u16*)m_current_vga_window.offset((x * 2) + (y * width() * 2)).as_ptr();
|
||||||
*buf = foreground << 8 | background << 12 | ch;
|
*buf = foreground << 8 | background << 12 | ch;
|
||||||
m_x = x + 1;
|
m_x = x + 1;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,8 @@ private:
|
||||||
explicit TextModeConsole(const VGACompatibleAdapter&);
|
explicit TextModeConsole(const VGACompatibleAdapter&);
|
||||||
|
|
||||||
mutable Spinlock m_vga_lock;
|
mutable Spinlock m_vga_lock;
|
||||||
u8* m_current_vga_window { nullptr };
|
|
||||||
|
VirtualAddress m_current_vga_window;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue