Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2438 → Rev 2439

/kernel/branches/Kolibri-acpi/const.inc
189,6 → 189,7
TASK_DATA equ (OS_BASE+0x0003020)
TASK_EVENT equ (OS_BASE+0x0003020)
 
d_width_calc_area equ (OS_BASE+0x0005000)
mouseunder equ (OS_BASE+0x0006900)
CDDataBuf equ (OS_BASE+0x0007000)
FLOPPY_BUFF equ (OS_BASE+0x0008000)
/kernel/branches/Kolibri-acpi/core/apic.inc
41,7 → 41,8
IOAPIC_ARB equ 0x2
IOAPIC_REDTBL equ 0x10
 
IPI_INIT equ (0x6 shl 8)
IPI_INIT equ (0x5 shl 8)
IPI_START equ (0x6 shl 8)
IPI_LEVEL_ASSERT equ (0x1 shl 14)
SHORTHAND_ALL_EXCL equ (0x3 shl 18)
 
129,15 → 130,9
;===========================================================
align 4
LAPIC_init:
; Check MSR support
;....
; Get LAPIC base address
;mov ecx, 0x1b
;rdmsr ; it may be replaced to
;and ax, 0xf000 ; mov eax, 0xfee00000
 
mov [acpi_lapic_base], 0xfee00000
; xchg bx, bx
cmp [LAPIC_BASE], 0
jne .done
 
stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_SW
mov [LAPIC_BASE], eax
211,32 → 206,8
; Start (every 0.01 sec)
; mov dword[esi + APIC_LVT_timer], 0x30020; periodic int 0x20
; mov dword[esi + APIC_timer_init], eax
xchg bx, bx
 
; mov al, 0x0F
; out 0x70, al
; mov al, 0x0A
; out 0x71, al
 
; mov [OS_BASE+0x469], word (__ap_start_16) shr 4
; mov [OS_BASE+0x469], word 0
 
mov [esi+APIC_ICRH], dword 0
mov [esi+APIC_ICRL], dword 0xc4500
 
mov ecx, 1000
@@:
loop @B
 
mov [esi+APIC_ICRH], dword 0
mov [esi+APIC_ICRL], dword 0xC4600+((0x10000+__ap_start_16) shr 12)
; mov [esi+APIC_ICRL], dword 0xC4612
 
; mov [esi+APIC_ICRH], dword 0
; mov [esi+APIC_ICRL], dword CMD_IPI_INIT+IPI_LEVEL_ASSERT+16
 
 
 
.done:
ret
 
;===========================================================
448,7 → 419,35
pop ebp
ret
 
align 4
start_ap:
;eax= cpu id
 
; xchg bx, bx
 
test eax, eax ;do not start self
jz .exit
 
cmp eax, [cpu_count]
ja .exit
 
mov eax, [smpt+eax*4]
shl eax, 24
 
mov [esi+APIC_ICRH], eax
mov [esi+APIC_ICRL], dword (IPI_INIT+IPI_LEVEL_ASSERT)
 
mov ecx, 10000
@@:
loop @B
 
CMD_IPI_START equ (IPI_START+IPI_LEVEL_ASSERT)+((0x10000+__ap_start_16) shr 12)
 
mov [esi+APIC_ICRH], eax
mov [esi+APIC_ICRL], dword CMD_IPI_START
.exit:
ret
 
 
 
 
/kernel/branches/Kolibri-acpi/gui/font.inc
7,7 → 7,7
 
$Revision$
 
; // Alver 22.06.2008 // {
;------------------------------------------------------------------------------
align 4
dtext_asciiz_esi: ; for skins title out
push eax
14,8 → 14,7
xor eax, eax
inc eax
jmp dtext.1
; } \\ Alver \\
 
;------------------------------------------------------------------------------
align 4
dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
; ebx x & y
26,12 → 25,11
; B = 1 <=> fill background with color eax
; edx start of text
; edi 1 force
 
; // Alver 22.06.2008 // {
push eax
xor eax, eax
;--------------------------------------
align 4
.1:
; } \\ Alver \\
pushad
movsx eax, bx ; eax=y
sar ebx, 16 ; ebx=x
39,6 → 37,8
cmp esi, 255
jb .loop
mov esi, 255
;--------------------------------------
align 4
.loop:
test ecx, ecx
js .test_asciiz
45,15 → 45,18
dec esi
js .end
jmp @f
;--------------------------------------
align 4
.test_asciiz:
cmp byte [edx], 0
jz .end
; // Alver 22.06.2008 // {
 
cmp byte [esp+28], 1
jne @f
dec esi
js .end
; } \\ Alver \\
;--------------------------------------
align 4
@@:
inc edx
pushad
62,9 → 65,13
jnz .font2
mov esi, 9
lea ebp, [FONT_I+8*edx+edx]
;--------------------------------------
align 4
.symloop1:
mov dl, byte [ebp]
or dl, 1 shl 6
;--------------------------------------
align 4
.pixloop1:
shr dl, 1
jz .pixloop1end
72,6 → 79,8
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
jmp .pixloop1cont
;--------------------------------------
align 4
.nopix:
test ecx, 0x40000000
jz .pixloop1cont
80,9 → 89,13
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
pop ecx
;--------------------------------------
align 4
.pixloop1cont:
inc eax
jmp .pixloop1
;--------------------------------------
align 4
.pixloop1end:
sub eax, 6
inc ebx
92,14 → 105,20
popad
add eax, 6
jmp .loop
;--------------------------------------
align 4
.font2:
add edx, edx
lea ebp, [FONT_II+4*edx+edx+1]
push 9
movzx esi, byte [ebp-1]
;--------------------------------------
align 4
.symloop2:
mov dl, byte [ebp]
push esi
;--------------------------------------
align 4
.pixloop2:
shr dl, 1
jnc .nopix2
106,6 → 125,8
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
jmp .pixloop2cont
;--------------------------------------
align 4
.nopix2:
test ecx, 0x40000000
jz .pixloop2cont
114,6 → 135,8
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
pop ecx
;--------------------------------------
align 4
.pixloop2cont:
inc eax
dec esi
128,7 → 151,10
add dword [esp+28], esi
popad
jmp .loop
;--------------------------------------
align 4
.end:
popad
pop eax ; << // Alver 22.06.2008 // <<
pop eax
ret
;------------------------------------------------------------------------------
/kernel/branches/Kolibri-acpi/gui/skincode.inc
11,7 → 11,8
include "skindata.inc"
 
;skin_data = 0x00778000
 
;------------------------------------------------------------------------------
align 4
read_skin_file:
stdcall load_file, ebx
test eax, eax
21,6 → 22,8
cmp ebx, 32*1024
jb @f
mov ebx, 32*1024
;--------------------------------------
align 4
@@:
lea ecx, [ebx+3]
shr ecx, 2
32,16 → 35,20
call parse_skin_data
xor eax, eax
ret
;--------------------------------------
align 4
.notfound:
xor eax, eax
inc eax
ret
;--------------------------------------
align 4
.noskin:
stdcall kernel_free, eax
push 2
pop eax
ret
 
;------------------------------------------------------------------------------
struct SKIN_HEADER
ident dd ?
version dd ?
81,13 → 88,15
type dw ?
data dd ?
ends
 
;------------------------------------------------------------------------------
align 4
load_default_skin:
mov [_skinh], 22
mov ebx, _skin_file_default
call read_skin_file
ret
 
;------------------------------------------------------------------------------
align 4
parse_skin_data:
mov ebp, skin_data
cmp [ebp+SKIN_HEADER.ident], 'SKIN'
127,6 → 136,8
 
mov ebx, [ebp+SKIN_HEADER.bitmaps]
add ebx, skin_data
;--------------------------------------
align 4
.lp1:
cmp dword[ebx], 0
je .end_bitmaps
139,8 → 150,12
or ecx, ecx
jnz @f
mov edx, skin_inactive.left.data
;--------------------------------------
align 4
@@:
jmp .next_bitmap
;--------------------------------------
align 4
.not_left:
dec eax
jnz .not_oper
152,8 → 167,12
or ecx, ecx
jnz @f
mov edx, skin_inactive.oper.data
;--------------------------------------
align 4
@@:
jmp .next_bitmap
;--------------------------------------
align 4
.not_oper:
dec eax
jnz .not_base
163,11 → 182,17
jnz @f
mov eax, [skin_inactive.left.width]
mov edx, skin_inactive.base.data
;--------------------------------------
align 4
@@:
jmp .next_bitmap
;--------------------------------------
align 4
.not_base:
add ebx, 8
jmp .lp1
;--------------------------------------
align 4
.next_bitmap:
mov ecx, [ebx+SKIN_BITMAPS.data]
add ecx, skin_data
178,10 → 203,13
mov [edx+0], ecx
add ebx, 8
jmp .lp1
;--------------------------------------
align 4
.end_bitmaps:
 
mov ebx, [ebp+SKIN_HEADER.buttons]
add ebx, skin_data
;--------------------------------------
align 4
.lp2:
cmp dword[ebx], 0
je .end_buttons
190,14 → 218,20
jnz .not_close
mov edx, skin_btn_close
jmp .next_button
;--------------------------------------
align 4
.not_close:
dec eax
jnz .not_minimize
mov edx, skin_btn_minimize
jmp .next_button
;--------------------------------------
align 4
.not_minimize:
add ebx, 12
jmp .lp2
;--------------------------------------
align 4
.next_button:
movsx eax, [ebx+SKIN_BUTTONS.left]
mov [edx+SKIN_BUTTON.left], eax
209,18 → 243,13
mov [edx+SKIN_BUTTON.height], eax
add ebx, 12
jmp .lp2
;--------------------------------------
align 4
.end_buttons:
 
.exit:
ret
 
sys_putimage_with_check:
or ebx, ebx
jz @f
call sys_putimage.forced
@@:
ret
 
;------------------------------------------------------------------------------
align 4
drawwindow_IV_caption:
 
mov ebp, skin_active
227,8 → 256,9
or al, al
jnz @f
mov ebp, skin_inactive
;--------------------------------------
align 4
@@:
 
mov esi, [esp+4]
mov eax, [esi+WDATA.box.width] ; window width
mov edx, [ebp+SKIN_DATA.left.left]
238,8 → 268,12
add ecx, [_skinh]
 
mov ebx, [ebp+SKIN_DATA.left.data]
call sys_putimage_with_check
 
or ebx, ebx
jz @f
call sys_putimage.forced
;--------------------------------------
align 4
@@:
mov esi, [esp+4]
mov eax, [esi+WDATA.box.width]
sub eax, [ebp+SKIN_DATA.left.width]
260,6 → 294,8
mov edx, [ebp+SKIN_DATA.base.left]
sub edx, [ebp+SKIN_DATA.base.width]
shl edx, 16
;--------------------------------------
align 4
.baseskinloop:
shr edx, 16
add edx, [ebp+SKIN_DATA.base.width]
266,11 → 302,19
shl edx, 16
 
push eax ebx ecx edx
call sys_putimage_with_check
 
or ebx, ebx
jz @f
call sys_putimage.forced
;--------------------------------------
align 4
@@:
pop edx ecx ebx eax
 
dec eax
jnz .baseskinloop
;--------------------------------------
align 4
.non_base:
 
mov esi, [esp+4]
283,16 → 327,18
mov ecx, [ebp+SKIN_DATA.oper.width]
shl ecx, 16
add ecx, [_skinh]
call sys_putimage_with_check
 
or ebx, ebx
jz @f
call sys_putimage.forced
;--------------------------------------
align 4
@@:
ret
 
;//mike.dld, 2006-08-02 ]
 
 
;------------------------------------------------------------------------------
align 4
drawwindow_IV:
;param1 - aw_yes
 
pusha
 
push edx
303,8 → 349,9
cmp byte [esp+32+4+4], 0
jne @f
mov ebp, skin_inactive
;--------------------------------------
align 4
@@:
 
mov eax, [edi+WDATA.box.left]
shl eax, 16
mov ax, word [edi+WDATA.box.left]
313,9 → 360,6
shl ebx, 16
mov bx, word [edi+WDATA.box.top]
add bx, word [edi+WDATA.box.height]
; mov esi,[edi+24]
; shr esi,1
; and esi,0x007f7f7f
mov esi, [ebp+SKIN_DATA.colors.outer]
or esi, 1 shl 25 ; 0x02000000 used for draw_rectangle without top line
ror ebx, 16
324,6 → 368,8
rol ebx, 16
call draw_rectangle
mov ecx, 3
;--------------------------------------
align 4
_dw3l:
add eax, 1*65536-1
add ebx, 0*65536-1
357,13 → 403,14
mov edi, [common_colours+4]; standard grab color
call [drawbar]
jmp draw_clientbar
;--------------------------------------
align 4
@@:
 
mov al, [esp+32+4+4]
call drawwindow_IV_caption
 
;--------------------------------------
align 4
draw_clientbar:
 
mov esi, [esp]
 
mov edx, [esi+WDATA.box.top] ; WORK AREA
382,11 → 429,11
test edi, 0x40000000
jnz _noinside2
call [drawbar]
;--------------------------------------
align 4
_noinside2:
 
cmp dword[skin_data], 'SKIN'
jne no_skin_add_button
 
;* close button
mov edi, [BTN_ADDR]
movzx eax, word [edi]
411,6 → 458,8
mov ebx, [esp]
mov ebx, [ebx+WDATA.box.width]
inc ebx
;--------------------------------------
align 4
_bCx_at_right:
add ebx, [skin_btn_close.left]
mov [eax], bx
425,7 → 474,6
mov ebx, [skin_btn_close.height]
dec ebx
mov [eax], bx
 
;* minimize button
mov edi, [BTN_ADDR]
movzx eax, word [edi]
450,6 → 498,8
mov ebx, [esp]
mov ebx, [ebx+WDATA.box.width]
inc ebx
;--------------------------------------
align 4
_bMx_at_right:
add ebx, [skin_btn_minimize.left]
mov [eax], bx
464,10 → 514,10
mov ebx, [skin_btn_minimize.height]
dec ebx
mov [eax], bx
 
;--------------------------------------
align 4
no_skin_add_button:
pop edi
popa
 
ret 4
 
;------------------------------------------------------------------------------
<
/kernel/branches/Kolibri-acpi/gui/window.inc
52,16 → 52,18
; type I - original style
call drawwindow_I
jmp window._.draw_window_caption.2
 
;--------------------------------------
align 4
@@:
dec al
jnz @f
 
; type II - only reserve area, no draw
call sys_window_mouse
; call sys_window_mouse
call [draw_pointer]
jmp .exit
 
;--------------------------------------
align 4
@@:
dec al
jnz @f
71,6 → 73,8
jmp window._.draw_window_caption.2
 
; type IV & V - skinned window (resizable & not)
;--------------------------------------
align 4
@@:
mov eax, [TASK_COUNT]
movzx eax, word[WIN_POS + eax * 2]
80,10 → 84,11
push eax
call drawwindow_IV
jmp window._.draw_window_caption.2
 
;--------------------------------------
align 4
.exit:
ret
 
;------------------------------------------------------------------------------
align 4
;------------------------------------------------------------------------------
syscall_display_settings: ;///// system function 48 ///////////////////////////
132,10 → 137,11
cmp ebx, .sizeof.ftable / 4
ja @f
jmp [.ftable + ebx * 4]
;--------------------------------------
align 4
@@:
ret
 
 
;------------------------------------------------------------------------------
align 4
syscall_display_settings.00:
xor eax, eax
145,10 → 151,11
mov [windowtypechanged], eax
 
jmp syscall_display_settings._.redraw_whole_screen
 
;--------------------------------------
align 4
.exit:
ret
 
;------------------------------------------------------------------------------
align 4
syscall_display_settings.01:
and ecx, 1
156,10 → 163,11
je .exit
mov [buttontype], ecx
mov [windowtypechanged], ebx
 
;--------------------------------------
align 4
.exit:
ret
 
;------------------------------------------------------------------------------
align 4
syscall_display_settings.02:
dec ebx
170,7 → 178,7
rep movsb
mov [windowtypechanged], ebx
ret
 
;------------------------------------------------------------------------------
align 4
syscall_display_settings.03:
mov edi, ecx
179,13 → 187,13
mov ecx, edx
rep movsb
ret
 
;------------------------------------------------------------------------------
align 4
syscall_display_settings.04:
mov eax, [_skinh]
mov [esp + 32], eax
ret
 
;------------------------------------------------------------------------------
align 4
syscall_display_settings.05:
mov eax, [screen_workarea.left - 2]
195,7 → 203,7
mov ax, word[screen_workarea.bottom]
mov [esp + 20], eax
ret
 
;------------------------------------------------------------------------------
align 4
syscall_display_settings.06:
xor esi, esi
210,14 → 218,19
or eax, eax
jge @f
xor eax, eax
;--------------------------------------
align 4
@@:
mov [screen_workarea.left], eax
cmp ebx, edi
jle @f
mov ebx, edi
;--------------------------------------
align 4
@@:
mov [screen_workarea.right], ebx
 
;--------------------------------------
align 4
.check_horizontal:
mov edi, [Screen_Max_Y]
mov eax, edx
229,14 → 242,19
or eax, eax
jge @f
xor eax, eax
;--------------------------------------
align 4
@@:
mov [screen_workarea.top], eax
cmp ebx, edi
jle @f
mov ebx, edi
;--------------------------------------
align 4
@@:
mov [screen_workarea.bottom], ebx
 
;--------------------------------------
align 4
.check_if_redraw_needed:
or esi, esi
jz .exit
243,10 → 261,11
 
call repos_windows
jmp syscall_display_settings._.calculate_whole_screen
 
;--------------------------------------
align 4
.exit:
ret
 
;------------------------------------------------------------------------------
align 4
syscall_display_settings.07:
mov eax, [_skinmargins + 0]
254,7 → 273,7
mov eax, [_skinmargins + 4]
mov [esp + 20], eax
ret
 
;------------------------------------------------------------------------------
align 4
syscall_display_settings.08:
mov ebx, ecx
265,10 → 284,12
 
call syscall_display_settings._.calculate_whole_screen
jmp syscall_display_settings._.redraw_whole_screen
 
;--------------------------------------
align 4
.exit:
ret
 
;------------------------------------------------------------------------------
align 4
syscall_display_settings._.calculate_whole_screen:
xor eax, eax
xor ebx, ebx
275,7 → 296,8
mov ecx, [Screen_Max_X]
mov edx, [Screen_Max_Y]
jmp calculatescreen
 
;------------------------------------------------------------------------------
align 4
syscall_display_settings._.redraw_whole_screen:
xor eax, eax
mov [draw_limits.left], eax
286,7 → 308,7
mov [draw_limits.bottom], eax
mov eax, window_data
jmp redrawscreen
 
;------------------------------------------------------------------------------
align 4
;------------------------------------------------------------------------------
syscall_set_window_shape: ;///// system function 50 ///////////////////////////
304,15 → 326,17
test ebx, ebx
jne .shape_scale
mov [edi + APPDATA.wnd_shape], ecx
 
;--------------------------------------