mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-11 07:19:20 +00:00
Update kernel
This commit is contained in:
55
KernelShell/Commands/cat.cpp
Normal file
55
KernelShell/Commands/cat.cpp
Normal file
@ -0,0 +1,55 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
|
||||
void cmd_cat(const char *args)
|
||||
{
|
||||
if (args[0] == '\0')
|
||||
return;
|
||||
|
||||
Node *thisNode = vfs->GetNodeFromPath(args, thisProcess->CurrentWorkingDirectory);
|
||||
if (thisNode == nullptr)
|
||||
{
|
||||
printf("cat: %s: No such file or directory\n", args);
|
||||
return;
|
||||
}
|
||||
|
||||
if (thisNode->Flags != NodeFlags::FILE &&
|
||||
thisNode->Flags != NodeFlags::CHARDEVICE)
|
||||
{
|
||||
printf("cat: %s: Not a file\n", args);
|
||||
return;
|
||||
}
|
||||
std::string path = vfs->GetPathFromNode(thisNode);
|
||||
|
||||
int fd = fopen(path.c_str(), "r");
|
||||
struct stat st;
|
||||
fstat(fd, &st);
|
||||
|
||||
char *buffer = new char[st.st_size + 1];
|
||||
fread(fd, buffer, st.st_size);
|
||||
printf("%s\n", buffer);
|
||||
delete[] buffer;
|
||||
fclose(fd);
|
||||
}
|
46
KernelShell/Commands/cd.cpp
Normal file
46
KernelShell/Commands/cd.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
|
||||
void cmd_cd(const char *args)
|
||||
{
|
||||
if (args[0] == '\0')
|
||||
return;
|
||||
|
||||
Node *thisNode = vfs->GetNodeFromPath(args, thisProcess->CurrentWorkingDirectory);
|
||||
|
||||
if (thisNode == nullptr)
|
||||
{
|
||||
printf("cd: %s: No such file or directory\n", args);
|
||||
return;
|
||||
}
|
||||
|
||||
if (thisNode->Flags != NodeFlags::DIRECTORY)
|
||||
{
|
||||
printf("cd: %s: Not a directory\n", args);
|
||||
return;
|
||||
}
|
||||
|
||||
thisProcess->CurrentWorkingDirectory = thisNode;
|
||||
}
|
25
KernelShell/Commands/echo.cpp
Normal file
25
KernelShell/Commands/echo.cpp
Normal file
@ -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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
void cmd_echo(const char *args)
|
||||
{
|
||||
printf("%s\n", args);
|
||||
}
|
33
KernelShell/Commands/exit.cpp
Normal file
33
KernelShell/Commands/exit.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
#include <task.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
using namespace Tasking;
|
||||
|
||||
void cmd_exit(const char *)
|
||||
{
|
||||
KernelShutdownThread(false);
|
||||
// TaskManager->KillThread(thisThread, KILL_SUCCESS);
|
||||
CPU::Halt(true);
|
||||
}
|
39
KernelShell/Commands/kill.cpp
Normal file
39
KernelShell/Commands/kill.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
#include <task.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
using namespace Tasking;
|
||||
|
||||
void cmd_kill(const char *args)
|
||||
{
|
||||
PID pid = atoi(args);
|
||||
PCB *pcb = TaskManager->GetProcessByID(pid);
|
||||
|
||||
if (pcb == nullptr)
|
||||
{
|
||||
printf("No process with PID %d\n", pid);
|
||||
return;
|
||||
}
|
||||
TaskManager->KillProcess(pcb, KILL_BY_OTHER_PROCESS);
|
||||
}
|
37
KernelShell/Commands/killall.cpp
Normal file
37
KernelShell/Commands/killall.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
#include <task.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
using namespace Tasking;
|
||||
|
||||
void cmd_killall(const char *args)
|
||||
{
|
||||
foreach (auto Proc in TaskManager->GetProcessList())
|
||||
{
|
||||
if (strcmp(Proc->Name, args) == 0)
|
||||
{
|
||||
TaskManager->KillProcess(Proc, KILL_BY_OTHER_PROCESS);
|
||||
}
|
||||
}
|
||||
}
|
57
KernelShell/Commands/ls.cpp
Normal file
57
KernelShell/Commands/ls.cpp
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
|
||||
void cmd_ls(const char *args)
|
||||
{
|
||||
if (args[0] == '\0')
|
||||
{
|
||||
Node *rootNode = thisProcess->CurrentWorkingDirectory;
|
||||
|
||||
if (rootNode == nullptr)
|
||||
rootNode = vfs->GetRootNode()->Children[0];
|
||||
|
||||
foreach (auto var in rootNode->Children)
|
||||
printf("%s\n", var->Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
Node *thisNode = vfs->GetNodeFromPath(args, thisProcess->CurrentWorkingDirectory);
|
||||
|
||||
if (thisNode == nullptr)
|
||||
{
|
||||
printf("ls: %s: No such file or directory\n", args);
|
||||
return;
|
||||
}
|
||||
|
||||
if (thisNode->Flags != NodeFlags::DIRECTORY)
|
||||
{
|
||||
printf("%s\n", thisNode->Name);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (auto var in thisNode->Children)
|
||||
printf("%s\n", var->Name);
|
||||
}
|
||||
}
|
35
KernelShell/Commands/lsof.cpp
Normal file
35
KernelShell/Commands/lsof.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
void cmd_lsof(const char *)
|
||||
{
|
||||
printf("PROCESS FD NAME\n");
|
||||
foreach (auto Proc in TaskManager->GetProcessList())
|
||||
{
|
||||
if (!Proc)
|
||||
continue;
|
||||
|
||||
std::vector<VirtualFileSystem::FileDescriptorTable::FileDescriptor> fds_array = Proc->FileDescriptors->GetFileDescriptors();
|
||||
foreach (auto fd in fds_array)
|
||||
printf("%s %d: %s\n", Proc->Name, fd.Descriptor,
|
||||
fd.Handle->AbsolutePath.c_str());
|
||||
}
|
||||
}
|
41
KernelShell/Commands/lspci.cpp
Normal file
41
KernelShell/Commands/lspci.cpp
Normal file
@ -0,0 +1,41 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
|
||||
void cmd_lspci(const char *)
|
||||
{
|
||||
foreach (auto Device in PCIManager->GetDevices())
|
||||
{
|
||||
printf("%02x:%02x.%d: %s: %s %s %s\n",
|
||||
// Device->Bus,
|
||||
// Device->Device,
|
||||
// Device->Function,
|
||||
// FIXME
|
||||
0, 0, 0,
|
||||
PCI::Descriptors::BridgeDeviceSubclassName(Device->Subclass),
|
||||
PCI::Descriptors::GetVendorName(Device->VendorID),
|
||||
PCI::Descriptors::GetDeviceName(Device->VendorID, Device->DeviceID),
|
||||
PCI::Descriptors::GetSubclassName(Device->Class, Device->Subclass));
|
||||
}
|
||||
}
|
64
KernelShell/Commands/mem.cpp
Normal file
64
KernelShell/Commands/mem.cpp
Normal file
@ -0,0 +1,64 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
#include <task.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
using namespace Tasking;
|
||||
|
||||
void cmd_mem(const char *)
|
||||
{
|
||||
uint64_t total = KernelAllocator.GetTotalMemory();
|
||||
uint64_t used = KernelAllocator.GetUsedMemory();
|
||||
uint64_t free = KernelAllocator.GetFreeMemory();
|
||||
uint64_t reserved = KernelAllocator.GetReservedMemory();
|
||||
|
||||
int usedPercent = (int)((used * 100) / total);
|
||||
int usedBar = (int)(usedPercent / 2);
|
||||
|
||||
int reservedPercent = (int)((reserved * 100) / total);
|
||||
int reservedBar = (int)(reservedPercent / 2);
|
||||
|
||||
printf("[");
|
||||
for (int i = 0; i < usedBar; i++)
|
||||
printf("=");
|
||||
for (int i = 0; i < 50 - usedBar; i++)
|
||||
printf(" ");
|
||||
printf("] %d%% Used\n", usedPercent);
|
||||
|
||||
printf("[");
|
||||
for (int i = 0; i < reservedBar; i++)
|
||||
printf("=");
|
||||
for (int i = 0; i < 50 - reservedBar; i++)
|
||||
printf(" ");
|
||||
printf("] %d%% Reserved\n", reservedPercent);
|
||||
|
||||
// printf("Total: %d MiB\n", (int)(TO_MiB(total)));
|
||||
// printf("Used: %d MiB\n", (int)(TO_MiB(used)));
|
||||
// printf("Free: %d MiB\n", (int)(TO_MiB(free)));
|
||||
// printf("Reserved: %d MiB\n", (int)(TO_MiB(reserved)));
|
||||
|
||||
printf("TOTAL USED FREE RESERVED\n");
|
||||
printf("%d MiB %d MiB %d MiB %d MiB\n",
|
||||
(int)(TO_MiB(total)), (int)(TO_MiB(used)),
|
||||
(int)(TO_MiB(free)), (int)(TO_MiB(reserved)));
|
||||
}
|
33
KernelShell/Commands/ps.cpp
Normal file
33
KernelShell/Commands/ps.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
#include <task.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
using namespace Tasking;
|
||||
|
||||
void cmd_ps(const char *)
|
||||
{
|
||||
printf("PID Name\n");
|
||||
foreach (auto p in TaskManager->GetProcessList())
|
||||
printf("%d %s\n", p->ID, p->Name);
|
||||
}
|
32
KernelShell/Commands/reboot.cpp
Normal file
32
KernelShell/Commands/reboot.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
#include <task.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
using namespace Tasking;
|
||||
|
||||
void cmd_reboot(const char *)
|
||||
{
|
||||
KernelShutdownThread(true);
|
||||
CPU::Halt(true);
|
||||
}
|
32
KernelShell/Commands/shutdown.cpp
Normal file
32
KernelShell/Commands/shutdown.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
#include <task.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
using namespace Tasking;
|
||||
|
||||
void cmd_shutdown(const char *)
|
||||
{
|
||||
KernelShutdownThread(false);
|
||||
CPU::Halt(true);
|
||||
}
|
46
KernelShell/Commands/top.cpp
Normal file
46
KernelShell/Commands/top.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
#include <task.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
using namespace Tasking;
|
||||
|
||||
void cmd_top(const char *)
|
||||
{
|
||||
printf("\e9400A1PID \e9CA100Name \e00A15BState \eCCCCCCPriority Memory Usage CPU Usage\n");
|
||||
foreach (auto Proc in TaskManager->GetProcessList())
|
||||
{
|
||||
printf("\e9400A1%-4d \e9CA100%-20s \e00A15B%s \eCCCCCC%d %ld %ld\n",
|
||||
Proc->ID, Proc->Name, Proc->Status == Running ? "Running" : "Stopped",
|
||||
Proc->Info.Priority, Proc->Memory->GetAllocatedMemorySize(),
|
||||
Proc->Info.UserTime + Proc->Info.KernelTime);
|
||||
|
||||
foreach (auto Thrd in Proc->Threads)
|
||||
{
|
||||
printf(" \eA80011%-4d \e9CA100%-20s \e00A15B%s \eCCCCCC%d %ld %ld\n",
|
||||
Thrd->ID, Thrd->Name, Thrd->Status == Running ? "Running" : "Stopped",
|
||||
Thrd->Info.Priority, Thrd->Memory->GetAllocatedMemorySize(),
|
||||
Thrd->Info.UserTime + Thrd->Info.KernelTime);
|
||||
}
|
||||
}
|
||||
}
|
65
KernelShell/Commands/uname.cpp
Normal file
65
KernelShell/Commands/uname.cpp
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
|
||||
void cmd_uname(const char *args)
|
||||
{
|
||||
if (args)
|
||||
{
|
||||
if (strcmp(args, "-a") == 0)
|
||||
{
|
||||
printf("Fennix Kernel %s %s %s %s\n",
|
||||
KERNEL_VERSION, KERNEL_NAME, __DATE__,
|
||||
KERNEL_ARCH);
|
||||
}
|
||||
else if (strcmp(args, "-s") == 0)
|
||||
{
|
||||
printf("%s\n", KERNEL_NAME);
|
||||
}
|
||||
else if (strcmp(args, "-v") == 0)
|
||||
{
|
||||
printf("%s\n", KERNEL_VERSION);
|
||||
}
|
||||
else if (strcmp(args, "-n") == 0)
|
||||
{
|
||||
printf("unknown\n");
|
||||
}
|
||||
else if (strcmp(args, "-r") == 0)
|
||||
{
|
||||
printf("%s\n", KERNEL_NAME);
|
||||
}
|
||||
else if (strcmp(args, "-m") == 0)
|
||||
{
|
||||
printf("%s\n", KERNEL_ARCH);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("uname: invalid option: %s\n", args);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Fennix Kernel\n");
|
||||
}
|
||||
}
|
51
KernelShell/Commands/uptime.cpp
Normal file
51
KernelShell/Commands/uptime.cpp
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
|
||||
void cmd_uptime(const char *)
|
||||
{
|
||||
if (TimeManager)
|
||||
{
|
||||
size_t Nanoseconds =
|
||||
TimeManager->GetNanosecondsSinceClassCreation();
|
||||
size_t Seconds = Nanoseconds / 10000000;
|
||||
size_t Minutes = Seconds / 60;
|
||||
size_t Hours = Minutes / 60;
|
||||
size_t Days = Hours / 24;
|
||||
|
||||
debug("Nanoseconds: %ld", Nanoseconds);
|
||||
|
||||
Seconds %= 60;
|
||||
Minutes %= 60;
|
||||
Hours %= 24;
|
||||
|
||||
printf("%ld days, %ld hours, %ld minutes, %ld %s\n",
|
||||
Days, Hours, Minutes, Seconds,
|
||||
Seconds == 1 ? "second" : "seconds");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Could not get uptime\n");
|
||||
}
|
||||
}
|
29
KernelShell/Commands/whoami.cpp
Normal file
29
KernelShell/Commands/whoami.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../cmds.hpp"
|
||||
|
||||
#include <filesystem.hpp>
|
||||
|
||||
#include "../../kernel.h"
|
||||
|
||||
using namespace VirtualFileSystem;
|
||||
|
||||
void cmd_whoami(const char *)
|
||||
{
|
||||
printf("kernel\n");
|
||||
}
|
422
KernelShell/Shell.cpp
Normal file
422
KernelShell/Shell.cpp
Normal file
@ -0,0 +1,422 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <kshell.hpp>
|
||||
|
||||
#include <filesystem.hpp>
|
||||
#include <driver.hpp>
|
||||
#include <lock.hpp>
|
||||
#include <debug.h>
|
||||
|
||||
#include "../Modules/PersonalSystem2/keyboard.hpp"
|
||||
#include "../kernel.h"
|
||||
#include "../Fex.hpp"
|
||||
#include "../DAPI.hpp"
|
||||
#include "cmds.hpp"
|
||||
|
||||
using namespace PS2Keyboard;
|
||||
|
||||
NewLock(ShellLock);
|
||||
|
||||
const char sc_ascii_low[] = {'?', '?', '1', '2', '3', '4', '5', '6',
|
||||
'7', '8', '9', '0', '-', '=', '?', '?', 'q', 'w', 'e', 'r', 't', 'y',
|
||||
'u', 'i', 'o', 'p', '[', ']', '?', '?', 'a', 's', 'd', 'f', 'g',
|
||||
'h', 'j', 'k', 'l', ';', '\'', '`', '?', '\\', 'z', 'x', 'c', 'v',
|
||||
'b', 'n', 'm', ',', '.', '/', '?', '?', '?', ' '};
|
||||
|
||||
const char sc_ascii_high[] = {'?', '?', '!', '@', '#', '$', '%', '^',
|
||||
'&', '*', '(', ')', '_', '+', '?', '?', 'Q', 'W', 'E', 'R', 'T', 'Y',
|
||||
'U', 'I', 'O', 'P', '{', '}', '?', '?', 'A', 'S', 'D', 'F', 'G',
|
||||
'H', 'J', 'K', 'L', ';', '\"', '~', '?', '|', 'Z', 'X', 'C', 'V',
|
||||
'B', 'N', 'M', '<', '>', '?', '?', '?', '?', ' '};
|
||||
|
||||
static int LowerCase = true;
|
||||
|
||||
char GetLetterFromScanCode(uint8_t ScanCode)
|
||||
{
|
||||
if (ScanCode & 0x80)
|
||||
{
|
||||
switch (ScanCode)
|
||||
{
|
||||
case KEY_U_LSHIFT:
|
||||
LowerCase = true;
|
||||
return 0;
|
||||
case KEY_U_RSHIFT:
|
||||
LowerCase = true;
|
||||
return 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (ScanCode)
|
||||
{
|
||||
case KEY_D_RETURN:
|
||||
return '\n';
|
||||
case KEY_D_LSHIFT:
|
||||
LowerCase = false;
|
||||
return 0;
|
||||
case KEY_D_RSHIFT:
|
||||
LowerCase = false;
|
||||
return 0;
|
||||
case KEY_D_BACKSPACE:
|
||||
return ScanCode;
|
||||
default:
|
||||
{
|
||||
if (ScanCode > 0x39)
|
||||
break;
|
||||
if (LowerCase)
|
||||
return sc_ascii_low[ScanCode];
|
||||
else
|
||||
return sc_ascii_high[ScanCode];
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetChar()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct Command
|
||||
{
|
||||
const char *Name;
|
||||
void (*Function)(const char *);
|
||||
};
|
||||
|
||||
static Command commands[] = {
|
||||
{"lsof", cmd_lsof},
|
||||
{"ls", cmd_ls},
|
||||
{"cd", cmd_cd},
|
||||
{"cat", cmd_cat},
|
||||
{"echo", cmd_echo},
|
||||
{"mkdir", nullptr},
|
||||
{"touch", nullptr},
|
||||
{"rm", nullptr},
|
||||
{"rmdir", nullptr},
|
||||
{"mv", nullptr},
|
||||
{"cp", nullptr},
|
||||
{"clear", nullptr},
|
||||
{"help", nullptr},
|
||||
{"exit", cmd_exit},
|
||||
{"reboot", cmd_reboot},
|
||||
{"shutdown", cmd_shutdown},
|
||||
{"ps", cmd_ps},
|
||||
{"kill", cmd_kill},
|
||||
{"killall", cmd_killall},
|
||||
{"top", cmd_top},
|
||||
{"mem", cmd_mem},
|
||||
{"mount", nullptr},
|
||||
{"umount", nullptr},
|
||||
{"uname", cmd_uname},
|
||||
{"whoami", cmd_whoami},
|
||||
{"passwd", nullptr},
|
||||
{"su", nullptr},
|
||||
{"login", nullptr},
|
||||
{"logout", nullptr},
|
||||
{"uptime", cmd_uptime},
|
||||
{"chown", nullptr},
|
||||
{"chgrp", nullptr},
|
||||
{"chmod", nullptr},
|
||||
{"chroot", nullptr},
|
||||
{"lspci", cmd_lspci}};
|
||||
|
||||
void StartKernelShell()
|
||||
{
|
||||
SmartLock(ShellLock);
|
||||
|
||||
debug("Starting kernel shell...");
|
||||
printf("Starting kernel shell...\n");
|
||||
thisThread->SetPriority(Tasking::TaskPriority::High);
|
||||
Display->SetBuffer(0);
|
||||
|
||||
Driver::DriverFile KeyboardModule;
|
||||
if (likely(DriverManager->GetDrivers().size() > 0))
|
||||
{
|
||||
foreach (auto Driver in DriverManager->GetDrivers())
|
||||
{
|
||||
if (((FexExtended *)Driver.ExtendedHeaderAddress)->Driver.Type == FexDriverType::FexDriverType_Input &&
|
||||
((FexExtended *)Driver.ExtendedHeaderAddress)->Driver.TypeFlags & FexDriverInputTypes::FexDriverInputTypes_Keyboard)
|
||||
{
|
||||
KeyboardModule = Driver;
|
||||
printf("Using driver \eCA21F6%s\eCCCCCC for keyboard input.\n",
|
||||
((FexExtended *)Driver.ExtendedHeaderAddress)->Driver.Name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Display->SetBuffer(0);
|
||||
std::string Buffer;
|
||||
std::vector<std::string *> History;
|
||||
size_t HistoryIndex = 0;
|
||||
bool CtrlDown = false;
|
||||
bool TabDoublePress = false;
|
||||
|
||||
while (true)
|
||||
{
|
||||
size_t BackspaceCount = 0;
|
||||
Buffer.clear();
|
||||
|
||||
VirtualFileSystem::Node *cwd = thisProcess->CurrentWorkingDirectory;
|
||||
if (!cwd)
|
||||
cwd = vfs->GetNodeFromPath("/");
|
||||
|
||||
printf("\e34C6EB%s@%s:%s$ \eCCCCCC",
|
||||
"kernel",
|
||||
"fennix",
|
||||
cwd->FileSystem->GetPathFromNode(cwd).c_str());
|
||||
Display->SetBuffer(0);
|
||||
|
||||
while (true)
|
||||
{
|
||||
KernelCallback callback{};
|
||||
callback.Reason = PollWaitReason;
|
||||
DriverManager->IOCB(KeyboardModule.DriverUID, &callback);
|
||||
char c = GetLetterFromScanCode(callback.InputCallback.Keyboard.Key);
|
||||
|
||||
switch (callback.InputCallback.Keyboard.Key)
|
||||
{
|
||||
case KEY_D_LCTRL:
|
||||
{
|
||||
CtrlDown = true;
|
||||
continue;
|
||||
}
|
||||
case KEY_U_LCTRL:
|
||||
{
|
||||
CtrlDown = false;
|
||||
continue;
|
||||
}
|
||||
case KEY_D_BACKSPACE:
|
||||
{
|
||||
if (BackspaceCount == 0)
|
||||
continue;
|
||||
|
||||
Display->Print('\b', 0);
|
||||
Buffer.pop_back();
|
||||
BackspaceCount--;
|
||||
Display->SetBuffer(0);
|
||||
continue;
|
||||
}
|
||||
case KEY_D_UP:
|
||||
{
|
||||
if (History.size() == 0 ||
|
||||
HistoryIndex == 0)
|
||||
continue;
|
||||
|
||||
HistoryIndex--;
|
||||
|
||||
for (size_t i = 0; i < Buffer.size(); i++)
|
||||
Display->Print('\b', 0);
|
||||
Display->SetBuffer(0);
|
||||
|
||||
Buffer = History[HistoryIndex]->c_str();
|
||||
|
||||
for (size_t i = 0; i < strlen(Buffer.c_str()); i++)
|
||||
Display->Print(Buffer[i], 0);
|
||||
BackspaceCount = Buffer.size();
|
||||
Display->SetBuffer(0);
|
||||
continue;
|
||||
}
|
||||
case KEY_D_DOWN:
|
||||
{
|
||||
if (History.size() == 0 ||
|
||||
HistoryIndex == History.size())
|
||||
continue;
|
||||
|
||||
if (HistoryIndex == History.size() - 1)
|
||||
{
|
||||
HistoryIndex++;
|
||||
for (size_t i = 0; i < Buffer.size(); i++)
|
||||
Display->Print('\b', 0);
|
||||
BackspaceCount = Buffer.size();
|
||||
Display->SetBuffer(0);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < Buffer.size(); i++)
|
||||
Display->Print('\b', 0);
|
||||
Display->SetBuffer(0);
|
||||
|
||||
HistoryIndex++;
|
||||
Buffer = History[HistoryIndex]->c_str();
|
||||
|
||||
for (size_t i = 0; i < strlen(Buffer.c_str()); i++)
|
||||
Display->Print(Buffer[i], 0);
|
||||
|
||||
BackspaceCount = Buffer.size();
|
||||
Display->SetBuffer(0);
|
||||
continue;
|
||||
}
|
||||
case KEY_D_TAB:
|
||||
{
|
||||
if (!TabDoublePress)
|
||||
{
|
||||
TabDoublePress = true;
|
||||
continue;
|
||||
}
|
||||
TabDoublePress = false;
|
||||
if (Buffer.size() == 0)
|
||||
{
|
||||
for (size_t i = 0; i < sizeof(commands) / sizeof(commands[0]); i++)
|
||||
{
|
||||
printf("%s ", commands[i].Name);
|
||||
Display->SetBuffer(0);
|
||||
}
|
||||
Display->Print('\n', 0);
|
||||
Display->SetBuffer(0);
|
||||
goto SecLoopEnd;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < Buffer.size(); i++)
|
||||
Display->Print('\b', 0);
|
||||
Display->SetBuffer(0);
|
||||
|
||||
for (size_t i = 0; i < sizeof(commands) / sizeof(commands[0]); i++)
|
||||
{
|
||||
if (strncmp(Buffer.c_str(), commands[i].Name, Buffer.size()) == 0)
|
||||
{
|
||||
Buffer = commands[i].Name;
|
||||
for (size_t i = 0; i < strlen(Buffer.c_str()); i++)
|
||||
Display->Print(Buffer[i], 0);
|
||||
BackspaceCount = Buffer.size();
|
||||
Display->SetBuffer(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (c == 0)
|
||||
continue;
|
||||
|
||||
if (CtrlDown)
|
||||
{
|
||||
switch (std::toupper((char)c))
|
||||
{
|
||||
case 'C':
|
||||
{
|
||||
Display->Print('^', 0);
|
||||
Display->Print('C', 0);
|
||||
Display->Print('\n', 0);
|
||||
fixme("No SIGINT handler yet.");
|
||||
Display->SetBuffer(0);
|
||||
goto SecLoopEnd;
|
||||
}
|
||||
case 'D':
|
||||
{
|
||||
Display->Print('^', 0);
|
||||
Display->Print('D', 0);
|
||||
Display->Print('\n', 0);
|
||||
fixme("No SIGKILL handler yet.");
|
||||
Display->SetBuffer(0);
|
||||
goto SecLoopEnd;
|
||||
}
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Display->Print(c, 0);
|
||||
if (c == '\n')
|
||||
{
|
||||
if (Buffer.length() > 0)
|
||||
{
|
||||
std::string *hBuff = new std::string(Buffer.c_str());
|
||||
History.push_back(hBuff);
|
||||
HistoryIndex = History.size();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Buffer += c;
|
||||
BackspaceCount++;
|
||||
Display->SetBuffer(0);
|
||||
}
|
||||
SecLoopEnd:
|
||||
|
||||
if (Buffer.length() == 0)
|
||||
continue;
|
||||
|
||||
bool Found = false;
|
||||
for (size_t i = 0; i < sizeof(commands) / sizeof(Command); i++)
|
||||
{
|
||||
std::string cmd_extracted;
|
||||
for (size_t i = 0; i < Buffer.length(); i++)
|
||||
{
|
||||
if (Buffer[i] == ' ')
|
||||
break;
|
||||
cmd_extracted += Buffer[i];
|
||||
}
|
||||
|
||||
debug("cmd: %s, array[%d]: %s", cmd_extracted.c_str(), i, commands[i].Name);
|
||||
if (strncmp(commands[i].Name, cmd_extracted.c_str(), cmd_extracted.size()) == 0)
|
||||
{
|
||||
if (strlen(commands[i].Name) != cmd_extracted.size())
|
||||
continue;
|
||||
|
||||
Found = true;
|
||||
|
||||
std::string arg_only;
|
||||
const char *cmd_name = commands[i].Name;
|
||||
for (size_t i = strlen(cmd_name) + 1; i < Buffer.length(); i++)
|
||||
arg_only += Buffer[i];
|
||||
|
||||
if (commands[i].Function)
|
||||
commands[i].Function(arg_only.c_str());
|
||||
else
|
||||
{
|
||||
std::string cmd_only;
|
||||
for (size_t i = 0; i < Buffer.length(); i++)
|
||||
{
|
||||
if (Buffer[i] == ' ')
|
||||
break;
|
||||
cmd_only += Buffer[i];
|
||||
}
|
||||
printf("%s: command not implemented\n",
|
||||
cmd_only.c_str());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Found)
|
||||
{
|
||||
std::string cmd_only;
|
||||
for (size_t i = 0; i < Buffer.length(); i++)
|
||||
{
|
||||
if (Buffer[i] == ' ')
|
||||
break;
|
||||
cmd_only += Buffer[i];
|
||||
}
|
||||
printf("%s: command not found\n",
|
||||
cmd_only.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KShellThread()
|
||||
{
|
||||
StartKernelShell();
|
||||
inf_loop;
|
||||
}
|
41
KernelShell/cmds.hpp
Normal file
41
KernelShell/cmds.hpp
Normal file
@ -0,0 +1,41 @@
|
||||
/*
|
||||
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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __FENNIX_KERNEL_SHELL_CMDS_H__
|
||||
#define __FENNIX_KERNEL_SHELL_CMDS_H__
|
||||
|
||||
#include <types.h>
|
||||
|
||||
void cmd_lsof(const char *args);
|
||||
void cmd_echo(const char *args);
|
||||
void cmd_ls(const char *args);
|
||||
void cmd_cd(const char *args);
|
||||
void cmd_cat(const char *args);
|
||||
void cmd_ps(const char *args);
|
||||
void cmd_uptime(const char *args);
|
||||
void cmd_whoami(const char *args);
|
||||
void cmd_uname(const char *args);
|
||||
void cmd_mem(const char *args);
|
||||
void cmd_kill(const char *args);
|
||||
void cmd_killall(const char *args);
|
||||
void cmd_top(const char *args);
|
||||
void cmd_exit(const char *args);
|
||||
void cmd_shutdown(const char *args);
|
||||
void cmd_reboot(const char *args);
|
||||
void cmd_lspci(const char *args);
|
||||
|
||||
#endif // !__FENNIX_KERNEL_SHELL_CMDS_H__
|
Reference in New Issue
Block a user