/kernel/branches/Kolibri-acpi/data32.inc |
---|
359,6 → 359,7 |
mem_block_mask rd 2 |
next_memblock rd 1 |
mst MEM_STATE |
pte_valid_mask rd 1 |
374,7 → 375,6 |
align 16 |
_display display_t |
bios_fb FRB |
LFBAddress dd ? |
/kernel/branches/Kolibri-acpi/kernel.asm |
---|
1,6 → 1,6 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; |
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. |
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. |
;; PROGRAMMING: |
;; Ivan Poddubny |
;; Marat Zakiyanov (Mario79) |
440,13 → 440,45 |
; ----------------------------------------- |
mov al, [BOOT_VARS+BOOT_DMA] ; DMA access |
mov [allow_dma_access], al |
movzx eax, byte [BOOT_VARS+BOOT_BPP] ; bpp |
mov [_display.bits_per_pixel], eax |
mov [_display.vrefresh], 60 |
mov al, [BOOT_VARS+BOOT_DEBUG_PRINT] ; If nonzero, duplicates debug output to the screen |
mov [debug_direct_print], al |
mov al, [BOOT_VARS+BOOT_LAUNCHER_START] ; Start the first app (LAUNCHER) after kernel is loaded? |
mov [launcher_start], al |
movzx eax, word [BOOT_VARS+BOOT_X_RES]; X max |
mov [_display.width], eax |
mov [display_width_standard], eax |
dec eax |
mov [screen_workarea.right], eax |
movzx eax, word [BOOT_VARS+BOOT_Y_RES]; Y max |
mov [_display.height], eax |
mov [display_height_standard], eax |
dec eax |
mov [screen_workarea.bottom], eax |
movzx eax, word [BOOT_VARS+BOOT_VESA_MODE] ; screen mode |
mov dword [SCR_MODE], eax |
; mov eax, [BOOT_VAR+0x9014] ; Vesa 1.2 bnk sw add |
; mov [BANK_SWITCH], eax |
mov eax, 640 *4 ; Bytes PerScanLine |
cmp [SCR_MODE], word 0x13 ; 320x200 |
je @f |
cmp [SCR_MODE], word 0x12 ; VGA 640x480 |
je @f |
movzx eax, word[BOOT_VARS+BOOT_PITCH] ; for other modes |
@@: |
mov [_display.lfb_pitch], eax |
mov eax, [_display.width] |
mul [_display.height] |
mov [_display.win_map_size], eax |
call calculate_fast_getting_offset_for_WinMapAddress |
; for Qemu or non standart video cards |
; Unfortunately [BytesPerScanLine] does not always |
; equal to [_display.width] * [ScreenBPP] / 8 |
call calculate_fast_getting_offset_for_LFB |
mov esi, BOOT_VARS+0x9080 |
movzx ecx, byte [esi-1] |
mov [NumBiosDisks], ecx |
453,6 → 485,59 |
mov edi, BiosDisksData |
rep movsd |
setvideomode: |
mov eax, [BOOT_VARS+BOOT_LFB] |
mov [LFBAddress], eax |
cmp word [SCR_MODE], 0x0012 ; VGA (640x480 16 colors) |
je .vga |
cmp word [SCR_MODE], 0x0013 ; MCGA (320*200 256 colors) |
je .32bpp |
cmp byte [_display.bits_per_pixel], 32 |
je .32bpp |
cmp byte [_display.bits_per_pixel], 24 |
je .24bpp |
cmp byte [_display.bits_per_pixel], 16 |
je .16bpp |
; cmp byte [_display.bits_per_pixel], 15 |
; je .15bpp |
.vga: |
mov [PUTPIXEL], VGA_putpixel |
mov [GETPIXEL], Vesa20_getpixel32 ; Conversion buffer is 32 bpp |
mov [_display.bytes_per_pixel], 4 ; Conversion buffer is 32 bpp |
jmp .finish |
; .15bpp: |
; mov [PUTPIXEL], Vesa20_putpixel15 |
; mov [GETPIXEL], Vesa20_getpixel15 |
; mov [_display.bytes_per_pixel], 2 |
; jmp .finish |
.16bpp: |
mov [PUTPIXEL], Vesa20_putpixel16 |
mov [GETPIXEL], Vesa20_getpixel16 |
mov [_display.bytes_per_pixel], 2 |
jmp .finish |
.24bpp: |
mov [PUTPIXEL], Vesa20_putpixel24 |
mov [GETPIXEL], Vesa20_getpixel24 |
mov [_display.bytes_per_pixel], 3 |
jmp .finish |
.32bpp: |
mov [PUTPIXEL], Vesa20_putpixel32 |
mov [GETPIXEL], Vesa20_getpixel32 |
mov [_display.bytes_per_pixel], 4 |
; jmp .finish |
.finish: |
mov [MOUSE_PICTURE], mousepointer |
mov [_display.check_mouse], check_mouse_area_for_putpixel |
mov [_display.check_m_pixel], check_mouse_area_for_getpixel |
; -------- Fast System Call init ---------- |
; Intel SYSENTER/SYSEXIT (AMD CPU support it too) |
bt [cpu_caps], CAPS_SEP |
534,11 → 619,8 |
mov ax, tss0 |
ltr ax |
call init_video |
call init_mtrr |
mov [LFBAddress], LFB_BASE |
mov ecx, bios_fb |
call set_framebuffer |
mov [LFBSize], 0xC00000 |
call init_LFB |
call init_fpu |
call init_malloc |
/kernel/branches/Kolibri-acpi/kernel32.inc |
---|
64,10 → 64,9 |
;include "video/vesa12.inc" ; Vesa 1.2 functions |
include "video/vesa20.inc" ; Vesa 2.0 functions |
include "video/blitter.inc" |
include "video/blitter.inc" ; |
include "video/vga.inc" ; VGA 16 color functions |
include "video/cursors.inc" ; cursors functions |
include "video/framebuffer.inc" ; framebuffer functions |
; Network Interface & TCPIP Stack |
/kernel/branches/Kolibri-acpi/docs/sysfuncr.txt |
---|
1048,7 → 1048,7 |
* ebx = 19 - номер подфункции |
* ecx = 0 - номер подподфункции |
Возвращаемое значение: |
* eax = текущий делитель скорости |
* eax = текущая скорость мыши |
------------ Подподфункция 1 - установить скорость мыши. ------------- |
Параметры: |
1055,31 → 1055,29 |
* eax = 18 - номер функции |
* ebx = 19 - номер подфункции |
* ecx = 1 - номер подподфункции |
* edx = новое значение делителя скорости |
* edx = новое значение скорости |
Возвращаемое значение: |
* функция не возвращает значения |
Замечание: рекомендуемый делитель скорости = 4 |
Замечание: рекомендуемая скорость = 1, 0 = заблокировать курсор. |
---------- Подподфункция 2 - получить чувствительность мыши ---------- |
------------- Подподфункция 2 - получить ускорение мыши. ------------- |
Параметры: |
* eax = 18 - номер функции |
* ebx = 19 - номер подфункции |
* ecx = 2 - номер подподфункции |
Возвращаемое значение: |
* eax = текущий коэффициент чувствительности |
* eax = 0 - выключить, 1 - слабое, 2 - среднее, 3 - сильное |
--------- Подподфункция 3 - установить чувствительность мыши --------- |
------------ Подподфункция 3 - установить ускорение мыши. ------------ |
Параметры: |
* eax = 18 - номер функции |
* ebx = 19 - номер подфункции |
* ecx = 3 - номер подподфункции |
* edx = новое значение коэффициента чувствительности |
* edx = 0 - выключить, 1 - слабое, 2 - среднее, 3 - сильное |
Возвращаемое значение: |
* функция не возвращает значения |
Замечание: рекомендуемый коэффициент чувствительности = 3 |
-------- Подподфункция 4 - установить положение курсора мыши. -------- |
Параметры: |
* eax = 18 - номер функции |
4539,7 → 4537,7 |
eax - SF_NETWORK_GET (74) |
bl - SSF_LINK_STATUS (10) |
====================================================================== |
============== Функция 75, подфункция 0, Открыть сокет. ============== |
======= Функция 75, подфункция 0, Open socket (Открыть сокет). ======= |
====================================================================== |
Параметры: |
* eax = 75 - номер функции |
4555,7 → 4553,7 |
eax - SF_NETWORK_SOCKET (75) |
bl - SSF_OPEN (0) |
====================================================================== |
============== Функция 75, подфункция 1, Закрыть сокет. ============== |
======= Функция 75, подфункция 1, Close socket (Закрыть сокет). ====== |
====================================================================== |
Параметры: |
* eax = 75 - номер функции |
4666,7 → 4664,7 |
eax - SF_NETWORK_SOCKET (75) |
bl - SSF_RECEIVE (7) |
====================================================================== |
=========== Функция 75, подфункция 8, Задать опции сокета. =========== |
= Функция 75, подфункция 8, Set socket options (Задать опции сокета) = |
====================================================================== |
Параметры: |
* eax = 75 - номер функции |
4687,7 → 4685,7 |
eax - SF_NETWORK_SOCKET (75) |
bl - SSF_SET_OPTIONS (8) |
====================================================================== |
========== Функция 75, подфункция 9, Получить опции сокета. ========== |
= Функция 75, подфункция 9, Get socket options(Получить опции сокета) |
====================================================================== |
Параметры: |
* eax = 75 - номер функции |
4708,14 → 4706,14 |
eax - SF_NETWORK_SOCKET (75) |
bl - SSF_GET_OPTIONS (9) |
====================================================================== |
========== Функция 75, подфункция 10, Получить парный сокет ========== |
= Функция 75, подфункция 10, Get socketpair (Получить парный сокет). = |
====================================================================== |
Параметры: |
* eax = 75 - номер функции |
* bl = 10 - номер подфункции |
Возвращаемое значение: |
* eax = номер первого сокета / -1 для ошибки |
* ebx = номер второго сокета / код ошибки |
* eax = socketnum1, -1 для ошибки |
* ebx = socketnum2, код ошибки в случае ошибки |
---------------------- Константы для регистров: ---------------------- |
eax - SF_NETWORK_SOCKET (75) |
4729,16 → 4727,12 |
* bh = номер устройства |
* bl = номер подфункции |
Протоколы и подфункции: |
0 - Ethernet: |
Ethernet (0) |
0 - Read MAC |
общие подфункции: |
0 - пакетов послано |
1 - пакетов принято |
1 - IPv4: |
IPv4 (1) |
0 - Read # IP packets sent |
1 - Read # IP packets received |
2 - Read IP |
3 - Write IP |
4 - Read DNS |
4748,13 → 4742,22 |
8 - Read gateway |
9 - Write gateway |
2 - ICMP: |
ICMP (2) |
0 - Read # ICMP packets sent |
1 - Read # ICMP packets received |
3 - enable/disable ICMP echo reply |
3 - UDP |
4 - TCP |
UDP (3) |
0 - Read # UDP packets sent |
1 - Read # UDP packets received |
5 - ARP: |
TCP (4) |
0 - Read # TCP packets sent |
1 - Read # TCP packets received |
ARP (5) |
0 - Read # ARP packets sent |
1 - Read # ARP packets received |
2 - Read # ARP entry's |
3 - Read ARP entry |
4 - Add static ARP entry |
4765,64 → 4768,6 |
---------------------- Константы для регистров: ---------------------- |
eax - SF_NETWORK_PROTOCOL (76) |
====================================================================== |
============= Функция 77, подфункция 0, Создать фьютекс. ============= |
====================================================================== |
Параметры: |
* eax = 77 - номер функции |
* ebx = 0 - номер подфункции |
* ecx = указатель на контрольное значение фьютекса (dword) |
Возвращаемое значение: |
* eax = дескриптор фьютекса, 0 при ошибке |
---------------------- Константы для регистров: ---------------------- |
eax - SF_FUTEX (77) |
ebx - SSF_CREATE (0) |
====================================================================== |
============= Функция 77, подфункция 1, Удалить фьютекс. ============= |
====================================================================== |
Параметры: |
* eax = 77 - номер функции |
* ebx = 1 - номер подфункции |
* ecx = дескриптор фьютекса |
Возвращаемое значение: |
* eax = 0 - успешно, -1 при ошибке |
Замечания: |
* Ядро автоматически удаляет фьютексы при завершении процесса. |
---------------------- Константы для регистров: ---------------------- |
eax - SF_FUTEX (77) |
ebx - SSF_DESTROY (1) |
====================================================================== |
================= Функция 77, подфункция 2, Ожидать. ================= |
====================================================================== |
Параметры: |
* eax = 77 - номер функции |
* ebx = 2 - номер подфункции |
* ecx = дескриптор фьютекса |
* edx = контрольное значение |
* esi = таймаут в сотых секунды, 0 - ждать бесконечно |
Возвращаемое значение: |
* eax = 0 - успешно, -1 - таймаут, |
-2 - контрольное значение не соответствует |
---------------------- Константы для регистров: ---------------------- |
eax - SF_FUTEX (77) |
ebx - SSF_WAIT (2) |
====================================================================== |
================ Функция 77, подфункция 3, Разбудить. ================ |
====================================================================== |
Параметры: |
* eax = 77 - номер функции |
* ebx = 3 - номер подфункции |
* ecx = дескриптор фьютекса |
* edx = сколько ожидающих будить (максимум) |
Возвращаемое значение: |
* eax = количество разбуженых |
---------------------- Константы для регистров: ---------------------- |
eax - SF_FUTEX (77) |
ebx - SSF_WAKE (3) |
====================================================================== |
========== Функция -1 - завершить выполнение потока/процесса ========= |
====================================================================== |
Параметры: |
4876,17 → 4821,18 |
==================== Коды ошибок файловой системы ==================== |
====================================================================== |
* 0 = успешно |
* 1 = не определена база и/или раздел жёсткого диска (подфункциями |
7, 8 функции 21) |
* 2 = функция не поддерживается для данной файловой системы |
* 3 = неизвестная файловая система |
* 4 = зарезервировано, никогда не возвращается в текущей реализации |
* 5 = файл не найден |
* 6 = файл закончился |
* 7 = указатель вне памяти приложения |
* 8 = диск заполнен |
* 9 = ошибка файловой системы |
* 9 = таблица FAT разрушена |
* 10 = доступ запрещён |
* 11 = ошибка устройства |
* 12 = файловой системе недостаточно оперативной памяти |
При запуске программы возможны также следующие коды ошибок: |
* 30 = 0x1E = недостаточно памяти |
* 31 = 0x1F = файл не является исполнимым |
/kernel/branches/Kolibri-acpi/docs/sysfuncs.txt |
---|
1041,7 → 1041,7 |
* ebx = 19 - subfunction number |
* ecx = 0 - subsubfunction number |
Returned value: |
* eax = current speed divider |
* eax = current mouse speed |
---------------- Subsubfunction 1 - set mouse speed. ----------------- |
Parameters: |
1048,31 → 1048,29 |
* eax = 18 - function number |
* ebx = 19 - subfunction number |
* ecx = 1 - subsubfunction number |
* edx = new value for speed divider |
* edx = new value for speed |
Returned value: |
* function does not return value |
Remark: recommended speed divider = 4 |
Remark: recommended speed = 1, 0 = lock the cursor. |
-------------- Subsubfunction 2 - get mouse sensitivity -------------- |
------------- Subsubfunction 2 - get mouse acceleration. ------------- |
Parameters: |
* eax = 18 - function number |
* ebx = 19 - subfunction number |
* ecx = 2 - subsubfunction number |
Returned value: |
* eax = current sensitivity |
* eax = 0 - off, 1 - slight, 2 - medium, 3 - intense |
-------------- Subsubfunction 3 - set mouse sensitivity -------------- |
------------- Subsubfunction 3 - set mouse acceleration. ------------- |
Parameters: |
* eax = 18 - function number |
* ebx = 19 - subfunction number |
* ecx = 3 - subsubfunction number |
* edx = new value for sensitivity |
* edx = 0 - off, 1 - slight, 2 - medium, 3 - intense |
Returned value: |
* function does not return value |
Remark: recommended sensitivity = 3 |
----------- Subsubfunction 4 - set mouse pointer position. ----------- |
Parameters: |
* eax = 18 - function number |
4669,7 → 4667,7 |
eax - SF_NETWORK_SOCKET (75) |
bl - SSF_GET_OPTIONS (9) |
====================================================================== |
============ Function 75, Subfunction 10, Get socketpair. ============ |
============ Function 75, Subfunction 10, Get socketpair. =========== |
====================================================================== |
Parameters: |
* eax = 75 - function number |
4690,16 → 4688,12 |
* bh = device number |
* bl = subfunction number |
Protocols and subfunctions: |
0 - Ethernet: |
Ethernet (0) |
0 - Read MAC |
common subfunctions: |
0 - Read # packets sent |
1 - Read # packets received |
1 - IPv4: |
IPv4 (1) |
0 - Read # IP packets sent |
1 - Read # IP packets received |
2 - Read IP |
3 - Write IP |
4 - Read DNS |
4709,13 → 4703,22 |
8 - Read gateway |
9 - Write gateway |
2 - ICMP: |
ICMP (2) |
0 - Read # ICMP packets sent |
1 - Read # ICMP packets received |
3 - enable/disable ICMP echo reply |
3 - UDP |
4 - TCP |
UDP (3) |
0 - Read # UDP packets sent |
1 - Read # UDP packets received |
5 - ARP: |
TCP (4) |
0 - Read # TCP packets sent |
1 - Read # TCP packets received |
ARP (5) |
0 - Read # ARP packets sent |
1 - Read # ARP packets received |
2 - Read # ARP entry's |
3 - Read ARP entry |
4 - Add static ARP entry |
4725,6 → 4728,7 |
---------------------- Constants for registers: ---------------------- |
eax - SF_NETWORK_PROTOCOL (76) |
====================================================================== |
========== Function 77, Subfunction 0, Create futex object =========== |
====================================================================== |
4738,10 → 4742,6 |
* Use subfunction 1 to destroy the futex. |
The kernel destroys the futexes automatically when the process |
terminates. |
---------------------- Constants for registers: ---------------------- |
eax - SF_FUTEX (77) |
ebx - SSF_CREATE (0) |
====================================================================== |
========= Function 77, Subfunction 1, Destroy futex object =========== |
====================================================================== |
4754,9 → 4754,6 |
Remarks: |
* The futex handle must have been created by subfunction 0 |
---------------------- Constants for registers: ---------------------- |
eax - SF_FUTEX (77) |
ebx - SSF_DESTROY (1) |
====================================================================== |
=============== Function 77, Subfunction 2, Futex wait =============== |
====================================================================== |
4776,9 → 4773,6 |
waiting for a wake operation on the futex. |
* The futex handle must have been created by subfunction 0 |
---------------------- Constants for registers: ---------------------- |
eax - SF_FUTEX (77) |
ebx - SSF_WAIT (2) |
====================================================================== |
=============== Function 77, Subfunction 3, Futex wake =============== |
====================================================================== |
4795,9 → 4789,6 |
waiting (e.g., inside futex wait) on the futex dword |
* The futex handle must have been created by subfunction 0 |
---------------------- Constants for registers: ---------------------- |
eax - SF_FUTEX (77) |
ebx - SSF_WAKE (3) |
====================================================================== |
=============== Function -1 - terminate thread/process =============== |
====================================================================== |
4813,8 → 4804,6 |
* This function terminates the current thread. Other thread can be |
killed by call to subfunction 2 of function 18. |
---------------------- Constants for registers: ---------------------- |
eax - SF_TERMINATE_PROCESS (-1) |
====================================================================== |
=========================== List of events =========================== |
====================================================================== |
4852,17 → 4841,18 |
=================== Error codes of the file system =================== |
====================================================================== |
* 0 = success |
* 1 = base and/or partition of a hard disk is not defined |
(by subfunctions 7, 8 of function 21) |
* 2 = function is not supported for the given file system |
* 3 = unknown file system |
* 4 = reserved, is never returned in the current implementation |
* 5 = file not found |
* 6 = end of file, EOF |
* 7 = pointer lies outside of application memory |
* 8 = disk is full |
* 9 = file system error |
* 9 = FAT table is destroyed |
* 10 = access denied |
* 11 = device error |
* 12 = file system requires more memory |
Application start functions can return also following errors: |
* 30 = 0x1E = not enough memory |
* 31 = 0x1F = file is not executable |
/kernel/branches/Kolibri-acpi/fs/ntfs.inc |
---|
1,6 → 1,6 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; |
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
/kernel/branches/Kolibri-acpi/network/IPv4.inc |
---|
1,6 → 1,6 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; |
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; IPv4.INC ;; |
939,7 → 939,6 |
test ebx, ebx |
jnz .got_device |
; Broadcast does not need gateway |
cmp eax, 0xffffffff |
je .broadcast |
977,10 → 976,6 |
mov edx, [IP_LIST + edi] ; Source IP |
; Broadcast does not need gateway |
cmp eax, 0xffffffff |
je @f |
; Check if we should route to gateway or not |
mov ebx, [IP_LIST + edi] |
and ebx, [SUBNET_LIST + edi] |
/kernel/branches/Kolibri-acpi/video/framebuffer.inc |
---|
File deleted |
/kernel/branches/Kolibri-acpi/hid/mousedrv.inc |
---|
35,8 → 35,8 |
iglobal |
;-------------------------------------- |
align 4 |
mouse_speed_factor dw 4 |
mouse_delay db 3 |
mouse_speed_factor dw 1 |
mouse_delay db 1 |
mouse_doubleclick_delay db 64 |
endg |
480,7 → 480,7 |
;----------------------------------------------------------------------------- |
align 4 |
proc set_mouse_data stdcall uses ecx edx, BtnState:dword, XMoving:dword, YMoving:dword, VScroll:dword, HScroll:dword |
proc set_mouse_data stdcall uses edx, BtnState:dword, XMoving:dword, YMoving:dword, VScroll:dword, HScroll:dword |
mov eax, [BtnState] |
and eax, 0x3FFFFFFF ; Top 2 bits are used to flag absolute movements |
551,17 → 551,35 |
endp |
;----------------------------------------------------------------------------- |
; 3 = (x+1)^2 /4 |
; 2 = (x+2)^2 /8 |
; 1 = (x+3)^2 /16 |
align 4 |
mouse_acceleration: |
neg ax |
jl mouse_acceleration |
add al, [mouse_delay] |
cmp [mouse_delay], 0 |
jz .end |
push eax |
@@: |
neg eax |
jl @b |
inc eax |
cmp [mouse_delay], 3 |
adc eax, 0 |
cmp [mouse_delay], 2 |
adc eax, 0 |
mul al |
mov cx, [mouse_speed_factor] |
dec ax |
shr ax, cl |
inc ax |
test eax, eax |
jns @f |
neg ax |
@@: |
shr eax, 2 |
cmp [mouse_delay], 2 |
jz .2 |
jnc .3 |
shr eax, 1 |
.2: |
shr eax, 1 |
.3: |
pop edx |
test edx, edx |
jns .end |
neg eax |
.end: |
imul [mouse_speed_factor] |
ret |