console: Add slide command

This commit is contained in:
mintsuki 2023-07-27 23:09:42 -05:00
parent 98f30bfdd6
commit 4b452e69a4

View File

@ -20,6 +20,9 @@ static void console_help(void) {
"%s" "%s"
"lsvol -- List volumes.\n" "lsvol -- List volumes.\n"
"firmware -- Show firmware type.\n" "firmware -- Show firmware type.\n"
#if defined (UEFI)
"slide -- Print load slide offset.\n"
#endif
"version -- Print version.\n" "version -- Print version.\n"
"copyright -- Print copyright.\n" "copyright -- Print copyright.\n"
"help -- Print this help message.\n", "help -- Print this help message.\n",
@ -27,6 +30,10 @@ static void console_help(void) {
); );
} }
#if defined (UEFI)
extern symbol __image_base;
#endif
void console(void) { void console(void) {
print("Welcome to the Limine console.\nType 'help' for more information.\n\n"); print("Welcome to the Limine console.\nType 'help' for more information.\n\n");
@ -57,6 +64,10 @@ void console(void) {
print("UEFI\n"); print("UEFI\n");
#else #else
print("unknown\n"); print("unknown\n");
#endif
#if defined (UEFI)
} else if (strcmp(prompt, "slide") == 0) {
print("%p\n", __image_base);
#endif #endif
} else if (strcmp(prompt, "version") == 0) { } else if (strcmp(prompt, "version") == 0) {
print(LIMINE_VERSION "\n"); print(LIMINE_VERSION "\n");