flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3 Next |
Author |
|
JohnFound 01 Dec 2015, 18:42
Well, this project has not been updated for a long time and is probably not compatible with the recent FreshLib changes. I will try to update the project today or tomorrow.
Notice that for KolibriOS, it works only with the network stack developed by hidnplayr. I am not sure it is already in the official distribution. |
|||
![]() |
|
Ray 01 Dec 2015, 23:23
Thanks!
Its already more than a year in the trunk and official KolibriOS builds. |
|||
![]() |
|
JohnFound 02 Dec 2015, 14:32
OK, I tested the project with the latest FreshLibDev version and actually it compiles at least for Win32 and Linux. There was some issues, but not related to the library.
You probably tried to compile the attached file from the first post, but it was really outdated. Now I deleted it in order to not mislead the readers anymore. Instead, use the Fossil repository of phWeb. The best option is to clone it with Fossil and then locally check out and work. This way you will always get the latest changes and if you are willing to develop the project further I can give you write access to the repository in order to push the changes. Now about KolibriOS port. There was some issues with the latest changes to the network stack, I updated the FreshLibDev branch on the Fresh IDE repository. These changes will be merged to the official version of Fresh IDE, but not instantly. So you need to checkout the FreshLIbDev branch and set your IDE "lib" alias to the directory of FreshLibDev: From the menu "Options|IDE options" and then select "lib" and press "Edit" button. I know this procedure is long, but phWeb and especially the KolibriOS port are on the edge of FreshLib/Fresh IDE development and you will need to apply some efforts. Regards |
|||
![]() |
|
Ray 02 Dec 2015, 17:09
Ok, thanks for that!
|
|||
![]() |
|
Ray 04 Dec 2015, 17:25
I tested latest changes of phWeb + FreshLibDev. Now phWeb can be compiled for all 3 supported platforms. I have tested Win32 version on WinXP and Linux version on Ubuntu. They worked good there.
Then I tried phWeb on the latest KolibriOS build and got PageFault exception. After debugging phWeb in mtdebug I've found two errors that lead to PageFault exception. The first error is in the file "FreshLibDev/system/KolibriOS/files.asm" procedure "body FileRead" line "stdcall StrPtr, [esi+__TFile.hFilename]". It passes first 4 bytes of the string to eax instead of pointer to it. I replaced that line with "lea eax, [esi+__TFile.hFilename]". The second one is in the file "phWeb/phWeb.asm" procedure "proc LoadConfiguration" line "stdcall StrCharCat, '.'". This procedure accepts two arguments instead of one. So I replaced it with "stdcall StrCharCat, eax, '.'". Some more work needed to make phWeb work properly on Kolibri, but at least it doesn't fall with PageFault. I hope you can apply this changes to make phWeb be more stable. |
|||
![]() |
|
JohnFound 04 Dec 2015, 22:57
@Ray - The second bug is real. I missed it because it is in the fall back code, that is executed only if there is no "WebSite.DocumentRoot" option in the configuration file. Now it is fixed in the repository.
But the first bug reported is elsewhere. Actually, the problem is that the OS dependent procedure "FileOpenAccess" was not implemented at all. There was simply empty stub and it returned some trash instead of open file handle. Now I implemented this procedure, so please update your library ("fossil revert", "fossil update" in the FreshLibDev directory). Unfortunately I can't test this code right now, so some bugs are still possible. |
|||
![]() |
|
Ray 05 Dec 2015, 18:03
I tried latest version of FreshLibDev with phWeb. There is still #PF because FileOpenAccess do not get control in proc CfgGetStr. mtdbg is very helpfull to step debug phWeb on Kolibri.
|
|||
![]() |
|
JohnFound 05 Dec 2015, 18:24
Well, probably bugs in FileOpenAccess. I will try to setup some testing platform. It is hard to debug code without some way to run it.
![]() |
|||
![]() |
|
JohnFound 06 Dec 2015, 11:27
I found where the problem is, but unfortunately there is no easy solution. CfgGetStr can work with filename string or open file handle as a input argument. In order to distinguish both it assumes all the pointers are above the first 64K and all the handles are below this limit. This is true in Linux and Windows but not in KolibriOS where the programs are loaded at address 0.
|
|||
![]() |
|
revolution 06 Dec 2015, 11:51
JohnFound wrote: I found where the problem is, but unfortunately there is no easy solution. CfgGetStr can work with filename string or open file handle as a input argument. In order to distinguish both it assumes all the pointers are above the first 64K and all the handles are below this limit. This is true in Linux and Windows but not in KolibriOS where the programs are loaded at address 0. |
|||
![]() |
|
JohnFound 06 Dec 2015, 14:19
revolution wrote: The sounds like a dangerous assumption even for Linux and Windows. Unless that is documented as part of the spec then the behaviour could change in a future update. It is dangerous assumption. These assumptions are used only internally in FreshLib and are not part of the user interface, so I can always change them. _________________ Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9 |
|||
![]() |
|
JohnFound 10 Dec 2015, 17:39
OK, with the latest commited versions of FreshLibDev and phWeb, the server starts in KolibriOS and even is able to serve one-two requests from the client. But I stuck on a problem that seems to be bug in the kernel. On random intervals, the listening socket hangs and stops to accept connections (system fn.75, subfn.5 simply hangs and does not return with or without error). The thread called SocketAccept hangs as well and it is not possible to kill it. This way, the whole OS have to be reboot.
For testing I am using QEMU as a KolibriOS machine and Firefox browser on the host machine. Of course some bugs in my code are also possible, but the fact that the hanging thread can not be killed indicates probably problem in the kernel. _________________ Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9 |
|||
![]() |
|
hidnplayr 13 Dec 2015, 11:09
I'm trying to compile phweb so I can debug the problem, but got stuck with the following error when compiling:
Code: Illegal instruction << dproc __ProcessOneSystemEvent, .hwnd, .wmsg, .wparam, .lparam PS: yes, I'm using latest source from fossil repositories. |
|||
![]() |
|
JohnFound 13 Dec 2015, 13:45
Welcome on FASM message board, hidnplayr. It is great to see you here!
![]() hidnplayr wrote: PS: yes, I'm using latest source from fossil repositories. Are you sure? "dproc" macro is deprecated in the latest FreshLibDev. Ensure you checked out FreshLib with "fossil co FreshLibDev". Also check the alias "%lib%" (or environment variable if you are using FASM for compilation). Also, if you are using plain FASM, don't forget about environment variable "%TargetOS%" = "KolibriOS". If the problem persists, please post the output of "fossil stat" in the directories of FreshLibDev and phWeb and describe in details your compilation process. _________________ Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9 |
|||
![]() |
|
hidnplayr 13 Dec 2015, 14:27
I'm using Fresh 2.2.5 (installer from fossil rep)
Code: D:\freshlibdev>fossil stat repository: D:/freshlibdev/FreshLibDev.fossil local-root: D:/freshlibdev/ config-db: C:/Users/hidnplayr/AppData/Local/_fossil checkout: 5516a8f95d013d72b1187f98b2c40588865c31e8 2015-11-29 06:18:02 UTC parent: 21f6f420b64b71e11a1a56dff69c97164fa5a5fe 2015-11-28 20:50:33 UTC tags: trunk comment: Missing release date fixed. (user: johnfound) Code: D:\kolibrios\phweb>fossil stat repository: D:/kolibrios/phweb/phWeb.fossil local-root: D:/kolibrios/phweb/ config-db: C:/Users/hidnplayr/AppData/Local/_fossil checkout: c30e7bfb6602b915a3085c99d5601436b4ead5bc 2015-12-10 14:36:43 UTC parent: 75d3e16e45a0b450d9231127fe921b12b7a88652 2015-12-04 23:12:48 UTC tags: trunk comment: Mainly added some debug output code in order to diagnose problems with KolibriOS port. (user: johnfound) I changed directorys in fresh IDE for libs etc to point to "D:\freshlibdev" Then I opened phWeb.fpr and hit ctrl+f9 in fresh IDE. |
|||
![]() |
|
JohnFound 13 Dec 2015, 14:56
You have checked out not the FreshLibDev branch, but the trunk branch of Fresh IDE. Please, enter the directory "D:/freshlibdev" and execute "fossil co FreshLibDev" then try to compile again. Notice that this will remove all the Fresh IDE code and only the FreshLib code will remain.
Check one more time the option TargetOS - see the screenshot. Of course, you can compile for Linux of Win32 as well.
|
||||||||||
![]() |
|
hidnplayr 13 Dec 2015, 15:15
JohnFound wrote: You have checked out not the FreshLibDev branch, but the trunk branch of Fresh IDE. Yes, that must have been the problem, I'm not used to this fossil system. It assembles now, time to squash some bugs. |
|||
![]() |
|
JohnFound 13 Dec 2015, 15:33
Oh, fossil is great and in fact very easy, but still needs some learning.
![]() About the phWeb, notice that I still may be wrong and the problem is in FreshLib interfaces to the KolibriOS network functions. You can check them in "freshlib/system/KolibriOS/network.asm". |
|||
![]() |
|
hidnplayr 13 Dec 2015, 17:21
JohnFound
Only problem noticed so far is stack corruption which results in page fault at address 0x4BE. Edit1: Perhaps freeing the stack and then using it is a bad idea ![]() Code: ; free the stack mov eax, sys_f68 mov ebx, 13 int $40 mov [__ThreadLock], 0 DebugMsg "Thread will be terminated now." Edit2: Another problem has been found, in kernel indeed. Need to investigate further. Last edited by hidnplayr on 13 Dec 2015, 18:42; edited 1 time in total |
|||
![]() |
|
Goto page Previous 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.