Board.KolibriOS.org

Official KolibriOS board
It is currently Mon May 20, 2019 12:09 pm

All times are UTC+03:00




Post new topic  Reply to topic  [ 30 posts ]  Go to page Previous 1 2
Author Message
PostPosted: Wed May 25, 2016 3:27 pm 
Offline
Mentor

Joined: Tue Mar 11, 2014 11:37 am
Posts: 184
I'm waiting for libimg wrappers :)

Netsurf needs it.

Go punk_joker!

_________________
---
Check out the Netsurf Web Browser for KolibriOS.
Read the wiki and happy hacking with KolibriOS!


Top
   
PostPosted: Mon Jun 20, 2016 5:28 am 
Offline

Joined: Tue Apr 12, 2011 11:19 pm
Posts: 1148
Wrapped for libini, while only the most used functions. In LIBINI_enum_sections and LIBINI_enum_keys, there is a problem, the program crashes after the first section, or key, that is, the next section is not transferred.

_________________
я лишь учусь


Top
   
PostPosted: Mon Jun 20, 2016 7:13 am 
Offline
Mentor

Joined: Tue Mar 11, 2014 11:37 am
Posts: 184
punk_joker wrote:
Wrapped for libini, while only the most used functions. In LIBINI_enum_sections and LIBINI_enum_keys, there is a problem, the program crashes after the first section, or key, that is, the next section is not transferred.


Make sure the alignment is correct . When I was writing the wrappers, i,faced some issues like this.
Also be careful with stacks becoming unbalanced after function calls etc

I think also the location of the imports was leading to an error in some wrapper. I added a comment to the relevant wrapper or assembly file, please check,them for reference.

_________________
---
Check out the Netsurf Web Browser for KolibriOS.
Read the wiki and happy hacking with KolibriOS!


Top
   
PostPosted: Mon Jun 20, 2016 8:43 pm 
Offline
Mentor
User avatar

Joined: Tue Jan 15, 2008 11:27 am
Posts: 752
punk_joker wrote:
Wrapped for libini, while only the most used functions. In LIBINI_enum_sections and LIBINI_enum_keys, there is a problem, the program crashes after the first section, or key, that is, the next section is not transferred.

Please write some tests. And it is necessary to define what should functions return? Now, it is 0 on success and mixture of -1 and 1 in other case. Btw dll.Load returns 1 on unsuccess.


Top
   
PostPosted: Wed Jun 22, 2016 11:24 am 
Offline
Mentor
User avatar

Joined: Tue Jan 15, 2008 11:27 am
Posts: 752
punk_joker

You can simplify the code.

For example, in kolibri_buf2d.h:
Code:
  int asm_init_status = init_buf2d_asm();
 
  /* just return asm_init_status? or return init_boxlib_asm() ?*/
 
  if(asm_init_status == 0)
    return 0;
  else
    return 1;


You really can use returned value of init_buf2d_asm:
Quote:
return init_buf2d_asm();

And in loadbuf2d.asm:
Code:
        
        stdcall dll.Load, @IMPORT
        test    eax, eax
        jnz     error
       
        mov eax, 0
        ret
       
error:
        mov eax, -1
        ret


It is possible to write such code as:
Code:
stdcall dll.Load, @IMPORT
test    eax, eax
jz     ok
xor eax, eax
dec eax
ok:
ret

if you want to return -1 on failure.
Or
Code:
stdcall dll.Load, @IMPORT
ret

if you want to return 1 on failure.

And it would be good style if 'SUCCESS' and 'FAILURE' constants were defined.


Top
   
PostPosted: Fri Jun 24, 2016 12:10 pm 
Offline

Joined: Tue Apr 12, 2011 11:19 pm
Posts: 1148
I'll do tonight code refactoring, and I will consider the comments. Thank you.

_________________
я лишь учусь


Top
   
PostPosted: Mon Jun 27, 2016 8:10 am 
Offline

Joined: Tue Apr 12, 2011 11:19 pm
Posts: 1148
Regarding example. I have not yet figured out completely from the assembly organization, and therefore preempted example with the necessary files that duplicate existing in the SVN. In the near future I will correct it.

_________________
я лишь учусь


Top
   
PostPosted: Thu Jun 30, 2016 5:12 pm 
Offline

Joined: Tue Apr 12, 2011 11:19 pm
Posts: 1148
In the attached file, the new version of the project organization. Folder Test in arhiae, to extract /сontrib.

From the current problems with the compilation of example via makefiles, when the program starts in KolibriOS starts and a console window.


Attachments:
test.7z [12.57 KiB]
Downloaded 126 times

_________________
я лишь учусь
Top
   
PostPosted: Wed Jul 06, 2016 1:19 pm 
Offline

Joined: Tue Mar 08, 2016 11:00 pm
Posts: 436
Add --subsystem windows to LDFLAGS
This sets needed flag in header, which is checked in newlibc startup code.


Top
   
PostPosted: Tue Jul 12, 2016 6:33 pm 
Offline

Joined: Sun Oct 30, 2011 6:43 pm
Posts: 1499
I found in loadboxlib.asm the following lines:
http://websvn.kolibrios.org/filedetails ... sm#line-37
Code:
editbox_key:
        mov [oldebp], ebp       ;Save ebp because GCC is crazy for it otherwise.
        pop ebp                 ;Save return address in ebp. Stack top is param now.
        mov eax, dword [press_key]
        call [edit_box_key]     ; The pointer we passed should be on the stack already.
        push ebp                ;push the return address back to stack
        mov ebp, [oldebp]
        ret
       
oldebp dd ?
press_key dd ?
What if more than one thread will use this code?

I paid attention to it because the situation is similar to the situation with my progressbar(this was fixed already) viewtopic.php?f=24&t=1220&start=270#p52844


Top
   
PostPosted: Mon Jul 18, 2016 1:50 pm 
Offline
Mentor
User avatar

Joined: Tue Jan 15, 2008 11:27 am
Posts: 752
punk_joker
How is it going?


Top
   
PostPosted: Fri Oct 21, 2016 12:50 pm 
Offline

Joined: Tue Mar 08, 2016 11:00 pm
Posts: 436
punk_joker wrote:
A detailed plan for the first half:

25 may - new project structure, example programm and makefile
27 may - final work on box_lib
29 may - wrapper for kmenu
2 june - wrapper for libimg (you need to deal with some issues)
5 june - libini, libio
9 june - archive
11 june - rasterworks
13 june - libgfx
15 june - buf2d
17 june - xml
18 june - libcrash
18 - 20 june - inspection checking, correcting possible errors

Статус на сегодня, в связи с окончанием обвязки box_lib. Цифра в списке - пункт из даты сверху
Пометки: + выполнено, ** - есть примеры, - нет
  • 25 +
  • 27 + ** (кроме colordialog)
  • 29 + **
  • 2 + **
  • 5 + (libio не нужна, все есть в libc)
  • 9 -
  • 11 +
  • 13 +
  • 15 +
  • 17 -
  • 18 -
  • http -(незаконч)
  • msgbox + **

Нужно еще задокументировать и рефакторить, но это в процессе применения.

Есть конечно и баги - вот по ним вопрос - куда бы их писать и отслеживать. Они (в моем ведении) больше относятся к box_lib, чем к обвязке


Top
   
PostPosted: Fri Oct 21, 2016 1:11 pm 
Offline

Joined: Tue Apr 12, 2011 11:19 pm
Posts: 1148
ColorDialog есть, он входит в proc_lib как и OpenDialog. А для него я писал обертку.

_________________
я лишь учусь


Top
   
PostPosted: Fri Oct 21, 2016 6:38 pm 
Offline

Joined: Tue Mar 08, 2016 11:00 pm
Posts: 436
punk_joker wrote:
ColorDialog есть, он входит в proc_lib как и OpenDialog. А для него я писал обертку.

Обертка есть, демки пока нет (комментарий относится к **).

Соответственно, где есть демки - в каком то объеме проверена и работоспособность.


Top
   
PostPosted: Fri Oct 21, 2016 8:38 pm 
Offline

Joined: Tue Apr 12, 2011 11:19 pm
Posts: 1148
По rasterworks демка у есть, хотя обертку надо доделать (сделать структуру буфера). Про баги писать в теме box_lib.

_________________
я лишь учусь


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

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:  
Powered by phpBB® Forum Software © phpBB Limited