Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Migrate to PSF font
  • Loading branch information
djphoenix committed May 27, 2019
1 parent eecd76e commit 2bd3181
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4,617 deletions.
9 changes: 8 additions & 1 deletion src/kernlib/display.cpp
Expand Up @@ -5,7 +5,12 @@
#include "efi.hpp"
#include "multiboot_info.hpp"
#include "pagetable.hpp"
#include "font-8x16.hpp"

asm(
".rodata;"
"fb_font_8x16:"
".incbin \"" __FILE__ ".font.psf\""
);

class ConsoleDisplay: public Display {
private:
Expand Down Expand Up @@ -62,6 +67,7 @@ class FramebufferDisplay: public Display {
size_t width, height;
PixelFormat pixelFormat;
size_t offset;
const uint8_t *fb_font_8x16;

size_t pixelBytes() {
switch (pixelFormat) {
Expand Down Expand Up @@ -126,6 +132,7 @@ class FramebufferDisplay: public Display {
Pagetable::map(reinterpret_cast<void*>(ptr));
}
clean();
asm volatile("lea fb_font_8x16(%%rip), %q0":"=r"(fb_font_8x16));
}
void write(const char *str) {
Mutex::CriticalLock lock(mutex);
Expand Down
Binary file added src/kernlib/display.cpp.font.psf
Binary file not shown.

0 comments on commit 2bd3181

Please sign in to comment.