From 0e94325936030990ac95b9ca90382aa265c95818 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 30 Nov 2019 14:14:59 +0100 Subject: Re-enabled font in non-installed versions --- src/kernel/fs/install.c | 6 +++--- src/kernel/graphics/font.c | 16 +++++++++++++--- src/kernel/graphics/vesa.c | 3 ++- src/kernel/paging/paging.c | 1 + 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/kernel/fs/install.c b/src/kernel/fs/install.c index 386ca0a..4df1f7f 100644 --- a/src/kernel/fs/install.c +++ b/src/kernel/fs/install.c @@ -62,9 +62,9 @@ void install_melvix() kfree(kernel_e); info("Copying font... "); - char* font_p[] = {"FONT.BIN"}; - struct iso9660_entity* font_e = ISO9660_get(font_p, 1); - if(!font_e) + char *font_p[] = {"FONT.BIN"}; + struct iso9660_entity *font_e = ISO9660_get(font_p, 1); + if (!font_e) panic("Font not found!"); uint8_t *font = kmalloc(font_e->length + 2048); serial_write_hex(font_e->length + 2048); 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 #include #include +#include +#include +#include + +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) diff --git a/src/kernel/paging/paging.c b/src/kernel/paging/paging.c index 4c8cb44..68784ee 100644 --- a/src/kernel/paging/paging.c +++ b/src/kernel/paging/paging.c @@ -26,6 +26,7 @@ void paging_install() paging_enable(); serial_write_dec(memory_get_all() >> 10); + vga_log("Installed paging", 4); } -- cgit v1.2.3