17 Commits
Author SHA1 Message Date
Egor00f 1df9d8496d libshell & shell: use shell_api.h (#657)
Build system / Build (es_ES) (push) Successful in 3m46s
Build system / Build (en_US) (push) Successful in 3m55s
Build system / Build (ru_RU) (push) Successful in 4m27s
Build system / Publish Images (push) Successful in 5m28s
Use `shell_api.h` and the buffer structure in `shell` and `libshell` to avoid magic numbers and sync

Reviewed-on: #657
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: Egor00f <y.yarin@inbox.ru>
2026-09-02 08:25:57 +00:00
Egor00f 570a432a84 libc.obj: fix _ksys_read_dir (#650)
Build system / Build (en_US) (push) Successful in 2m26s
Build system / Build (es_ES) (push) Successful in 2m32s
Build system / Build (ru_RU) (push) Successful in 2m35s
Build system / Publish Images (push) Successful in 2m31s
and update `libc.obj`: update `opendir` for new `_ksys_read_dir`

Thanks to @Burer for spotting this mistake.

Reviewed-on: #650
Co-authored-by: Egor00f <y.yarin@inbox.ru>
2026-08-17 17:24:24 +00:00
Egor00f e470ef5db5 libc.obj: fix opendir (#645)
Build system / Build (en_US) (push) Successful in 2m14s
Build system / Build (ru_RU) (push) Successful in 2m26s
Build system / Build (es_ES) (push) Successful in 2m30s
Build system / Publish Images (push) Successful in 2m31s
Changes:
- [x] ignore `EOF` error
- [x] fix buf size
  `520` and `264` were mixed up
- [x] Separate checks for `malloc` and `_ksys_read_dir`
- [x] fix some potential errors
- [x] update `dir_example.c`
  + it may have page fail if run it from `shell`, because it try call `con_set_flags`
  + fix `mkdir` test
  + show `opendir` error

Reviewed-on: #645
Co-authored-by: Egor00f <y.yarin@inbox.ru>
2026-08-17 15:42:54 +00:00
Egor00f da0e6f492b libc.obj: export missed vfprintf (#634)
Build system / Build (en_US) (push) Successful in 2m36s
Build system / Build (es_ES) (push) Successful in 2m38s
Build system / Build (ru_RU) (push) Successful in 2m41s
Build system / Publish Images (push) Successful in 2m9s
The `vfprintf` function is declared in the header files, but is not exported in the library.

Reviewed-on: #634
Co-authored-by: Egor00f <y.yarin@inbox.ru>
2026-08-06 13:52:14 +00:00
Egor00f 3c2bdfb418 Обновить programs/develop/ktcc/libc.obj/source/stdio/puts.c
Test PR / Build (es_ES) (pull_request) Successful in 1m50s
Test PR / Build (ru_RU) (pull_request) Successful in 1m56s
Test PR / Build (en_US) (pull_request) Successful in 1m58s
Build system / Build (en_US) (push) Successful in 2m10s
Build system / Build (es_ES) (push) Successful in 2m13s
Build system / Build (ru_RU) (push) Successful in 2m17s
Build system / Publish Images (push) Successful in 2m22s
2026-08-05 17:24:27 +00:00
Egor00f 67770ec3f4 libc.obj: implement console output via SHELL (#354)
Test PR / Build (ru_RU) (pull_request) Successful in 1m49s
Test PR / Build (en_US) (pull_request) Successful in 1m54s
Test PR / Build (es_ES) (pull_request) Successful in 1m57s
Adding console I/O via the `SHELL`.

Demonstration of [http_tcp_demo.c](https://git.kolibrios.org/KolibriOS/kolibrios/src/branch/main/programs/develop/ktcc/libc.obj/samples/http_tcp_demo.c):
<video src="attachments/847d7d19-3d67-480d-80c8-6d678af61a43" title="Запись экрана от 2026-03-07 13-55-50.mp4" controls></video>

- [x] output
- [x] multithread
  - [x] add mutex
  - [x] multithread tests

Reviewed-on: #354
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Reviewed-by: Kiril Lipatov <lipatov.kiril@gmail.com>
Co-authored-by: Egor00f <y.yarin@inbox.ru>
2026-08-04 12:49:19 +05:00
Egor00f 76294451d2 libc.obj: implement console output via SHELL (#354)
Build system / Build (en_US) (push) Successful in 3m18s
Build system / Build (es_ES) (push) Successful in 3m21s
Build system / Build (ru_RU) (push) Successful in 2m28s
Build system / Publish Images (push) Successful in 2m39s
Adding console I/O via the `SHELL`.

Demonstration of [http_tcp_demo.c](https://git.kolibrios.org/KolibriOS/kolibrios/src/branch/main/programs/develop/ktcc/libc.obj/samples/http_tcp_demo.c):
<video src="attachments/847d7d19-3d67-480d-80c8-6d678af61a43" title="Запись экрана от 2026-03-07 13-55-50.mp4" controls></video>

- [x] output
- [x] multithread
  - [x] add mutex
  - [x] multithread tests

Reviewed-on: #354
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Reviewed-by: Kiril Lipatov <lipatov.kiril@gmail.com>
Co-authored-by: Egor00f <y.yarin@inbox.ru>
2026-08-04 07:10:36 +00:00
Egor00f 54f9fa3348 libc.obj: update opendir && implement _ksys_read_dir (#514)
Build system / Build (en_US) (push) Successful in 3m33s
Build system / Build (es_ES) (push) Successful in 3m35s
Build system / Build (ru_RU) (push) Successful in 3m38s
Build system / Publish Images (push) Successful in 1m43s
fix memory leak in `opendir`.

and additionally implement `_ksys_read_dir`
and at the same time the magic numbers were removed

Reviewed-on: #514
Reviewed-by: Ivan B <1+dunkaist@noreply.localhost>
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Co-authored-by: Egor00f <y.yarin@inbox.ru>
Co-committed-by: Egor00f <y.yarin@inbox.ru>
2026-07-03 11:30:15 +00:00
Egor00fandBurer e0e0290234 libs/libc.obj: update vfprintf and vprintf (#482)
Allow for output greater than STDIO_MAX_MEM:
- automatically allocated langer buffer if vsnprintf requires it
- use vfprintf in vprintf instead of vsnprintf

---------

Co-authored-by: Burer <burer@kolibrios.org>
Reviewed-on: #482
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: Егор <y.yarin@inbox.ru>
Co-committed-by: Егор <y.yarin@inbox.ru>
2026-06-17 16:46:42 +00:00
Egor00f ceb29bbd9e apps/unimg: fix build with disabled c-- (#496)
reason: #486

`unimg` now building with c--, but it not under `if tup.getconfig('NO_CMM') ~= 'full' then`

Reviewed-on: #496
Reviewed-by: Burer <burer@kolibrios.org>
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Co-authored-by: Egor00f <y.yarin@inbox.ru>
Co-committed-by: Egor00f <y.yarin@inbox.ru>
2026-06-15 14:09:42 +00:00
Egor00fandBurer d08e94331a libs/ksys.h: add wrappers for more system functions (#355)
- add system functions:
  - 18.10
  - 18.13
  - 18.15
  - 18.20
  - 18.22
  - 18.23
  - 18.24
  - 18.25
  - 21.2
  - 21.5
  - 21.11
  - 21.12
  - 22
  - 26.2
  - 26.5
  - 26.11
  - 26.12
- add return value for _ksys_kill_by_pid and _ksys_keyboard_layout
- some small fixes (grammar, extra comma in asm fragment)

---------

Co-authored-by: Burer <burer@kolibrios.org>
Reviewed-on: #355
Reviewed-by: Ivan B <1+dunkaist@noreply.localhost>
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: Egor00f <y.yarin@inbox.ru>
Co-committed-by: Egor00f <y.yarin@inbox.ru>
2026-06-08 16:10:35 +00:00
Egor00fandBurer e8d095ed88 implement strftime (#447)
Taken from https://github.com/arnoldrobbins/strftime/blob/master/strftime.c

Time zones support is disabled (`z` and `Z` don't work)

The test runs and displays correctly.
`tm_yday` and `tm_wday` in test set manually, because `mktime` doesn't set `tm_yday` and `tm_wday`.

---------

Co-authored-by: Burer <burer@kolibrios.org>
Reviewed-on: #447
Reviewed-by: Kiril Lipatov <lipatov.kiril@gmail.com>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: Egor00f <y.yarin@inbox.ru>
Co-committed-by: Egor00f <y.yarin@inbox.ru>
2026-06-05 12:26:51 +00:00
Egor00f 76b9c0b0d9 fix missed memccpy and memcpy (#443)
Perhaps this was forgotten. Otherwise, why would it be defined using `DLLAPI`?

These functions exist, but they're missing from `EXPORTS` and `libc.def`.

Reviewed-on: #443
Reviewed-by: Ivan B <1+dunkaist@noreply.localhost>
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Co-authored-by: Egor00f <y.yarin@inbox.ru>
Co-committed-by: Egor00f <y.yarin@inbox.ru>
2026-05-26 06:04:22 +00:00
Egor00fandBurer d486c6b33a libc.obj: update exit (#340)
## New functions:
+ implement `_exit`/`_Exit`.
+ implement `atexit`.
+ implement `abort`.
`abort` write `Aborted pid: %d` to debug board

## Changes:

### call `exit` after main.
Just calling `exit`

### `exit` write exit code
If exit code isn't 0 `exit` will write exit code to debug board.

### use `con_exit(0)`
use
```c
con_exit(0)
```
instead of
```c
con_exit(status);
```
[from console.obj readme](310999dcc4/programs/develop/libraries/console_coff/console_en.txt (L15)).
I think the console window shouldn't be so dependent on the exit code. It's must only always close or always stay on screen

### `exit` writing exit code to debug board
Since the exit code is not used anywhere right now, I think it's better to just show it on the debug board.

for auto rebuild `crt0.o` need #339

from #311

---------

Co-authored-by: Burer <burer@kolibrios.org>
Reviewed-on: #340
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: Egor00f <y.yarin@inbox.ru>
Co-committed-by: Egor00f <y.yarin@inbox.ru>
2026-05-19 10:30:46 +00:00
Egor00fandBurer 175bd31489 add autobuild of some tcc libs (#339)
Implement autobuild for(this libs in [`programs/develop/ktcc/bin/lib/`](https://git.kolibrios.org/KolibriOS/kolibrios/src/branch/main/programs/develop/ktcc/bin/lib)):
+ `crt0.o`
+ `libtcc1.a`
+ `tiny.o`
+ `libshell.a`
+ `libcryptal.a`
+ `libsound.a`

it autobuild for kolibrios image and programs build.

`link_tcc` automatically add this libs to `extra_inputs`

roots of this grow from #311

---------

Co-authored-by: Burer <burer@kolibrios.org>
Reviewed-on: #339
Reviewed-by: Burer <burer@kolibrios.org>
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Co-authored-by: Егор <y.yarin@inbox.ru>
Co-committed-by: Егор <y.yarin@inbox.ru>
2026-05-16 08:30:18 +00:00
Egor00f e94fb7d5ef move mv -f libc.a $(INSTALLDIR) to install target
Build system / Check kernel codestyle (pull_request) Successful in 49s
Build system / Build (pull_request) Successful in 10m39s
2026-04-17 17:14:26 +00:00
Egor00f 91dc4d8cad libc.obj: Added strtok_r (#341)
Reviewed-on: #341
Reviewed-by: Max Logaev <maxlogaev@proton.me>
Co-authored-by: Egor00f <y.yarin@inbox.ru>
Co-committed-by: Egor00f <y.yarin@inbox.ru>
2026-03-08 00:36:53 +03:00