From dcdba034269baf3df9e0fd112a2ff30c4ab9fc86 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 25 May 2023 02:49:32 +0300 Subject: [PATCH] Kernel shell stub --- KernelShell.cpp | 24 ++++++++++++++++++++++++ Recovery/RecoveryMain.cpp | 8 ++++++++ include/kshell.hpp | 25 +++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 KernelShell.cpp create mode 100644 include/kshell.hpp diff --git a/KernelShell.cpp b/KernelShell.cpp new file mode 100644 index 0000000..49f5ba3 --- /dev/null +++ b/KernelShell.cpp @@ -0,0 +1,24 @@ +/* + This file is part of Fennix Kernel. + + Fennix Kernel is free software: you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of + the License, or (at your option) any later version. + + Fennix Kernel is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Fennix Kernel. If not, see . +*/ + +#include +#include + +void StartKernelShell() +{ + stub; +} diff --git a/Recovery/RecoveryMain.cpp b/Recovery/RecoveryMain.cpp index 1145508..3a668f4 100644 --- a/Recovery/RecoveryMain.cpp +++ b/Recovery/RecoveryMain.cpp @@ -16,6 +16,7 @@ */ #include +#include #include #include #include @@ -308,6 +309,12 @@ namespace Recovery void RebootCommandWrapper() { TaskManager->CreateThread(TaskManager->GetCurrentProcess(), (IP)RebootCommandThread); } void ShutdownCommandWrapper() { TaskManager->CreateThread(TaskManager->GetCurrentProcess(), (IP)ShutdownCommandThread); } + void ShellCommandWrapper() + { + delete RecoveryScreen, RecoveryScreen = nullptr; + StartKernelShell(); + inf_loop; + } GraphicalUserInterface::GUI *gui = nullptr; void GUIWrapper() { gui->Loop(); } @@ -335,6 +342,7 @@ namespace Recovery wdgRecWin->CreateLabel({10, 40, 0, 0}, "All you can do is shutdown/reboot the system."); wdgRecWin->CreateButton({10, 70, 90, 20}, "Reboot", (uintptr_t)RebootCommandWrapper); wdgRecWin->CreateButton({110, 70, 90, 20}, "Shutdown", (uintptr_t)ShutdownCommandWrapper); + wdgRecWin->CreateButton({210, 70, 90, 20}, "Shell", (uintptr_t)ShellCommandWrapper); RecWin->AddWidget(wdgRecWin); Rect DebugWindow; diff --git a/include/kshell.hpp b/include/kshell.hpp new file mode 100644 index 0000000..97b7495 --- /dev/null +++ b/include/kshell.hpp @@ -0,0 +1,25 @@ +/* + This file is part of Fennix Kernel. + + Fennix Kernel is free software: you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of + the License, or (at your option) any later version. + + Fennix Kernel is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Fennix Kernel. If not, see . +*/ + +#ifndef __FENNIX_KERNEL_KERNEL_SHELL_H__ +#define __FENNIX_KERNEL_KERNEL_SHELL_H__ + +#include + +void StartKernelShell(); + +#endif // !__FENNIX_KERNEL_KERNEL_SHELL_H__