diff --git a/kernel/trunk/core/peload.inc b/kernel/trunk/core/peload.inc index 85fede96b6..809926d93f 100644 --- a/kernel/trunk/core/peload.inc +++ b/kernel/trunk/core/peload.inc @@ -322,8 +322,10 @@ __exports: unmap_pages, 'UnmapPages', \ ; eax, ecx sys_msg_board_str, 'SysMsgBoardStr', \ get_timer_ticks, 'GetTimerTicks', \ + get_stack_base, 'GetStackBase', \ delay_hs, 'Delay', \ ; ebx - set_mouse_data, 'SetMouseData' + set_mouse_data, 'SetMouseData', \ ; + set_keyboard_data, 'SetKeyboardData' ; gcc fastcall diff --git a/kernel/trunk/core/taskman.inc b/kernel/trunk/core/taskman.inc index 02a35f70f2..c31b67df7b 100644 --- a/kernel/trunk/core/taskman.inc +++ b/kernel/trunk/core/taskman.inc @@ -1166,4 +1166,13 @@ proc set_app_params stdcall,slot:dword, params:dword,\ ret endp + +align 4 + +get_stack_base: + mov eax,[current_slot] + mov eax,[eax+APPDATA.pl0_stack] + ret + + include "debug.inc" diff --git a/kernel/trunk/hid/keyboard.inc b/kernel/trunk/hid/keyboard.inc index 2eac6309b7..fe058a0fca 100644 --- a/kernel/trunk/hid/keyboard.inc +++ b/kernel/trunk/hid/keyboard.inc @@ -94,12 +94,34 @@ hotkey_do_test: pop eax ret + +align 4 + +set_keyboard_data: + + movzx eax,word[TASK_COUNT] ; top window process + movzx eax,word[WIN_POS+eax*2] + shl eax,8 + mov al,[SLOT_BASE+eax+APPDATA.keyboard_mode] + mov [keyboard_mode],al + + mov eax, ecx + + push ebx + push esi + push edi + push ebp + + call send_scancode + + pop ebp + pop edi + pop esi + pop ebx + ret + align 4 irq1: -; save_ring3_context -; mov ax, os_data -; mov ds, ax -; mov es, ax movzx eax,word[TASK_COUNT] ; top window process movzx eax,word[WIN_POS+eax*2] @@ -108,6 +130,9 @@ irq1: mov [keyboard_mode],al in al,0x60 + +send_scancode: + mov [keyboard_data],al ; ch = scancode @@ -310,11 +335,6 @@ irq1: .exit.irq1: mov [check_idle_semaphore],5 -; mov al,0x20 ; ready for next irq -; out 0x20,al - -; restore_ring3_context -; iret ret set_lights: @@ -340,4 +360,4 @@ numlock_map: db 0x33 ;Num 3 db 0x30 ;Num 0 db 0x2E ;Num . -;..........................Part2 End................................................ \ No newline at end of file +;..........................Part2 End................................................ diff --git a/kernel/trunk/kernel32.inc b/kernel/trunk/kernel32.inc index b0707c178c..9434b8a003 100644 --- a/kernel/trunk/kernel32.inc +++ b/kernel/trunk/kernel32.inc @@ -144,7 +144,7 @@ struc APPDATA .ev_count_ dd ? ;unused ;+20 .exc_handler dd ? ;+24 .except_mask dd ? ;+28 - .pl0_stack dd ? ;unused ;+32 + .pl0_stack dd ? ;+32 .heap_base dd ? ;+36 .heap_top dd ? ;+40 .cursor dd ? ;+44