Add basic character output for VGA graphics mode console (#649)

* Test output of colors for VGA graphics modes in examples/vga.c
* [metal] Character output in VGA graphics modes is mostly working
* [metal] Mention magic key to switch video mode, at bootup
This commit is contained in:
tkchia 2022-10-05 21:46:50 +08:00 committed by GitHub
parent b75a4654cf
commit edb8fef06c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 2059 additions and 324 deletions

View file

@ -49,12 +49,12 @@ int main(int argc, char *argv[]) {
printf("res = %d?\n", res);
return -1;
}
printf("Hello World! %.19Lg\n", atan2l(x, y));
printf("\e[92;44mHello World!\e[0m %.19Lg\n", atan2l(x, y));
// read/print loop so machine doesn't reset on metal
for (;;) {
if ((res = readansi(0, buf, 16)) > 0) {
printf("got %`'.*s\r\n", res, buf);
printf("got \e[97m%`'.*s\e[0m\r\n", res, buf);
}
}
}