From c30c9e5b52d56ca75d11d87067b51fedfd9652a4 Mon Sep 17 00:00:00 2001 From: "Alexey Teplov (" Date: Wed, 16 Jun 2010 15:56:03 +0000 Subject: [PATCH] 61 system function. git-svn-id: svn://kolibrios.org@1497 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/core/syscall.inc | 4 +-- kernel/trunk/kernel.asm | 46 ++++++++++++++++++++++------------- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/kernel/trunk/core/syscall.inc b/kernel/trunk/core/syscall.inc index 89b5280d0a..a62c454d29 100644 --- a/kernel/trunk/core/syscall.inc +++ b/kernel/trunk/core/syscall.inc @@ -163,7 +163,7 @@ iglobal dd file_system ; 58-Common file system interface dd 0 dd 0 - dd sys_gs ; 61-Direct graphics access + dd 0 dd sys_pci ; 62-PCI functions dd sys_msg_board ; 63-System message board @@ -234,7 +234,7 @@ iglobal dd cross_order ; 58-Common file system interface dd undefined_syscall ; 59-reserved dd sys_IPC ; 60-Inter Process Communication - dd cross_order ; 61-Direct graphics access + dd sys_gs ; 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 diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 8b4f0834ba..23912fce5a 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -4569,35 +4569,47 @@ sys_process_def: mov [esp+32], edx ret + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; 61 sys function. ;; +;; in eax=61,ebx in [1..3] ;; +;; out eax ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +iglobal +align 4 +f61call: + dd sys_gs.1 ; resolution + dd sys_gs.2 ; bits per pixel + dd sys_gs.3 ; bytes per scanline +endg + + align 4 sys_gs: ; direct screen access + dec ebx + cmp ebx,2 + ja .not_support + jmp dword [f61call+ebx*4] +.not_support: + or [esp+32],dword -1 + ret - cmp eax,1 ; resolution - jne no_gs1 + +.1: ; resolution mov eax,[Screen_Max_X] shl eax,16 mov ax,[Screen_Max_Y] add eax,0x00010001 - mov [esp+36],eax + mov [esp+32],eax ret - no_gs1: - - cmp eax,2 ; bits per pixel - jne no_gs2 +.2: ; bits per pixel movzx eax,byte [ScreenBPP] - mov [esp+36],eax + mov [esp+32],eax ret - no_gs2: - - cmp eax,3 ; bytes per scanline - jne no_gs3 +.3: ; bytes per scanline mov eax,[BytesPerScanLine] - mov [esp+36],eax - ret - no_gs3: - - or [esp+36],dword -1 + mov [esp+32],eax ret