Need help starting ....

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
fachamix
Posts: 21
Joined: Thu Oct 26, 2006 9:30 pm

Need help starting ....

Post 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 )
User avatar
ucosty
Member
Member
Posts: 271
Joined: Tue Aug 08, 2006 7:43 am
Location: Sydney, Australia

Post 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.
The cake is a lie | rackbits.com
User avatar
smiddy
Member
Member
Posts: 127
Joined: Sun Oct 24, 2004 11:00 pm
Location: In my cube, like a good leming. ;-)

Post 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.
fachamix
Posts: 21
Joined: Thu Oct 26, 2006 9:30 pm

but....

Post 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
fachamix
Posts: 21
Joined: Thu Oct 26, 2006 9:30 pm

I critic...

Post 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
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post 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.
fachamix
Posts: 21
Joined: Thu Oct 26, 2006 9:30 pm

ok....

Post 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
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post 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.
fachamix
Posts: 21
Joined: Thu Oct 26, 2006 9:30 pm

so......

Post 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
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: so......

Post 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 ?.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post 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
fachamix
Posts: 21
Joined: Thu Oct 26, 2006 9:30 pm

so

Post 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
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: so

Post 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: .
Last edited by Dex on Tue Nov 07, 2006 1:44 pm, edited 1 time in total.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post 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)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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.
Last edited by Brynet-Inc on Tue Nov 07, 2006 5:13 pm, edited 1 time in total.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Post Reply