@@ -56,19 +56,21 @@ char** get_args(char *input) {
5656void user_input (char * input ) {
5757 // Массив структур команд, состоящий из самой команды, подсказки и указателя до void-функции
5858 struct { char * text , * hint ; void (* command )(char * * ); } commands [] = {
59- // Команда Подсказка для команды Указатель до функции
60- {.text = "END" , .hint = "HALT CPU" , .command = & halt_cpu },
61- {.text = "CLEAR" , .hint = "Clear screen" , .command = & clear_screen_command },
62- {.text = "QEMUSHUTDOWN" , .hint = "Shutdown QEMU" , .command = & shutdown_qemu },
63- {.text = "INFO" , .hint = "Get info" , .command = & info_command_shell },
64- {.text = "FREEMEMADDR" , .hint = "Get free mem addr" , .command = & print_freememaddr },
65- {.text = "TESTMEM" , .hint = "Test memory" , .command = & test_mem_command },
66- {.text = "MEMDUMP" , .hint = "Dump memory" , .command = & mem_dump },
67- {.text = "MALLOC" , .hint = "Alloc memory. Usage: MALLOC <size>" , .command = & kmalloc_command },
68- {.text = "FREE" , .hint = "Free memory. Usage: FREE <address>" , .command = & free_command },
69- {.text = "ECHO" , .hint = "Echo an text" , .command = & echo_command },
70- {.text = "SLEEP" , .hint = "Wait time. Usage: SLEEP <ms>" , .command = & sleep_command },
71- {.text = "REBOOT" , .hint = "Reboot system" , .command = & reboot_command },
59+ // Команда Подсказка для команды Указатель до функции
60+ {.text = "END" , .hint = "HALT CPU" , .command = & halt_cpu },
61+ {.text = "CLEAR" , .hint = "Clear screen" , .command = & clear_screen_command },
62+ {.text = "QEMUSHUTDOWN" , .hint = "Shutdown QEMU" , .command = & shutdown_qemu },
63+ {.text = "INFO" , .hint = "Get info" , .command = & info_command_shell },
64+ {.text = "MEMDUMP" , .hint = "Dump memory" , .command = & mem_dump },
65+ {.text = "MALLOC" , .hint = "Alloc memory. Usage: MALLOC <size>" , .command = & kmalloc_command },
66+ {.text = "FREE" , .hint = "Free memory. Usage: FREE <address>" , .command = & free_command },
67+ {.text = "ECHO" , .hint = "Echo an text" , .command = & echo_command },
68+ {.text = "SLEEP" , .hint = "Wait time. Usage: SLEEP <ms>" , .command = & sleep_command },
69+ {.text = "REBOOT" , .hint = "Reboot system" , .command = & reboot_command },
70+ {.text = "RAND" , .hint = "Gen random num. Usage: RAND <seed>" , .command = & rand_comamnd },
71+ {.text = "RANDRANGE" , .hint = "Get random num from range. Usage: RANDRANGE <seed> <min> <max>" , .command = & rand_range_command },
72+ {.text = "FIB" , .hint = "Fibonacci. Usage: FIB <num>" , .command = & fibonacci_command },
73+ {.text = "BINPOW" , .hint = "Binary power. Usage: BINPOW <base> <exponent>" , .command = & binary_pow_command },
7274 };
7375
7476 int executed = 0 ;
0 commit comments