77 unsigned char Key = 0;
78 while (!(Key =
Kgetkey()) && Key ==
'a') {
100 Kprintf(
"Not enough args\nUsage: setname [New Name]");
129#define NUM_COMMANDS (sizeof(commands) / sizeof(CommandEntry))
146 char *cmd = (
char *)
Kmalloc(128, 8);
158 int argc =
Split(cmd, argv, 8);
168 commands[i].func((
const char **)argv, argc);
175 Kprintf(
"\nUnKnown Command - Try `help`\n");
void * Kmalloc(size_t size, size_t align)
Allocate memory.
void Kfree(void *ptr)
Free allocated memory.
void Readf(const char *argv[], int argc)
Read and display contents of a file from the FAT16 filesystem.
void Rm(const char *argv[], int argc)
Delete a file from the FAT16 filesystem.
void Writef(const char *argv[], int argc)
Write data to a file in the FAT16 filesystem from user input.
void Mkf(const char *argv[], int argc)
Create a new empty file on the FAT16 filesystem.
Definitions and declarations for FAT16 filesystem and ATA I/O.
void Fat16Ls(void)
Lists files in the FAT16 root directory.
char Kgetkey()
Gets the next character from the keyboard buffer (blocking).
void Kgetstr(char *str, int length)
Reads a line of input from the keyboard (blocking).
void Kflush()
Flushes the keyboard controller input buffer.
void Kprintf(const char *fmt,...)
Formatted output to the screen.
void Kcfp()
Clears the screen by filling the video memory with spaces.
void Regexc()
Interactive regex command.
CommandEntry commands[]
Array of all available shell commands.
void CmdRecvPack(const char *argv[], int argc)
Receives network packets from VirtNet (on keypress).
void CmdHelp(const char *argv[], int argc)
Displays built-in help information.
void CmdShutdown(const char *argv[], int argc)
Sends shutdown signal when running under QEMU.
void CmdUser(const char *argv[], int argc)
Prints the current username.
void Sh()
The main interactive WKern shell loop.
void CmdLs(const char *argv[], int argc)
Lists FAT16 filesystem contents.
void CmdCmp(const char *argv[], int argc)
Compares two strings using the internal shell comparison function.
void CmdClear(const char *argv[], int argc)
Clears the shell screen.
void(* CommandFunc)(const char *argv[], int argc)
Command function pointer type.
void CmdTst(const char *argv[], int argc)
Executes a test WEX executable.
void CmdSetName(const char *argv[], int argc)
Sets the username used in the shell.
#define NUM_COMMANDS
Number of commands available in the shell.
void CmdRegex(const char *argv[], int argc)
Runs the regex test utility.
void Help()
Prints Shell Help.
void Runwex(unsigned char *wexexecu)
Automatically checks and executes an executable.
int Split(char *input, char **argv, int max_args)
Split into ARGC.
void Kshcmp()
Interactive string comparison.
int Kstrcmp(const char *a, const char *b)
Compare Strings - Similar to standard libc strcmp.
Represents an individual shell command.
void NetStq(u32 iob)
Processes received packets from the VirtIO queue.