Compare commits

...

2 Commits

Author SHA1 Message Date
Bananymous 45d8d76e87 Kernel: Use the correct bpp when writing to framebuffer 2023-11-29 00:31:24 +02:00
Bananymous e3890fa7c4 Shell: make clear use \e[2J instead of \e[J
This makes kernel to actually clear the full screen. If framebuffer
did not fit font exactly last row would be left partially uncleared
2023-11-28 23:55:37 +02:00
2 changed files with 2 additions and 2 deletions

View File

@ -115,7 +115,7 @@ namespace Kernel
if ((size_t)offset >= m_width * m_height * bytes_per_pixel_internal)
return 0;
size_t bytes_to_copy = BAN::Math::min<size_t>(m_width * m_height * 3 - offset, buffer.size());
size_t bytes_to_copy = BAN::Math::min<size_t>(m_width * m_height * bytes_per_pixel_internal - offset, buffer.size());
memcpy(reinterpret_cast<void*>(m_video_buffer->vaddr() + offset), buffer.data(), bytes_to_copy);
uint32_t first_pixel = offset / bytes_per_pixel_internal;

View File

@ -290,7 +290,7 @@ BAN::Optional<int> execute_builtin(BAN::Vector<BAN::String>& args, int fd_in, in
if (args.front() == "clear"sv)
{
fprintf(fout, "\e[H\e[J");
fprintf(fout, "\e[H\e[2J");
fflush(fout);
}
else if (args.front() == "exit"sv)