Skip to content

Commit

Permalink
adding essential commands to the shell
Browse files Browse the repository at this point in the history
  • Loading branch information
Kbz-8 committed Jul 22, 2024
1 parent 3d31f36 commit d433e1c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub fn build(b: *std.Build) void
"/bin/bash", "-c",
std.mem.concat(b.allocator, u8, &[_][]const u8
{
"sleep 1 && ",
"mkdir -p ", iso_dir, "/boot/grub && ",
"mv ", kernel_path, " ", iso_dir, "/boot/ && ",
"cp sources/grub/grub.cfg ", iso_dir, "/boot/grub/ && ",
Expand Down
1 change: 0 additions & 1 deletion sources/drivers/keyboard/keyboard.zig
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,3 @@ pub fn init() void
kernel.arch.idt.irqInstallHandler(1, &keyboardHandler);
kernel.logs.klogln("[PS/2 Keyboard Driver] loaded");
}

6 changes: 6 additions & 0 deletions sources/kernel/shell/dumb_shell.zig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ pub const DumbShell = struct
const key: u32 = drivers.kb.getCurrentKeyPressed();
if(self.halt)
{
if(key == drivers.kb.PGUP)
drivers.vga.reverseScroll()
else if(key == drivers.kb.PGDOWN)
drivers.vga.scroll();
if(key == drivers.kb.LEFT)
drivers.vga.moveCursor(.Left)
else if(key == drivers.kb.RIGHT)
Expand Down Expand Up @@ -118,6 +122,8 @@ pub const DumbShell = struct
stk.stackTrace(8)
else if(libk.str.streqlnt(&self.buffer, "panic"))
kpanic("shell request")
else if(libk.str.streqlnt(&self.buffer, "ratio"))
kpanic("ratio")
else if(libk.str.streqlnt(&self.buffer, "stfu"))
drivers.kb.disableKeyboard()
else if(libk.str.streqlnt(&self.buffer, "whoami"))
Expand Down

0 comments on commit d433e1c

Please sign in to comment.