Page 1 of 2

Need help starting ....

Posted: Sun Oct 29, 2006 4:01 pm
by fachamix
hello everyone thanks for read this topic.

i would like to know , what C compiler and what Assembler should i use to make a Real Mode 16 bit Operating System, or how my development evironment should look like.


thanks for read



(sorry for my english )

Posted: Sun Oct 29, 2006 9:12 pm
by ucosty
The only 16bit C compiler, off the top of my head, is the old Borland compilers. They are free to download from the Borland museum. Do a google search for that and you should find it.

As for assemblers, nasm works fine for 16bit code.

Posted: Sun Oct 29, 2006 10:18 pm
by smiddy
For an assembler I recommend FASM, it is a flat assembler that puts everything you write into the same place in the binary as where you put it in the text.

but....

Posted: Wed Nov 01, 2006 4:46 pm
by fachamix
PLEASE CONTINUE HELPING ME, DONT LEAVE ME ALONG WITH THIS!!!!!!!!!!

but ...............

Its true, Borland C gives me 16bit code, but! i cant convert the EXEs or COMs or OBJs files to pure binary later, so i can boot it.

And ,in case i compile and i produce a OBJ file, i want to mix it with a ASSEMBLER file, i cant find a LINKER that can link OBJs files and can give me a pure BINARY file ( IF ANYONE KNOWS ONE TALL ME, REMEBER I NEED 16bit CODE).

FASM (Flat Assembler) its a good alternative, but i dont want to make an OS using only assembler, bcause i would make myself crazy.

NASM is a better alternative ...... for me, because it gives me more output formats, BUT!!!!!!!!! if you know a way to use FASM and a C compiler to make a pure binary 16 bit code, TELL ME! jajajajaj :D



thanks a lot everyone, halp me

I critic...

Posted: Wed Nov 01, 2006 5:35 pm
by fachamix
i made a critic to Borland C, aboput writing a 16 bit OS with it, maybe my ignorance doesnt let me see that i CAN TRUELY make an OS with it, and i dont know how :P


if anyone knows how to make an 16 bit OS with Borland C tall me ( i mean, create a binary :p )


and read the post before it too please.




I REALLY WANT TO START MY 16 bit OS , BUT USING C (and of course ASSEMBLER, its always necesary), i use WinXP dont forget

Posted: Wed Nov 01, 2006 6:33 pm
by Dex
Y ou need OS loader for Dummies (thats its name)
http://alexfru.chat.ru/programming/los4d.zip
Info here:
http://alexfru.chat.ru/los4d_manual.html
It has what you want and should help you get started.

ok....

Posted: Sun Nov 05, 2006 6:33 pm
by fachamix
i read the article you advise me, but i still dont know .

the obnly thing i dont know is .............. WHAT C COMPILER I HAVE TO USE TO MAKE A 16bit Real Mode OS????????????


everybody keps saying to use Borland C o Turbo C but this two compilers can generate EXE , COM , DLL, or their respectives OBJs files.

As long as I am reading , i need something that can generate me a PURE BINARY program. Its this OK ??? or Im missing something.

can i really use this compielrs ????? how ??? please, i really need your help people, i am really entusiast about making a OS.

Maybe there is something I still dont see , but please reply me, try to guide me.

THNAKS A LOT EVERYONE

Posted: Sun Nov 05, 2006 7:39 pm
by Dex
I think your miss the point, your OS can be a exe or com file, all you need is some way to load your exe or com file some thing like this:
http://alexfru.chat.ru/epm.html#bootprog
My main OS "Dex4u" is a exe and by realmode OS (MiniDOS) is a com file.

so......

Posted: Mon Nov 06, 2006 8:56 am
by fachamix
so..... tell me if i understand what you are saying Dex4u:

Are you saying that I CAN MAKE MY 16bit OS using for example TurboC or BorlandC ??????????? and the only problem would be LOAD the program ????

what C compiler did you use to make your MiniDOS ????

remeber i use WinXP ( I have also Linux Mandrake, but i dont use it a lot because the router i have doesnt have the drivers for linux)


please POST a REPLY answering my question, thanks for everybody for clear mi ideas, i really thanks everyone.


THANKS A LOT

Re: so......

Posted: Mon Nov 06, 2006 9:41 am
by Dex
fachamix wrote: Are you saying that I CAN MAKE MY 16bit OS using for example TurboC or BorlandC ??????????? and the only problem would be LOAD the program ????
Yes as OS like FreeDos are code with it.
what C compiler did you use to make your MiniDOS ????
None it code in ASM.
remeber i use WinXP ( I have also Linux Mandrake, but i dont use it a lot because the router i have doesnt have the drivers for linux)
You may need to run turboC in DosBOX emulator ?.

Posted: Mon Nov 06, 2006 1:28 pm
by JAAman
everybody keps saying to use Borland C o Turbo C but this two compilers can generate EXE , COM , DLL, or their respectives OBJs files.
"exe", "com" and "DLL" are not file types, they are simply extensions that say this file is executable
As long as I am reading , i need something that can generate me a PURE BINARY program. Its this OK ??? or Im missing something.
"COM" is pure binary, it is the format used by CP/M and is a plain binary image, (and normally expects to be loaded at offset 0x100, and have CS==DS) -- quite easy to use, though the file length is limited to 65280 bytes

so

Posted: Tue Nov 07, 2006 7:43 am
by fachamix
so JAAman and Dex, lets see


I can start making my OS using TurboC. Generate an EXE file, i load it .

JAAman its that right ???, was Dex right saying i can make the OS generating a EXE file, so i wont be limited by the size of COMs files????


If YES, would i have aproblem using GRUB to LOAD the EXE file ????


¿?¿?¿¿?¿?¿?¿?¿?¿




--------------------------

thanks, thanks , thanks a lot people, i am from ARgentina, and my teachers only know the TEORY of operatign systems, but no one of them had ever try to program one, so you guys are the only people i can ask.

just for reading, thanks a lot.

I´ll wait for reply

Re: so

Posted: Tue Nov 07, 2006 8:46 am
by Dex
fachamix wrote: JAAman its that right ???, was Dex right saying i can make the OS generating a EXE file, so i wont be limited by the size of COMs files????
If you do not believe me when i tell you something, then i will not answer your stupid ?.
Typical C programmer :roll: .

Posted: Tue Nov 07, 2006 11:38 am
by Combuster
If YES, would i have aproblem using GRUB to LOAD the EXE file ????
GRUB is basically designed to boot protected mode operating systems. It does not recognize Dos executables.
The only thing you can possibly use GRUB for is to chainload a bootloader other than the default, but if you are booting from floppy or cd like most people, thats pretty pointless. Besides, chainloading EXEs wouldnt work as it isnt flat binary.

For the rest, you might want to formulate your questions better so we know what you plan to do and what not...

Dex: Glad my native tounge is BASIC 8)

Posted: Tue Nov 07, 2006 11:58 am
by Brynet-Inc
C is a very powerful language, Considering quite a few modern Operating Systems are written in C..

It was also developed for the original AT&T UNIX systems it should be treated with a bit more respect!.

I respect Assembly obviously, But it's really an architecture lock in and harder to maintain once the code base gets large compared to C. It's also instantly locked into a specific CPU platform. (A big reason why UNIX was ported to C..)

If you were programming on a small embedded system It's native Assembly language would likely be best. But for a full fledge OS in the 21st century it's just not really feasible to maintain a pure ASM code base anymore (Especially with a lot of developers..).

fachamix, You can find boot loaders that will load your .COM(Flat binary) or .EXE(MZ/PE it's really just an extension..) but be sure that in the code you do not use any libraries or include files from the borland C compiler. (And don't use any DOS interrupts)

I personally like using the a.out format or the ELF format.