tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Implementing .macro gas syntax


From: Michael Matz
Subject: Re: [Tinycc-devel] Implementing .macro gas syntax
Date: Mon, 28 Jan 2019 01:18:01 +0100 (CET)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)

Hi,

On Sun, 27 Jan 2019, Giovanni Mascellani wrote:

16bit code gen, and certain other assembler constructs are still missing
as well (e.g. the easier .incbin), but yes, .macro is a large part of
what's still missing.

For my project I might be in a slightly easier situation: I already have
tcc running at ring 0 in protected mode (without pagination), and what I
want to do is to compile and load Linux directly (using tcc_relocate()).

Ah, yes, that definitely eases things.

generate a bzImage. Of course I will need to understand Linux 32 bits
boot protocol and fill appropriately boot_params when jumping in Linux,
but that still seems to be easier than generate the whole bzImage and
perform the 16 bits boot protocol.

You should be able to start from the multiboot startup I've added to my linux repo, it takes over from whatever multiboot loader in 32bit protected mode, i.e. that code is fully compilable by TCC, and the 32bit asm parts shouldn't be much hassle once .macro is there.

With these assumptions, it seems that the big missing thing in tcc is .macro, and that's why I directed my attention on it at once. Also because, on the other hand, using gcc is a compromise I cannot afford: I wish I was already able to build gcc at that level of bootstrap...

You need to start from a GCC version that still was written in C. A couple years ago x86-64 TCC was able to compile the last C variant of GCC, version 4.7.x.

I guess my idea was to error out when preproc and gas defined two macros
with the same name...

Also a possibility, depends on which one is easier and lighter on the fast paths in the preprocessor.


Ciao,
Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]