mirror of
https://github.com/limine-bootloader/limine
synced 2024-11-27 02:49:56 +03:00
Add E9_OUTPUT config option
This commit is contained in:
parent
54eaf96860
commit
74c7c0d776
BIN
limine.bin
BIN
limine.bin
Binary file not shown.
@ -8,6 +8,8 @@
|
||||
|
||||
#define SEPARATOR '\n'
|
||||
|
||||
bool config_ready = false;
|
||||
|
||||
static char *config_addr;
|
||||
|
||||
int init_config(int drive, int part) {
|
||||
@ -33,6 +35,8 @@ int init_config(int drive, int part) {
|
||||
}
|
||||
}
|
||||
|
||||
config_ready = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
extern bool config_ready;
|
||||
|
||||
int init_config(int drive, int part);
|
||||
int config_get_entry_name(char *ret, size_t index, size_t limit);
|
||||
int config_set_entry(size_t index);
|
||||
|
@ -3,8 +3,12 @@
|
||||
#include <stdint.h>
|
||||
#include <lib/print.h>
|
||||
#include <lib/blib.h>
|
||||
#include <sys/cpu.h>
|
||||
#include <lib/config.h>
|
||||
#include <lib/term.h>
|
||||
#include <lib/libc.h>
|
||||
#include <sys/cpu.h>
|
||||
|
||||
static int e9_output = -1;
|
||||
|
||||
static const char *base_digits = "0123456789abcdef";
|
||||
|
||||
@ -114,6 +118,11 @@ void print(const char *fmt, ...) {
|
||||
static char print_buf[PRINT_BUF_MAX];
|
||||
|
||||
void vprint(const char *fmt, va_list args) {
|
||||
if (config_ready && e9_output == -1) {
|
||||
e9_output = config_get_value(print_buf, 0, PRINT_BUF_MAX, "E9_OUTPUT") &&
|
||||
!strcmp(print_buf, "yes");
|
||||
}
|
||||
|
||||
size_t print_buf_i = 0;
|
||||
|
||||
for (;;) {
|
||||
@ -170,8 +179,8 @@ void vprint(const char *fmt, va_list args) {
|
||||
out:
|
||||
term_write(print_buf, print_buf_i);
|
||||
|
||||
#ifdef E9_OUTPUT
|
||||
for (size_t i = 0; i < print_buf_i; i++)
|
||||
outb(0xe9, print_buf[i]);
|
||||
#endif
|
||||
if (e9_output == 1) {
|
||||
for (size_t i = 0; i < print_buf_i; i++)
|
||||
outb(0xe9, print_buf[i]);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
DEFAULT_ENTRY=0
|
||||
TIMEOUT=3
|
||||
GRAPHICS=yes
|
||||
E9_OUTPUT=yes
|
||||
|
||||
THEME_BLACK=80000000
|
||||
THEME_RED=aa0000
|
||||
|
Loading…
Reference in New Issue
Block a user