Compare commits
2 Commits
27eacac19c
...
15f4f7c72f
Author | SHA1 | Date | |
---|---|---|---|
15f4f7c72f | |||
0002c2314c |
@ -35,7 +35,6 @@ luna_app(time.cpp time)
|
|||||||
luna_app(ln.cpp ln)
|
luna_app(ln.cpp ln)
|
||||||
luna_app(mktemp.cpp mktemp)
|
luna_app(mktemp.cpp mktemp)
|
||||||
luna_app(sysfuzz.cpp sysfuzz)
|
luna_app(sysfuzz.cpp sysfuzz)
|
||||||
luna_app(pivot_root.cpp pivot_root)
|
|
||||||
luna_app(cp.cpp cp)
|
luna_app(cp.cpp cp)
|
||||||
luna_app(kill.cpp kill)
|
luna_app(kill.cpp kill)
|
||||||
luna_app(gol.cpp gol)
|
luna_app(gol.cpp gol)
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
#include <os/ArgumentParser.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
Result<int> luna_main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
StringView new_root;
|
|
||||||
StringView put_old;
|
|
||||||
|
|
||||||
os::ArgumentParser parser;
|
|
||||||
parser.add_description("Move the current root directory to another directory and replace it with another mount.");
|
|
||||||
parser.add_system_program_info("pivot_root"_sv);
|
|
||||||
parser.add_positional_argument(new_root, "new_root", true);
|
|
||||||
parser.add_positional_argument(put_old, "put_old", true);
|
|
||||||
parser.parse(argc, argv);
|
|
||||||
|
|
||||||
long rc = syscall(SYS_pivot_root, new_root.chars(), put_old.chars());
|
|
||||||
return Result<int>::from_syscall(rc);
|
|
||||||
}
|
|
@ -19,21 +19,20 @@ constexpr u8 RIGHT_SHIFT = 0x36;
|
|||||||
constexpr u8 CAPS_LOCK = 0x3a;
|
constexpr u8 CAPS_LOCK = 0x3a;
|
||||||
|
|
||||||
constexpr u8 LEFT_CONTROL = 0x1D;
|
constexpr u8 LEFT_CONTROL = 0x1D;
|
||||||
constexpr u8 TAB = 0x0F;
|
|
||||||
constexpr u8 LEFT_ALT = 0x38;
|
constexpr u8 LEFT_ALT = 0x38;
|
||||||
constexpr u8 F11 = 0x57;
|
constexpr u8 F11 = 0x57;
|
||||||
constexpr u8 F12 = 0x58;
|
constexpr u8 F12 = 0x58;
|
||||||
|
|
||||||
static bool should_ignore_key(u8 scancode)
|
static bool should_ignore_key(u8 scancode)
|
||||||
{
|
{
|
||||||
return (scancode > 0x3A && scancode < 0x47) || scancode == TAB || scancode == F11 || scancode == F12;
|
return (scancode > 0x3A && scancode < 0x47) || scancode == F11 || scancode == F12;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr char key_table[] = {
|
constexpr char key_table[] = {
|
||||||
'\0',
|
'\0',
|
||||||
'\1', // escape
|
'\1', // escape
|
||||||
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '\b',
|
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '\b',
|
||||||
'\0', // tab
|
'\t', // tab
|
||||||
'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n',
|
'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n',
|
||||||
'\0', // left ctrl
|
'\0', // left ctrl
|
||||||
'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`',
|
'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`',
|
||||||
@ -75,7 +74,7 @@ constexpr char shifted_key_table[] = {
|
|||||||
'\0',
|
'\0',
|
||||||
'\1', // escape
|
'\1', // escape
|
||||||
'!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '\b',
|
'!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '\b',
|
||||||
'\0', // tab
|
'\t', // tab
|
||||||
'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n',
|
'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n',
|
||||||
'\0', // left ctrl
|
'\0', // left ctrl
|
||||||
'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', '~',
|
'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', '~',
|
||||||
|
@ -106,6 +106,7 @@ void ConsoleDevice::process_key_event(u8 scancode)
|
|||||||
{
|
{
|
||||||
TextConsole::putwchar(L'\b');
|
TextConsole::putwchar(L'\b');
|
||||||
if (_iscntrl(maybe_char.value())) TextConsole::putwchar(L'\b');
|
if (_iscntrl(maybe_char.value())) TextConsole::putwchar(L'\b');
|
||||||
|
if (maybe_char.value() == '\t') TextConsole::wprint(L"\b\b");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -179,7 +180,7 @@ void ConsoleDevice::process_key_event(u8 scancode)
|
|||||||
if (m_settings.c_lflag & ECHOCTL)
|
if (m_settings.c_lflag & ECHOCTL)
|
||||||
{
|
{
|
||||||
bool should_echo = true;
|
bool should_echo = true;
|
||||||
if (key == '\n' || key == '\0' || key == m_settings.c_cc[VEOF]) should_echo = false;
|
if (key == '\n' || key == '\t' || key == '\0' || key == m_settings.c_cc[VEOF]) should_echo = false;
|
||||||
|
|
||||||
if (should_echo)
|
if (should_echo)
|
||||||
{
|
{
|
||||||
|
@ -346,7 +346,7 @@ namespace TextConsole
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case L'\t': {
|
case L'\t': {
|
||||||
wprint(L" ");
|
wprint(L" ");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case L'\r': g_x_position = 0; break;
|
case L'\r': g_x_position = 0; break;
|
||||||
|
Loading…
Reference in New Issue
Block a user