flat assembler
Message board for the users of flat assembler.

Index > MenuetOS > compilers for menuetos

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 28 Jun 2006, 12:32
There have been developed a few compilers for menuetos. why fasm is the only one included on the current distros?
I have found sources of TCC for Menuet translated to Fasm, but any info about it, does it works? who did the port?
Post 28 Jun 2006, 12:32
View user's profile Send private message Visit poster's website Reply with quote
Wildwest



Joined: 13 Sep 2004
Posts: 100
Location: Russia
Wildwest 04 Jul 2006, 19:02
Post 04 Jul 2006, 19:02
View user's profile Send private message Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 06 Jul 2006, 12:05
Wildwest wrote:
Look here - LCC port
http://meos.sysbin.com/viewtopic.php?t=535

Thanks ,but i don´t understand the language used on the forum.
Post 06 Jul 2006, 12:05
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 06 Jul 2006, 13:23
Maybe you could look at this C compiler, as it user fasm as a backend
http://freshmeat.net/projects/simplec/?branch_id=44088&release_id=205235

Note: Its not for menuet, but may help ?.
Post 06 Jul 2006, 13:23
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 06 Jul 2006, 14:55
Babelfish will (somewhat) translate it: http://babelfish.altavista.com

Octavio wrote:
Wildwest wrote:
Look here - LCC port
http://meos.sysbin.com/viewtopic.php?t=535

Thanks ,but i don´t understand the language used on the forum.
Post 06 Jul 2006, 14:55
View user's profile Send private message Visit poster's website Reply with quote
Wildwest



Joined: 13 Sep 2004
Posts: 100
Location: Russia
Wildwest 06 Jul 2006, 18:54
The direct link is http://iam.gorodok.net/lcc41.zip
It is a C compiler, which translate code to ASM(which can be compiled by FASM). It work in Windows or DOS...

It would be interesting to see the "sources of TCC for Menuet translated to Fasm". Can you give a link?
Post 06 Jul 2006, 18:54
View user's profile Send private message Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 07 Jul 2006, 14:34
Wildwest wrote:
It would be interesting to see the "sources of TCC for Menuet translated to Fasm". Can you give a link?

http://www.menuetos.org/stuff32.htm small c compiler from Veselin.
I want to port it to my OS but i don´t know if it already works under menuetos.
Post 07 Jul 2006, 14:34
View user's profile Send private message Visit poster's website Reply with quote
Wildwest



Joined: 13 Sep 2004
Posts: 100
Location: Russia
Wildwest 07 Jul 2006, 18:12
>I want to port it to my OS but i don´t know if it already works under menuetos.

AFAIK, it work in MenuetOS and with some modification in KolibriOS, but it cannot work with large or 2d arrays and have some problems with includes. Example application is at first post here
http://meos.sysbin.com/viewtopic.php?t=519&start=15

PS: Usually "TCC" is http://fabrice.bellard.free.fr/tcc/
BTW, your OS is good.
Post 07 Jul 2006, 18:12
View user's profile Send private message Reply with quote
JMGK



Joined: 26 Aug 2005
Posts: 27
JMGK 07 Jul 2006, 19:39
Hi,

i posted, in the old meos board, a linker that accepted coff objs and output meos executables

with this tool, you could use visual c++ to produce meos executables... but seens the board dont exists anymore, and i cant find it in my sources archives

maybe one of the users of that old board downloaded and saved it

jmgk
Post 07 Jul 2006, 19:39
View user's profile Send private message Reply with quote
Endre



Joined: 29 Dec 2003
Posts: 215
Location: Budapest, Hungary
Endre 08 Jul 2006, 18:00
I think you don't need any extra compiler for MenuetOS. On linux I can use gcc for compiling executable for MenuetOS. I say linux since on Windows (cygwin, mingw) although you should also be able to use gcc, but there the linker doesn't support binary format (I reveal you it can be overcome).

To compile executables for MenuetOs on linux you need to create a linker script for MenuetOS and to implement syscalls of MenuetOS (some inline assembly).

Once I tried it out but not with C (it would have been too simple Smile) but with Ada. I used the gnat compiler. I implemented the famous EXAMPLE.ASM from the distribution floppy. And it really worked. The original EXAMPLE was 470 bytes while my Ada version 480. Not a big difference, however I didn't optimize everything, so there are pads of many bytes generated by the linker which are still to be eliminated. Maybe with bare C you could reach the size of the hand written code. I guess that a thoroughly written C-code can even be better. Not speaking about the productivity...

Now I've looked for it again to show you the opportunity you might want to exploit. I've made some changes on it, so it can happen that it doesn't want to work now, but the necessary corrections can be done also by you.

I reveal that you can do the same with gcc and g++, however in this latter case you will have troubles with virtual functions, but at least there is no problem with inharitance.


Description:
Download
Filename: gnat.tar.bz2
Filesize: 4.35 KB
Downloaded: 1145 Time(s)

Post 08 Jul 2006, 18:00
View user's profile Send private message Reply with quote
halyavin



Joined: 21 Aug 2004
Posts: 42
halyavin 13 Jul 2006, 14:38
I'm developing modification of TCC compiler for MenuetOS. Currenly the main problem is standart library.
Endre
There is one more problem with C++ - exceptions. Currently MenuetOS/KolibriOS doesn't support them.
Post 13 Jul 2006, 14:38
View user's profile Send private message Visit poster's website Reply with quote
DC740



Joined: 01 Oct 2004
Posts: 74
Location: Argentina
DC740 13 Jul 2006, 20:13
This is the tool that linked coff files into menuetos programs??? I could never make it work :S

EDIT: by the way... the script to compile menuetos binaries from gcc already has been done a long time ago... Jarek made it, I have a copy in my HD. if you want I can upload it to you (Doom 2, DOSBox, and Quake were ported to MenuetOS with that script)


Description: menuet coff linker... I could never make it work
Download
Filename: MEOSLINK.RAR
Filesize: 20.43 KB
Downloaded: 1166 Time(s)


_________________
[img]http://img194.imageshack.us/img194/9575/argentino7no3ym.gif
[/img]
Post 13 Jul 2006, 20:13
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 14 Jul 2006, 04:59
No offense to Jarek (spideros1), but I think he hasn't posted here in over a year, plus his website is down. So, go ahead and post whatever. Razz
Post 14 Jul 2006, 04:59
View user's profile Send private message Visit poster's website Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 14 Jul 2006, 11:30
halyavin wrote:
Currenly the main problem is standart library.

what kind of problem?
translation to assembly or Menuetos interface?
Post 14 Jul 2006, 11:30
View user's profile Send private message Visit poster's website Reply with quote
Endre



Joined: 29 Dec 2003
Posts: 215
Location: Budapest, Hungary
Endre 14 Jul 2006, 12:10
@DC740: I think if Jarek had known the gnu linker a bit more then he wouldn't have written this superfluous program. Even not with MSC. It's however not a script but a simple linker. This job can also be done by the standard gnu linker on linux (see my example), and also on windows. Although in this latter case you have to cut the first 2048 bytes as I remember (you can simply do it with dd). But why should you write an own linker? Nonsense.

@Halyavin: Yes, you're right, but if you know how exceptions/virtual functions/etc. work, then you can write the appropriate functions (library) that the linker could use to resolve the problems when building menuetos executable. It's not a big magic, but needs a bit more work at the beginning.


Last edited by Endre on 14 Jul 2006, 19:24; edited 1 time in total
Post 14 Jul 2006, 12:10
View user's profile Send private message Reply with quote
JMGK



Joined: 26 Aug 2005
Posts: 27
JMGK 14 Jul 2006, 13:23
DC740,

yes, the tool is this one... what problem you found using it?

in my tests, it worked so weel, that i was very proud of it Smile

you must remember that it dont have a libc for menuetos, so, if you use basic things like strcpy() and like, you need to code it yourself

jmgk
Post 14 Jul 2006, 13:23
View user's profile Send private message Reply with quote
lost



Joined: 14 Jul 2006
Posts: 3
lost 14 Jul 2006, 13:34
2Endre:
virtual function requires no run-time support, just link with .rdata* sections (mingw gcc 3.*?).

RTTI - too complex & too overheaded for meos.
run-time support for exeptions coming soon Wink
Post 14 Jul 2006, 13:34
View user's profile Send private message Reply with quote
profkid13



Joined: 21 Aug 2003
Posts: 111
profkid13 14 Jul 2006, 13:34
Post 14 Jul 2006, 13:34
View user's profile Send private message Reply with quote
Endre



Joined: 29 Dec 2003
Posts: 215
Location: Budapest, Hungary
Endre 14 Jul 2006, 19:22
lost wrote:
2Endre:
virtual function requires no run-time support, just link with .rdata* sections (mingw gcc 3.*?).
Unfortunately, it's not so simple. The compiler generates function calls in its own library (see e.g. /usr/lib/gcc/../libstdc++.a), ie it needs run-time support, but since there are standard linker scripts thus the linker does its job automagically on your usual OS and will link everything your code just needs. But if you're using your own simple linker script then you get error messages like these here:

undefined reference to `__cxa_pure_virtual'
undefined reference to `vtable for __cxxabiv1::__class_type_info'
undefined reference to `vtable for __cxxabiv1::__si_class_type_info'

So, for menuetos you have to either use those libraries or to write your own ones to resolve the problem. I don't know whether the first way is feasible.
Post 14 Jul 2006, 19:22
View user's profile Send private message Reply with quote
lost



Joined: 14 Jul 2006
Posts: 3
lost 14 Jul 2006, 20:21
my makefile:

Code:
OUTFILE = ex1
OUTFILE2 = ex2
OBJS2= asm_code.obj example2.o 
OBJS = asm_code.obj example1.o 
LIBS = libsikwl.a libmeos.a
GCCFEAT = gcc-min\unwind-sjlj.o

.SUFFIXES: .asm .obj

all : $(OBJS) $(OBJS2) $(LIBS)
        ld -n -nostdlib -nostdinclude  -T menuet.ld -o $(OUTFILE)  $(OBJS)  -Llib  -lsikwl -lmeos 
        objcopy $(OUTFILE) -O binary
        ld -n -nostdlib -nostdinclude  -T menuet.ld -o $(OUTFILE2) $(OBJS2) -Llib -lsikwl -lmeos 
        objcopy $(OUTFILE2) -O binary

.asm.obj:
        fasm $*.asm

.cpp.o:
        g++ -fno-rtti -fno-exceptions -O2 -c $*.cpp 

libsikwl.a:
        make -C sikwl all

libmeos.a:
        make -C meos all

clean:
        rm *.o
        rm *.obj
        rm lib/*.a
        mingw32-make -C sikwl clean
        mingw32-make     -C meos clean

rebuild: clean all    


Menuet.ld
Quote:

ENTRY(Start)
SECTIONS
{
.text 0x000000:
{
*(.text)
}

.data : {
*(.data)
*(.rdata*)
}
hEnd = . ;
.bss :
{
*(.bss)
*(.bss2)
}
Memory = . ;
}


Application:
Code:
//#include "meos/system.h"
#include "meos/memory.h"//TODO:MOVE TO system.h
#include "sikwl/sikwl.h"
using namespace sikwl;
extern void meMain() asm("meMain");
    extern "C" void __cxa_pure_virtual()
    {
                meos_exit();
    }
void meMain()
{
        mainWindow* wnd=new mainWindow("Example2: Some Static Controls",200,200,300,100,0x00CCFFCC|SKINNED_WINDOW);
    wnd->addWidget((sikWidget*)new sikLabel("LABEL!!!",30,30,200,200));
    wnd->show();
    while(wnd->run());
    wnd->close();
}    
Post 14 Jul 2006, 20:21
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  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 can 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.