flat assembler
Message board for the users of flat assembler.

Index > OS Construction > How Compile TinyC & Fasm

Author
Thread Post new topic Reply to topic
dark_teo



Joined: 26 Jul 2005
Posts: 5
dark_teo
Help!!!!!!!!!
krn.c
void _start(void)
{

int a;
a=1;
}


boot.asm
format ELF
extrn '_start' as _start
section '.text'
jmp _start

and try it this command
fasm boot.asm
tcc -nostdlib -nostdinc -wl,--oformat,elf32-i386 krn.c
tcc -r -o test.o krn.o boot.o

but entry-point start krn.c
i want this after compile

jmp _start
_start:
int a;
a=1;


how compile binary file?????
Post 02 Feb 2007, 09:14
View user's profile Send private message Reply with quote
dazzit



Joined: 07 Jan 2007
Posts: 9
Location: Devon, UK
dazzit
I've briefly touched on this elsewhere but not without modifying TCC. I can't remember exactly what it was I had to do but if I remember correctly, the PE linker won't create a binary and the ELF linker even though it has been told to create a binary, still sticks the dynamic interpreter section at the start of the file. Tell it to link at a particular address and you'll also end up with up to 4K of padding up to a page boundary at the start. I really must find those sources if people are starting to show interest.
Theoretically, according to the manual it should be possible with certain command line flags but in practice, Fabrce Bellard moved on to develping FFDSHOW and PLEX86.
I'd actualy compiled a working bootloader and was part way through paged memory management when I got bored. I was develping the basic algorithms in 'C' and then migrating to assembler.
Post 05 Feb 2007, 14:33
View user's profile Send private message Reply with quote
dazzit



Joined: 07 Jan 2007
Posts: 9
Location: Devon, UK
dazzit
Ooops.. Qemu..
Post 05 Feb 2007, 21:47
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.