- Move the FASM manual out of DOCPACK to `/kolibrios/develop/fasm/fasm.txt` on ISO, next to the Oberon-07 and TCC docs
- Update the document letters in the Russian `guide.htm`, they were one letter off before
- Default document for an unknown parameter stays KFar keys
| DOCPACK, kpacked, sectors | en_US | ru_RU | es_ES |
|---|---|---|---|
| before | 218 + 150 | 232 + 62 | 218 + 199 |
| after | 95 + 468 | 105 + 466 | 95 + 493 |
Reviewed-on: KolibriOS/kolibrios#739
Reviewed-by: Kiril Lipatov <lipatov.kiril@gmail.com>
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
open_connection in http.obj left the socket open whenever connect()
failed. The kernel never reclaims sockets of a finished process
(socket_process_end is a stub), so every failed connect leaked a socket
with its two SOCKET_BUFFER_SIZE rings for good, and a late SYN+ACK could
still connect the orphan. WebView with a few dead image hosts ran the
kernel heap dry ("SOCKET_ring_create: Out of memory!"), after which every
application lost the network. Close the socket on the way out.
The socket() error check compared against 0, but the syscall returns -1
on failure; compare with -1.
The close() above exposed a second bug: tcp_connect took SOCKET.mutex
before creating the rings and returned from .nomem and .enoroute without
releasing it. Any later socket_free on that socket - close() from the
application, once http.obj does it - then waited for the mutex forever
and the thread became unkillable. Unlock on both error exits.
Assisted-by: Claude Fable 5.1 <noreply@anthropic.com>
A grayscale JPEG is decoded as Image.bpp8i with a 256-level gray
palette built from xor eax, eax, so every entry had alpha 0. After
img.convert to Image.bpp32 the picture was fully transparent: programs
that blend by alpha (WebView) reserved its room and drew nothing.
The palette now starts at 0xFF000000, as the PNG decoder fills its own.
Assisted-by: Claude Opus 5 <noreply@anthropic.com>
- Move ImgF to ISO (closed source)
- Move Examples to ISO (any normal app is a better example... and also there is already /sys/example.asm)
- Remove /sys/settings/kolibri.lbl as unnecessary
- Kpack /sys/settings/keymap.key (this is a binnary file so no matter, -2.5KB) and load it by 68.27
Reviewed-on: KolibriOS/kolibrios#721
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: leency <lipatov.kiril@gmail.com>
On a failed bind cmdPASV jumped straight back to .next_port, and
nextpasvport wraps within [start, end], so a range with no usable port
spun forever without reading the control connection again: the client
hangs.
Count the ports in the range (end - start + 1), decrement after a
failed bind and give up at zero, then close the listener, reset the
state and answer 425 Can't open data connection. The counter lives in a
new thread_data field rather than a register, because mcall bind
clobbers eax/ebx/ecx/edx/esi/edi and esi already carries the sockaddr
length for bind. Decrementing after the failed bind and not before the
next attempt is what keeps a single-port range (start = end) working:
it still gets its one attempt.
Also validate the pair read from the ini. With start > end the range
degenerates and no port is bindable, so fall back to 2000/5000.
---------
Co-authored-by: Igor Shutrov <kolibridev@inbox.ru>
Reviewed-on: KolibriOS/kolibrios#710
Reviewed-by: Kiril Lipatov <lipatov.kiril@gmail.com>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: Igor shutrov <kolibridev@mail.ru>
- replace the hand drawn scrollbars with the box_lib widget
- separate start and minimal window size, enforce minimal on resize
- use the libimg and box_lib import lists instead of hand written ones
- use the process_information struct for procinfo
- drop the dead sound handler and the unused palette offset
- bump version to 1.53
---------
Co-authored-by: Burer <burer@kolibrios.org>
Reviewed-on: KolibriOS/kolibrios#715
Reviewed-by: Kiril Lipatov <lipatov.kiril@gmail.com>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: IgorA <aie85playm@gmail.com>
mcall close takes the socket number in ecx, but the operand was
commented out in the two places that close the PASV listener, so close
ran with whatever ecx happened to hold. Both call sites had just put the
listener in ecx, so the socket was closed by accident: the code worked
only as long as that accident held. The cmdPASV cleanup was commented
out completely, so a second PASV before the client connected left the
previous listener open.
Restore the operand in threadloop (ftpd.asm) and in open_datasock, and
re-enable the cmdPASV prologue, which also resets passivesocknum to -1.
Closing the data socket needed the same care: datasocketnum only holds
a live socket in MODE_PASSIVE_OK and MODE_ACTIVE, so the new
close_data_sock helper closes it in those two states only. The
.cannot_open label is also reachable before open_datasock runs (the
length checks at the top of cmdSTOR), where datasocketnum is either
stale or never initialised, and closing it unconditionally there could
have closed an unrelated socket that had reused the number. The field
is now initialised to -1 at thread start and reset to -1 after every
close.
---------
Co-authored-by: leency <lipatov.kiril@gmail.com>
Co-authored-by: Igor Shutrov <kolibridev@inbox.ru>
Reviewed-on: KolibriOS/kolibrios#707
Reviewed-by: Kiril Lipatov <lipatov.kiril@gmail.com>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: igorsh <kolibridev@mail.ru>
cmdSTOR opens the destination with O_CREATE + O_WRITE, and libio only
truncates on write when the position is already at EOF (libio.asm:314),
which never happens here. Replacing a longer file with a shorter one
therefore kept the old tail: 4096-byte A overwritten by 1024-byte B
produced a 4096-byte file holding B followed by A[1024:4096], and
overwriting with zero bytes left the file completely untouched.
Call file.truncate (SF 70.4, size = Position = 0) right after a
successful open so that STOR replaces the file, as RFC 959 requires.
The descriptor survives the call in ebx because sendFTP clobbers the
registers. A failed truncate closes the descriptor and answers 550
through a new .truncate_error path.
The libio import list gains file_truncate, exported since 2009.
-------------------------
STOR: усекать файл при перезаписи, чтобы не оставался старый хвост
Проблема
cmdSTOR открывает целевой файл с O_CREATE + O_WRITE, а libio усекает файл при записи только если позиция уже находится в EOF (libio.asm:314). В этом сценарии условие никогда не выполняется. Поэтому при замене длинного файла коротким сохранялся старый хвост: 4096-байтный A, перезаписанный 1024-байтным B, давал 4096-байтный файл, содержащий B, а затем A[1024:4096]. Перезапись нулевым количеством байт вообще не изменяла файл.
Решение
Сразу после успешного открытия вызывается file.truncate (SF 70.4, size = Position = 0), чтобы STOR заменял файл, как требует RFC 959. Дескриптор сохраняется в ebx после вызова, так как sendFTP затирает регистры. Если truncate завершается ошибкой, дескриптор закрывается, а ответ 550 отправляется через новый обработчик .truncate_error.
Дополнительно
В список импортов libio добавлен file_truncate (экспортируется с 2009 года).
Co-authored-by: leency <lipatov.kiril@gmail.com>
Co-authored-by: Igor Shutrov <kolibridev@inbox.ru>
Reviewed-on: KolibriOS/kolibrios#706
Reviewed-by: Kiril Lipatov <lipatov.kiril@gmail.com>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: igorsh <kolibridev@mail.ru>
Fixes KolibriOS/kolibrios#636
**Причина.** Каждое меню работает в своём потоке и рисует себя из холста `m.canvas`. Этот холст освобождал (`G.destroy`) не только сам поток меню, но и другие потоки:
- `Menu.close()` вызывается из главного потока и при переключении подменю. Он освобождал холст до `K.ExitID()`.
- При срабатывании шортката из подменю холст родительского меню освобождал поток-потомок.
При быстрых кликах поток меню в этот момент как раз внутри `DrawCanvas` (sysfn 65). Ядро читает из уже освобождённого буфера и получает page fault в режиме ядра, поэтому в логе CS=8. Кроме того, если поток сам выходил через `exit`/`escape` одновременно с чужим `close()`, получался двойной free.
**Исправление.** В [Menu.ob07](develop/cedit/SRC/Menu.ob07) убрал все четыре `G.destroy` для холста меню: в `exit`, `escape`, `close` и в ветке шорткатов. Холст и так создаётся лениво в `open()` при `m.canvas = NIL`. Меню создаются один раз при старте, и размер у них не меняется, так что холст теперь живёт всё время работы программы. Утечки нет, и кроме того больше нет выделения и освобождения памяти при каждом открытии меню.
Reviewed-on: KolibriOS/kolibrios#702
Reviewed-by: Burer <burer@kolibrios.org>
Reviewed-by: Alexey Ryabov <alex@b00bl1k.ru>
Co-authored-by: leency <lipatov.kiril@gmail.com>
Reworks Terminal to use the drivers/serial API instead of using UART registers directly, enabling virtual COM port (VCP) support in addition to physical ports.
- port field now accepts a numeric port id instead of a COMx name
- syscalls use `SF_*`/`SSF_*` named constants
Closes#604
Reviewed-on: KolibriOS/kolibrios#638
Reviewed-by: Burer <burer@kolibrios.org>
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Co-authored-by: Alexey Ryabov <alex@b00bl1k.ru>
Sysfn 76 returns -1 for a missing device. The ARP conflict counter
check in .maintain_link treats any change of the value as a new
conflict, so when a device disappeared the counter jumped 0 -> -1 -> 0
across the reconnect and a bogus "IP address conflict" notification
popped up on every replug of a USB network device.
Skip the check when the query fails.
Assisted-by: Claude Opus 5 <noreply@anthropic.com>
Reviewed-on: KolibriOS/kolibrios#677
Reviewed-by: hidnplayr <hidnplayr@gmail.com>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: leency <lipatov.kiril@gmail.com>
Sysfn 74 returns -1 for a missing device, not 0, so the device-presence
check in .maintain_link never took the .link_down path and the interface
stayed in connected state forever. As a result DHCP was never restarted
when a device reappeared on the same slot (e.g. an Android phone
re-enumerating in RNDIS tethering mode with a new random MAC), leaving
the interface with a stale IP and a dead gateway.
Compare against 1 (Ethernet), the same way the .link_up? path already
does, so a vanished device properly resets the interface state and DHCP
runs again on reconnect.
Assisted-by: Claude Opus 5 <noreply@anthropic.com>
Reviewed-on: KolibriOS/kolibrios#676
Reviewed-by: hidnplayr <hidnplayr@gmail.com>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: leency <lipatov.kiril@gmail.com>
Rewrite of the editbox widget. Binary layout and public API unchanged.
- much more readable code
- scroll step = actual chars that fit in the field (`visibleCount`, ex-`shift_old`), not hardcoded 8 (fixes#652)
- `edit_box` formalized as a fasm `struct` with named fields; unions add readable aliases (`caretPos`, `textLen`, `selectColor`, ...) to the old names
- `txCol` -> `txColor` (`BColor` union with per-channel access)
- clipboard: payload described by `BClipBuf` struct, content validated before paste, fixed paste arithmetic and a memory leak on read
- restored Ctrl+C
- fixed `not cx` truncation (buffer overflow), stale redraw in insert mode, division with uninitialized edx
- control flow untangled into procedures, net -94 lines
---------
Co-authored-by: Burer <burer@kolibrios.org>
Co-authored-by: ZReticules <my_mailbox_228@mail.ru>
Reviewed-on: KolibriOS/kolibrios#662
Reviewed-by: IgorA <22+igora@noreply.localhost>
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: The Bird of Hermes <zlo.shustrik@mail.ru>
and update `libc.obj`: update `opendir` for new `_ksys_read_dir`
Thanks to @Burer for spotting this mistake.
Reviewed-on: KolibriOS/kolibrios#650
Co-authored-by: Egor00f <y.yarin@inbox.ru>
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: KolibriOS/kolibrios#645
Co-authored-by: Egor00f <y.yarin@inbox.ru>
- Size (fit into 8192 bytes or 16 IMG sectors):
- Drop `ulist` in favor of static arrays
- Dropping `malloc`/`free`/`exit`; `sprintf`, `pow`, `strlen` and 64-bit division no longer pull in libc and libtcc1
- Dead code removed
- Rendering:
- libimg dropped. `png2h.py` turns the original PNG into a palette-indexed atlas; the blit writes a 32bpp buffer, sysfn 65 puts it on screen - the same call `img_draw` made. No runtime PNG decode, output pixel-identical. The buffer ends at the ground line: 18% fewer pixels per frame
- Bugs fixed:
- Every fourth pterodactyl was invisible and unhittable: `getRandomNumber` is inclusive, so `yPosArr[3]` read the next field (999) and the bird spawned off-screen
- Releasing the jump key never shortened the first jump: gated on a flag set only after the intro; Chrome gates on the loop being scheduled
- Flap rate `1000/6` truncated to 166, `minSpeed` 8.5 to 8 - birds came earlier than in Chrome
- Hardcoded caption height clipped the window on every non-default skin
- A maximum jump left the buffer and cut off the dino's head; the playfield is centered now
- Obstacles and clouds leaked: nodes were freed, their data never
- Localization:
- Caption localized to EN/RU/ES via `CONFIG_LANG`, fits every skin in the tree
Reviewed-on: KolibriOS/kolibrios#632
Reviewed-by: Kiril Lipatov <lipatov.kiril@gmail.com>
Reviewed-by: Ivan B <1+dunkaist@noreply.localhost>
XDPascal для Колибри и Винды. С примерами.
Компиляторы убирают из бинарника недостижимые процедуры: два прохода,
на первом строится граф вызовов, на втором код мёртвых процедур не пишется.
Бинарники меньше в 1.5-5 раз. Ключ -nosmart отключает, вывод при этом
побайтово совпадает со старым компилятором.
Также снимаются кавычки с аргументов командной строки: без этого
make.bat не работал со сборкой не через Delphi.
xdpw_2020 - прежний компилятор, xdpw_2026 - новый.
Assisted-by: Claude Opus 5 <noreply@anthropic.com>
Reviewed-on: KolibriOS/kolibrios#646
Reviewed-by: Ivan B <1+dunkaist@noreply.localhost>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: leency <lipatov.kiril@gmail.com>
- all languages are configured via cedit.ini (the “edit” button in the “languages” menu)
- build/run/debug commands are also configured via cedit.ini
- new languages can be added via cedit.ini
- zator language has been added
---------
Co-authored-by: Burer <burer@kolibrios.org>
Reviewed-on: KolibriOS/kolibrios#554
Reviewed-by: Kiril Lipatov <lipatov.kiril@gmail.com>
Reviewed-by: Alexey Ryabov <alex@b00bl1k.ru>
Co-authored-by: 4ds-dev <4ds.dev@gmail.com>
Klavisha takes 11 sectors in IMG, and is included only in RU build.
I propose move it to ISO to free space on IMG and make it more consisntent.
Reviewed-on: KolibriOS/kolibrios#635
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Reviewed-by: Alexey <alex@b00bl1k.ru>
This PR adds a new enum_ports call to the serial driver's control API that lets user-mode programs list the serial ports currently registered in the system.
It also updates debug output strings, changes the USB FTDI driver's service procedure name, and removes duplicated code from the baud rate calculation.
Reviewed-on: KolibriOS/kolibrios#629
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: Alexey Ryabov <alex@b00bl1k.ru>
The `vfprintf` function is declared in the header files, but is not exported in the library.
Reviewed-on: KolibriOS/kolibrios#634
Co-authored-by: Egor00f <y.yarin@inbox.ru>
- Add `bbench` to IMG and System Panel
- Universal benchmark with 17 tests for CPU, graphics, memory and disk
- Tests can be toggled and configured
- Generates derailed reports in HTML
- Remove `MGB` and `FSPEED` from System Panel, move them from IMG to ISO
---------
Co-authored-by: Burer <burer@kolibrios.org>
Reviewed-on: KolibriOS/kolibrios#561
Reviewed-by: bad_Dr3dd0x <1702+bad_dr3dd0x@noreply.localhost>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: leency <lipatov.kiril@gmail.com>