FreshLib первые шаги.

Discussing libraries simplifying applications development
  • Yes, I have been waiting for this.

    To help you, where could a programmer with some knowledge of FASM and the kolibrios API start to help you out?
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • А у Fossil нельзя скачать каталог одним zip-файлом, как у WebSVN? Непонятно ничего.
  • Freeman
    You can use fuel-scm - Fossil SCM GUI front-end.
    http://code.google.com/p/fuel-scm/
  • hidnplayr wrote:Yes, I have been waiting for this. To help you, where could a programmer with some knowledge of FASM and the kolibrios API start to help you out?
    First, download FreshLibDev branch from the repository. Or better clone the whole repository - then you will be always up to date. You will need Fossil in order to do it.
    There are sub directories "/KolibriOS" in "freshlib" directory. They contains all OS dependent part of FreshLib, related to KolibriOS. Just now, most of them contain placeholder procedures that do nothing. For example "freshlib/system/files.asm" contains different OS dependent file procedures: FileOpen, FileCreate, etc.
    So, just choose some of these files and implement the functionality of the placeholder procedures.
    I tried to keep the count of such OS dependent procedures as small as possible, so it should be relatively easy.
    The only possible trouble is that the most of the procedures are not documented, but you can check the functionality of Linux and Windows versions of the same procedures or simply ask me for explanations.
    Just inform me what library you choose to work on, in order to not make double work.

    The most convenient workflow is to make account in the Fossil repository. Then I will give you permissions to push to the repository, so you can directly checkout your changes there.
    Of course, everyone can simply send the code to me as well.
    Freeman wrote:А у Fossil нельзя скачать каталог одним zip-файлом, как у WebSVN? Непонятно ничего.
    Можно, только надо включится как анонимный потребитель. После етого появятся линки на .zip и .tar; А можно и адрес конкретной версии вручную задать: FreshLibDev
  • Мои поздравления и пожелания успеха!
  • Well, you can count me responsible for making networking/sockets work (on net branch)
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • hidnplayr wrote:Well, you can count me responsible for making networking/sockets work (on net branch)
    Very good! I wanted to leave it to the end, because don't like network programming very much. ;)
    So, you have to work on the library: "freshlib/system/KolibriOS/network.asm"
    It follows Berkeley socket library very close (but not exactly).
    You can check the respective implementations in Win32/network.asm and Linux/network.asm

    If you prefer to commit changes directly to fossil repository, just go, register yourself and send me a PM in order to set needed permissions.
  • Sorry but i'm not used to using fosil and my time is quite expensive right now, but i think this might just work...

    Code: Select all

    ; _______________________________________________________________________________________
    ;|                                                                                       |
    ;| ..::FreshLib::..  Free, open source. Licensed under "Fresh artistic license."         |
    ;|_______________________________________________________________________________________|
    ;
    ;  Description: OS dependent part of the network library.
    ;
    ;  Target OS: KolibriOS
    ;
    ;  Dependencies:
    ;
    ;  Notes:
    ;
    ;_________________________________________________________________________________________
    
    
    
    proc SocketCreate, .protocol_family, .socket_type, .protocol
    begin
            push    ebx ecx edx esi
    
            mov     eax, sys_socket
            mov     ebx, 0
            mov     ecx, [.protocol_family]
            mov     edx, [.socket_type]
            mov     esi, [.protocol]
            int     $40
    
            cmp     eax, -1                 ; if eax is -1, set carry flag
            cmc
    
            pop     esi edx ecx ebx
            return
    endp
    
    
    
    proc SocketClose, .hSocket
    begin
            push    ebx ecx
    
            mov     eax, sys_socket
            mov     ebx, 1
            mov     ecx, [.hSocket]
            int     $40
    
            cmp     eax, -1                 ; if eax is -1, set carry flag
            cmc
    
            pop     ecx ebx
            return
    endp
    
    
    
    proc SocketConnect, .hSocket, .pAddress
    begin
            push    ebx ecx edx esi
    
            mov     eax, sys_socket
            mov     ebx, 4
            mov     ecx, [.hSocket]
            mov     edx, [.pAddress]
            mov     esi, sizeof.TSocketAddress
            int     $40
    
            cmp     eax, -1                 ; if eax is -1, set carry flag
            cmc
    
            pop     esi edx ecx ebx
            return
    endp
    
    
    
    proc SocketBind, .hSocket, .pAddressIn
    begin
            push    ebx ecx edx esi
    
            mov     eax, sys_socket
            mov     ebx, 2
            mov     ecx, [.hSocket]
            mov     edx, [.pAddressIn]
            mov     esi, sizeof.TSocketAddressIn
            int     $40
    
            cmp     eax, -1                 ; if eax is -1, set carry flag
            cmc
    
            pop     esi edx ecx ebx
            return
    endp
    
    
    
    proc SocketListen, .hSocket, .maxPending
    begin
            push    ebx ecx edx
    
            mov     eax, sys_socket
            mov     ebx, 3
            mov     ecx, [.hSocket]
            mov     edx, [.maxPending]
            int     $40
    
            cmp     eax, -1                 ; if eax is -1, set carry flag
            cmc
    
            pop     edx ecx ebx
            return
    endp
    
    
    
    proc SocketAccept, .hSocket, .pAddress
    begin
            push    ebx ecx edx esi
    
            mov     eax, sys_socket
            mov     ebx, 5
            mov     ecx, [.hSocket]
            mov     edx, [.pAddress]
            mov     esi, sizeof.TSocketAddress
            int     $40
    
            cmp     eax, -1                 ; if eax is -1, set carry flag
            cmc
    
            pop     esi edx ecx ebx
            return
    endp
    
    
    
    proc SocketSend, .hSocket, .pBuffer, .DataLen, .flags
    begin
            push    ebx ecx edx esi edi
    
            mov     eax, sys_socket
            mov     ebx, 6
            mov     ecx, [.hSocket]
            mov     edx, [.pBuffer]
            mov     esi, [.DataLen]
            mov     edi, [.flags]
            int     $40
    
            cmp     eax, -1                 ; if eax is -1, set carry flag
            cmc
    
            pop     edi esi edx ecx ebx
            return
    endp
    
    
    proc SocketReceive, .hSocket, .pBuffer, .BufferSize, .flags
    begin
            push    ebx ecx edx esi edi
    
            mov     eax, sys_socket
            mov     ebx, 7
            mov     ecx, [.hSocket]
            mov     edx, [.pBuffer]
            mov     esi, [.BufferSize]
            mov     edi, [.flags]
            int     $40
    
            cmp     eax, -1                 ; if eax is -1, set carry flag
            cmc
    
            pop     edi esi edx ecx ebx
            return
    endp
    
    
    proc SocketSendTo, .hSocket, .pBuffer, .DataLen, .flags, .pAddressTo
    begin
            stc
            return
    endp
    
    
    proc SocketReceiveFrom, .hSocket, .pBuffer, .BufferSize, .flags, .pAddressFrom
    begin
            stc
            return
    endp
    
    
    ps: sys_socket = 75 (only for net branch)
    Last edited by hidnplayr on Tue Oct 23, 2012 1:10 pm, edited 1 time in total.
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • hidnplayr wrote:Sorry but i'm not used to using fosil and my time is quite expensive right now, but i think this might just work...
    No problem at all. The code looks great! I will test it and will let you know if there are some problems.

    Thank you.
  • hidnplayr wrote:ps: sys_socket = 74 (only for net branch)
    А эти функции, когда будут в транке? Что нибудь конкретно планировано?
  • johnfound wrote:
    hidnplayr wrote:ps: sys_socket = 74 (only for net branch)
    А эти функции, когда будут в транке? Что нибудь конкретно планировано?
    Как только автор смержит с транком.
  • oops... sockets function is number 75, not 74 according to my documentation :) (wich is correct)
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • Значит все таки ф75, а не 74. Спасибо.
  • Who is online

    Users browsing this forum: No registered users and 2 guests