Flat Binary with GCC
Posted: Sat Sep 28, 2002 8:53 am
Hi,
How can I create a flat binary file out of a single C source file, that can be loaded into a certain address and jumped to?
Lets say I have this in the c source file:
void k_main()
{
char *vid = ( char * ) 0xb8000;
int i = 0;
vid = 'A';
i++;
vid = 0x07;
while ( 1 )
{
}
}
I want this to be put into a flat binary file that can be loaded at an address and jumped to, it would then print the 'A' and then hang.
I have tried many tutorials on writing a simple c kernel, but I dont like them it should be much more simple, if gcc is so complex to use I will not use it.
Thanks.
How can I create a flat binary file out of a single C source file, that can be loaded into a certain address and jumped to?
Lets say I have this in the c source file:
void k_main()
{
char *vid = ( char * ) 0xb8000;
int i = 0;
vid = 'A';
i++;
vid = 0x07;
while ( 1 )
{
}
}
I want this to be put into a flat binary file that can be loaded at an address and jumped to, it would then print the 'A' and then hang.
I have tried many tutorials on writing a simple c kernel, but I dont like them it should be much more simple, if gcc is so complex to use I will not use it.
Thanks.