system/docs: update docs and SF constants to match actual kernel #306

Merged
Burer merged 9 commits from docs-review into main 2026-02-26 17:25:20 +00:00
Owner
  • Update sysfuncs.txt and sysfuncr.txt to match actual kernel code:
    • Add missing SF's info
    • Add missing constants
    • Fix some mistakes
  • Update KOSfuncs.inc to match actual kernel code:
    • Remove obsolete constants
    • Add missing constants
    • Rename some constants to match their names in docs
- Update sysfuncs.txt and sysfuncr.txt to match actual kernel code: - Add missing SF's info - Add missing constants - Fix some mistakes - Update KOSfuncs.inc to match actual kernel code: - Remove obsolete constants - Add missing constants - Rename some constants to match their names in docs
Burer added the Category/General
Priority
High
Kind
Enhancement
Category/Kernel
labels 2026-01-01 13:58:37 +00:00
Burer self-assigned this 2026-01-01 13:58:37 +00:00
Burer added 1 commit 2026-01-01 13:58:38 +00:00
system/docs: align docs with actual kernel, add constants for SF 51
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 2m22s
Build system / Build (pull_request) Successful in 16m44s
8fb3bb76c6
Burer requested review from Doczom 2026-01-01 13:58:38 +00:00
Burer requested review from dunkaist 2026-01-01 13:58:38 +00:00
Burer requested review from mxlgv 2026-01-01 13:58:38 +00:00
Burer added 1 commit 2026-01-02 12:33:58 +00:00
system/docs: revert some old tweaks, add some new
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 2m28s
Build system / Build (pull_request) Successful in 17m26s
5ed012b0d9
Doczom approved these changes 2026-01-02 13:31:30 +00:00
Dismissed
Owner

I don't think new aliases are necessary. It just clutter the code. Except: SF_THREAD_CONTROL

I don't think new aliases are necessary. It just clutter the code. Except: `SF_THREAD_CONTROL`
mxlgv requested changes 2026-01-02 20:55:14 +00:00
Dismissed
@@ -3691,0 +3695,4 @@
* ecx = требуемый размер в байтах
Возвращаемое значение:
* eax = 0 - неудача
* eax = указатель на выделенное кольцо
Owner

"Кольцевой буфер/кольцевую память" maybe?

"Кольцевой буфер/кольцевую память" maybe?
mxlgv marked this conversation as resolved
@@ -4517,3 +4548,3 @@
eax - SF_BLITTER (73)
======================================================================
=================== Функция 74, подфункция -1 ========================
=================== Функция 74, подфункция 255 ========================
Owner

Is this really necessary?

Is this really necessary?
mxlgv marked this conversation as resolved
@@ -5095,2 +5164,3 @@
Возвращаемое значение:
* eax = 0 если успех, иначе ошибка.
* eax = 0 если успех, иначе отрицательный код ошибки:
-EFAULT, -EINVAL, -EMFILE, -ENFILE.
Owner

I'm not sure if this is specifically stated somewhere in the documentation (error codes).

I'm not sure if this is specifically stated somewhere in the documentation (error codes).
mxlgv marked this conversation as resolved
@@ -5098,3 +5168,3 @@
---------------------- Константы для регистров: ----------------------
eax - SF_FUTEX (77)
ebx - ...
ebx - 13
Owner

Why is there no constant?

Why is there no constant?
mxlgv marked this conversation as resolved
@@ -3619,3 +3681,3 @@
---------------------- Constants for registers: ----------------------
eax - SF_SYS_MISC (68)
ebx - SSF_MEM_ALLOC_RING (29)
ebx - 30
Owner

Why is there no constant?

Why is there no constant?
mxlgv marked this conversation as resolved
@@ -3834,3 +3896,3 @@
ebx - SSF_RESUME (5)
======================================================================
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
== Function 69, subfunction 6 - read from memory of debugged process. ==
Owner

Seems extra =

Seems extra =
mxlgv marked this conversation as resolved
@@ -4452,3 +4514,3 @@
---------------------- Constants for registers: ----------------------
eax - SF_NETWORK_GET (74)
eax - SF_NETWORK_GET (74) / SF_NETWORK_DEVICE (74)
Owner

I suspect this is a little-used thing, let's not make aliases and just replace it with something that is often used

I suspect this is a little-used thing, let's not make aliases and just replace it with something that is often used
mxlgv marked this conversation as resolved
@@ -5251,0 +5327,4 @@
* Subfunctions 4-7 are reserved and currently return -1.
* Subfunctions 8, 9 and 12 are not implemented and return -EBADF.
======================================================================
=========== Function 77, Subfunction 10, Read from pipe. ============
Owner

Maybe - instead of ,?

Maybe `-` instead of `,`?
mxlgv marked this conversation as resolved
@@ -5251,0 +5342,4 @@
---------------------- Constants for registers: ----------------------
eax - SF_FUTEX (77)
ebx - 10
Owner

Const?

Const?
mxlgv marked this conversation as resolved
@@ -5251,0 +5377,4 @@
---------------------- Constants for registers: ----------------------
eax - SF_FUTEX (77)
ebx - 13
Owner

Const?

Const?
mxlgv marked this conversation as resolved
Burer added 1 commit 2026-01-10 12:33:40 +00:00
More docs tweaks and SF constants added
Some checks failed
Build system / Build (pull_request) Failing after 1s
Build system / Check kernel codestyle (pull_request) Successful in 1m11s
746808c462
Burer dismissed Doczom's review 2026-01-10 12:33:40 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

Burer added 1 commit 2026-01-11 14:30:12 +00:00
Remove unused alias, clarify constants
Some checks failed
Build system / Build (pull_request) Failing after 1s
Build system / Check kernel codestyle (pull_request) Successful in 1m19s
1bd596dc01
Burer added 1 commit 2026-01-11 14:33:08 +00:00
Clarify SC structure size on docs
Some checks failed
Build system / Build (pull_request) Failing after 1s
Build system / Check kernel codestyle (pull_request) Successful in 1m4s
0152013f11
mxlgv requested changes 2026-01-24 19:55:26 +00:00
Dismissed
@@ -5074,3 +5141,4 @@
* esi = сколько байт записать
Возвращаемое значение:
* eax = количество записанных байт
-EBADF при ошибке
Owner

Are these constants documented somewhere?

Are these constants documented somewhere?
mxlgv marked this conversation as resolved
@@ -132,6 +132,11 @@ SF_STYLE_SETTINGS=48
SF_APM=49
SF_SET_WINDOW_SHAPE=50
SF_CREATE_THREAD=51
SF_THREAD_CONTROL=51
Owner

I suggest getting rid of this SF_CREATE_THREAD constant and not creating aliases.

I suggest getting rid of this `SF_CREATE_THREAD` constant and not creating aliases.
Author
Owner

SF_CREATE_THREAD is used in some programs.
It should be changed everywhere in a separate PR.
I deleted alias SF_THREAD_CONTROL for now,

`SF_CREATE_THREAD` is used in some programs. It should be changed everywhere in a separate PR. I deleted alias `SF_THREAD_CONTROL` for now,
Owner

It will be decided here: #321

It will be decided here: https://git.kolibrios.org/KolibriOS/kolibrios/issues/321
mxlgv marked this conversation as resolved
@@ -187,3 +192,1 @@
SSF_WAIT_SIGNAL=14 ; wait for signal from another program/driver
SSF_LOAD_DRIVER=16
SSF_CONTROL_DRIVER=17
SSF_WAIT_SIGNAL=14 ; GetEvent wrapper (wait for kernel event)
Owner

What is GetEvent?

What is `GetEvent`?
mxlgv marked this conversation as resolved
@@ -190,0 +192,4 @@
SSF_WAIT_SIGNAL=14 ; GetEvent wrapper (wait for kernel event)
SSF_GET_SERVICE=16
SSF_CALL_SERVICE=17
SSF_LOAD_DRIVER=16 ; alias (deprecated name)
Owner

What's the problem with old names?

What's the problem with old names?
mxlgv marked this conversation as resolved
@@ -70,11 +70,11 @@ SF_SYSTEM=18
SSF_WINDOW_BEHAVIOR=25 ; window focus relation with other windows
Owner

Let's not touch this file. Fix it as part of this task: #317

Let's not touch this file. Fix it as part of this task: https://git.kolibrios.org/KolibriOS/kolibrios/issues/317
Owner

Please roll back this file!

Please roll back this file!
mxlgv marked this conversation as resolved
mxlgv requested changes 2026-01-24 20:14:56 +00:00
Dismissed
@@ -5054,4 +5117,3 @@
Параметры:
* eax = 77 - номер функции
* ebx = 10 - номер подфункции
* ecx = дескриптор файла
Owner

There is no mistake here. Reverse this change

There is no mistake here. Reverse this change
mxlgv marked this conversation as resolved
@@ -5049,20 +5108,28 @@ Remarks:
eax - SF_FUTEX (77)
ebx - SSF_WAKE (3)
======================================================================
======= Функция 77, подфункция 10, Прочитать из файла в буфер. =======
Owner

There is no mistake here. Reverse this change.

There is no mistake here. Reverse this change.
mxlgv marked this conversation as resolved
@@ -3369,3 +3375,3 @@
* буфер, на который указывает ecx, содержит следующую информацию:
* +0: dword: идентификатор последующих данных сигнала
* +4: данные принятого сигнала (20 байт), формат которых
* +4: 5 dword: данные принятого сигнала, формат которых
Owner

In my opinion, 20 bytes is more obvious than 5 dword

In my opinion, 20 bytes is more obvious than 5 dword
Author
Owner

In all other similar places, dwords are used, not bytes.
So it is better for consistency.

In all other similar places, dwords are used, not bytes. So it is better for consistency.
mxlgv marked this conversation as resolved
@@ -3395,3 +3405,3 @@
---------------------- Константы для регистров: ----------------------
eax - SF_SYS_MISC (68)
ebx - SSF_LOAD_DRIVER (16)
ebx - SSF_LOAD_DRIVER (16) / SSF_GET_SERVICE (16)
Owner

In my opinion, services can be confused with daemons. The old name reflects the essence more.

In my opinion, services can be confused with daemons. The old name reflects the essence more.
mxlgv marked this conversation as resolved
@@ -3418,3 +3430,3 @@
---------------------- Константы для регистров: ----------------------
eax - SF_SYS_MISC (68)
ebx - SSF_CONTROL_DRIVER (17)
ebx - SSF_CONTROL_DRIVER (17) / SSF_CALL_SERVICE (17)
Owner
The same: https://git.kolibrios.org/KolibriOS/kolibrios/pulls/306/files#issuecomment-3987
mxlgv marked this conversation as resolved
@@ -4522,3 +4553,3 @@
Параметры:
* eax = 74 - номер функции
* bl = -1 - номер подфункции
* bl = -1 (или 255) - номер подфункции
Owner

This should be obvious to the developer. Why explain this?

This should be obvious to the developer. Why explain this?
mxlgv marked this conversation as resolved
@@ -4946,3 +4978,3 @@
---------------------- Константы для регистров: ----------------------
eax - SF_NETWORK_SOCKET (75)
bl - SSF_GET_PAIR (10)
bl - SSF_GET_PAIR (10) / SSF_SOCKET_PAIR (10)
Owner

If this is needed for "getting" why change it?

If this is needed for "getting" why change it?
mxlgv marked this conversation as resolved
@@ -5033,3 +5091,4 @@
-2 - контрольное значение не соответствует
---------------------- Константы для регистров: ----------------------
eax - SF_FUTEX (77)
Owner

Since in function 77 it is now better to replace not only futexes with SF_POSIX. And add prefixes for subfunctions like SF_FUTEX_CREATE, etc.

Since in function 77 it is now better to replace not only futexes with `SF_POSIX`. And add prefixes for subfunctions like `SF_FUTEX_CREATE`, etc.
Author
Owner

As these constants are used in some programs, that should be changed in a separate PR.

As these constants are used in some programs, that should be changed in a separate PR.
Owner

Will be fixed as part of this task: #321

Will be fixed as part of this task: https://git.kolibrios.org/KolibriOS/kolibrios/issues/321
mxlgv marked this conversation as resolved
@@ -5051,2 +5110,3 @@
======================================================================
======= Функция 77, подфункция 10, Прочитать из файла в буфер. =======
Замечания:
* Подфункции 4-7 зарезервированы и сейчас возвращают -1.
Owner

Add here that for now only pipe file descriptors are supported

Add here that for now only pipe file descriptors are supported
mxlgv marked this conversation as resolved
@@ -5063,3 +5129,3 @@
---------------------- Константы для регистров: ----------------------
eax - SF_FUTEX (77)
ebx - ...
ebx - SSF_PIPE_READ (10)
Owner

It is assumed that reading will be in the future on file descriptors. It is better to remove the PIPE prefix if the constant names are not taken.

It is assumed that reading will be in the future on file descriptors. It is better to remove the `PIPE` prefix if the constant names are not taken.
mxlgv marked this conversation as resolved
@@ -5078,3 +5147,3 @@
---------------------- Константы для регистров: ----------------------
eax - SF_FUTEX (77)
ebx - ...
ebx - SSF_PIPE_WRITE (11)
Owner
Same: https://git.kolibrios.org/KolibriOS/kolibrios/pulls/306/files#issuecomment-3992
mxlgv marked this conversation as resolved
Burer added 1 commit 2026-01-27 18:37:51 +00:00
More fixed to documentation and kosfuncs.inc
Some checks failed
Build system / Build (pull_request) Failing after 1s
Build system / Check kernel codestyle (pull_request) Successful in 1m13s
2f8a3c83b9
mxlgv requested changes 2026-01-27 23:14:50 +00:00
Dismissed
@@ -5025,4 +5083,2 @@
* eax = 77 - номер функции
* ebx = 2 - номер подфункции
* ecx = дескриптор фьютекса
* edx = контрольное значение
Owner

It was written correctly. It is a control value and not a pointer. Please roll back

It was written correctly. It is a control value and not a pointer. Please roll back
Owner

@Burer Control value. NOT a pointer. Please note:

lock cmpxchg [ecx], edx

@Burer Control value. NOT a pointer. Please note: https://git.kolibrios.org/KolibriOS/kolibrios/src/commit/1173ca7b2669f3ed6f37231ef7512a52029bc126/kernel/trunk/posix/futex.inc#L117
mxlgv marked this conversation as resolved
@@ -4997,3 +5055,3 @@
* eax = 77 - номер функции
* ebx = 0 - номер подфункции
* ecx = указатель на контрольное значение фьютекса (dword)
* ecx = указатель на контрольное значение фьютекса
Owner

It’s true that this is a pointer to dword. Anything larger than dword will probably be ignored.

It’s true that this is a pointer to dword. Anything larger than dword will probably be ignored.
mxlgv marked this conversation as resolved
@@ -5000,2 +5057,3 @@
* ecx = указатель на контрольное значение фьютекса
Возвращаемое значение:
* eax = дескриптор фьютекса, 0 при ошибке
* eax = указатель на дескриптор фьютекса, 0 при ошибке
Owner

I apologize, it seems I expressed myself incorrectly. Everything here is correct; it is a descriptor and not a pointer (it doesn’t matter to us how this is implemented in the kernel); even just a pointer can be considered a “descriptor”. Please roll back

I apologize, it seems I expressed myself incorrectly. Everything here is correct; it is a descriptor and not a pointer (it doesn’t matter to us how this is implemented in the kernel); even just a pointer can be considered a “descriptor”. Please roll back
mxlgv marked this conversation as resolved
@@ -5010,3 +5068,3 @@
* eax = 77 - номер функции
* ebx = 1 - номер подфункции
* ecx = дескриптор фьютекса
* ecx = указатель на дескриптор фьютекса
Owner

Please roll back. See message above

Please roll back. See message above
mxlgv marked this conversation as resolved
@@ -5026,3 +5084,2 @@
* ebx = 2 - номер подфункции
* ecx = дескриптор фьютекса
* edx = контрольное значение
* ecx = указатель на дескриптор фьютекса
Owner

Please roll back. See message above

Please roll back. See message above
mxlgv marked this conversation as resolved
@@ -5041,3 +5100,3 @@
* eax = 77 - номер функции
* ebx = 3 - номер подфункции
* ecx = дескриптор фьютекса
* ecx = указатель на дескриптор фьютекса
Owner

Please roll back. See message above

Please roll back. See message above
mxlgv marked this conversation as resolved
@@ -5053,0 +5112,4 @@
* Подфункции 4-7 зарезервированы и сейчас возвращают -1.
* Подфункции 8, 9 и 12 не реализованы и возвращают -EBADF (-9).
======================================================================
======= Функция 77, подфункция 10, Прочитать из файла. =======
Owner

Seems missing ====

Seems missing `====`
mxlgv marked this conversation as resolved
@@ -5071,3 +5139,2 @@
* ebx = 11 - номер подфункции
* ecx = дескриптор файла
* edx = указатель на буфер, откуда брать данные для записи
* ecx = указатель на файловый дескриптор
Owner

There is no mistake here. Reverse this change

There is no mistake here. Reverse this change
mxlgv marked this conversation as resolved
@@ -5197,11 +5281,12 @@ Remarks:
Parameters:
* eax = 77 - function number
* ebx = 1 - subfunction number
* ecx = futex handle
Owner

There is no mistake here. Reverse this change

There is no mistake here. Reverse this change
mxlgv marked this conversation as resolved
@@ -5181,3 +5269,3 @@
* eax = 77 - function number
* ebx = 0 - subfunction number
* ecx = pointer to futex dword
* ecx = pointer to futex control value
Owner

Correct: Pointer to futex dword control value.

Correct: Pointer to futex dword control value.
mxlgv marked this conversation as resolved
@@ -5187,3 +5273,1 @@
* Use subfunction 1 to destroy the futex.
The kernel destroys the futexes automatically when the process
terminates.
* eax = pointer to futex handle, 0 on error
Owner

There is no mistake here. Reverse this change

There is no mistake here. Reverse this change
mxlgv marked this conversation as resolved
@@ -5215,3 +5300,1 @@
* ecx = futex handle
* edx = control value
* esi = timeout in system ticks or 0 for infinity
* ecx = pointer to futex handle
Owner

There is no mistake here. Reverse this change

There is no mistake here. Reverse this change
mxlgv marked this conversation as resolved
@@ -5216,2 +5300,2 @@
* edx = control value
* esi = timeout in system ticks or 0 for infinity
* ecx = pointer to futex handle
* edx = pointer to futex control value
Owner

There is no mistake here. Reverse this change

There is no mistake here. Reverse this change
Owner

Control value. NOT a pointer. Please note:

lock cmpxchg [ecx], edx

Control value. NOT a pointer. Please note: https://git.kolibrios.org/KolibriOS/kolibrios/src/commit/1173ca7b2669f3ed6f37231ef7512a52029bc126/kernel/trunk/posix/futex.inc#L117
mxlgv marked this conversation as resolved
@@ -5235,3 +5315,3 @@
* eax = 77 - function number
* ebx = 3 - subfunction number
* ecx = futex handle
* ecx = pointer to futex handle
Owner

There is no mistake here. Reverse this change

There is no mistake here. Reverse this change
mxlgv marked this conversation as resolved
Burer added 1 commit 2026-01-28 08:07:18 +00:00
More fixes to docs, revert all changes in koldbg kosfuncs.ini
Some checks failed
Build system / Build (pull_request) Failing after 2s
Build system / Check kernel codestyle (pull_request) Successful in 1m9s
5b9975e2f9
Burer added 1 commit 2026-01-28 12:55:24 +00:00
More fixes to docs, part 2
Some checks failed
Build system / Check kernel codestyle (pull_request) Successful in 1m13s
Build system / Build (pull_request) Failing after 7m45s
3b8f9b67db
mxlgv approved these changes 2026-01-28 13:09:09 +00:00
Dismissed
Burer changed title from WIP: system/docs: align docs with actual kernel, add missing SF constants to system/docs: update docs and SF constants to match actual kernel 2026-01-28 14:10:36 +00:00
Burer requested review from Doczom 2026-01-28 14:27:02 +00:00
Burer added 1 commit 2026-01-29 11:06:59 +00:00
Fix broken Unicode symbol
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 1m17s
Build system / Build (pull_request) Successful in 16m42s
4f24329f15
Burer dismissed mxlgv's review 2026-01-29 11:06:59 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

Burer requested review from mxlgv 2026-01-29 11:26:23 +00:00
Burer requested review from Sweetbread 2026-01-29 11:26:23 +00:00
mxlgv approved these changes 2026-01-30 01:40:42 +00:00
Owner

@dunkaist @Doczom @Sweetbread Please review this again if possible...

@dunkaist @Doczom @Sweetbread Please review this again if possible...
Doczom approved these changes 2026-02-26 16:38:42 +00:00
Burer merged commit 06c1497624 into main 2026-02-26 17:25:20 +00:00
Burer deleted branch docs-review 2026-02-26 17:25:21 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KolibriOS/kolibrios#306