Rev 8158 | Rev 8176 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8158 | Rev 8160 | ||
---|---|---|---|
Line 69... | Line 69... | ||
69 | format binary as "mnt" |
69 | format binary as "mnt" |
Line 70... | Line 70... | ||
70 | 70 | ||
71 | include 'macros.inc' |
71 | include 'macros.inc' |
Line 72... | Line 72... | ||
72 | include 'struct.inc' |
72 | include 'struct.inc' |
Line 73... | Line 73... | ||
73 | 73 | ||
74 | $Revision: 8158 $ |
74 | $Revision: 8160 $ |
Line 1744... | Line 1744... | ||
1744 | add ebx, edx |
1744 | add ebx, edx |
1745 | ; 1 = normal layout |
1745 | ; 1 = normal layout |
1746 | dec ecx |
1746 | dec ecx |
1747 | jnz .shift |
1747 | jnz .shift |
Line 1748... | Line 1748... | ||
1748 | 1748 | ||
- | 1749 | ; if given memory address belongs to kernel then error |
|
- | 1750 | push ebx |
|
- | 1751 | mov eax, ebx |
|
- | 1752 | mov ebx, 128 |
|
- | 1753 | call is_region_userspace |
|
- | 1754 | pop ebx |
|
1749 | cmp ebx, 0x7FFFFFFF ; if given memory address belongs to kernel then error |
1755 | test eax, eax |
Line 1750... | Line 1756... | ||
1750 | ja .addr_error |
1756 | jz .addr_error |
1751 | 1757 | ||
1752 | mov eax, keymap |
1758 | mov eax, keymap |
1753 | mov ecx, 128 |
1759 | mov ecx, 128 |
Line 1757... | Line 1763... | ||
1757 | .shift: |
1763 | .shift: |
1758 | ; 2 = layout with pressed Shift |
1764 | ; 2 = layout with pressed Shift |
1759 | dec ecx |
1765 | dec ecx |
1760 | jnz .alt |
1766 | jnz .alt |
Line -... | Line 1767... | ||
- | 1767 | ||
- | 1768 | push ebx |
|
1761 | 1769 | mov eax, ebx |
|
- | 1770 | mov ebx, 128 |
|
- | 1771 | call is_region_userspace |
|
- | 1772 | pop ebx |
|
1762 | cmp ebx, 0x7FFFFFFF |
1773 | test eax, eax |
Line 1763... | Line 1774... | ||
1763 | ja .addr_error |
1774 | jz .addr_error |
1764 | 1775 | ||
1765 | mov eax, keymap_shift |
1776 | mov eax, keymap_shift |
1766 | mov ecx, 128 |
1777 | mov ecx, 128 |
Line 1770... | Line 1781... | ||
1770 | .alt: |
1781 | .alt: |
1771 | ; 3 = layout with pressed Alt |
1782 | ; 3 = layout with pressed Alt |
1772 | dec ecx |
1783 | dec ecx |
1773 | jne .country |
1784 | jne .country |
Line -... | Line 1785... | ||
- | 1785 | ||
- | 1786 | push ebx |
|
1774 | 1787 | mov eax, ebx |
|
- | 1788 | mov ebx, 128 |
|
- | 1789 | call is_region_userspace |
|
- | 1790 | pop ebx |
|
1775 | cmp ebx, 0x7FFFFFFF |
1791 | test eax, eax |
Line 1776... | Line 1792... | ||
1776 | ja .addr_error |
1792 | jz .addr_error |
1777 | 1793 | ||
1778 | mov eax, keymap_alt |
1794 | mov eax, keymap_alt |
1779 | mov ecx, 128 |
1795 | mov ecx, 128 |
Line 5645... | Line 5661... | ||
5645 | or [esp + 44], al |
5661 | or [esp + 44], al |
5646 | ret |
5662 | ret |
5647 | ; ----------------------------------------- |
5663 | ; ----------------------------------------- |
Line 5648... | Line 5664... | ||
5648 | 5664 | ||
5649 | align 4 |
- | |
5650 | 5665 | align 4 |
|
5651 | undefined_syscall: ; Undefined system call |
5666 | undefined_syscall: ; Undefined system call |
5652 | mov [esp + 32], dword -1 |
5667 | mov [esp + 32], dword -1 |
Line -... | Line 5668... | ||
- | 5668 | ret |
|
- | 5669 | ||
- | 5670 | align 4 |
|
- | 5671 | ; check if given memory region lays in lower 2gb (userspace memory) or not |
|
- | 5672 | is_region_userspace: |
|
- | 5673 | ; in: eax = base |
|
- | 5674 | ; ebx = len |
|
- | 5675 | ; out: eax = 1 if region in userspace memory, 0 if not |
|
- | 5676 | push esi edi ecx |
|
- | 5677 | add eax, ebx |
|
- | 5678 | cmp eax, OS_BASE |
|
- | 5679 | ja @f |
|
- | 5680 | ||
- | 5681 | mov eax, 1 |
|
- | 5682 | jmp .ret |
|
- | 5683 | ||
- | 5684 | @@: |
|
- | 5685 | xor eax, eax |
|
- | 5686 | .ret: |
|
Line 5653... | Line 5687... | ||
5653 | ret |
5687 | pop ecx edi esi |
5654 | 5688 | ret |
|
5655 | 5689 |