2009-09-17 13:55:38 +02:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
2009-10-12 16:39:59 +02:00
|
|
|
|
$Revision$
|
2009-09-17 13:55:38 +02:00
|
|
|
|
|
|
|
|
|
; Old style system call converter
|
|
|
|
|
align 16
|
|
|
|
|
cross_order:
|
2009-10-07 11:59:35 +02:00
|
|
|
|
; load all registers in crossed order
|
|
|
|
|
mov eax, ebx
|
|
|
|
|
mov ebx, ecx
|
|
|
|
|
mov ecx, edx
|
|
|
|
|
mov edx, esi
|
|
|
|
|
mov esi, edi
|
|
|
|
|
movzx edi, byte[esp+28 + 4]
|
|
|
|
|
call dword [servetable+edi*4]
|
|
|
|
|
ret
|
2009-09-17 13:55:38 +02:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
2009-10-07 11:59:35 +02:00
|
|
|
|
;; SYSENTER ENTRY ;;
|
2009-09-17 13:55:38 +02:00
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
2009-10-07 11:59:35 +02:00
|
|
|
|
align 32
|
|
|
|
|
sysenter_entry:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov esp, [ss:tss._esp0]
|
|
|
|
|
sti
|
|
|
|
|
push ebp ; save app esp + 4
|
|
|
|
|
mov ebp, [ebp] ; ebp - original ebp
|
|
|
|
|
;------------------
|
|
|
|
|
pushad
|
|
|
|
|
cld
|
|
|
|
|
|
|
|
|
|
movzx eax, al
|
|
|
|
|
call dword [servetable2 + eax * 4]
|
|
|
|
|
|
|
|
|
|
popad
|
|
|
|
|
;------------------
|
|
|
|
|
xchg ecx, [ss:esp] ; <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - app ecx, ecx - app esp + 4
|
|
|
|
|
sub ecx, 4
|
|
|
|
|
xchg edx, [ecx] ; edx - return point, & save original edx
|
|
|
|
|
push edx
|
|
|
|
|
mov edx, [ss:esp + 4]
|
|
|
|
|
mov [ecx + 4], edx ; save original ecx
|
|
|
|
|
pop edx
|
|
|
|
|
sysexit
|
2009-09-17 13:55:38 +02:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
2009-10-07 11:59:35 +02:00
|
|
|
|
;; SYSTEM CALL ENTRY ;;
|
2009-09-17 13:55:38 +02:00
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
2009-10-07 11:59:35 +02:00
|
|
|
|
align 16
|
|
|
|
|
i40:
|
|
|
|
|
pushad
|
|
|
|
|
cld
|
|
|
|
|
movzx eax, al
|
|
|
|
|
call dword [servetable2 + eax * 4]
|
|
|
|
|
popad
|
|
|
|
|
iretd
|
2009-09-17 13:55:38 +02:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;; SYSCALL ENTRY ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
align 32
|
|
|
|
|
syscall_entry:
|
|
|
|
|
; cli syscall clear IF
|
2009-10-07 11:59:35 +02:00
|
|
|
|
xchg esp, [ss:tss._esp0]
|
|
|
|
|
push ecx
|
|
|
|
|
lea ecx, [esp+4]
|
|
|
|
|
xchg ecx, [ss:tss._esp0]
|
|
|
|
|
sti
|
|
|
|
|
push ecx
|
|
|
|
|
mov ecx, [ecx]
|
|
|
|
|
;------------------
|
|
|
|
|
pushad
|
|
|
|
|
cld
|
|
|
|
|
|
|
|
|
|
movzx eax, al
|
|
|
|
|
call dword [servetable2 + eax * 4]
|
2009-09-17 13:55:38 +02:00
|
|
|
|
|
2009-10-07 11:59:35 +02:00
|
|
|
|
popad
|
|
|
|
|
;------------------
|
|
|
|
|
mov ecx, [ss:esp+4]
|
|
|
|
|
pop esp
|
|
|
|
|
sysret
|
2009-09-17 13:55:38 +02:00
|
|
|
|
|
|
|
|
|
iglobal
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; SYSTEM FUNCTIONS TABLE ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
|
|
align 4
|
|
|
|
|
servetable:
|
|
|
|
|
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
2010-01-15 12:54:11 +01:00
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd sound_interface ; 55-Sound interface
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd file_system ; 58-Common file system interface
|
|
|
|
|
dd 0
|
|
|
|
|
dd sys_IPC ; 60-Inter Process Communication
|
|
|
|
|
dd sys_gs ; 61-Direct graphics access
|
|
|
|
|
dd sys_pci ; 62-PCI functions
|
|
|
|
|
dd sys_msg_board ; 63-System message board
|
|
|
|
|
dd 0
|
2009-09-17 13:55:38 +02:00
|
|
|
|
dd syscall_putimage_palette; 65-PutImagePalette
|
2010-01-15 12:54:11 +01:00
|
|
|
|
dd sys_process_def ; 66-Process definitions - keyboard
|
|
|
|
|
dd sys_window_move ; 67-Window move or resize
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd file_system_lfn ; 70-Common file system interface, version 2
|
2009-09-17 13:55:38 +02:00
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; NEW SYSTEM FUNCTIONS TABLE ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
align 4
|
|
|
|
|
servetable2:
|
|
|
|
|
|
2010-01-15 12:54:11 +01:00
|
|
|
|
dd sys_drawwindow ; 0-DrawWindow
|
|
|
|
|
dd syscall_setpixel ; 1-SetPixel
|
|
|
|
|
dd sys_getkey ; 2-GetKey
|
|
|
|
|
dd sys_clock ; 3-GetTime
|
|
|
|
|
dd syscall_writetext ; 4-WriteText
|
|
|
|
|
dd delay_hs ; 5-DelayHs
|
2009-09-17 13:55:38 +02:00
|
|
|
|
dd syscall_openramdiskfile ; 6-OpenRamdiskFile
|
2010-01-15 12:54:11 +01:00
|
|
|
|
dd syscall_putimage ; 7-PutImage
|
|
|
|
|
dd syscall_button ; 8-DefineButton
|
|
|
|
|
dd sys_cpuusage ; 9-GetProcessInfo
|
|
|
|
|
dd sys_waitforevent ; 10-WaitForEvent
|
|
|
|
|
dd sys_getevent ; 11-CheckForEvent
|
|
|
|
|
dd sys_redrawstat ; 12-BeginDraw and EndDraw
|
|
|
|
|
dd syscall_drawrect ; 13-DrawRect
|
2009-10-07 11:59:35 +02:00
|
|
|
|
dd syscall_getscreensize ; 14-GetScreenSize
|
2010-01-15 12:54:11 +01:00
|
|
|
|
dd sys_background ; 15-bgr
|
2009-10-07 11:59:35 +02:00
|
|
|
|
dd sys_cachetodiskette ; 16-FlushFloppyCache
|
2010-01-15 12:54:11 +01:00
|
|
|
|
dd sys_getbutton ; 17-GetButton
|
|
|
|
|
dd sys_system ; 18-System Services
|
|
|
|
|
dd paleholder ; 19-reserved
|
|
|
|
|
dd sys_midi ; 20-ResetMidi and OutputMidi
|
|
|
|
|
dd sys_setup ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,.
|
|
|
|
|
dd sys_settime ; 22-setting date,time,clock and alarm-clock
|
2009-09-17 13:55:38 +02:00
|
|
|
|
dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent
|
2010-01-15 12:54:11 +01:00
|
|
|
|
dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist
|
|
|
|
|
dd undefined_syscall ; 25-reserved
|
|
|
|
|
dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,.
|
|
|
|
|
dd undefined_syscall ; 27-reserved
|
|
|
|
|
dd undefined_syscall ; 28-reserved
|
|
|
|
|
dd sys_date ; 29-GetDate
|
|
|
|
|
dd sys_current_directory ; 30-Get/SetCurrentDirectory
|
|
|
|
|
dd undefined_syscall ; 31-reserved
|
|
|
|
|
dd undefined_syscall ; 32-reserved
|
|
|
|
|
dd undefined_syscall ; 33-reserved
|
|
|
|
|
dd undefined_syscall ; 34-reserved
|
|
|
|
|
dd syscall_getpixel ; 35-GetPixel
|
|
|
|
|
dd syscall_getarea ; 36-GetArea
|
|
|
|
|
dd readmousepos ; 37-GetMousePosition_ScreenRelative,.
|
|
|
|
|
dd syscall_drawline ; 38-DrawLine
|
|
|
|
|
dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,.
|
|
|
|
|
dd set_app_param ; 40-WantEvents
|
2009-10-07 11:59:35 +02:00
|
|
|
|
dd syscall_getirqowner ; 41-GetIrqOwner
|
2010-01-15 12:54:11 +01:00
|
|
|
|
dd get_irq_data ; 42-ReadIrqData
|
|
|
|
|
dd sys_outport ; 43-SendDeviceData
|
|
|
|
|
dd sys_programirq ; 44-ProgramIrqs
|
|
|
|
|
dd reserve_free_irq ; 45-ReserveIrq and FreeIrq
|
|
|
|
|
dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea
|
|
|
|
|
dd display_number ; 47-WriteNum
|
|
|
|
|
dd syscall_display_settings ; 48-SetRedrawType and SetButtonType
|
|
|
|
|
dd sys_apm ; 49-Advanced Power Management (APM)
|
|
|
|
|
dd syscall_set_window_shape ; 50-Window shape & scale
|
|
|
|
|
dd syscall_threads ; 51-Threads
|
|
|
|
|
dd undefined_syscall ; 52-Stack driver status
|
|
|
|
|
dd undefined_syscall ; 53-Socket interface
|
|
|
|
|
dd undefined_syscall ; 54-reserved
|
|
|
|
|
dd cross_order ; 55-Sound interface
|
|
|
|
|
dd undefined_syscall ; 56-reserved
|
|
|
|
|
dd sys_pcibios ; 57-PCI BIOS32
|
|
|
|
|
dd cross_order ; 58-Common file system interface
|
|
|
|
|
dd undefined_syscall ; 59-reserved
|
|
|
|
|
dd cross_order ; 60-Inter Process Communication
|
|
|
|
|
dd cross_order ; 61-Direct graphics access
|
|
|
|
|
dd cross_order ; 62-PCI functions
|
|
|
|
|
dd cross_order ; 63-System message board
|
|
|
|
|
dd sys_resize_app_memory ; 64-Resize application memory usage
|
|
|
|
|
dd cross_order ; 65-PutImagePalette
|
|
|
|
|
dd cross_order ; 66-Process definitions - keyboard
|
|
|
|
|
dd cross_order ; 67-Window move or resize
|
|
|
|
|
dd f68 ; 68-Some internal services
|
|
|
|
|
dd sys_debug_services ; 69-Debug
|
|
|
|
|
dd cross_order ; 70-Common file system interface, version 2
|
|
|
|
|
dd syscall_windowsettings ; 71-Window settings
|
|
|
|
|
dd sys_sendwindowmsg ; 72-Send window message
|
2009-09-17 13:55:38 +02:00
|
|
|
|
dd sys_network ; 73-Network stack
|
|
|
|
|
dd sys_socket ; 74-Sockets
|
|
|
|
|
dd sys_protocols ; 75-Protocols
|
2010-01-15 12:54:11 +01:00
|
|
|
|
times 255 - ( ($-servetable2) /4 ) dd undefined_syscall
|
|
|
|
|
dd sys_end ; -1-end application
|
2009-09-17 13:55:38 +02:00
|
|
|
|
|
|
|
|
|
endg
|