flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > Asm driven CMS.

Goto page 1, 2, 3, 4, 5  Next
Author
Thread Post new topic Reply to topic
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 21 May 2012, 08:59
It is an old my idea to create fully asm driven web site.
So, I installed web server in home ( asm32.hopto.org - don't open it now by default it loads php based engine) with lighttpd web server and have started to port my PHP mini CMS (Fresh main site is based on it) to assembly.
You can see the most recent test .cgi here: http://asm32.hopto.org/index.cgi
Of course, I will post the sources, but little bit later.
The CGI engine is portable for Windows and Linux.

If someone knows about good enough web server written in FASM and supporting at least CGI - I can change the server as well and then it will be really "Powered by FASM". Very Happy

Stay tuned...

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 21 May 2012, 08:59
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 21 May 2012, 09:03
Quote:


SCRIPT_FILENAME=/home/www/asm32/



Although you are not a target, beware because there are people who just hack websites randomly. Wink
Post 21 May 2012, 09:03
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 21 May 2012, 09:29
Of course it is possible, but I made some effort (according my limited Linux skills) to protect the box. If you have some ideas about possible security holes, please share them and I will try to fix the holes. (with trowel if needed Wink )
Post 21 May 2012, 09:29
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4336
Location: Now
edfed 21 May 2012, 15:31
cooooool Smile
Post 21 May 2012, 15:31
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 21 May 2012, 16:10
The sources are published as always in fossil repository: Here
The good thing about such projects is that they reveal some missing features in FreshLib, so I have double profit - adding functions useful for the real life programming to FreshLib and creating useful programs in assembly. Smile
Post 21 May 2012, 16:10
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach 22 May 2012, 00:07
JohnFound wrote:
If someone knows about good enough web server written in FASM and supporting at least CGI - I can change the server as well and then it will be really "Powered by FASM". Very Happy

Stay tuned...

That is awesome! How do you store data, it would need some kind of fasm-db too. Wink

_________________
BOS homepage: http://bos.asmhackers.net/
Post 22 May 2012, 00:07
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 22 May 2012, 00:20
In the prototype (also written by me) the articles are stored as .txt files, formated with lightweight markup language similar to markdown. For example "*bold*" is rendered as bold and [some link] as a link.
Now I will make the markup language to be more "markdown compatible" and will implement some features I need. (for example online article posting).
Post 22 May 2012, 00:20
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 841
Location: Jakarta, Indonesia
TmX 22 May 2012, 05:59
How to get the source code?
Maybe

Code:
fossil checkout FreshLibDev    


?
Post 22 May 2012, 05:59
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 22 May 2012, 06:21
TmX wrote:
How to get the source code?


It is better to clone the whole repository (it is not so big):
Code:
; first clone
fossil clone http://chiselapp.com/user/johnfound/repository/FreshIDE/ Fresh.fossil

; then create folder for the checkout and open from this directory:
fossil open Fresh.fossil FreshLibDev

; later you can only do updates to stay up to date:
fossil update
    

Another way (IMHO not recommended) is to download the .zip file with the latest version. Go to the repository site and login as a anonymous user.
Then navigate to the needed latest revision of FreshLibDev branch in this case. There should be link for tarball and zip archives with the files.


For MiniMagAsm, the clone command will be similar:
Code:
fossil clone http://chiselapp.com/user/johnfound/repository/MiniMagAsm/ MiniMagAsm.fossil
    


If someone wants to participate to these projects, just register yourself on the repository pages and send me a notice. I will set the needed permissions in order to allow repository checkins. (of course you have full privileges on your local clone of the repositories).

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 22 May 2012, 06:21
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 22 May 2012, 11:01
Very Cool Cool, this would be great port to DexOS, with DexOS web server and OS coded in fasm.
That would truly be a fully fasm driven web site Wink
Post 22 May 2012, 11:01
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 22 May 2012, 11:56
Dex4u wrote:
Very Cool Cool, this would be great port to DexOS, with DexOS web server and OS coded in fasm.
That would truly be a fully fasm driven web site Wink


Yes, it would be cool. But you first have to make some effort and write the OS dependent part of FreshLib for DexOS. Wink

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 22 May 2012, 11:56
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach 22 May 2012, 15:35
JohnFound wrote:
Yes, it would be cool. But you first have to make some effort and write the OS dependent part of FreshLib for DexOS. Wink

What is required by the host OS to run FreshLib? Do you have some document about it, because checking all directories by hand in the repository isn't much fun. Wink Also I saw some threading/process handling code in there, how would you handle that in a single tasking OS?

_________________
BOS homepage: http://bos.asmhackers.net/
Post 22 May 2012, 15:35
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 22 May 2012, 16:31
bubach wrote:
JohnFound wrote:
Yes, it would be cool. But you first have to make some effort and write the OS dependent part of FreshLib for DexOS. Wink

What is required by the host OS to run FreshLib? Do you have some document about it, because checking all directories by hand in the repository isn't much fun. Wink Also I saw some threading/process handling code in there, how would you handle that in a single tasking OS?


Unfortunately, there is no document describing how to port FreshLib. I am writing one in the moment, but the work goes slow, because FreshLib is changing.

Generally, it is not so hard work to port FreshLib to any OS, because it uses relatively tiny OS dependent layer and most of the library is OS independent.

Actually, all OS dependent code is separated in directories named after the OS they serve. Linux and Win32 in this moment.
It is not necessary to implement all functionality. For example, if DexOS misses threads, the procedure ThreadCreate in the library "system/DexOS/process.asm" will always return error (CF=1).
The application that needs threads will have to properly manage this error and try to work without threads or in the worst case terminate properly.

If someone wants to port FreshLib to DexOS, or any other OS I will provide all possible assistance.
As I can see the possible problems - for most of the hobby OSes, the main problem will be to provide the memory management.
FreshLib uses heap functions in Win32 and malloc from LibC in Linux in order to be able to allocate small blocks of memory.
Most of the OS independent functions rely on dynamic memory objects, so it is essential.
In case, the OS does not provide such memory allocation mechanisms, the port will need to implement heap manager.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 22 May 2012, 16:31
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 841
Location: Jakarta, Indonesia
TmX 22 May 2012, 17:27
Hi JohnFound,
How do you test the CMS on Windows? Also using lighttpd?

Maybe you don't mind sharing the lighttpd.conf?
I'm stuck at error 403, and according to debugging log: ""NOT handling file as static file, extension forbidden"

My guess is this is the culprit:
Quote:


#### CGI module
#cgi.assign = ( ".php" => "C:/PHP/php-cgi.exe",
# ".pl" => "C:/Perl/perl.exe",
# ".cgi" => "C:/Perl/perl.exe" )


Update:
After changing the TargetOS into Win32, I got this error:
Quote:

Error: symbol already defined << CreateMenu dd RVA ..lbl?c9 >> user32.inc


Last edited by TmX on 22 May 2012, 17:51; edited 1 time in total
Post 22 May 2012, 17:27
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 22 May 2012, 17:43
I will definitely port FreshLib to DexOS, just need to finish the USB stack.
Post 22 May 2012, 17:43
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 22 May 2012, 18:39
TmX wrote:
Hi JohnFound,
How do you test the CMS on Windows? Also using lighttpd?

On windows I am testing using local server "nanoweb". For the Linux version I am using FTP client and upload directly to the server - it is experimental, so I don't care so much.

In nanoweb, the configuration string is:
Code:
ParseExt          = cgi CGI $SCRIPT_FILENAME    

In lighttpd, configuration I use is:
Code:
server.modules = (
        "mod_accesslog",
        "mod_access",
        "mod_compress",
#following one is important
        "mod_cgi",        
        "mod_fastcgi"
)

cgi.assign = ( ".cgi" => "" )    


Quote:
Maybe you don't mind sharing the lighttpd.conf?

I can't do it today, because the internet connection I have in this moment is really very bad, but the above excerpt should work.

Quote:
After changing the TargetOS into Win32, I got this error:

My fault. I named a procedure CreateMenu and forgot about Win32 function with the same name. It is fixed now - update the source with "fossil update" if you cloned the repository.
BTW, the latest 2 check ins are not tested at all, so some errors are possible.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 22 May 2012, 18:39
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 841
Location: Jakarta, Indonesia
TmX 23 May 2012, 02:41
Yes you're right.
I forgot this part:
Quote:

#### CGI module
cgi.assign = (".cgi" => "", ".exe" => "", "" => "")


Otherwise, lighttpd would not know what to do with CGI files

BTW, now it works
Image
Post 23 May 2012, 02:41
View user's profile Send private message Reply with quote
XVilka



Joined: 04 May 2011
Posts: 42
Location: Russia
XVilka 23 May 2012, 07:04
JohnFound: i've not finished porting some webserver to fasm, while most of work is done. I'll share sources today, stay tuned. Also it have support for CGI (though I'm thinking cgi not quite effective solution and can be changed to fastcgi or at least scgi - it is very simple - see whole specification here http://python.ca/scgi/protocol.txt )
Post 23 May 2012, 07:04
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 23 May 2012, 07:43
XVilka, I am waiting for your server. What OS it is written for? It will be good to be for Linux, though. Smile

XVilka wrote:
though I'm thinking cgi not quite effective solution and can be changed to fastcgi or at least scgi


I know cgi is not effective, and I think about using FastCGI or SCGI.
On the other hand, having several processes of assembly written CGI is quite different than running several instances of huge PHP or Perl interpreter.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 23 May 2012, 07:43
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
XVilka



Joined: 04 May 2011
Posts: 42
Location: Russia
XVilka 23 May 2012, 07:51
Now it is for Linux, going to port on KolibriOS too. Yes, but as assembly man you need to know how much scgi/fastcgi faster than pure cgi Wink And I think scgi can be preffered for this ultra-light server solution
Post 23 May 2012, 07:51
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, 3, 4, 5  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 cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.