mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-25 22:14:37 +00:00
kshell: Add more debug messages
This commit is contained in:
parent
b13fe4a28f
commit
d23ab8f476
@ -122,12 +122,14 @@ void KShellThread()
|
|||||||
uint32_t homeX = 0, homeY = 0;
|
uint32_t homeX = 0, homeY = 0;
|
||||||
uint32_t unseekX = 0, unseekY = 0;
|
uint32_t unseekX = 0, unseekY = 0;
|
||||||
size_t seekCount = 0;
|
size_t seekCount = 0;
|
||||||
|
debug("clearing strBuf(\"%s\")", strBuf.c_str());
|
||||||
strBuf.clear();
|
strBuf.clear();
|
||||||
|
|
||||||
FileNode *cwd = thisProcess->CWD;
|
FileNode *cwd = thisProcess->CWD;
|
||||||
if (!cwd)
|
if (!cwd)
|
||||||
cwd = fs->GetRoot(0);
|
cwd = fs->GetRoot(0);
|
||||||
std::string cwdStr = fs->GetByNode(cwd);
|
std::string cwdStr = fs->GetByNode(cwd);
|
||||||
|
debug("cwd: %*s", (int)cwdStr.size(), cwdStr.c_str());
|
||||||
|
|
||||||
printf("\x1b[1;34m%s@%s:%s$ \x1b[0m",
|
printf("\x1b[1;34m%s@%s:%s$ \x1b[0m",
|
||||||
"kernel", "fennix",
|
"kernel", "fennix",
|
||||||
@ -422,6 +424,7 @@ void KShellThread()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
char c = Driver::GetScanCode(sc, upperCase);
|
char c = Driver::GetScanCode(sc, upperCase);
|
||||||
|
debug("sc: %#lx, uc: %d -> %c", sc, upperCase, c);
|
||||||
|
|
||||||
if (ctrlDown)
|
if (ctrlDown)
|
||||||
{
|
{
|
||||||
@ -454,15 +457,19 @@ void KShellThread()
|
|||||||
if (strBuf.length() > 0)
|
if (strBuf.length() > 0)
|
||||||
{
|
{
|
||||||
std::string *hBuff = new std::string(strBuf.c_str());
|
std::string *hBuff = new std::string(strBuf.c_str());
|
||||||
|
debug("cloned strBuf(\"%s\") to hBuff(\"%s\")", strBuf.c_str(), hBuff->c_str());
|
||||||
history.push_back(hBuff);
|
history.push_back(hBuff);
|
||||||
hIdx = history.size();
|
hIdx = history.size();
|
||||||
|
debug("pushed \"%s\" to history; index: %d", hBuff->c_str(), hIdx);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (seekCount >= bsCount)
|
else if (seekCount >= bsCount)
|
||||||
{
|
{
|
||||||
putchar(c);
|
putchar(c);
|
||||||
|
debug("BEFORE strBuf(\"%s\") %ld %ld", strBuf.c_str(), strBuf.size(), strBuf.capacity());
|
||||||
strBuf += c;
|
strBuf += c;
|
||||||
|
debug("AFTER strBuf(\"%s\") %ld %ld", strBuf.c_str(), strBuf.size(), strBuf.capacity());
|
||||||
seekCount = ++bsCount;
|
seekCount = ++bsCount;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -481,6 +488,7 @@ void KShellThread()
|
|||||||
}
|
}
|
||||||
SecLoopEnd:
|
SecLoopEnd:
|
||||||
|
|
||||||
|
debug("strBuf.length(): %d", strBuf.length());
|
||||||
if (strBuf.length() == 0)
|
if (strBuf.length() == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -546,6 +554,7 @@ void KShellThread()
|
|||||||
break;
|
break;
|
||||||
cmd_only += strBuf[i];
|
cmd_only += strBuf[i];
|
||||||
}
|
}
|
||||||
|
debug("cmd_only: %s", cmd_only.c_str());
|
||||||
|
|
||||||
std::string path = "/bin/";
|
std::string path = "/bin/";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user