term: Bug fixes

This commit is contained in:
mintsuki 2021-11-21 01:18:39 +01:00
parent b0e9007e2c
commit 9cbe856da0
3 changed files with 18 additions and 21 deletions

View File

@ -20,6 +20,7 @@
#include <pxe/tftp.h>
#include <drivers/disk.h>
#include <sys/idt.h>
#include <sys/cpu.h>
struct volume *boot_volume;
@ -80,6 +81,19 @@ void entry(uint8_t boot_drive, int boot_from) {
term_notready();
#if bios == 1
{
struct rm_regs r = {0};
r.eax = 0x0003;
rm_int(0x10, &r, &r);
current_video_mode = -1;
outb(0x3d4, 0x0a);
outb(0x3d5, 0x20);
}
#endif
init_e820();
init_memmap();

View File

@ -141,6 +141,10 @@ void stage3_common(void) {
char *quiet_str = config_get_value(NULL, 0, "QUIET");
quiet = quiet_str != NULL && strcmp(quiet_str, "yes") == 0;
#if bios == 1
term_textmode();
#endif
char *verbose_str = config_get_value(NULL, 0, "VERBOSE");
verbose = verbose_str != NULL && strcmp(verbose_str, "yes") == 0;

View File

@ -7,7 +7,6 @@
#include <lib/blib.h>
#include <drivers/vga_textmode.h>
#include <lib/print.h>
#include <sys/cpu.h>
// Tries to implement this standard for terminfo
// https://man7.org/linux/man-pages/man4/console_codes.4.html
@ -75,26 +74,6 @@ void term_notready(void) {
term_rows = 100;
term_cols = 100;
#if bios == 1
{
if (current_video_mode != -1) {
struct rm_regs r = {0};
r.eax = 0x0003;
rm_int(0x10, &r, &r);
current_video_mode = -1;
}
volatile uint16_t *vmem = (volatile uint16_t *)0xb8000;
for (size_t i = 0; i < 80*25; i++) {
vmem[i] = 0x0720;
}
outb(0x3d4, 0x0a);
outb(0x3d5, 0x20);
}
#endif
}
void (*raw_putchar)(uint8_t c);