Skip to content

Commit 49f2f69

Browse files
authored
Merge pull request #161 from Bone-Project/dev3
Control + D support #159
2 parents d4232bd + 6d808e9 commit 49f2f69

File tree

4 files changed

+138
-97
lines changed

4 files changed

+138
-97
lines changed

bin/boneshell/boneshell.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
** @contributors:
2020
2121
** Amanuel Bogale <amanuel2> : start
22+
** Ashish Ahuja <Fortunate-MAN>
2223
**/
2324

2425
#include <stdio/stdio.h>
@@ -34,6 +35,7 @@
3435
#include <drv/ps2/kbd/kbd.h>
3536
#include <drv/cmos/rtc/rtc.h>
3637
#include <../platform/pc/drv/ps2/kbd/kbd.c>
38+
#include <var/cpu/cpu_info.h>
3739

3840
extern volatile bool TAB_PREVIOUS_VALUE_SET;
3941
extern volatile char* TAB_PREVIOUS_VALUE;
@@ -50,6 +52,7 @@ volatile bool exit_set__shell = false;
5052
volatile bool tab_multiple_opts = false;
5153
volatile bool tab_one_opt = false;
5254
volatile bool tab_zero_opt = false;
55+
volatile bool exit_shell = false;
5356
bool executed_internally=false;
5457

5558
void removeSpaces(char* source)
@@ -74,6 +77,7 @@ void loop_terminal()
7477
printk ("%s release %s started at ", VAR_OSNAME, VAR_RELEASE);
7578
start_time = rtc_get_time();
7679
rtc_print_struct(start_time);
80+
//__debug_print_cpu_info();
7781
while(1)
7882
{
7983
start_shell:;
@@ -116,9 +120,12 @@ void loop_terminal()
116120
scank (true, true, "%s", cmd_active.value + (strlen (cmd_active.value)));
117121
}
118122

119-
if(strcmp(cmd_active.value, "exit")==0)
123+
if(strcmp(cmd_active.value, "exit")==0 || exit_set__shell == true)
124+
//if (exit_set__shell == true)
120125
{
121126
shell_instance_cnt--;
127+
exit_set__shell = false;
128+
strcpy (cmd_active.value, " ");
122129
printk("Exited shell instance #%d\n",shell_instance_cnt+1);
123130
goto end_shell;
124131
}

include/bin/boneshell/boneshell.h

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <unistd/unistd.h>
55

66
extern struct cmd_t cmd_boneshell;
7+
extern volatile bool exit_shell;
78

89
#endif /*_BIN_BONE_SHELL_H_*/
910

0 commit comments

Comments
 (0)