OurOS 0.1
Operating System built by McGill Students
 
Loading...
Searching...
No Matches
kshell_cmds.c File Reference
#include "kshell_cmds.h"
#include <stddef.h>
#include "cpu/gdt.h"
#include "cpu/idt.h"
#include "hal.h"
#include "io.h"
#include <console.h>
#include "port_io.h"
#include <stdlib.h>
#include <string.h>

Macros

#define CMD(_name)   static int _name(int argc, const char *argv[], putchar putc);
 Macro to declare a shell command.
 

Functions

cmd_t find_cmd (const char *name)
 Gets the cmd_t of a shell command, or NULL if not found.
 
static int echo (int argc, const char *argv[], putchar putc)
 
static int help (int argc, const char *argv[], putchar putc)
 
static int quit (int argc, const char *argv[], putchar putc)
 
static int clear (int argc, const char *argv[], putchar putc)
 
static int framebuffer (int argc, const char *argv[], putchar putc)
 
static int idt (int argc, const char *argv[], putchar putc)
 
static int gdt (int argc, const char *argv[], putchar putc)
 
static int div (int argc, const char *argv[], putchar putc)
 

Variables

struct cmd_tbl_entry command_table []
 The shell's commands.
 

Macro Definition Documentation

◆ CMD

#define CMD (   _name)    static int _name(int argc, const char *argv[], putchar putc);

Macro to declare a shell command.

Parameters
_nameName of the command and its associated function.

Function Documentation

◆ clear()

static int clear ( int  argc,
const char *  argv[],
putchar  putc 
)
static

◆ div()

static int div ( int  argc,
const char *  argv[],
putchar  putc 
)
static

◆ echo()

static int echo ( int  argc,
const char *  argv[],
putchar  putc 
)
static

◆ find_cmd()

cmd_t find_cmd ( const char *  name)

Gets the cmd_t of a shell command, or NULL if not found.

Parameters
nameName the command.

◆ framebuffer()

static int framebuffer ( int  argc,
const char *  argv[],
putchar  putc 
)
static

◆ gdt()

static int gdt ( int  argc,
const char *  argv[],
putchar  putc 
)
static

◆ help()

static int help ( int  argc,
const char *  argv[],
putchar  putc 
)
static

◆ idt()

static int idt ( int  argc,
const char *  argv[],
putchar  putc 
)
static

◆ quit()

static int quit ( int  argc,
const char *  argv[],
putchar  putc 
)
static

Variable Documentation

◆ command_table

struct cmd_tbl_entry command_table[]
Initial value:
= {
{ "echo", echo, "display a line of text" },
{ "help", help, "print help message for kernel commands" },
{ "quit", quit, "quit the operating system" },
{ "clear", clear, "clear the kernel console" },
{ "framebuffer", framebuffer, "manage the screen framebuffer" },
{ "idt", idt, "print interrupt descriptor table info" },
{ "gdt", gdt, "print global descriptor table info" },
{ "div", div, "divide two integers and display the result" },
{ NULL, NULL, NULL }
}
struct cpu_gdt_entry gdt[GDT_SEGMENTS]
Definition gdt.c:4
struct cpu_idt_entry idt[256]
Definition idt.c:9
static int div(int argc, const char *argv[], putchar putc)
Definition kshell_cmds.c:129
static int clear(int argc, const char *argv[], putchar putc)
Definition kshell_cmds.c:84
static int quit(int argc, const char *argv[], putchar putc)
Definition kshell_cmds.c:78
static int help(int argc, const char *argv[], putchar putc)
Definition kshell_cmds.c:63
static int echo(int argc, const char *argv[], putchar putc)
Definition kshell_cmds.c:53
static int framebuffer(int argc, const char *argv[], putchar putc)
Definition kshell_cmds.c:90
#define NULL
Definition stddef.h:4

The shell's commands.