|
@@ -1,135 +0,0 @@
|
|
|
-;
|
|
|
-; hello.asm
|
|
|
-;
|
|
|
-; Copyright (C) 2017 Aleksandar Andrejevic <theflash@sdf.lonestar.org>
|
|
|
-;
|
|
|
-; This program is free software: you can redistribute it and/or modify
|
|
|
-; it under the terms of the GNU Affero General Public License as
|
|
|
-; published by the Free Software Foundation, either version 3 of the
|
|
|
-; License, or (at your option) any later version.
|
|
|
-;
|
|
|
-; This program is distributed in the hope that it will be useful,
|
|
|
-; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
-; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
-; GNU Affero General Public License for more details.
|
|
|
-;
|
|
|
-; You should have received a copy of the GNU Affero General Public License
|
|
|
-; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
-;
|
|
|
-
|
|
|
-SYSCALL_ALLOC_MEMORY EQU 0
|
|
|
-SYSCALL_CLOCK_GET_TIME EQU 1
|
|
|
-SYSCALL_CLOCK_SET_TIME EQU 2
|
|
|
-SYSCALL_CLOSE_OBJECT EQU 3
|
|
|
-SYSCALL_COMMIT_MEMORY EQU 4
|
|
|
-SYSCALL_CREATE_MEMORY_SECTION EQU 5
|
|
|
-SYSCALL_CREATE_PROCESS EQU 6
|
|
|
-SYSCALL_CREATE_SEMAPHORE EQU 7
|
|
|
-SYSCALL_CREATE_THREAD EQU 8
|
|
|
-SYSCALL_CREATE_USER EQU 9
|
|
|
-SYSCALL_DELETE_FILE EQU 10
|
|
|
-SYSCALL_DELETE_USER EQU 11
|
|
|
-SYSCALL_DEVICE_IOCTL EQU 12
|
|
|
-SYSCALL_DUPLICATE_HANDLE EQU 13
|
|
|
-SYSCALL_ENUM_PROCESSES EQU 14
|
|
|
-SYSCALL_FLUSH_MEMORY_SECTION EQU 15
|
|
|
-SYSCALL_FREE_MEMORY EQU 16
|
|
|
-SYSCALL_GET_EXCEPTION_INFO EQU 17
|
|
|
-SYSCALL_GET_MILLISECONDS EQU 18
|
|
|
-SYSCALL_GET_NANOSECONDS EQU 19
|
|
|
-SYSCALL_GET_PROCESS_ID EQU 20
|
|
|
-SYSCALL_GET_THREAD_ID EQU 21
|
|
|
-SYSCALL_GET_USER_ID EQU 22
|
|
|
-SYSCALL_LIST_DIRECTORY EQU 23
|
|
|
-SYSCALL_LOGON_USER EQU 24
|
|
|
-SYSCALL_MAP_MEMORY_SECTION EQU 25
|
|
|
-SYSCALL_MOUNT EQU 26
|
|
|
-SYSCALL_OPEN_FILE EQU 27
|
|
|
-SYSCALL_OPEN_MEMORY_SECTION EQU 28
|
|
|
-SYSCALL_OPEN_PIPE EQU 29
|
|
|
-SYSCALL_OPEN_PROCESS EQU 30
|
|
|
-SYSCALL_OPEN_THREAD EQU 31
|
|
|
-SYSCALL_POWER_CONTROL EQU 32
|
|
|
-SYSCALL_QUERY_FILE EQU 33
|
|
|
-SYSCALL_QUERY_HANDLE EQU 34
|
|
|
-SYSCALL_QUERY_PROCESS EQU 35
|
|
|
-SYSCALL_QUERY_THREAD EQU 36
|
|
|
-SYSCALL_QUERY_USER EQU 37
|
|
|
-SYSCALL_RAISE_EXCEPTION EQU 38
|
|
|
-SYSCALL_READ_FILE EQU 39
|
|
|
-SYSCALL_READ_MEMORY EQU 40
|
|
|
-SYSCALL_READ_PIPE EQU 41
|
|
|
-SYSCALL_RELEASE_SEMAPHORE EQU 42
|
|
|
-SYSCALL_RESTORE_EXCEPTION_HANDLER EQU 43
|
|
|
-SYSCALL_REVERT_USER EQU 44
|
|
|
-SYSCALL_SAVE_EXCEPTION_HANDLER EQU 45
|
|
|
-SYSCALL_SET_MEMORY_FLAGS EQU 46
|
|
|
-SYSCALL_SET_USER_ID EQU 47
|
|
|
-SYSCALL_SLEEP EQU 48
|
|
|
-SYSCALL_TERMINATE EQU 49
|
|
|
-SYSCALL_TERMINATE_THREAD EQU 50
|
|
|
-SYSCALL_UNCOMMIT_MEMORY EQU 51
|
|
|
-SYSCALL_UNMOUNT EQU 52
|
|
|
-SYSCALL_WAIT_PROCESS EQU 53
|
|
|
-SYSCALL_WAIT_SEMAPHORE EQU 54
|
|
|
-SYSCALL_WAIT_THREAD EQU 55
|
|
|
-SYSCALL_WRITE_FILE EQU 56
|
|
|
-SYSCALL_WRITE_MEMORY EQU 57
|
|
|
-SYSCALL_WRITE_PIPE EQU 58
|
|
|
-SYSCALL_YIELD_QUANTUM EQU 59
|
|
|
-
|
|
|
-bits 32
|
|
|
-
|
|
|
-section .text
|
|
|
-
|
|
|
-start: push 0
|
|
|
- push 0
|
|
|
- push handle
|
|
|
- push name
|
|
|
- push SYSCALL_OPEN_FILE
|
|
|
- call syscall
|
|
|
- add esp, 20
|
|
|
- push 4
|
|
|
- push address
|
|
|
- push 12
|
|
|
- push framebuffer
|
|
|
- push 0xC9000004
|
|
|
- push dword [handle]
|
|
|
- push SYSCALL_DEVICE_IOCTL
|
|
|
- call syscall
|
|
|
- add esp, 28
|
|
|
- or eax, eax
|
|
|
- jnz .stop
|
|
|
- mov edi, dword [address]
|
|
|
- lea esi, [edi + 160]
|
|
|
- mov ecx, 960
|
|
|
- cld
|
|
|
- rep movsd
|
|
|
- mov eax, 0x07200720
|
|
|
- mov ecx, 40
|
|
|
- rep stosd
|
|
|
- sub edi, 160
|
|
|
- mov esi, message
|
|
|
- mov ecx, 13
|
|
|
- rep movsw
|
|
|
-.stop: xor eax, eax
|
|
|
- not eax
|
|
|
- push eax
|
|
|
- push eax
|
|
|
- push SYSCALL_SLEEP
|
|
|
- call syscall
|
|
|
- add esp, 12
|
|
|
- jmp .stop
|
|
|
-
|
|
|
-%include "../library/src/syscall.asm"
|
|
|
-
|
|
|
-section .data
|
|
|
-
|
|
|
-handle: DD 0
|
|
|
-name: DB '@Video0', 0
|
|
|
-framebuffer: DD 0x10000000
|
|
|
- DD 0
|
|
|
- DD 80 * 25 * 2
|
|
|
-address: DD 0
|
|
|
-message: DB 'H', 7, 'e', 7, 'l', 7, 'l', 7, 'o', 7, ',', 7, ' ',
|
|
|
- DB 7, 'w', 7, 'o', 7, 'r', 7, 'l', 7, 'd', 7, '!', 7
|