summaryrefslogtreecommitdiff
path: root/kernel/io/psf2.h
diff options
context:
space:
mode:
authorSamuel Johnson <[email protected]>2025-07-01 10:33:05 -0400
committerSamuel Johnson <[email protected]>2025-07-01 10:33:05 -0400
commit571a656a6bd9b4b9d5c595c578d15ba79bb19ef7 (patch)
tree46f75b47f4edab4281de14ffa1c4a91a5a84f8f1 /kernel/io/psf2.h
parent12fd3a91f138bf90520134682e38bf3b0341e660 (diff)
Add serial loggingHEADtrunkdev
Diffstat (limited to 'kernel/io/psf2.h')
-rw-r--r--kernel/io/psf2.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/kernel/io/psf2.h b/kernel/io/psf2.h
new file mode 100644
index 0000000..e8dda44
--- /dev/null
+++ b/kernel/io/psf2.h
@@ -0,0 +1,37 @@
+#ifndef HOS_IO_PSF2_H
+#define HOS_IO_PSF2_H
+
+#include <cstdint>
+#include <io/font.h>
+
+#define PSF2_MAGIC0 0x72
+#define PSF2_MAGIC1 0xb5
+#define PSF2_MAGIC2 0x4a
+#define PSF2_MAGIC3 0x86
+
+#define PSF2_HAS_UNICODE_TABLE 0x01
+
+#define PSF2_SEPARATOR 0xff
+#define PSF2_STARTSEQ 0xfe
+
+namespace hos::io
+{
+ class psf2 : public font
+ {
+ public:
+ psf2 (void *font_start_addr);
+
+ void write (unsigned char character, void *fb_addr, std::uint16_t bpp);
+ private:
+ unsigned char magic[4];
+ unsigned int version;
+ unsigned int header_size;
+ unsigned int flags;
+ unsigned int length;
+ unsigned int charsize;
+ unsigned int height;
+ unsigned int width;
+ };
+}
+
+#endif