Update the hello.asm sample program.
authorcoderain <coderain@sdf.org>
Thu, 18 May 2017 16:12:28 +0000 (18:12 +0200)
committercoderain <coderain@sdf.org>
Thu, 18 May 2017 16:12:28 +0000 (18:12 +0200)
tests/hello.asm

index 6e98b5173f9997c753430f58aada5ae57db81a3f..e44df0d394f8ee3b68e9865cb6911e514efff0c0 100644 (file)
 ; 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
@@ -25,16 +86,18 @@ start:                  push 0
                         push 0
                         push handle
                         push name
-                        call open_file
-                        add esp, 16
+                        push SYSCALL_OPEN_FILE
+                        call syscall
+                        add esp, 20
                         push 4
                         push address
                         push 12
                         push framebuffer
                         push 0xC9000004
                         push dword [handle]
-                        call device_ioctl
-                        add esp, 24
+                        push SYSCALL_DEVICE_IOCTL
+                        call syscall
+                        add esp, 28
                         or eax, eax
                         jnz .stop
                         mov edi, dword [address]
@@ -53,8 +116,9 @@ start:                  push 0
                         not eax
                         push eax
                         push eax
-                        call sleep
-                        add esp, 8
+                        push SYSCALL_SLEEP
+                        call syscall
+                        add esp, 12
                         jmp .stop
 
 %include "../library/src/syscall.asm"