Board.KolibriOS.org

Official KolibriOS board
It is currently Fri Aug 23, 2019 5:37 am

All times are UTC+03:00




Post new topic  Reply to topic  [ 24 posts ]  Go to page 1 2 Next
Author Message
PostPosted: Sat Oct 20, 2012 1:11 am 
Offline

Joined: Fri Feb 18, 2011 3:13 pm
Posts: 201
Начал я потихонько работать над порт FreshLib под Колибри. Дело пошло, потому что теперь в freshlib эсть heap manager, а он обязателен для работой библиотеки.
Пока сделано мало - можно посмотреть и скачать из репозитория.

А вот и очень простая тестовая програмка. Что важно, ето то что ету програмку можно компилировать для все три системы: Win32, Linux и Колибри и она будеть делать одно и то же. (хоть и немного - выводит поздравление на доски отладки). :lol:

Если кто нибудь хочет участвовать - добро пожаловать. :)


Attachments:
File comment: Чтобы скомпилировать надо иметь актуальную FreshLibDev и FASM 1.71 или Fresh 2.0.9 и выше.
FreshLibHello.zip [1.77 KiB]
Downloaded 220 times
Top
   
PostPosted: Sat Oct 20, 2012 12:02 pm 
Offline
Mentor/Kernel Developer
User avatar

Joined: Fri Jun 30, 2006 9:01 am
Posts: 1248
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


Top
   
PostPosted: Sat Oct 20, 2012 12:26 pm 
Offline
User avatar

Joined: Tue May 08, 2007 12:44 am
Posts: 346
А у Fossil нельзя скачать каталог одним zip-файлом, как у WebSVN? Непонятно ничего.

_________________
Разработчик языка программирования Кантор


Top
   
PostPosted: Sat Oct 20, 2012 2:37 pm 
Offline
Mentor
User avatar

Joined: Tue Jan 15, 2008 11:27 am
Posts: 752
Freeman
You can use fuel-scm - Fossil SCM GUI front-end.
http://code.google.com/p/fuel-scm/


Top
   
PostPosted: Sat Oct 20, 2012 3:11 pm 
Offline

Joined: Fri Feb 18, 2011 3:13 pm
Posts: 201
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


Top
   
PostPosted: Sat Oct 20, 2012 6:45 pm 
Offline

Joined: Mon Sep 24, 2007 11:11 am
Posts: 2814
Мои поздравления и пожелания успеха!


Top
   
PostPosted: Mon Oct 22, 2012 5:25 pm 
Offline
Mentor/Kernel Developer
User avatar

Joined: Fri Jun 30, 2006 9:01 am
Posts: 1248
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


Top
   
PostPosted: Mon Oct 22, 2012 5:45 pm 
Offline

Joined: Fri Feb 18, 2011 3:13 pm
Posts: 201
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.


Top
   
PostPosted: Mon Oct 22, 2012 8:04 pm 
Offline
Mentor/Kernel Developer
User avatar

Joined: Fri Jun 30, 2006 9:01 am
Posts: 1248
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:
; _______________________________________________________________________________________
;|                                                                                       |
;| ..::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)

_________________
"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


Last edited by hidnplayr on Tue Oct 23, 2012 1:10 pm, edited 1 time in total.

Top
   
PostPosted: Mon Oct 22, 2012 8:14 pm 
Offline

Joined: Fri Feb 18, 2011 3:13 pm
Posts: 201
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.


Top
   
PostPosted: Tue Oct 23, 2012 9:16 am 
Offline

Joined: Fri Feb 18, 2011 3:13 pm
Posts: 201
hidnplayr wrote:
ps: sys_socket = 74 (only for net branch)


А эти функции, когда будут в транке? Что нибудь конкретно планировано?


Top
   
PostPosted: Tue Oct 23, 2012 10:22 am 
johnfound wrote:
hidnplayr wrote:
ps: sys_socket = 74 (only for net branch)


А эти функции, когда будут в транке? Что нибудь конкретно планировано?

Как только автор смержит с транком.


Top
   
PostPosted: Tue Oct 23, 2012 1:00 pm 
Offline
User avatar

Joined: Tue Aug 25, 2009 4:45 pm
Posts: 794
johnfound: см. http://wiki.kolibrios.org/wiki/New_stack и http://wiki.kolibrios.org/wiki/New_network_api


Top
   
PostPosted: Tue Oct 23, 2012 1:16 pm 
Offline
Mentor/Kernel Developer
User avatar

Joined: Fri Jun 30, 2006 9:01 am
Posts: 1248
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


Top
   
PostPosted: Tue Oct 23, 2012 1:34 pm 
Offline

Joined: Fri Feb 18, 2011 3:13 pm
Posts: 201
Значит все таки ф75, а не 74. Спасибо.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 24 posts ]  Go to page 1 2 Next

All times are UTC+03:00


Who is online

Users browsing this forum: No registered users and 0 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited