Modify shell
This commit is contained in:
parent
619b32ad49
commit
e0fb6dc926
|
@ -49,7 +49,6 @@ int main(void)
|
||||||
shell.read = userShellRead;
|
shell.read = userShellRead;
|
||||||
|
|
||||||
shellInit(&shell, shellBuffer, 512);
|
shellInit(&shell, shellBuffer, 512);
|
||||||
printf("shell init\n");
|
|
||||||
|
|
||||||
while (connect_session(&session_fs, "MemFS", 0x10000) < 0)
|
while (connect_session(&session_fs, "MemFS", 0x10000) < 0)
|
||||||
;
|
;
|
||||||
|
|
|
@ -216,12 +216,12 @@ static inline int serial_in_shift(void* addr, int shift)
|
||||||
|
|
||||||
bool init_uart_mmio()
|
bool init_uart_mmio()
|
||||||
{
|
{
|
||||||
static int mapped = 0xff;
|
static int mapped = 0;
|
||||||
if (mapped != 0) {
|
if (mapped == 0) {
|
||||||
if (-1 == mmap(UART_ADDR, UART_ADDR, 4096, true)) {
|
if (-1 == mmap(UART_ADDR, UART_ADDR, 4096, true)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
mapped = 0;
|
mapped = 1;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,7 +203,6 @@ void shellInit(Shell* shell, char* buffer, unsigned short size)
|
||||||
shellAdd(shell);
|
shellAdd(shell);
|
||||||
|
|
||||||
shellSetUser(shell, shellSeekCommand(shell, SHELL_DEFAULT_USER, shell->commandList.base, 0));
|
shellSetUser(shell, shellSeekCommand(shell, SHELL_DEFAULT_USER, shell->commandList.base, 0));
|
||||||
|
|
||||||
shellWritePrompt(shell, 1);
|
shellWritePrompt(shell, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,11 +322,9 @@ static void shellWritePrompt(Shell* shell, unsigned char newline)
|
||||||
if (newline) {
|
if (newline) {
|
||||||
shellWriteString(shell, "\r\n");
|
shellWriteString(shell, "\r\n");
|
||||||
}
|
}
|
||||||
#ifndef __riscv
|
|
||||||
shellWriteString(shell, shell->info.user->data.user.name);
|
shellWriteString(shell, shell->info.user->data.user.name);
|
||||||
shellWriteString(shell, ":");
|
shellWriteString(shell, ":");
|
||||||
shellWriteString(shell, shell->info.path ? shell->info.path : "/");
|
shellWriteString(shell, shell->info.path ? shell->info.path : "/");
|
||||||
#endif
|
|
||||||
shellWriteString(shell, "$ ");
|
shellWriteString(shell, "$ ");
|
||||||
} else {
|
} else {
|
||||||
shellWriteString(shell, shellText[SHELL_TEXT_PASSWORD_HINT]);
|
shellWriteString(shell, shellText[SHELL_TEXT_PASSWORD_HINT]);
|
||||||
|
|
Loading…
Reference in New Issue