flat assembler
Message board for the users of flat assembler.

Index > Heap > fasm on skyos

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
anyone of you heard of fasm ported to skyos?

http://www.skyos.org/?q=node/446

Image

i just knew it Laughing

just found no idea why nobody mentioned Rolling Eyes Rolling Eyes
Post 12 Aug 2006, 21:58
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
what is skyos?
Post 13 Aug 2006, 11:10
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
idk much about skyos, just found it under osnews.com and its interface looks cool :p

wiki wrote:

SkyOS is a proprietary operating system developed by Robert Szeleney. It has existed since 1996, but what was once going to be released as version 5.0 has instead become a rewrite of the entire operating system from the ground up and this rewrite is now in development and testing. It was open source in its early stages, but is now proprietary.


you need a "serial number" if you wanna run the OS, pay USD30 to get the ISO or , promise to port a project to be their beta dev/tester :p

SkyOS Home Page
http://www.skyos.org/
SkyOS Tour
http://www.skyos.org/?q=node/414
SkyOS About
http://www.skyos.org/?q=node/408
Post 13 Aug 2006, 14:06
View user's profile Send private message Visit poster's website Reply with quote
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009
skyos is actually pretty nice looking. I haven't tried it, because... well, I'm not going to pay $30 for Beta software. But the interface looks nice and clean.
Post 13 Aug 2006, 14:45
View user's profile Send private message Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi
SkyOS is looking very tempting to buy Smile
My guess is that mattst80 who usually idles on #flatassembler has something to do with the Fasm-package addition.
Post 13 Aug 2006, 15:59
View user's profile Send private message MSN Messenger Reply with quote
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009
I think SkyOS could certainly rival Windows. It looks powerful, but newbie friendly. Those who are sick of Windows, but are afraid of Linux, should be jumping all over this.
Post 13 Aug 2006, 16:27
View user's profile Send private message Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi
DataHunter2009 wrote:
I think SkyOS could certainly rival Windows. It looks powerful, but newbie friendly. Those who are sick of Windows, but are afraid of Linux, should be jumping all over this.


Propably just not yet, it's BETA afterall...

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 13 Aug 2006, 16:31
View user's profile Send private message MSN Messenger Reply with quote
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009
I of course didn't mean now. Wink But it already looks very good, so imagine what the final version will be like. This is the type of OS I've always wanted to make... but, I'm not that good. Razz
Post 13 Aug 2006, 16:35
View user's profile Send private message Reply with quote
mattst88



Joined: 12 May 2006
Posts: 260
Location: South Carolina
mattst88
Yep, that was me. I was ridiculously simple.

Anyway, yes, FASM works in SkyOS, but I don't have much info on syscalls and such.

here's syscalls.h if anyone can explain to me how to use it:

Code:
#if defined(__INSIDE_LIBSKY__) || defined(__IMPLEMENTS_SYSCALL__)
#ifndef I_SYSCALL
#define I_SYSCALL

#ifndef KERNEL
#include <errno.h>
#endif

#ifndef NULL
#define NULL    ((void *)0)
#endif

#define __NR_sys_open              0
#define __NR_sys_close             1
#define __NR_sys_os_read           2
#define __NR_sys_write                     3            /* used for printf too */
#define __NR_sys_lseek          4
#define __NR_os_exit               5
#define __NR_sys_sysinfo          6
#define __NR_sys_set_quantum   7

#define __NR_sys_socket        8
#define __NR_sys_bind          9
#define __NR_sys_accept        10

#define __NR_sys_dup                       11
#define __NR_sys_dup2                      12
#define __NR_sys_connect               13

#define __NR_sys_spawn                     14
#define __NR_sys_findfirst                      15
#define __NR_sys_findnext                       16
#define __NR_sys_chdir                      17

#define __NR_sys_mount                          18
#define __NR_sys_umount                         19
#define __NR_sys_getcwd                         20
#define __NR_sys_brk                            21
#define __NR_sys_msgbox                 22
#define __NR_sys_ioctl                  23
#define __NR_sys_getpos         24
#define __NR_sys_module_alloc             25
#define __NR_sys_module_symbol_size               26
#define __NR_sys_module_get_symbolt       27
#define __NR_sys_module_init                    28
#define __NR_sys_exec                                   29
#define __NR_call_v86                                   30
#define __NR_os_image_info                              31
#define __NR_sys_get_ticks                              32
#define __NR_sys_sendto                                 33
#define __NR_sys_recvfrom                               34
#define __NR_sys_get_curtime                    35

#define __NR_sys_shutdown                               37
#define __NR_sys_readdir                                38
#define __NR_sys_cpe_set                                39
#define __NR_sys_createdir                              40
#define __NR_sys_ramdisk                                41
#define __NR_sys_sync                                   42
#define __NR_sys_cache_configure                43
#define __NR_sys_module_unload                  44
#define __NR_sys_semaphore                              45
#define __NR_sys_SystemInfo                             46
#define __NR_sys_getpid                                 47
#define __NR_sys_gettaskname                    48
#define __NR_sys_get_usec_counter               49

#define __NR_sys_RSMGetNodeByName               51
#define __NR_sys_RSMEnumNodes                   52
#define __NR_sys_send                                   53
#define __NR_sys_recv                                   54
#define __NR_sys_listen                                 55
#define __NR_sys_ioctlsocket                    56
#define __NR_sys_sleeptaskusec                  57
#define __NR_sys_fsinfo                                 58
#define __NR_sys_RSMSetEntry                    59
#define __NR_sys_debug_attach                   60
#define __NR_sys_debug_action                   61
#define __NR_sys_stat                                   70
#define __NR_sys_notify                                 71
#define __NR_sys_RSMGetEntry                    72
#define __NR_sys_RSMIterEntry                   73
#define __NR_sys_RegistryLoad                   74
#define __NR_sys_statfs                                 75
#define __NR_sys_unlink                                 76
#define __NR_sys_GetMeasurePoint                77
#define __NR_sys_GetMeasurePointByIndex 78
#define __NR_sys_GI_create_window       100
#define __NR_sys_GI_wait_message    101
#define __NR_sys_GI_rect                        102
#define __NR_sys_GI_line                        103
#define __NR_sys_GI_setpix                  104
#define __NR_sys_GI_post_message    105
#define __NR_sys_GI_blit                        106
#define __NR_sys_GI_text                        107
#define __NR_sys_GI_set_timer           108
#define __NR_sys_GI_destroy_window  109
#define __NR_sys_GI_set_mouse_pointer 110
#define __NR_sys_GI_get_resolution  111
#define __NR_sys_GI_setup_GFX       112
#define __NR_sys_GI_compute_screen_coordinates 113
#define __NR_sys_GI_set_dimension       114
#define __NR_sys_GI_palette_set_logical 115
#define __NR_sys_GI_beginpaint  116
#define __NR_sys_GI_endpaint    117
#define __NR_sys_GI_window_info 118
#define __NR_sys_GI_get_next_handle 119
#define __NR_sys_GI_window_set_state 120
#define __NR_sys_GI_color_free           121
#define __NR_sys_GI_color_get            122
#define __NR_sys_GI_install_font         123
#define __NR_sys_GI_get_font             124
#define __NR_sys_GI_enum_fonts           125
#define __NR_sys_GI_capture_screen   126
#define __NR_sys_GI_sound_play           127
#define __NR_sys_GI_sound_setup          128
#define __NR_sys_GI_sound_max_buffer 129
#define __NR_sys_GI_query_message    130
#define __NR_sys_GI_redraw_window    131
#define __NR_sys_closesocket             132
#define __NR_sys_kill                            133
#define __NR_sys_task_info                       134
#define __NR_sys_wait_for_task_state 135
#define __NR_sys_syslog_set                      136
#define __NR_sys_GI_copy_rect            137
#define __NR_sys_theme_get               138
#define __NR_sys_theme_set               139
#define __NR_sys_GI_mouse_get            140
#define __NR_sys_clipboard_add           141
#define __NR_sys_clipboard_get           142
#define __NR_sys_GI_kill_timer           143
#define __NR_sys_GI_circle                       144
#define __NR_sys_SystemEventServices_Initialize 145
#define __NR_sys_style_set                       146
#define __NR_sys_style_get           147
#define __NR_sys_DllInfo                 148
#define __NR_sys_DllLoad                         149
#define __NR_sys_DllUnload                       150
#define __NR_sys_DllGetFunction      151
#define __NR_sys_GI_redraw_region    152
#define __NR_sys_TimeDebug                       153
#define __NR_sys_GI_request_fullscreen 154
#define __NR_sys_SetKeyMap 155
#define __NR_sys_GI_GetResource         156
#define __NR_sys_GetNetStatistic        157
#define __NR_sys_GI_set_high_timer     158
#define __NR_sys_RSMGetNodeWithIndex   159

#define __NR_sys_getsockopt                             160
#define __NR_sys_setsockopt                             161
#define __NR_sys_select                                 162
#define __NR_sys_sethostname                    163
#define __NR_sys_gethostname                    164
#define __NR_sys_isatty                                 165
#define __NR_sys_fcntl                                  166
#define __NR_sys_getsockname                    167
#define __NR_sys_getpeername                    168
#define __NR_sys_SetCapture                             169
#define __NR_sys_GI_set_focus                   170
#define __NR_sys_debug_data                             171
#define __NR_sys_GI_SetWindowCap                172
#define __NR_sys_mem_dump                               173
#define __NR_sys_settaskstate                   174
#define __NR_sys_tasklogging                    175
#define __NR_sys_seek                                   176
#define __NR_sys_system_busy                    177
#define __NR_sys_fork                                   178
#define __NR_sys_waitpid                            179
#define __NR_sys_utime                                  180
#define __NR_sys_GI_GetWindow                           181
#define __NR_sys_GI_GetDataMessage      182
#define __NR_sys_RegisterMessageDumper  183
#define __NR_sys_GI_SetWindowValue         184
#define __NR_sys_GI_Lock                                185
#define __NR_sys_CheckBootOption        186
#define __NR_sys_GI_SetWindowBitmap             187
#define __NR_sys_GetBootKey                             188
#define __NR_sys_GI_AddTransparentRect  189
#define __NR_sys_GI_GetMousePos         190
#define __NR_sys_pipe                                   191
#define __NR_sys_ShdMem                                 192
#define __NR_sys_GI_SetMousePointerImage 193
#define __NR_sys_NetFilterStart         194
#define __NR_sys_NetFilterGetNextPacket 195
#define __NR_sys_opendir                                196
#define __NR_sys_closedir                               197
#define __NR_sys_listener_register              198
#define __NR_sys_listener_unregister    199
#define __NR_sys_fs_initialize                  200
#define __NR_sys_SendSignal                             201
#define __NR_sys_SignalSetHandler               202
#define __NR_sys_return                                 203
#define __NR_sys_GetProcessImageName    204
#define __NR_sys_GI_SetWindowTitle              205
#define __NR_sys_GI_WindowAtPointer     206
#define __NR_sys_rewinddir                              207
#define __NR_sys_tls_alloc                              208
#define __NR_sys_tls_free                               209
#define __NR_sys_tls_set                                210
#define __NR_sys_tls_get                                211
#define __NR_sys_SystemEvent                    212
#define __NR_sys_profile                                213
#define __NR_sys_RegistrySerializeEnable 214
#define __NR_sys_AttributeRead                  215
#define __NR_sys_AttributeOpenDirectory 216
#define __NR_sys_AttributeCloseDirectory 217
#define __NR_sys_AttributeReadDirectory 218
#define __NR_sys_GetApplicationDirectory 219

#define __NR_sys_DataExchangePortRegister 220
#define __NR_sys_DataExchangePortConnect  221
#define __NR_sys_DataExchangePortRead     222
#define __NR_sys_DataExchangePortWrite    223
#define __NR_sys_DataExchangePortBlocking 224
#define __NR_sys_DataExchangePortRelease  225
#define __NR_sys_BootStep                                 226
#define __NR_sys_SwitchSecurityContext    227
#define __NR_sys_uname                                    228
#define __NR_sys_GI_SetMousePos                         229
#define __NR_sys_GI_HideMouseCursor                     230
#define __NR_sys_GetFSCapability                        231
#define __NR_sys_dump_fd                                        232
#define __NR_sys_sigprocmask                            233
#define __NR_sys_setpgid                                        234
#define __NR_sys_getpgid                                        235
#define __NR_sys_getppid                                        236
#define __NR_sys_MapVirtualKey                          237
#define __NR_sys_GI_register_accelerator        238
#define __NR_sys_setsid                                         239
#define __NR_sys_getsid                                         240
#define __NR_sys_tweak                                          241
#define __NR_sys_GI_KeyStateGet                         242
#define __NR_sys_GI_RaiseWindowToTop            243
#define __NR_sys_rename                                         244
#define __NR_sys_GI_InjectMouseAction           245
#define __NR_sys_GI_InjectKeyAction                 246
#define __NR_sys_GI_GetMouseState                       247
#define __NR_sys_MemoryMap                                      248
#define __NR_sys_MemoryUnMap                            249
#define __NR_sys_usleep                                         250
#define __NR_sys_SemaphoreCreateEtc                     251
#define __NR_sys_SemaphoreCreate                        252
#define __NR_sys_SemaphoreDelete                        253
#define __NR_sys_SemaphoreDeleteEtc                     254
#define __NR_sys_SemaphoreAcquire                       255
#define __NR_sys_SemaphoreAcquireEtc            256
#define __NR_sys_SemaphoreRelease                       257
#define __NR_sys_SemaphoreReleaseEtc            258
#define __NR_sys_SemaphoreGetCount                      259
#define __NR_sys_SemaphoreInfo                          260
#define __NR_sys_DataExchangePortDataAvailable 261
#define __NR_sys_ThreadResume                           262
#define __NR_sys_TaskInfo                                       263
#define __NR_sys_GI_PosInWindow                         264
#define __NR_sys_MultipleObjectWait                     265
#define __NR_sys_MemoryMapGet                           266
#define __NR_sys_SystemGetVolumeInformation 267
#define __NR_sys_GetInternalOSVersion       268
#define __NR_sys_symlink                                        269
#define __NR_sys_readlink                                       270
#define __NR_sys_DataExchangePortWriteTo        271
#define __NR_sys_DataExchangePortWriteToBroadcast       272
#define __NR_sys_ThreadSetPriority                      273
#define __NR_sys_SystemNotificationsGet         274
#define __NR_sys_sigsuspend                                     275
#define __NR_sys_GetPidOfTask                           276
#define __NR_sys_alarm                                          277
#define __NR_sys_ThreadYield                            278
#define __NR_sys_QueryOpen                                      279
#define __NR_sys_QueryClose                                     280
#define __NR_sys_QueryRead                                      281
#define __NR_sys_GetParentNode                          282
#define __NR_sys_IndexCreate                            283
#define __NR_sys_IndexRemove                            284
#define __NR_sys_IndexOpen                                      285
#define __NR_sys_IndexRead                                      286
#define __NR_sys_IndexClose                                     287
#define __NR_sys_LastInputActivity                      288
#define __NR_sys_GI_DirectAccess                        289
#define __NR_sys_IsDebugKernel                          290
#define __NR_sys_GetInternalBuildNumber         291
#define __NR_sys_TaskLogData                            292
#define __NR_sys_DragAndDropServiceStart        293
#define __NR_sys_DragAndDropCancel                      294
#define __NR_sys_DragAndDropDrop                        295
#define __NR_sys_DragAndDropAllow                       296
#define __NR_sys_GI_DragAndDropInProgress       297
#define __NR_sys_GI_DragAndDropDeny                     298
#define __NR_sys_GI_GetWindowValue                      299
#define __NR_sys_fsync                                          300
#define __NR_sys_DesktopComposing                       301
#define __NR_sys_GI_TranslationChanged          302
#define __NR_sys_TaskFlagSet                            303
#define __NR_sys_TaskFlagClear                          304
#define __NR_sys_TaskFlagsGet                           305
#define __NR_sys_gettimeofday                           306
#define __NR_sys_GI_RegisterGestureExecutor 307
#define __NR_sys_TraceAction                            308
#define __NR_sys_sysconf                                        309
#define __NR_sys_MemAreaAlloc                           310
#define __NR_sys_MemAreaMap                                     311
#define __NR_sys_GI_WindowSetIcon                       312
#define __NR_sys_GI_WindowGetIcon                       313
#define __NR_sys_UpdateMeasurePoint                     314
#define __NR_sys_AddMeasurePoint                        315
#define __NR_sys_HeapAlloc                                      316
#define __NR_sys_HeapResize                                     317
#define __NR_sys_ThreadDetach                           318
#define __NR_sys_SecurityContextCheckCurrentProcess 319
#define __NR_sys_GI_set_window_mouse_pointer    320
#define __NR_sys_listener_register_thread   321
#define __NR_sys_CheckFilePermission            322
#define __NR_sys_FilePermissionAuthentificate 323
#define __NR_sys_GetFunctionName        324
#define __NR_sys_mmap   325
#define __NR_sys_munmap 326
#define __NR_sys_KernelDebuggerEnter 327
#define __NR_sys_mprotect       328
#define __NR_sys_msync          329
#define __NR_sys_GI_WindowUnlink 330
#define __NR_sys_GI_WindowLink 331
#define __NR_sys_GI_compute_window_coordinates 332
#define __NR_sys_GI_WindowOwnSet        333
#define __NR_sys_GIWM_LayerCommand 334
#define __NR_sys_GI_WindowSetDefaultColor 335
#define __NR_sys_GI_WindowTransparency 336
#define __NR_sys_chmod 337
#define __NR_sys_exit_code 338
#define __NR_sys_getprocesspid 339
#define __NR_sys_clipboard_clear 340


asm (".L__X'%ebx = 1\n\t"
     ".L__X'%ecx = 2\n\t"
     ".L__X'%edx = 2\n\t"
     ".L__X'%eax = 3\n\t"
     ".L__X'%esi = 3\n\t"
     ".L__X'%edi = 3\n\t"
     ".L__X'%ebp = 3\n\t"
     ".L__X'%esp = 3\n\t"
     ".macro bpushl name reg\n\t"
     ".if 1 - \\name\n\t"
     ".if 2 - \\name\n\t"
     "pushl %ebx\n\t"
     ".else\n\t"
     "xchgl \\reg, %ebx\n\t"
     ".endif\n\t"
     ".endif\n\t"
     ".endm\n\t"
     ".macro bpopl name reg\n\t"
     ".if 1 - \\name\n\t"
     ".if 2 - \\name\n\t"
     "popl %ebx\n\t"
     ".else\n\t"
     "xchgl \\reg, %ebx\n\t"
     ".endif\n\t"
     ".endif\n\t"
     ".endm\n\t"
     ".macro bmovl name reg\n\t"
     ".if 1 - \\name\n\t"
     ".if 2 - \\name\n\t"
     "movl \\reg, %ebx\n\t"
     ".endif\n\t"
     ".endif\n\t"
     ".endm\n\t"); 

#undef INLINE_SYSCALL

#define INLINE_SYSCALL(name, nr, args...) \
  ({                                                                          \
    unsigned int resultvar = INTERNAL_SYSCALL (name, , nr, args);             \
    (int) resultvar; })
 
/* Define a macro which expands inline into the wrapper code for a system
   call.  This use is for internal calls that do not need to handle errors
   normally.  It will never touch errno.  This returns just what the kernel
   gave back.  */
#undef INTERNAL_SYSCALL

# define INTERNAL_SYSCALL(name, err, nr, args...) \
  ({                                                                          \
    unsigned int resultvar;                                                   \
    asm volatile (                                                            \
    LOADARGS_##nr                                                             \
    "movl %1, %%eax\n\t"                                                      \
    "int $0xA0\n\t"                                                   \
    RESTOREARGS_##nr                                                          \
    : "=a" (resultvar)                                                        \
    : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc");                  \
    (int) resultvar; })

#undef INTERNAL_SYSCALL_DECL
#define INTERNAL_SYSCALL_DECL(err) do { } while (0)

#undef INTERNAL_SYSCALL_ERROR_P
#define INTERNAL_SYSCALL_ERROR_P(val, err) \
  ((unsigned int) (val) >= 0xfffff001u)

#undef INTERNAL_SYSCALL_ERRNO
#define INTERNAL_SYSCALL_ERRNO(val, err)        (-(val))

#define LOADARGS_0
# define LOADARGS_1 \
    "bpushl .L__X'%k2, %k2\n\t"                                               \
    "bmovl .L__X'%k2, %k2\n\t"

#define LOADARGS_2      LOADARGS_1
#define LOADARGS_3      LOADARGS_1
#define LOADARGS_4      LOADARGS_1
#define LOADARGS_5      LOADARGS_1

#define RESTOREARGS_0
#if defined I386_USE_SYSENTER && defined SHARED
# define RESTOREARGS_1 \
    "bpopl .L__X'%k3, %k3\n\t"
#else
# define RESTOREARGS_1 \
    "bpopl .L__X'%k2, %k2\n\t"
#endif
#define RESTOREARGS_2   RESTOREARGS_1
#define RESTOREARGS_3   RESTOREARGS_1
#define RESTOREARGS_4   RESTOREARGS_1
#define RESTOREARGS_5   RESTOREARGS_1

#define ASMFMT_0()
#define ASMFMT_1(arg1) \
        , "acdSD" (arg1)
#define ASMFMT_2(arg1, arg2) \
        , "adSD" (arg1), "c" (arg2)
#define ASMFMT_3(arg1, arg2, arg3) \
        , "aSD" (arg1), "c" (arg2), "d" (arg3)
#define ASMFMT_4(arg1, arg2, arg3, arg4) \
        , "aD" (arg1), "c" (arg2), "d" (arg3), "S" (arg4)
#define ASMFMT_5(arg1, arg2, arg3, arg4, arg5) \
        , "a" (arg1), "c" (arg2), "d" (arg3), "S" (arg4), "D" (arg5)


#define _syscall0(type,name) \
type name(void) \
{ \
        return INLINE_SYSCALL(name, 1, 0);\
}

#define _syscall1(type,name,atype,a) \
type name(atype a) \
{ \
        return INLINE_SYSCALL(name, 1, a);\
}

#define _syscall2(type,name,atype,a,btype,b) \
type name(atype a,btype b) \
{ \
        return INLINE_SYSCALL(name, 2, a, b);\
}

#define _syscall3(type,name,atype,a,btype,b,ctype,c) \
type name(atype a,btype b,ctype c) \
{ \
        return INLINE_SYSCALL(name, 3, a, b, c);\
}


#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
{ \
        return INLINE_SYSCALL(name, 4, arg1, arg2,arg3,arg4);\
} 

#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
{ \
        return INLINE_SYSCALL(name, 5, arg1, arg2,arg3,arg4,arg5);\
}
#endif


#endif
    


I'm interested in doing some asm coding, but I don't know enough. If there are any other headers that might be useful to figuring out this stuff, let me know which ones and I'll post them.

Btw, if anyone is interested in developing for SkyOS, you can Apply for Developer Access.

I was planning on posting here and letting people know, but I guess I forgot.
Post 13 Aug 2006, 16:37
View user's profile Send private message Visit poster's website Reply with quote
gunblade



Joined: 19 Feb 2004
Posts: 209
gunblade
Never heard of SkyOS either, but they seem to use unix-style syscall's. (Actually, at a second glance, it looks like just another linux distro. (I said LOOKS like, might not be.. but its sure damn close)).

The way you use those syscalls, is you put the number of the syscall you want to use into eax, then call an interrupt.

In linux, that interupt is 0x80, In SkyOS.. no idea, should be in the docs somewhere.

So to call the "exit" syscall, you would do:

Code:
mov eax, 1
mov ebx, 0   ; This is the return value, you find this out by doing "man 2 exit" in a terminal, (or man 2 <insert syscall name here> for others)
int 0x80    


Im gonna read up on skyos and edit this post to suit.

[edit]
Right, its not linux from what i can tell.. more like one of those windows-linux hybrids.

But the interrupt for kernel syscalls apears to be 0xA0

Therefore, say you wanted to call __NR_os_exit, you would do:

Code:
mov eax, 5
int 0xA0
    


Any arguments that the syscall takes, you would pass in ebx, ecx, etc.. (That's if they use unix-style syscalling, i believe BSD uses the stack rather than the registers)

This information might not be accurate, and probably isnt, if they have manpages in skyos, read them, they provide the most information on individual syscalls and such.
Post 13 Aug 2006, 17:46
View user's profile Send private message Reply with quote
mattst88



Joined: 12 May 2006
Posts: 260
Location: South Carolina
mattst88
With help from gunblade both on the forums and on IRC (#flatassembler on freenode) I got a hello world program working Smile

Code:
format ELF
public main

section '.text' executable align 16

main:
mov edx,len
mov ecx,msg
mov ebx,1
mov eax,3
int 0xA0

mov eax,5
mov ebx,0
int 0xA0

section '.data' writeable align 4

msg     db      'Hello, world!',0xa
len     = $ - msg
    
Post 13 Aug 2006, 18:42
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
Anybody know why they switched from PE to ELF?

P.S. Kudos on the FASM port, can't have too many! Wink
Post 13 Aug 2006, 19:54
View user's profile Send private message Visit poster's website Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi
I was wondering the change too, because what I've read from skyos.org whole project started back in '96 so it was going PE for quite a long time...
Post 13 Aug 2006, 20:18
View user's profile Send private message MSN Messenger Reply with quote
mattst88



Joined: 12 May 2006
Posts: 260
Location: South Carolina
mattst88
They (he: Robert Szeleney) decided to change because gcc was giving him a hard time, I think. ELF apparently makes this easier.
Post 13 Aug 2006, 23:24
View user's profile Send private message Visit poster's website Reply with quote
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009
I wonder when it'll come out of Beta. I might pay for it when it's stable.
Post 13 Aug 2006, 23:36
View user's profile Send private message Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
according the their page, http://www.skyos.org/?q=node/4
if you joined now, you would still get a final (out of beta) skyos in ISO image.

Currently SkyOS is in its beta stage. By joining the SkyOS Beta Program you will get access to these beta releases as well as the final version once its available. You get the following benefits when you join the SkyOS Beta Program:
- Download access to the newest beta version and all future beta versions until the final release
- SkyOS Final as a downloadable ISO image once its available
Post 14 Aug 2006, 01:11
View user's profile Send private message Visit poster's website Reply with quote
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009
Well, like I said, I'm not going to pay for Beta software. Wink
Post 14 Aug 2006, 02:04
View user's profile Send private message Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi
In case someone is interested:

Code:
_sys_open                               =       0
_sys_close                              =       1
_sys_os_read                            =       2
_sys_write                              =       3
_sys_lseek                              =       4
_os_exit                                =       5
_sys_sysinfo                            =       6
_sys_set_quantum                        =       7

_sys_socket                             =       8
_sys_bind                               =       9
_sys_accept                             =       10

_sys_dup                                =       11
_sys_dup2                               =       12
_sys_connect                            =       13

_sys_spawn                              =       14
_sys_findfirst                          =       15
_sys_findnext                           =       16
_sys_chdir                              =       17

_sys_mount                              =       18
_sys_umount                             =       19
_sys_getcwd                             =       20
_sys_brk                                =       21
_sys_msgbox                             =       22
_sys_ioctl                              =       23
_sys_getpos                             =       24
_sys_module_alloc                       =       25
_sys_module_symbol_size                 =       26
_sys_module_get_symbolt                 =       27
_sys_module_init                        =       28
_sys_exec                               =       29
_call_v86                               =       30
_os_image_info                          =       31
_sys_get_ticks                          =       32
_sys_sendto                             =       33
_sys_recvfrom                           =       34
_sys_get_curtime                        =       35

_sys_shutdown                           =       37
_sys_readdir                            =       38
_sys_cpe_set                            =       39
_sys_createdir                          =       40
_sys_ramdisk                            =       41
_sys_sync                               =       42
_sys_cache_configure                    =       43
_sys_module_unload                      =       44
_sys_semaphore                          =       45
_sys_SystemInfo                         =       46
_sys_getpid                             =       47
_sys_gettaskname                        =       48
_sys_get_usec_counter                   =       49

_sys_RSMGetNodeByName                   =       51
_sys_RSMEnumNodes                       =       52
_sys_send                               =       53
_sys_recv                               =       54
_sys_listen                             =       55
_sys_ioctlsocket                        =       56
_sys_sleeptaskusec                      =       57
_sys_fsinfo                             =       58
_sys_RSMSetEntry                        =       59
_sys_debug_attach                       =       60
_sys_debug_action                       =       61
_sys_stat                               =       70
_sys_notify                             =       71
_sys_RSMGetEntry                        =       72
_sys_RSMIterEntry                       =       73
_sys_RegistryLoad                       =       74
_sys_statfs                             =       75
_sys_unlink                             =       76
_sys_GetMeasurePoint                    =       77
_sys_GetMeasurePointByIndex             =       78
_sys_GI_create_window                   =       100
_sys_GI_wait_message                    =       101
_sys_GI_rect                            =       102
_sys_GI_line                            =       103
_sys_GI_setpix                          =       104
_sys_GI_post_message                    =       105
_sys_GI_blit                            =       106
_sys_GI_text                            =       107
_sys_GI_set_timer                       =       108
_sys_GI_destroy_window                  =       109
_sys_GI_set_mouse_pointer               =       110
_sys_GI_get_resolution                  =       111
_sys_GI_setup_GFX                       =       112
_sys_GI_compute_screen_coordinates      =       113
_sys_GI_set_dimension                   =       114
_sys_GI_palette_set_logical             =       115
_sys_GI_beginpaint                      =       116
_sys_GI_endpaint                        =       117
_sys_GI_window_info                     =       118
_sys_GI_get_next_handle                 =       119
_sys_GI_window_set_state                =       120
_sys_GI_color_free                      =       121
_sys_GI_color_get                       =       122
_sys_GI_install_font                    =       123
_sys_GI_get_font                        =       124
_sys_GI_enum_fonts                      =       125
_sys_GI_capture_screen                  =       126
_sys_GI_sound_play                      =       127
_sys_GI_sound_setup                     =       128
_sys_GI_sound_max_buffer                =       129
_sys_GI_query_message                   =       130
_sys_GI_redraw_window                   =       131
_sys_closesocket                        =       132
_sys_kill                               =       133
_sys_task_info                          =       134
_sys_wait_for_task_state                =       135
_sys_syslog_set                         =       136
_sys_GI_copy_rect                       =       137
_sys_theme_get                          =       138
_sys_theme_set                          =       139
_sys_GI_mouse_get                       =       140
_sys_clipboard_add                      =       141
_sys_clipboard_get                      =       142
_sys_GI_kill_timer                      =       143
_sys_GI_circle                          =       144
_sys_SystemEventServices_Initialize     =       145
_sys_style_set                          =       146
_sys_style_get                          =       147
_sys_DllInfo                            =       148
_sys_DllLoad                            =       149
_sys_DllUnload                          =       150
_sys_DllGetFunction                     =       151
_sys_GI_redraw_region                   =       152
_sys_TimeDebug                          =       153
_sys_GI_request_fullscreen              =       154
_sys_SetKeyMap                          =       155
_sys_GI_GetResource                     =       156
_sys_GetNetStatistic                    =       157
_sys_GI_set_high_timer                  =       158
_sys_RSMGetNodeWithIndex                =       159

_sys_getsockopt                         =       160
_sys_setsockopt                         =       161
_sys_select                             =       162
_sys_sethostname                        =       163
_sys_gethostname                        =       164
_sys_isatty                             =       165
_sys_fcntl                              =       166
_sys_getsockname                        =       167
_sys_getpeername                        =       168
_sys_SetCapture                         =       169
_sys_GI_set_focus                       =       170
_sys_debug_data                         =       171
_sys_GI_SetWindowCap                    =       172
_sys_mem_dump                           =       173
_sys_settaskstate                       =       174
_sys_tasklogging                        =       175
_sys_seek                               =       176
_sys_system_busy                        =       177
_sys_fork                               =       178
_sys_waitpid                            =       179
_sys_utime                              =       180
_sys_GI_GetWindow                       =       181
_sys_GI_GetDataMessage                  =       182
_sys_RegisterMessageDumper              =       183
_sys_GI_SetWindowValue                  =       184
_sys_GI_Lock                            =       185
_sys_CheckBootOption                    =       186
_sys_GI_SetWindowBitmap                 =       187
_sys_GetBootKey                         =       188
_sys_GI_AddTransparentRect              =       189
_sys_GI_GetMousePos                     =       190
_sys_pipe                               =       191
_sys_ShdMem                             =       192
_sys_GI_SetMousePointerImage            =       193
_sys_NetFilterStart                     =       194
_sys_NetFilterGetNextPacket             =       195
_sys_opendir                            =       196
_sys_closedir                           =       197
_sys_listener_register                  =       198
_sys_listener_unregister                =       199
_sys_fs_initialize                      =       200
_sys_SendSignal                         =       201
_sys_SignalSetHandler                   =       202
_sys_return                             =       203
_sys_GetProcessImageName                =       204
_sys_GI_SetWindowTitle                  =       205
_sys_GI_WindowAtPointer                 =       206
_sys_rewinddir                          =       207
_sys_tls_alloc                          =       208
_sys_tls_free                           =       209
_sys_tls_set                            =       210
_sys_tls_get                            =       211
_sys_SystemEvent                        =       212
_sys_profile                            =       213
_sys_RegistrySerializeEnable            =       214
_sys_AttributeRead                      =       215
_sys_AttributeOpenDirectory             =       216
_sys_AttributeCloseDirectory            =       217
_sys_AttributeReadDirectory             =       218
_sys_GetApplicationDirectory            =       219

_sys_DataExchangePortRegister           =       220
_sys_DataExchangePortConnect            =       221
_sys_DataExchangePortRead               =       222
_sys_DataExchangePortWrite              =       223
_sys_DataExchangePortBlocking           =       224
_sys_DataExchangePortRelease            =       225
_sys_BootStep                           =       226
_sys_SwitchSecurityContext              =       227
_sys_uname                              =       228
_sys_GI_SetMousePos                     =       229
_sys_GI_HideMouseCursor                 =       230
_sys_GetFSCapability                    =       231
_sys_dump_fd                            =       232
_sys_sigprocmask                        =       233
_sys_setpgid                            =       234
_sys_getpgid                            =       235
_sys_getppid                            =       236
_sys_MapVirtualKey                      =       237
_sys_GI_register_accelerator            =       238
_sys_setsid                             =       239
_sys_getsid                             =       240
_sys_tweak                              =       241
_sys_GI_KeyStateGet                     =       242
_sys_GI_RaiseWindowToTop                =       243
_sys_rename                             =       244
_sys_GI_InjectMouseAction               =       245
_sys_GI_InjectKeyAction                 =       246
_sys_GI_GetMouseState                   =       247
_sys_MemoryMap                          =       248
_sys_MemoryUnMap                        =       249
_sys_usleep                             =       250
_sys_SemaphoreCreateEtc                 =       251
_sys_SemaphoreCreate                    =       252
_sys_SemaphoreDelete                    =       253
_sys_SemaphoreDeleteEtc                 =       254
_sys_SemaphoreAcquire                   =       255
_sys_SemaphoreAcquireEtc                =       256
_sys_SemaphoreRelease                   =       257
_sys_SemaphoreReleaseEtc                =       258
_sys_SemaphoreGetCount                  =       259
_sys_SemaphoreInfo                      =       260
_sys_DataExchangePortDataAvailable      =       261
_sys_ThreadResume                       =       262
_sys_TaskInfo                           =       263
_sys_GI_PosInWindow                     =       264
_sys_MultipleObjectWait                 =       265
_sys_MemoryMapGet                       =       266
_sys_SystemGetVolumeInformation         =       267
_sys_GetInternalOSVersion               =       268
_sys_symlink                            =       269
_sys_readlink                           =       270
_sys_DataExchangePortWriteTo            =       271
_sys_DataExchangePortWriteToBroadcast   =       272
_sys_ThreadSetPriority                  =       273
_sys_SystemNotificationsGet             =       274
_sys_sigsuspend                         =       275
_sys_GetPidOfTask                       =       276
_sys_alarm                              =       277
_sys_ThreadYield                        =       278
_sys_QueryOpen                          =       279
_sys_QueryClose                         =       280
_sys_QueryRead                          =       281
_sys_GetParentNode                      =       282
_sys_IndexCreate                        =       283
_sys_IndexRemove                        =       284
_sys_IndexOpen                          =       285
_sys_IndexRead                          =       286
_sys_IndexClose                         =       287
_sys_LastInputActivity                  =       288
_sys_GI_DirectAccess                    =       289
_sys_IsDebugKernel                      =       290
_sys_GetInternalBuildNumber             =       291
_sys_TaskLogData                        =       292
_sys_DragAndDropServiceStart            =       293
_sys_DragAndDropCancel                  =       294
_sys_DragAndDropDrop                    =       295
_sys_DragAndDropAllow                   =       296
_sys_GI_DragAndDropInProgress           =       297
_sys_GI_DragAndDropDeny                 =       298
_sys_GI_GetWindowValue                  =       299
_sys_fsync                              =       300
_sys_DesktopComposing                   =       301
_sys_GI_TranslationChanged              =       302
_sys_TaskFlagSet                        =       303
_sys_TaskFlagClear                      =       304
_sys_TaskFlagsGet                       =       305
_sys_gettimeofday                       =       306
_sys_GI_RegisterGestureExecutor         =       307
_sys_TraceAction                        =       308
_sys_sysconf                            =       309
_sys_MemAreaAlloc                       =       310
_sys_MemAreaMap                         =       311
_sys_GI_WindowSetIcon                   =       312
_sys_GI_WindowGetIcon                   =       313
_sys_UpdateMeasurePoint                 =       314
_sys_AddMeasurePoint                    =       315
_sys_HeapAlloc                          =       316
_sys_HeapResize                         =       317
_sys_ThreadDetach                       =       318
_sys_SecurityContextCheckCurrentProcess =       319
_sys_GI_set_window_mouse_pointer        =       320
_sys_listener_register_thread           =       321
_sys_CheckFilePermission                =       322
_sys_FilePermissionAuthentificate       =       323
_sys_GetFunctionName                    =       324
_sys_mmap                               =       325
_sys_munmap                             =       326
_sys_KernelDebuggerEnter                =       327
_sys_mprotect                           =       328
_sys_msync                              =       329
_sys_GI_WindowUnlink                    =       330
_sys_GI_WindowLink                      =       331
_sys_GI_compute_window_coordinates      =       332
_sys_GI_WindowOwnSet                    =       333
_sys_GIWM_LayerCommand                  =       334
_sys_GI_WindowSetDefaultColor           =       335
_sys_GI_WindowTransparency              =       336
_sys_chmod                              =       337
_sys_exit_code                          =       338
_sys_getprocesspid                      =       339
_sys_clipboard_clear                    =       340    

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 14 Aug 2006, 02:37
View user's profile Send private message MSN Messenger Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2141
Location: Estonia
Madis731
Isn't it sad that the many years put into the free assembler have grown out to be so good and it takes little effort to put it almost anywhere (which is good). Wouldn't Tomasz need a little more credit!? I think they should pay tribute to him...not like a percentage of profit, but more like a one-shot investment Smile

I know one might probably say "but it is FREE". It doesn't mean that you CAN'T pay Razz if you want. I guess its on everybody's consciense. Afterall it makes EVERYBODY feel good. SkyOS can have mindpeace and Tomasz will have one more reason to develop FASM Wink - well for the FASM community. We should be all happy when someones effort is rewarded.

Of course if they already HAVE done something great in return - I'm sorry for these lines :$
Post 14 Aug 2006, 07:02
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
mattst88



Joined: 12 May 2006
Posts: 260
Location: South Carolina
mattst88
I'll look into it.

I assume you feel the same way about the GNU Project, Microsoft, Zeta, *BSDs. That is, they should all make donations since FASM works on their OS's too.
Post 14 Aug 2006, 13:06
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.