flat assembler
Message board for the users of flat assembler.
Index
> MenuetOS > compilers for menuetos Goto page 1, 2 Next |
Author |
|
Wildwest 04 Jul 2006, 19:02
Look here - LCC port
http://meos.sysbin.com/viewtopic.php?t=535 |
|||
04 Jul 2006, 19:02 |
|
Octavio 06 Jul 2006, 12:05
Wildwest wrote: Look here - LCC port Thanks ,but i don´t understand the language used on the forum. |
|||
06 Jul 2006, 12:05 |
|
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 ?. |
|||
06 Jul 2006, 13:23 |
|
rugxulo 06 Jul 2006, 14:55
Babelfish will (somewhat) translate it: http://babelfish.altavista.com
Octavio wrote:
|
|||
06 Jul 2006, 14:55 |
|
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? |
|||
06 Jul 2006, 18:54 |
|
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. |
|||
07 Jul 2006, 14:34 |
|
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. |
|||
07 Jul 2006, 18:12 |
|
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 |
|||
07 Jul 2006, 19:39 |
|
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 ) 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.
|
|||||||||||
08 Jul 2006, 18:00 |
|
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. |
|||
13 Jul 2006, 14:38 |
|
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)
_________________ [img]http://img194.imageshack.us/img194/9575/argentino7no3ym.gif [/img] |
|||||||||||
13 Jul 2006, 20:13 |
|
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.
|
|||
14 Jul 2006, 04:59 |
|
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? |
|||
14 Jul 2006, 11:30 |
|
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 |
|||
14 Jul 2006, 12:10 |
|
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 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 |
|||
14 Jul 2006, 13:23 |
|
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 |
|||
14 Jul 2006, 13:34 |
|
profkid13 14 Jul 2006, 13:34
|
|||
14 Jul 2006, 13:34 |
|
Endre 14 Jul 2006, 19:22
lost wrote: 2Endre: 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. |
|||
14 Jul 2006, 19:22 |
|
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:
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(); } |
|||
14 Jul 2006, 20:21 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.