aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/graphics
diff options
context:
space:
mode:
authorMarvin Borner2019-11-30 14:14:59 +0100
committerMarvin Borner2019-11-30 14:14:59 +0100
commit0e94325936030990ac95b9ca90382aa265c95818 (patch)
treeb83d90ecce9746e4e44a21695e18385afae6ef15 /src/kernel/graphics
parent13991f3985af026f8d645d9f5d2afed42c8a5435 (diff)
Re-enabled font in non-installed versions
Diffstat (limited to 'src/kernel/graphics')
-rw-r--r--src/kernel/graphics/font.c16
-rw-r--r--src/kernel/graphics/vesa.c3
2 files changed, 15 insertions, 4 deletions
diff --git a/src/kernel/graphics/font.c b/src/kernel/graphics/font.c
index 1e4e666..a7e5096 100644
--- a/src/kernel/graphics/font.c
+++ b/src/kernel/graphics/font.c
@@ -4,14 +4,24 @@
#include <kernel/graphics/font.h>
#include <mlibc/stdlib/liballoc.h>
#include <kernel/fs/ata_pio.h>
+#include <kernel/fs/atapi_pio.h>
+#include <kernel/system.h>
+#include <kernel/fs/iso9660/iso9660.h>
+
+void font_install()
+{
+ font = (struct font *) kmalloc(100000);; // High quality shit
-void font_install() {
uint8_t boot_drive_id = (uint8_t) (*((uint8_t *) 0x9000));
if (boot_drive_id != 0xE0) {
struct ata_interface *primary_master = new_ata(1, 0x1F0);
marfs_init(primary_master);
-
- font = (struct font *) kmalloc(100000); // High quality shit
marfs_read_whole_file(4, (uint8_t *) font);
+ } else {
+ char *font_p[] = {"FONT.BIN"};
+ struct iso9660_entity *font_e = ISO9660_get(font_p, 1);
+ if (!font_e) panic("Font not found!");
+ ATAPI_granular_read(1 + (font_e->length / 2048), font_e->lba, (uint8_t *) font);
+ kfree(font_e);
}
} \ No newline at end of file
diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c
index 9563f4f..8dc5929 100644
--- a/src/kernel/graphics/vesa.c
+++ b/src/kernel/graphics/vesa.c
@@ -67,12 +67,13 @@ uint16_t *vbe_get_modes()
uint16_t *mode_ptr = (uint16_t *) info->video_modes;
size_t number_modes = 1;
for (uint16_t *p = mode_ptr; *p != 0xFFFF; p++) number_modes++;
+ serial_write_dec(number_modes);
uint16_t *ret = kmalloc(sizeof(uint16_t) * number_modes);
for (size_t i = 0; i < number_modes; i++)
ret[i] = ((uint16_t *) info->video_modes)[i];
- return mode_ptr;
+ return ret;
}
struct vbe_mode_info *vbe_get_mode_info(uint16_t mode)