using gcc plz help
using gcc plz help
Hello everyone!
Well I have decided to shift to gcc and ld for developing my OS....
I am creating a RM OS and don't know how to use gcc and ld for creating a DOS COM file i.e. raw binary file that can be loaded into memory as it is fo exeution...
I am presently using turbo C++ for that...
I use:
tcc -c -r- -mt -2 file.cpp
this gives me file.obj
then I use:
tlink /t file kstart, kernel.bin
I also have a ksatrt.asm file which calls main() which I compiled and used above....
this gives me kernel.bin file. But I don't know how to use gcc for 16bit RM OS... Ihave tried many shots in dark but no one got right....
please help.....
Well I have decided to shift to gcc and ld for developing my OS....
I am creating a RM OS and don't know how to use gcc and ld for creating a DOS COM file i.e. raw binary file that can be loaded into memory as it is fo exeution...
I am presently using turbo C++ for that...
I use:
tcc -c -r- -mt -2 file.cpp
this gives me file.obj
then I use:
tlink /t file kstart, kernel.bin
I also have a ksatrt.asm file which calls main() which I compiled and used above....
this gives me kernel.bin file. But I don't know how to use gcc for 16bit RM OS... Ihave tried many shots in dark but no one got right....
please help.....
Re:using gcc plz help
Hi,
On Linux platforms, try the "BIN86" package (see http://www.cix.co.uk/~mayday/). This includes a C compiler, assembler, LD, etc all designed for producing real mode code. I'm not sure if there's a DOS/Windows port or not (I assume it can be compiled with CYGWIN on Windows)...
Cheers,
Brendan
I don't think there is a version of GCC that can produce 16 bit/real mode code (it's 32 bit or 64 bit only).Codemaster Snake wrote:I am creating a RM OS and don't know how to use gcc and ld for creating a DOS COM file i.e. raw binary file that can be loaded into memory as it is fo exeution...
On Linux platforms, try the "BIN86" package (see http://www.cix.co.uk/~mayday/). This includes a C compiler, assembler, LD, etc all designed for producing real mode code. I'm not sure if there's a DOS/Windows port or not (I assume it can be compiled with CYGWIN on Windows)...
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re:using gcc plz help
Yes,I got similar problem.
As gcc does not generate 16 bits code,that adds me lots of problem.
I suggest giving up the idea of building a real mode OS.
Protected mode is a little ugly ,but useful,isn't it
As gcc does not generate 16 bits code,that adds me lots of problem.
I suggest giving up the idea of building a real mode OS.
Protected mode is a little ugly ,but useful,isn't it
Re:using gcc plz help
So this means that I'kll have to switch my OS to PM to be able to use it with gcc...
That's a hell of a kind of problem... No I'll have to dig the **** of PM programming and then write my OS from the sctrach again....
That's a hell of a kind of problem... No I'll have to dig the **** of PM programming and then write my OS from the sctrach again....
Re:using gcc plz help
Plz can anyone explain me this script:
Code: Select all
/* Link.ld */
OUTPUT_FORMAT("binary")
ENTRY(start)
SECTIONS
{
.text 0x100000 :
{
code = .; _code = .; __code = .;
*(.text)
. = ALIGN(4096);
}
.data :
{
__CTOR_LIST__ = .; LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) *(.ctors) LONG(0) __CTOR_END__ = .;
__DTOR_LIST__ = .; LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) *(.dtors) LONG(0) __DTOR_END__ = .;
data = .; _data = .; __data = .;
*(.data)
. = ALIGN(4096);
}
.bss :
{
bss = .; _bss = .; __bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .; _end = .; __end = .;
}
INPUT(KStub.o Support.o OStream.o Interrupt.o kernel.o IStream.o Video.o string.o keyboard.o kbInt.o)
OUTPUT(bin\Kernel.bin)
Re:using gcc plz help
Code: Select all
OUTPUT_FORMAT("binary")
Code: Select all
ENTRY(start)
Code: Select all
.text 0x100000
Code: Select all
*(.text)
Code: Select all
. = ALIGN(4096);
Code: Select all
__CTOR_LIST__ = .; LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) *(.ctors) LONG(0) __CTOR_END__ = .;
Code: Select all
INPUT(KStub.o Support.o OStream.o Interrupt.o kernel.o IStream.o Video.o string.o keyboard.o kbInt.o)
Code: Select all
OUTPUT(bin\Kernel.bin)
Re:using gcc plz help
So this means that I can use this only with 32bit protected mode OS.