1212
1313void fibonacci_command (char * * args ) {
1414 if (!args [0 ]) {
15- kprint ("FIB usage: FIB <num>\n " );
15+ kprint ("FIB usage: FIB <num>" );
1616 return ;
1717 }
1818
1919 int num = strtoint (args [0 ]);
2020
2121 u32 fib = fibonacci (num );
2222
23- kprintf ("fib(%d) = %d\n " , num , fib );
23+ kprintf ("fib(%d) = %d" , num , fib );
2424}
2525
2626void binary_pow_command (char * * args ) {
2727 if (!args [0 ] || !args [1 ]) {
28- kprint ("BINPOW usage: BINPOW <base> <exponent>\n " );
28+ kprint ("BINPOW usage: BINPOW <base> <exponent>" );
2929 return ;
3030 }
3131
@@ -34,31 +34,31 @@ void binary_pow_command(char **args) {
3434
3535 int powered = binary_pow (b , e );
3636
37- kprintf ("%d ** %d = %d\n " , b , e , powered );
37+ kprintf ("%d ** %d = %d" , b , e , powered );
3838}
3939
4040void rand_comamnd (char * * args ) {
4141 if (!args [0 ]) {
42- kprint ("RAND usage: RAND <seed>\n " );
42+ kprint ("RAND usage: RAND <seed>" );
4343 return ;
4444 }
4545
4646 u32 seed = strtoint (args [0 ]);
4747
48- kprintf ("%d\n " , rand (& seed ));
48+ kprintf ("%d" , rand (& seed ));
4949}
5050
5151void rand_range_command (char * * args ) {
5252 if (!args [0 ] || !args [1 ] || !args [2 ]) {
53- kprint ("RANDRANGE usage: RANDRANGE <seed> <min> <max>\n " );
53+ kprint ("RANDRANGE usage: RANDRANGE <seed> <min> <max>" );
5454 return ;
5555 }
5656
5757 u32 seed = strtoint (args [0 ]);
5858 u32 min = strtoint (args [1 ]);
5959 u32 max = strtoint (args [2 ]);
6060
61- kprintf ("%d\n " , rand_range (& seed , min , max ));
61+ kprintf ("%d" , rand_range (& seed , min , max ));
6262}
6363
6464void reboot_command (char * * args ) {
@@ -67,7 +67,7 @@ void reboot_command(char** args) {
6767
6868void sleep_command (char * * args ) {
6969 if (!args [0 ]) {
70- kprint ("SLEEP usage: SLEEP <ms>\n " );
70+ kprint ("SLEEP usage: SLEEP <ms>" );
7171 return ;
7272 }
7373
@@ -108,7 +108,7 @@ void info_command_shell(char** args) {
108108 kprintf ("HEAP (%d): start at %d, minimal block size %d\n" , meminfo .heap_size , meminfo .heap_start , meminfo .block_size );
109109 kprintf ("Total used: %d\n" , meminfo .total_used );
110110 kprintf ("Total free: %d\n" , meminfo .total_free );
111- kprintf ("Block count: %d\n " , meminfo .block_count );
111+ kprintf ("Block count: %d" , meminfo .block_count );
112112}
113113
114114void mem_dump (char * * args ) {
@@ -119,12 +119,11 @@ void echo_command(char **args) {
119119 for (int i = 0 ; args [i ] != NULL ; i ++ ) {
120120 kprintf ("%s " , args [i ]);
121121 }
122- kprint ("\n" );
123122}
124123
125124void free_command (char * * args ) {
126125 if (!args [0 ]) {
127- kprint ("FREE usage: FREE <hex_address>\n " );
126+ kprint ("FREE usage: FREE <hex_address>" );
128127 return ;
129128 }
130129
@@ -135,7 +134,7 @@ void free_command(char **args) {
135134
136135 u32 addr = hex_strtoint (addr_str );
137136 kfree ((void * )addr );
138- kprintf ("Freed memory at %x\n " , addr );
137+ kprintf ("Freed memory at %x" , addr );
139138}
140139
141140void kmalloc_command (char * * args ) {
@@ -150,5 +149,5 @@ void kmalloc_command(char** args) {
150149 char buf1 [32 ] = "" ;
151150 hex_to_ascii ((int )ptr , buf1 );
152151
153- kprintf ("Allocate %d bytes.\nPointer: %s\n " , size , buf1 );
152+ kprintf ("Allocate %d bytes.\nPointer: %s" , size , buf1 );
154153}
0 commit comments