Files
kolibrios/programs/develop/ktcc/trunk/libc.obj/samples/shell_test.c
Egor00f 15f27eb1c3 libc.obj: add call exit after main && add build for ctr0.o && use return instead exit in samples
нен работает
по стандартам после `main` должно быть закрыте всего, что закрывается в `exit`
ну терпите, crt увеличиласть на несколько байт
обертка для `exit` в crt нужна т.к. `exit` импортируется.

зачем вообще было держать бинарь `libc.obj/lib/crt0.o`, если абсолютно такой же лежит в `bin/lib/` всемсте `tcc`? Нет, зачем вообще тащить бинари в репку?
2026-01-15 21:19:10 +05:00

22 lines
494 B
C

#include "../include/shell_api.h"
char string[256];
int main()
{
shell_cls();
shell_printf("SHELL PID=%d\n\r", shell_get_pid());
shell_puts("This is a test console application for Shell\n\r");
shell_puts("Type a string (255 symbols max): ");
shell_gets(string, 255);
shell_printf("You typed: %s\n\r", string);
shell_puts("Press any key: ");
string[0] = shell_getc();
shell_printf("\n\rYou pressed: %c", string[0]);
shell_exit();
return 0;
}