Kolibri-F:

- Added syscall_ common name for system call functions. 
- Fixed not logical names of system calls of functions.

git-svn-id: svn://kolibrios.org@8986 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat 2021-07-03 14:13:18 +00:00
parent 422f79f395
commit 631f5b8e1e
29 changed files with 214 additions and 224 deletions

View File

@ -1291,15 +1291,15 @@ default_fs_functions:
dd 0 ; no user functions dd 0 ; no user functions
endg endg
; This function is called from file_system_lfn. ; This function is called from syscall_file_system_lfn.
; This handler gets the control each time when fn 70 is called ; This handler gets the control each time when fn 70 is called
; with unknown item of root subdirectory. ; with unknown item of root subdirectory.
; in: esi = ebp -> path string ; in: esi = ebp -> path string
; out: if the handler processes path, it must not return in file_system_lfn, ; out: if the handler processes path, it must not return in syscall_file_system_lfn,
; but instead pop return address and return directly to the caller ; but instead pop return address and return directly to the caller
; otherwise simply return ; otherwise simply return
dyndisk_handler: dyndisk_handler:
push ebx edi ; save registers used in file_system_lfn push ebx edi ; save registers used in syscall_file_system_lfn
; 1. Acquire the mutex. ; 1. Acquire the mutex.
mov ecx, disk_list_mutex mov ecx, disk_list_mutex
call mutex_lock call mutex_lock
@ -1340,7 +1340,7 @@ dyndisk_handler:
; 3. Release the mutex. ; 3. Release the mutex.
call mutex_unlock call mutex_unlock
; 4. Return normally. ; 4. Return normally.
pop edi ebx ; restore registers used in file_system_lfn pop edi ebx ; restore registers used in syscall_file_system_lfn
ret ret
; part of 2d: the name matches partially, but we must check that this is full ; part of 2d: the name matches partially, but we must check that this is full
; equality. ; equality.
@ -1383,7 +1383,7 @@ dyndisk_handler:
jz @f jz @f
mov esi, fs_dyndisk_next mov esi, fs_dyndisk_next
@@: ; Let the procedure from fs_lfn.inc do the job. @@: ; Let the procedure from fs_lfn.inc do the job.
jmp file_system_lfn.maindir_noesi jmp syscall_file_system_lfn.maindir_noesi
.root: .root:
pop ecx edx pop ecx edx
@ -1547,7 +1547,7 @@ dyndisk_handler:
jmp @b jmp @b
; This is a callback for enumerating partitions called from ; This is a callback for enumerating partitions called from
; file_system_lfn.maindir in the case of inserted media. ; syscall_file_system_lfn.maindir in the case of inserted media.
; It just increments eax until DISK.NumPartitions reached and then ; It just increments eax until DISK.NumPartitions reached and then
; cleans up. ; cleans up.
fs_dyndisk_next: fs_dyndisk_next:
@ -1567,7 +1567,7 @@ fs_dyndisk_next:
ret ret
; This is a callback for enumerating partitions called from ; This is a callback for enumerating partitions called from
; file_system_lfn.maindir in the case of missing media. ; syscall_file_system_lfn.maindir in the case of missing media.
; In this case we create one pseudo-partition. ; In this case we create one pseudo-partition.
fs_dyndisk_next_nomedia: fs_dyndisk_next_nomedia:
cmp eax, 1 cmp eax, 1
@ -1584,7 +1584,7 @@ fs_dyndisk_next_nomedia:
stc stc
ret ret
; This function is called from file_system_lfn. ; This function is called from syscall_file_system_lfn.
; This handler is called when virtual root is enumerated ; This handler is called when virtual root is enumerated
; and must return all items which can be handled by this. ; and must return all items which can be handled by this.
; It is called several times, first time with eax=0 ; It is called several times, first time with eax=0
@ -1592,7 +1592,7 @@ fs_dyndisk_next_nomedia:
; out: eax = 0 => no more items ; out: eax = 0 => no more items
; eax != 0 => buffer pointed to by edi contains name of item ; eax != 0 => buffer pointed to by edi contains name of item
dyndisk_enum_root: dyndisk_enum_root:
push edx ; save register used in file_system_lfn push edx ; save register used in syscall_file_system_lfn
mov ecx, disk_list_mutex ; it will be useful mov ecx, disk_list_mutex ; it will be useful
; 1. If this is the first call, acquire the mutex and initialize. ; 1. If this is the first call, acquire the mutex and initialize.
test eax, eax test eax, eax
@ -1615,11 +1615,11 @@ dyndisk_enum_root:
jnz @b jnz @b
pop esi eax pop esi eax
; 5. Return with eax = item. ; 5. Return with eax = item.
pop edx ; restore register used in file_system_lfn pop edx ; restore register used in syscall_file_system_lfn
ret ret
.last: .last:
; 6. Release the mutex and return with eax = 0. ; 6. Release the mutex and return with eax = 0.
call mutex_unlock call mutex_unlock
xor eax, eax xor eax, eax
pop edx ; restore register used in file_system_lfn pop edx ; restore register used in syscall_file_system_lfn
ret ret

View File

@ -27,7 +27,7 @@ sysfn_saveramdisk: ; 18.6 = SAVE FLOPPY IMAGE (HD version only)
shl eax, 9 shl eax, 9
mov [ebx+12], eax mov [ebx+12], eax
pushad pushad
call file_system_lfn_protected ;in ebx call syscall_file_system_lfn_protected ;in ebx
popad popad
mov [esp+32], eax mov [esp+32], eax
ret ret

View File

@ -97,7 +97,7 @@ endg
read_image: read_image:
mov ebx, read_image_fsinfo mov ebx, read_image_fsinfo
pushad pushad
call file_system_lfn_protected call syscall_file_system_lfn_protected
popad popad
ret ret

View File

@ -69,7 +69,7 @@ yes_shutdown_param:
; load kernel.mnt to _CLEAN_ZONE ; load kernel.mnt to _CLEAN_ZONE
mov ebx, kernel_file_load mov ebx, kernel_file_load
pushad pushad
call file_system_lfn call syscall_file_system_lfn
popad popad
@@: @@:
mov esi, OS_BASE+restart_code_start ; move kernel re-starter to 0x5000:0 mov esi, OS_BASE+restart_code_start ; move kernel re-starter to 0x5000:0

View File

@ -2,21 +2,11 @@
# Compile the KolibriOS kernel on Linux # Compile the KolibriOS kernel on Linux
# 2017, The KolibriOS team # 2017, The KolibriOS team
KERPACK=$HOME/kolibrios/programs/other/kpack/kerpack_linux/kerpack KERPACK=./tools/kerpack
KOLIBRI_IMG=$HOME/nightly/kolibri.img KOLIBRI_IMG=kolibri.img
replace=0; # Replace kernel in the image file?
echo 'lang fix en' > lang.inc echo 'lang fix en' > lang.inc
fasm -m 65536 bootbios.asm bootbios.bin fasm -m 65536 bootbios.asm bootbios.bin
fasm -m 65536 kernel.asm kernel.mnt fasm -m 65536 -s kernel.fas kernel.asm kernel.mnt
$KERPACK kernel.mnt kernel.mnt $KERPACK kernel.mnt kernel.mnt
mcopy -D o -i $KOLIBRI_IMG kernel.mnt ::kernel.mnt
[[ $replace -eq 1 ]] && {
mntpt=$(mktemp -d)
sudo mount -o loop $KOLIBRI_IMG $mntpt
sudo mount -o remount,rw $mntpt
sudo cp kernel.mnt ${mntpt}/KERNEL.MNT
sudo umount $mntpt
rmdir $mntpt
}

View File

@ -56,7 +56,7 @@ endg
align 4 align 4
pci_api: syscall_pci_api:
;cross ;cross
mov eax, ebx mov eax, ebx
@ -499,7 +499,7 @@ pci_emu_dat:
endg endg
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
align 4 align 4
sys_pcibios: syscall_pcibios:
cmp [pci_access_enabled], 1 cmp [pci_access_enabled], 1
jne .unsupported_func jne .unsupported_func
cmp [pci_bios_entry], 0 cmp [pci_bios_entry], 0

View File

@ -205,7 +205,7 @@ proc usb_thread_proc
; If failed, set [usb_event] to -1 and terminate myself. ; If failed, set [usb_event] to -1 and terminate myself.
dbgstr 'cannot create event for USB thread' dbgstr 'cannot create event for USB thread'
or [usb_event], -1 or [usb_event], -1
jmp sys_end jmp syscall_end
@@: @@:
mov [usb_event], eax mov [usb_event], eax
push -1 ; initial timeout: infinite push -1 ; initial timeout: infinite

View File

@ -10,7 +10,7 @@ $Revision$
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
sys_clipboard: syscall_clipboard:
xor eax, eax xor eax, eax
dec eax dec eax
; check availability of main list ; check availability of main list

View File

@ -9,15 +9,15 @@ $Revision$
; diamond, 2006 ; diamond, 2006
sys_debug_services: syscall_debug_services:
cmp ebx, 9 cmp ebx, 9
ja @f ja @f
jmp dword [sys_debug_services_table+ebx*4] jmp dword [syscall_debug_service_services_table+ebx*4]
@@: @@:
ret ret
iglobal iglobal
align 4 align 4
sys_debug_services_table: syscall_debug_service_services_table:
dd debug_set_event_data dd debug_set_event_data
dd debug_getcontext dd debug_getcontext
dd debug_setcontext dd debug_setcontext

View File

@ -388,7 +388,7 @@ proc get_fileinfo stdcall, file_name:dword, info:dword
pushad pushad
cld cld
call protect_from_terminate call protect_from_terminate
call file_system_lfn call syscall_file_system_lfn
call unprotect_from_terminate call unprotect_from_terminate
popad popad
ret ret
@ -423,7 +423,7 @@ proc read_file stdcall,file_name:dword, buffer:dword, off:dword,\
pushad pushad
lea ebx, [cmd] lea ebx, [cmd]
call file_system_lfn_protected call syscall_file_system_lfn_protected
popad popad
ret ret
endp endp

View File

@ -75,11 +75,11 @@ __exports:
user_free, 'UserFree', \ ; stdcall user_free, 'UserFree', \ ; stdcall
unmap_pages, 'UnmapPages', \ ; eax, ecx unmap_pages, 'UnmapPages', \ ; eax, ecx
sys_msg_board_str, 'SysMsgBoardStr', \ sys_msg_board_str, 'SysMsgBoardStr', \
sys_msg_board, 'SysMsgBoard', \ syscall_msg_board, 'SysMsgBoard', \
get_clock_ns, 'GetClockNs', \ ;retval edx:eax 64-bit value get_clock_ns, 'GetClockNs', \ ;retval edx:eax 64-bit value
get_timer_ticks, 'GetTimerTicks', \ get_timer_ticks, 'GetTimerTicks', \
get_stack_base, 'GetStackBase', \ get_stack_base, 'GetStackBase', \
delay_hs, 'Delay', \ ; ebx sys_delay_hs, 'Delay', \ ; ebx
set_mouse_data, 'SetMouseData', \ ; set_mouse_data, 'SetMouseData', \ ;
set_keyboard_data, 'SetKeyboardData', \ ; gcc fastcall set_keyboard_data, 'SetKeyboardData', \ ; gcc fastcall
register_keyboard, 'RegKeyboard', \ register_keyboard, 'RegKeyboard', \

View File

@ -906,7 +906,7 @@ proc safe_map_page stdcall, slot:dword, req_access:dword, ofs:dword
ret ret
endp endp
sys_IPC: syscall_IPC:
;input: ;input:
; ebx=1 - set ipc buffer area ; ebx=1 - set ipc buffer area
; ecx=address of buffer ; ecx=address of buffer
@ -1098,15 +1098,15 @@ sysfn_meminfo:
ret ret
align 4 align 4
f68: syscall_some_intrenal_services:
cmp ebx, 4 cmp ebx, 4
jbe sys_sheduler jbe sys_sheduler
cmp ebx, 11 cmp ebx, 11
jb undefined_syscall jb syscall_undefined
cmp ebx, 29 cmp ebx, 29
ja undefined_syscall ja syscall_undefined
xor eax, eax xor eax, eax
jmp dword [f68call+ebx*4-11*4] jmp dword [syscall_some_intrenal_servicescall+ebx*4-11*4]
.11: .11:
call init_heap call init_heap
mov [esp+SYSCALL_STACK._eax], eax mov [esp+SYSCALL_STACK._eax], eax
@ -1230,27 +1230,27 @@ f68:
ret ret
align 4 align 4
f68call: ; keep this table closer to main code syscall_some_intrenal_servicescall: ; keep this table closer to main code
dd f68.11 ; init_heap dd syscall_some_intrenal_services.11 ; init_heap
dd f68.12 ; user_alloc dd syscall_some_intrenal_services.12 ; user_alloc
dd f68.13 ; user_free dd syscall_some_intrenal_services.13 ; user_free
dd f68.14 ; get_event_ex dd syscall_some_intrenal_services.14 ; get_event_ex
dd f68.fail ; moved to f68.24 dd syscall_some_intrenal_services.fail ; moved to syscall_some_intrenal_services.24
dd f68.16 ; get_service dd syscall_some_intrenal_services.16 ; get_service
dd f68.17 ; call_service dd syscall_some_intrenal_services.17 ; call_service
dd f68.18 ; loadLibUnicode dd syscall_some_intrenal_services.18 ; loadLibUnicode
dd f68.19 ; load_dll dd syscall_some_intrenal_services.19 ; load_dll
dd f68.20 ; user_realloc dd syscall_some_intrenal_services.20 ; user_realloc
dd f68.21 ; load_driver dd syscall_some_intrenal_services.21 ; load_driver
dd f68.22 ; shmem_open dd syscall_some_intrenal_services.22 ; shmem_open
dd f68.23 ; shmem_close dd syscall_some_intrenal_services.23 ; shmem_close
dd f68.24 ; set exception handler dd syscall_some_intrenal_services.24 ; set exception handler
dd f68.25 ; unmask exception dd syscall_some_intrenal_services.25 ; unmask exception
dd f68.26 ; user_unmap dd syscall_some_intrenal_services.26 ; user_unmap
dd f68.27 ; load_file_umode dd syscall_some_intrenal_services.27 ; load_file_umode
dd f68.28 ; loadFileUnicode dd syscall_some_intrenal_services.28 ; loadFileUnicode
dd f68.29 ; user_ring dd syscall_some_intrenal_services.29 ; user_ring
align 4 align 4
proc load_pe_driver stdcall, file:dword, cmdline:dword proc load_pe_driver stdcall, file:dword, cmdline:dword

View File

@ -367,7 +367,7 @@ unlock_application_table:
; sysfn 64 implementation ; sysfn 64 implementation
align 4 align 4
sys_resize_app_memory: syscall_resize_app_memory:
; in: eax = 64 - function number ; in: eax = 64 - function number
; ebx = 1 - number of its only subfunction ; ebx = 1 - number of its only subfunction
; ecx = new amount of memory ; ecx = new amount of memory
@ -727,7 +727,7 @@ destroy_thread:
pushad pushad
xchg eax, ecx xchg eax, ecx
mov ebx, 2 mov ebx, 2
call sys_system call syscall_system
popad popad
@@: @@:
inc eax inc eax
@ -813,7 +813,7 @@ proc unprotect_from_terminate
lock dec [edx+APPDATA.terminate_protection] lock dec [edx+APPDATA.terminate_protection]
; If the result of decrement is zero, somebody has requested termination, ; If the result of decrement is zero, somebody has requested termination,
; but at that moment we were inside a critical area; terminate now. ; but at that moment we were inside a critical area; terminate now.
jz sys_end jz syscall_end
; Otherwise, return to the caller. ; Otherwise, return to the caller.
ret ret
endp endp

View File

@ -98,89 +98,89 @@ iglobal
align 4 align 4
servetable2: servetable2:
dd syscall_draw_window ; 0-DrawWindow dd syscall_draw_window ; 0 - define and draw the window;
dd syscall_setpixel ; 1-SetPixel dd syscall_setpixel ; 1 - put pixel in the window;
dd sys_getkey ; 2-GetKey dd syscall_getkey ; 2 - get the code of the pressed key;
dd sys_clock ; 3-GetTime dd syscall_clock ; 3 - get system time;
dd syscall_writetext ; 4-WriteText dd syscall_writetext ; 4 - draw text string;
dd delay_hs_unprotected ; 5-DelayHs dd syscall_delay_hs_unprotected ; 5 - delay;
dd undefined_syscall ; 6-deprecated OpenRamdiskFile dd syscall_undefined ; 6 - system call undefined;
dd syscall_putimage ; 7-PutImage dd syscall_putimage ; 7 - draw image in the window;
dd syscall_button ; 8-DefineButton dd syscall_button ; 8 - define/delete the button;
dd sys_cpuusage ; 9-GetProcessInfo dd syscall_thread_info ; 9 - information on execution thread;
dd sys_waitforevent ; 10-WaitForEvent dd syscall_waitforevent ; 10 - wait for event;
dd sys_getevent ; 11-CheckForEvent dd syscall_checkforevent ; 11 - check for event, no wait;
dd sys_redrawstat ; 12-BeginDraw and EndDraw dd syscall_redrawstat ; 12 - begin/end window redraw;
dd syscall_drawrect ; 13-DrawRect dd syscall_drawrect ; 13 - draw a rectangle in the window;
dd syscall_getscreensize ; 14-GetScreenSize dd syscall_getscreensize ; 14 - get screen size;
dd sys_background ; 15-bgr dd syscall_background ; 15 - working with the background;
dd sys_cachetodiskette ; 16-FlushFloppyCache dd syscall_cachetodiskette ; 16 - save ramdisk on a floppy;
dd sys_getbutton ; 17-GetButton dd syscall_getbutton ; 17 - get the identifier of the pressed button;
dd sys_system ; 18-System Services dd syscall_system ; 18 - system services;
dd paleholder ; 19-reserved dd syscall_undefined ; 19 - system call undefined;
dd sys_midi ; 20-ResetMidi and OutputMidi dd syscall_midi ; 20 - reset MIDI and output MIDI;
dd sys_setup ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,. dd syscall_setup ; 21 - setting system parameters;
dd sys_settime ; 22-setting date,time,clock and alarm-clock dd syscall_settime ; 22 - setting date, time, clock and alarm-clock;
dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent dd syscall_wait_event_timeout ; 23 - wait for event with timeout;
dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist dd syscall_cdaudio ; 24 - work with a CD player;
dd syscall_putarea_backgr ; 25-Put Area to background dd syscall_putarea_backgr ; 25 - put area to background;
dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,. dd syscall_getsetup ; 26 - get system parameters;
dd undefined_syscall ; 27-reserved dd syscall_undefined ; 27 - system call undefined;
dd undefined_syscall ; 28-reserved dd syscall_undefined ; 28 - system call undefined;
dd sys_date ; 29-GetDate dd syscall_date ; 29 - get date;
dd sys_current_directory ; 30-Get/SetCurrentDirectory dd syscall_current_directory ; 30 - get/set current directory;
dd undefined_syscall ; 31-reserved dd syscall_undefined ; 31 - system call undefined;
dd undefined_syscall ; 32-reserved dd syscall_undefined ; 32 - system call undefined;
dd undefined_syscall ; 33-reserved dd syscall_undefined ; 33 - system call undefined;
dd syscall_getpixel_WinMap ; 34-GetPixel WinMap dd syscall_getpixel_WinMap ; 34 - find out who the screen point belongs to;
dd syscall_getpixel ; 35-GetPixel dd syscall_getpixel ; 35 - read the color of the pixel on the screen;
dd syscall_getarea ; 36-GetArea dd syscall_getarea ; 36 - read the screen area;
dd readmousepos ; 37-GetMousePosition_ScreenRelative,. dd syscall_get_mouse_pos ; 37 - work with the mouse;
dd syscall_drawline ; 38-DrawLine dd syscall_drawline ; 38 - draw a line;
dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,. dd syscall_getbackground ; 39 - get background info;
dd set_app_param ; 40-WantEvents dd syscall_set_eventmask ; 40 - set event mask;
dd undefined_syscall ; 41- deprecated GetIrqOwner dd syscall_undefined ; 41 - system call undefined;
dd undefined_syscall ; 42- deprecated ReadIrqData dd syscall_undefined ; 42 - system call undefined;
dd sys_outport ; 43-SendDeviceData dd syscall_outport ; 43 - input / output to the port;
dd undefined_syscall ; 44- deprecated ProgramIrqs dd syscall_undefined ; 44 - system call undefined;
dd undefined_syscall ; 45- deprecated ReserveIrq and FreeIrq dd syscall_undefined ; 45 - system call undefined;
dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea dd syscall_reserveportarea ; 46 - reserve port area and free port area;
dd display_number ; 47-WriteNum dd syscall_putnumber ; 47 - print a number to the window;
dd syscall_display_settings ; 48-SetRedrawType and SetButtonType dd syscall_window_styles ; 48 - window display styles;
dd sys_apm ; 49-Advanced Power Management (APM) dd syscall_apm ; 49 - Advanced Power Management (APM);
dd syscall_set_window_shape ; 50-Window shape & scale dd syscall_set_window_shape ; 50 - window shape & scale;
dd syscall_threads ; 51-Threads dd syscall_threads ; 51 - threads;
dd undefined_syscall ; 52- deprecated Stack driver status dd syscall_undefined ; 52 - system call undefined;
dd undefined_syscall ; 53- deprecated Socket interface dd syscall_undefined ; 53 - system call undefined;
dd sys_clipboard ; 54-Custom clipboard dd syscall_clipboard ; 54 - working with the clipboard;
dd sound_interface ; 55-Sound interface dd syscall_sound_interface ; 55 - sound interface;
dd undefined_syscall ; 56-reserved dd syscall_undefined ; 56 - system call undefined;
dd sys_pcibios ; 57-PCI BIOS32 dd syscall_pcibios ; 57 - PCI BIOS32;
dd undefined_syscall ; 58-deprecated Common file system interface dd syscall_undefined ; 58 - system call undefined;
dd undefined_syscall ; 59-reserved dd syscall_undefined ; 59 - system call undefined;
dd sys_IPC ; 60-Inter Process Communication dd syscall_IPC ; 60 - Inter Process Communication(IPC);
dd sys_gs ; 61-Direct graphics access dd syscall_dga ; 61 - direct graphics access;
dd pci_api ; 62-PCI functions dd syscall_pci_api ; 62 - PCI functions;
dd sys_msg_board ; 63-System message board dd syscall_msg_board ; 63 - system message board;
dd sys_resize_app_memory ; 64-Resize application memory usage dd syscall_resize_app_memory ; 64 - resize application memory usage;
dd sys_putimage_palette ; 65-PutImagePalette dd syscall_putimage_palette ; 65 - display an image with a palette in the window;
dd sys_process_def ; 66-Process definitions - keyboard dd syscall_process_def ; 66 - process definitions - keyboard;
dd syscall_move_window ; 67-Window move or resize dd syscall_move_window ; 67 - window move or resize;
dd f68 ; 68-Some internal services dd syscall_some_intrenal_services ; 68 - some internal services;
dd sys_debug_services ; 69-Debug dd syscall_debug_services ; 69 - debug services;
dd file_system_lfn ; 70-Common file system interface, version 2 dd syscall_file_system_lfn ; 70 - file system interface;
dd syscall_window_settings ; 71-Window settings dd syscall_window_settings ; 71 - window settings;
dd sys_sendwindowmsg ; 72-Send window message dd syscall_send_window_msg ; 72 - send window message;
dd blit_32 ; 73-blitter; dd syscall_blit_32 ; 73 - graphic blitter;
dd sys_network ; 74-reserved for new stack dd syscall_network ; 74 - work with network devices;
dd sys_socket ; 75-reserved for new stack dd syscall_socket ; 75 - work with network sockets;
dd sys_protocols ; 76-reserved for new stack dd syscall_protocols ; 76 - network options and statistics;
dd sys_posix ; posix support dd syscall_posix_subsystem ; 77 - POSIX subsystem;
dd undefined_syscall ; 78-free dd syscall_undefined ; 78 - system call undefined;
dd undefined_syscall ; 79-free dd syscall_undefined ; 79 - system call undefined;
dd fileSystemUnicode ; 80-File system interface for different encodings dd syscall_fs_diff_encodings ; 80 - file system interface for different encodings;
times 255 - ( ($-servetable2) /4 ) dd undefined_syscall times 255 - ( ($-servetable2) /4 ) dd syscall_undefined
dd sys_end ; -1-end application dd syscall_end ; -1-end application
endg endg

View File

@ -873,8 +873,8 @@ common_app_entry:
mov ebx, dll_error_msg mov ebx, dll_error_msg
mov ebp, notifyapp mov ebp, notifyapp
call fs_execute_from_sysdir_param call fs_execute_from_sysdir_param
; Terminate process (TODO: Need jump to .cleanup after sys_end ?) ; Terminate process (TODO: Need jump to .cleanup after syscall_end ?)
call sys_end call syscall_end
@@: @@:
; Find APP_STARTUP_THUNK in DLL.OBJ ; Find APP_STARTUP_THUNK in DLL.OBJ

View File

@ -685,7 +685,7 @@ v86_exc_c:
if DEBUG_SHOW_IO if DEBUG_SHOW_IO
mov edx, ebx mov edx, ebx
mov ebx, 200 mov ebx, 200
call delay_hs call sys_delay_hs
mov esi, [esp+v86_regs.size+10h+4] mov esi, [esp+v86_regs.size+10h+4]
mov eax, [esi+V86_machine.iopm] mov eax, [esi+V86_machine.iopm]
@@: @@:

View File

@ -23,7 +23,7 @@ $Revision$
_esp equ esp _esp equ esp
macro put_board { macro put_board {
call sys_msg_board call syscall_msg_board
} }
macro debug_func name { macro debug_func name {

View File

@ -90,7 +90,7 @@ image_of_ebx EQU esp+20
; ret ; ret
; endp ; endp
; syscall_fileSystemUnicode: ; with user pointer correctness checking ; syscall_syscall_fs_diff_encodings: ; with user pointer correctness checking
; ; in: ebx -> f.80 parameter structure ; ; in: ebx -> f.80 parameter structure
; stdcall file_system_is_operation_safe, ebx ; stdcall file_system_is_operation_safe, ebx
; jnz @f ; jnz @f
@ -99,13 +99,13 @@ image_of_ebx EQU esp+20
; mov dword [image_of_eax], ERROR_MEMORY_POINTER ; mov dword [image_of_eax], ERROR_MEMORY_POINTER
; ret ; ret
; @@: ; @@:
; jmp fileSystemUnicode ; jmp syscall_fs_diff_encodings
; temporarily commented out cause acpi driver (drivers/devman) uses sysfn70 via 0x40 ; temporarily commented out cause acpi driver (drivers/devman) uses sysfn70 via 0x40
; so because drivers it kernel space, pointer checking fails ; so because drivers it kernel space, pointer checking fails
; TODO solution: add filesystem functions without pointer checking to kernel exports ; TODO solution: add filesystem functions without pointer checking to kernel exports
; and make the driver use them, not int 0x40 ; and make the driver use them, not int 0x40
; syscall_fileSystemUnicode commented out for the same reason ; syscall_syscall_fs_diff_encodings commented out for the same reason
; syscall_file_system_lfn: ; with user pointer correctness checking ; syscall_file_system_lfn: ; with user pointer correctness checking
; ; in: ebx -> f.70 parameter structure ; ; in: ebx -> f.70 parameter structure
; stdcall file_system_is_operation_safe, ebx ; stdcall file_system_is_operation_safe, ebx
@ -115,28 +115,28 @@ image_of_ebx EQU esp+20
; mov dword [image_of_eax], ERROR_MEMORY_POINTER ; mov dword [image_of_eax], ERROR_MEMORY_POINTER
; ret ; ret
; @@: ; @@:
; jmp file_system_lfn ; jmp syscall_file_system_lfn
; System function 70 ; System function 70
file_system_lfn_protected: syscall_file_system_lfn_protected:
pushad pushad
call protect_from_terminate call protect_from_terminate
call file_system_lfn call syscall_file_system_lfn
call unprotect_from_terminate call unprotect_from_terminate
popad popad
mov [image_of_eax], eax mov [image_of_eax], eax
mov [image_of_ebx], ebx mov [image_of_ebx], ebx
ret ret
fileSystemUnicode: syscall_fs_diff_encodings:
; in: ebx -> f.80 parameter structure ; in: ebx -> f.80 parameter structure
mov edi, [ebx+20] mov edi, [ebx+20]
mov esi, [ebx+24] mov esi, [ebx+24]
jmp @f jmp @f
file_system_lfn: syscall_file_system_lfn:
; in: ebx -> f.70 parameter structure ; in: ebx -> f.70 parameter structure
xor edi, edi xor edi, edi
lea esi, [ebx+20] lea esi, [ebx+20]
@ -512,7 +512,7 @@ uglobal
addDirSeal db ? addDirSeal db ?
endg endg
sys_current_directory: ; sysfunction 30 syscall_current_directory: ; sysfunction 30
mov eax, [current_slot] mov eax, [current_slot]
mov edi, [eax+APPDATA.cur_dir] mov edi, [eax+APPDATA.cur_dir]
xor eax, eax xor eax, eax

View File

@ -326,7 +326,7 @@ wait_event_timeout:
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
get_event_ex: ;; f68:14 get_event_ex: ;; syscall_some_intrenal_services:14
;info: ;info:
; Waiting for any event in the EventList of the current slot ; Waiting for any event in the EventList of the current slot
; Code event data - copied to application memory (indirectly by edi) ; Code event data - copied to application memory (indirectly by edi)
@ -431,7 +431,7 @@ align 4
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
sys_sendwindowmsg: ;; f72 syscall_send_window_msg: ;; f72
dec ebx dec ebx
jnz .ret ;subfunction==1 ? jnz .ret ;subfunction==1 ?
pushfd pushfd
@ -475,7 +475,7 @@ align 4
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
sys_getevent: ;; f11 syscall_checkforevent: ;; f11
mov ebx, [current_slot] ;now this is a question, what where to put...... mov ebx, [current_slot] ;now this is a question, what where to put......
pushfd ; this is a consequence of the general concept: let the test function have pushfd ; this is a consequence of the general concept: let the test function have
cli ; the right to hope to disable interrupts, as when called from shed cli ; the right to hope to disable interrupts, as when called from shed
@ -485,11 +485,11 @@ sys_getevent: ;; f11
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
sys_waitforevent: ;; f10 syscall_waitforevent: ;; f10
or ebx, -1; infinite timeout or ebx, -1; infinite timeout
;-------------------------------------- ;--------------------------------------
align 4 align 4
sys_wait_event_timeout: ;; f23 syscall_wait_event_timeout: ;; f23
call unprotect_from_terminate call unprotect_from_terminate
mov edx, get_event_for_app; wait_test mov edx, get_event_for_app; wait_test
call Wait_events_ex ; ebx - timeout call Wait_events_ex ; ebx - timeout

View File

@ -69,7 +69,7 @@ syscall_draw_window: ;///// system function 0 /////////////////////////////////
.exit: .exit:
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
syscall_display_settings: ;///// system function 48 /////////////////////////// syscall_window_styles: ;///// system function 48 ///////////////////////////
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
cmp ebx, 13 cmp ebx, 13
ja .ret ja .ret
@ -1008,8 +1008,8 @@ align 4
jz @f jz @f
push edx push edx
call syscall_display_settings.calculateScreen call syscall_window_styles.calculateScreen
call syscall_display_settings.redrawScreen call syscall_window_styles.redrawScreen
pop edx pop edx
;-------------------------------------- ;--------------------------------------
align 4 align 4

View File

@ -16,7 +16,7 @@ $Revision$
; ebx =2 - set day of week ecx- 1-7 ; ebx =2 - set day of week ecx- 1-7
; ebx =3 - set alarm-clock ecx - 00SSMMHH ; ebx =3 - set alarm-clock ecx - 00SSMMHH
; out: 0 -Ok 1 -wrong format 2 -battery low ; out: 0 -Ok 1 -wrong format 2 -battery low
sys_settime: syscall_settime:
cli cli
mov al, 0x0d mov al, 0x0d

View File

@ -1357,7 +1357,7 @@ set_variables:
align 4 align 4
;input eax=43,bl-byte of output, ecx - number of port ;input eax=43,bl-byte of output, ecx - number of port
sys_outport: syscall_outport:
mov edi, ecx ; separate flag for read / write mov edi, ecx ; separate flag for read / write
and ecx, 65535 and ecx, 65535
@ -1414,7 +1414,7 @@ sys_outport:
mov [esp+20], eax mov [esp+20], eax
ret ret
display_number: syscall_putnumber:
; add check pointers ; add check pointers
test bl, bl test bl, bl
jz @f jz @f
@ -1624,7 +1624,7 @@ midi_base dw 0
endg endg
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
sys_setup: syscall_setup:
; 1 = roland mpu midi base , base io address ; 1 = roland mpu midi base , base io address
; 2 = keyboard 1, base kaybap 2, shift keymap, 9 country 1eng 2fi 3ger 4rus ; 2 = keyboard 1, base kaybap 2, shift keymap, 9 country 1eng 2fi 3ger 4rus
; 3 = not used ; 3 = not used
@ -1731,7 +1731,7 @@ sys_setup:
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
sys_getsetup: syscall_getsetup:
; 1 = roland mpu midi base , base io address ; 1 = roland mpu midi base , base io address
; 2 = keyboard 1, base kaybap 2, shift keymap, 9 country 1eng 2fi 3ger 4rus ; 2 = keyboard 1, base kaybap 2, shift keymap, 9 country 1eng 2fi 3ger 4rus
; 3 = not used ; 3 = not used
@ -1867,7 +1867,7 @@ get_timer_ticks:
mov eax, [timer_ticks] mov eax, [timer_ticks]
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
readmousepos: syscall_get_mouse_pos:
; eax=0 screen relative ; eax=0 screen relative
; eax=1 window relative ; eax=1 window relative
; eax=2 buttons pressed ; eax=2 buttons pressed
@ -2021,7 +2021,7 @@ put_mpu_out:
align 4 align 4
sys_midi: syscall_midi:
cmp [mididp], 0 cmp [mididp], 0
jnz sm0 jnz sm0
mov [esp+36], dword 1 mov [esp+36], dword 1
@ -2079,7 +2079,7 @@ detect_devices:
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ret ret
sys_end: syscall_end:
;-------------------------------------- ;--------------------------------------
cmp [_display.select_cursor], 0 cmp [_display.select_cursor], 0
je @f je @f
@ -2174,7 +2174,7 @@ sys_system_table:
sysfn_num = ($ - sys_system_table)/4 sysfn_num = ($ - sys_system_table)/4
endg endg
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
sys_system: syscall_system:
dec ebx dec ebx
cmp ebx, sysfn_num cmp ebx, sysfn_num
jae @f jae @f
@ -2303,8 +2303,8 @@ sysfn_deactivate: ; 18.1 = DEACTIVATE WINDOW
movzx esi, word [WIN_STACK + ecx * 2] movzx esi, word [WIN_STACK + ecx * 2]
lea esi, [WIN_POS + esi * 2] lea esi, [WIN_POS + esi * 2]
call window._.window_deactivate call window._.window_deactivate
call syscall_display_settings.calculateScreen call syscall_window_styles.calculateScreen
call syscall_display_settings.redrawScreen call syscall_window_styles.redrawScreen
.nowindowdeactivate: .nowindowdeactivate:
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -2672,7 +2672,7 @@ version_end:
endg endg
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
sys_cachetodiskette: syscall_cachetodiskette:
cmp ebx, 1 cmp ebx, 1
jb .no_floppy_save jb .no_floppy_save
cmp ebx, 2 cmp ebx, 2
@ -2692,7 +2692,7 @@ bgrlock db 0
endg endg
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
sys_background: syscall_background:
cmp ebx, 1 ; BACKGROUND SIZE cmp ebx, 1 ; BACKGROUND SIZE
jnz nosb1 jnz nosb1
test ecx, ecx test ecx, ecx
@ -3045,7 +3045,7 @@ force_redraw_background:
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
sys_getbackground: syscall_getbackground:
; cmp eax,1 ; SIZE ; cmp eax,1 ; SIZE
dec ebx dec ebx
jnz nogb1 jnz nogb1
@ -3100,7 +3100,7 @@ nogb4:
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
sys_getkey: syscall_getkey:
mov [esp + 32], dword 1 mov [esp + 32], dword 1
; test main buffer ; test main buffer
mov ebx, [current_slot_idx] ; TOP OF WINDOW STACK mov ebx, [current_slot_idx] ; TOP OF WINDOW STACK
@ -3157,7 +3157,7 @@ align 4
jmp .ret_eax jmp .ret_eax
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
sys_getbutton: syscall_getbutton:
mov ebx, [current_slot_idx] ; TOP OF WINDOW STACK mov ebx, [current_slot_idx] ; TOP OF WINDOW STACK
mov [esp + 32], dword 1 mov [esp + 32], dword 1
movzx ecx, word [WIN_STACK + ebx * 2] movzx ecx, word [WIN_STACK + ebx * 2]
@ -3177,7 +3177,7 @@ align 4
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
sys_cpuusage: syscall_thread_info:
; RETURN: ; RETURN:
; ;
@ -3287,7 +3287,7 @@ sys_cpuusage:
ret ret
align 4 align 4
sys_clock: syscall_clock:
cli cli
; Mikhail Lisovin xx Jan 2005 ; Mikhail Lisovin xx Jan 2005
@@: @@:
@ -3325,7 +3325,7 @@ sys_clock:
align 4 align 4
sys_date: syscall_date:
cli cli
@@: @@:
@ -3360,7 +3360,7 @@ sys_date:
; redraw status ; redraw status
sys_redrawstat: syscall_redrawstat:
cmp ebx, 1 cmp ebx, 1
jne no_widgets_away jne no_widgets_away
; buttons away ; buttons away
@ -3776,7 +3776,7 @@ redrawscreen:
push eax push eax
;;; mov ebx,2 ;;; mov ebx,2
;;; call delay_hs ;;; call sys_delay_hs
;mov ecx,0 ; redraw flags for apps ;mov ecx,0 ; redraw flags for apps
xor ecx, ecx xor ecx, ecx
@ -4048,7 +4048,7 @@ delay_ms: ; delay in 1/1000 sec
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
set_app_param: syscall_set_eventmask:
mov edi, [TASK_BASE] mov edi, [TASK_BASE]
mov eax, ebx mov eax, ebx
xchg eax, [edi + TASKDATA.event_mask] ; set new event mask xchg eax, [edi + TASKDATA.event_mask] ; set new event mask
@ -4057,16 +4057,16 @@ set_app_param:
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; this is for syscall ; this is for syscall
proc delay_hs_unprotected proc syscall_delay_hs_unprotected
call unprotect_from_terminate call unprotect_from_terminate
call delay_hs call sys_delay_hs
call protect_from_terminate call protect_from_terminate
ret ret
endp endp
if 1 if 1
align 4 align 4
delay_hs: ; delay in 1/100 secs sys_delay_hs: ; delay in 1/100 secs
; ebx = delay time ; ebx = delay time
pushad pushad
@ -4093,7 +4093,7 @@ delay_hs: ; delay in 1/100 secs
else else
align 4 align 4
delay_hs: ; delay in 1/100 secs sys_delay_hs: ; delay in 1/100 secs
; ebx = delay time ; ebx = delay time
push ecx push ecx
push edx push edx
@ -4437,7 +4437,7 @@ sys_putimage_bpp:
; jmp [draw_pointer] ; jmp [draw_pointer]
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
sys_putimage_palette: syscall_putimage_palette:
; ebx = pointer to image ; ebx = pointer to image
; ecx = [xsize]*65536 + [ysize] ; ecx = [xsize]*65536 + [ysize]
; edx = [xstart]*65536 + [ystart] ; edx = [xstart]*65536 + [ystart]
@ -4842,7 +4842,7 @@ sys_msg_board_str:
je @f je @f
mov ebx, 1 mov ebx, 1
movzx ecx, byte [esi] movzx ecx, byte [esi]
call sys_msg_board call syscall_msg_board
inc esi inc esi
jmp @b jmp @b
@@: @@:
@ -4884,7 +4884,7 @@ sys_msg_board_dword:
mov cl, al mov cl, al
xor ebx, ebx xor ebx, ebx
inc ebx inc ebx
call sys_msg_board call syscall_msg_board
pop eax pop eax
pop ecx pop ecx
loop @b loop @b
@ -4902,7 +4902,7 @@ iglobal
msg_board_pos dd 42*6*65536+10 ; for printing debug output on the screen msg_board_pos dd 42*6*65536+10 ; for printing debug output on the screen
endg endg
sys_msg_board: syscall_msg_board:
; ebx=1 -> write, cl = byte to write ; ebx=1 -> write, cl = byte to write
; ebx=2 -> read, ecx=0 -> no data, ecx=1 -> data in al ; ebx=2 -> read, ecx=0 -> no data, ecx=1 -> data in al
push eax ebx push eax ebx
@ -5000,17 +5000,17 @@ end if
iglobal iglobal
align 4 align 4
f66call: f66call:
dd sys_process_def.1 ; 1 = set keyboard mode dd syscall_process_def.1 ; 1 = set keyboard mode
dd sys_process_def.2 ; 2 = get keyboard mode dd syscall_process_def.2 ; 2 = get keyboard mode
dd sys_process_def.3 ; 3 = get keyboard ctrl, alt, shift dd syscall_process_def.3 ; 3 = get keyboard ctrl, alt, shift
dd sys_process_def.4 ; 4 = set system-wide hotkey dd syscall_process_def.4 ; 4 = set system-wide hotkey
dd sys_process_def.5 ; 5 = delete installed hotkey dd syscall_process_def.5 ; 5 = delete installed hotkey
dd sys_process_def.6 ; 6 = disable input, work only hotkeys dd syscall_process_def.6 ; 6 = disable input, work only hotkeys
dd sys_process_def.7 ; 7 = enable input, opposition to f.66.6 dd syscall_process_def.7 ; 7 = enable input, opposition to f.66.6
endg endg
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
sys_process_def: syscall_process_def:
dec ebx dec ebx
cmp ebx, 7 cmp ebx, 7
jae .not_support ;if >=8 then or eax,-1 jae .not_support ;if >=8 then or eax,-1
@ -5150,15 +5150,15 @@ endg
iglobal iglobal
align 4 align 4
f61call: f61call:
dd sys_gs.1 ; resolution dd syscall_dga.1 ; resolution
dd sys_gs.2 ; bits per pixel dd syscall_dga.2 ; bits per pixel
dd sys_gs.3 ; bytes per scanline dd syscall_dga.3 ; bytes per scanline
endg endg
align 4 align 4
sys_gs: ; direct screen access syscall_dga: ; direct screen access
dec ebx dec ebx
cmp ebx, 2 cmp ebx, 2
ja .not_support ja .not_support
@ -5691,7 +5691,7 @@ apm_vf dd 0
endg endg
align 4 align 4
sys_apm: syscall_apm:
xor eax, eax xor eax, eax
cmp word [apm_vf], ax ; Check APM BIOS enable cmp word [apm_vf], ax ; Check APM BIOS enable
jne @f jne @f
@ -5743,7 +5743,7 @@ sys_apm:
; ----------------------------------------- ; -----------------------------------------
align 4 align 4
undefined_syscall: ; Undefined system call syscall_undefined: ; Undefined system call
mov [esp + 32], dword -1 mov [esp + 32], dword -1
ret ret

View File

@ -245,7 +245,7 @@ macro socket_init {
; ; ; ;
;-----------------------------------------------------------------; ;-----------------------------------------------------------------;
align 4 align 4
sys_socket: syscall_socket:
mov dword[esp+20], 0 ; Set error code to 0 mov dword[esp+20], 0 ; Set error code to 0

View File

@ -720,7 +720,7 @@ checksum_2:
; ; ; ;
;-----------------------------------------------------------------; ;-----------------------------------------------------------------;
align 4 align 4
sys_network: syscall_network:
cmp bl, 255 cmp bl, 255
jne @f jne @f
@ -847,7 +847,7 @@ sys_network:
; ; ; ;
;-----------------------------------------------------------------; ;-----------------------------------------------------------------;
align 4 align 4
sys_protocols: syscall_protocols:
cmp bh, NET_DEVICES_MAX ; Check if device number exists cmp bh, NET_DEVICES_MAX ; Check if device number exists
jae .doesnt_exist jae .doesnt_exist

View File

@ -47,17 +47,17 @@ sys_posix_call:
dd sys_futex ;5 reserved dd sys_futex ;5 reserved
dd sys_futex ;6 reserved dd sys_futex ;6 reserved
dd sys_futex ;7 reserved dd sys_futex ;7 reserved
dd sys_posix.fail ;8 sys_open dd syscall_posix_subsystem.fail ;8 sys_open
dd sys_posix.fail ;9 sys_close dd syscall_posix_subsystem.fail ;9 sys_close
dd sys_read ;10 read() dd sys_read ;10 read()
dd sys_write ;11 write() dd sys_write ;11 write()
dd sys_posix.fail ;12 sys_dup3 dd syscall_posix_subsystem.fail ;12 sys_dup3
dd sys_pipe2 ;13 dd sys_pipe2 ;13
.end: .end:
endg endg
align 4 align 4
sys_posix: syscall_posix_subsystem:
cmp ebx, (sys_posix_call.end-sys_posix_call)/4 cmp ebx, (sys_posix_call.end-sys_posix_call)/4
jae .fail jae .fail

View File

@ -19,7 +19,7 @@
$Revision$ $Revision$
align 4 align 4
sound_interface: syscall_sound_interface:
cmp eax, ebx ; this is subfunction #55 ? cmp eax, ebx ; this is subfunction #55 ?
jne retFunc55 ; if no then return. jne retFunc55 ; if no then return.

Binary file not shown.

Binary file not shown.

View File

@ -197,7 +197,7 @@ purge .dy1
ret ret
align 4 align 4
blit_32: syscall_blit_32:
push ebp push ebp
push edi push edi
push esi push esi