WKern
Loading...
Searching...
No Matches
shellhelp.c
Go to the documentation of this file.
1/*
2WKern - A Bare Metal OS / Kernel I am maKing (For Fun)
3Copyright (C) 2025 Wdboyes13
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 3 of the License, or
8any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <https://www.gnu.org/licenses/>.
17*/
18#include <KShell/shell.h>
19#include <io/kio.h>
20#include <mem/kmem.h>
21#include <utils/util.h>
23void Help() {
24 Kprintf("Page 1 or 2 ? ");
25 char *opt = (char *)Kmalloc(10, 8);
26 if (!opt) {
27 Kprintf("There was a mistaKe created, Known as a Malloc Failure");
28 return;
29 }
30 Kgetstr(opt, 10);
31 if (Kstrcmp(opt, "1") == 0) {
32 Kprintf("\nshutdown - shutdown system");
33 Kprintf("\nhelp - list command");
34 Kprintf("\ncmp - compare strings");
35 Kprintf("\nclear - clear screen");
36 Kprintf("\nsetname - Set Username");
37 Kprintf("\nuser - List Username");
38 Kprintf("\nrecvpacK - Receive a networK pacKet");
39 } else if (Kstrcmp(opt, "2") == 0) {
40 Kprintf("\ntst - Test a WEX Executable");
41 Kprintf("\nls - List Files in Mounted FAT16");
42 Kprintf("\nread - Read File Contents from Cluster (512 Bytes)");
43 Kprintf("\nmKfile - MaKe a new file");
44 Kprintf("\nrm - Remove a file");
45 Kprintf("\nwrite - Write to a File");
46 Kprintf("\nregex - Use POSIX ERE Regex");
47 }
48 Kfree(opt);
49}
void * Kmalloc(size_t size, size_t align)
Allocate memory.
Definition alloc.c:48
void Kfree(void *ptr)
Free allocated memory.
Definition alloc.c:75
void Kgetstr(char *str, int length)
Reads a line of input from the keyboard (blocking).
Definition keyin.c:186
void Kprintf(const char *fmt,...)
Formatted output to the screen.
Definition printer.c:152
void Help()
Prints Shell Help.
Definition shellhelp.c:23
int Kstrcmp(const char *a, const char *b)
Compare Strings - Similar to standard libc strcmp.
Definition strings.c:27