OS Development Under MS-DOS

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.
User avatar
DednDave
Posts: 18
Joined: Fri Feb 05, 2010 10:40 am
Location: Mesa, Arizona

Re: OS Development Under MS-DOS

Post by DednDave »

i am no turbo C expert :P
but, perhaps you could write it as a tiny model (.COM) program
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: OS Development Under MS-DOS

Post by Nathan »

No, I want to build a OS, not a Windows 3.11 :P
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: OS Development Under MS-DOS

Post by neon »

I personally recommend against flat binary kernels tbh. I would just parse the output executable of the compiler and linker of your choice and use that.

If you really want to go flat binary, you might be able to use exe2bin to convert the EXE to a flat binary. Or, you can just use a .COM file (its a flat binary) if Turbo C supports it.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: OS Development Under MS-DOS

Post by qw »

Nathan,
DednDave is right. Compile in TINY memory model and link to a COM file (TLINK can do this without EXE2BIN). Provide your own C0T.OBJ with ORG 0 (or ORG anything you like) instead of ORG 100H. Write a bootloader to load this file from your boot disk.

Roel

Edit: fixed typo.
Last edited by qw on Mon Feb 08, 2010 3:59 am, edited 1 time in total.
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: OS Development Under MS-DOS

Post by Nathan »

Very nice!
I'm going to test this and post here what I got. :D
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: OS Development Under MS-DOS

Post by qw »

neon wrote:I personally recommend against flat binary kernels tbh. I would just parse the output executable of the compiler and linker of your choice and use that.
I agree with you but I wouldn't recommend MZ-EXE.

Nathan,
Good luck!

Roel
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: OS Development Under MS-DOS

Post by neon »

Hello,
Hobbes wrote:I agree with you but I wouldn't recommend MZ-EXE.
While I would agree that EXE might not be best for beginners here, I would encourage anyone to use what is best for their projects' goals, whether it is EXE or not.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: OS Development Under MS-DOS

Post by qw »

Then the OP may like BootProg.
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: OS Development Under MS-DOS

Post by Nathan »

Hobbes wrote:Then the OP may like BootProg.
That's an awesome tool, but someone here already tried to use it?

Also, using Turbo C, as the compiler and BootProg as my bootloader. I can do a OS running VESA mode(or like VESA), as Windows 3.11?

Best Regards.
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:

Re: OS Development Under MS-DOS

Post by Combuster »

Necromancy alert.
"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
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: OS Development Under MS-DOS

Post by Nathan »

Combuster wrote:Necromancy alert.
[-X

Could you please isntead of make jokes, help me? :|
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: OS Development Under MS-DOS

Post by neon »

I am not sure I understand your question. Windows 3.11 didnt use VBE but it doesnt mean that you cant use it.

Also note its VBE not Vesa, Vesa is the organization that developed the VBE specs.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
montrom
Member
Member
Posts: 86
Joined: Thu May 13, 2010 1:45 pm

Re: OS Development Under MS-DOS

Post by montrom »

Hi, as long as the Boot Loader you use has the ability to set the VBE graphics mode, then you will be able to program the graphics code using the C language. You could also set the graphics mode after boot, using a vm86 method.
Visit the Montrom user page for more info.
User avatar
Nathan
Member
Member
Posts: 201
Joined: Sun Jul 19, 2009 1:48 pm
Location: Brazil
Contact:

Re: OS Development Under MS-DOS

Post by Nathan »

neon wrote:I am not sure I understand your question. Windows 3.11 didnt use VBE but it doesnt mean that you cant use it.

Also note its VBE not Vesa, Vesa is the organization that developed the VBE specs.
Thanks for adviding me. Now I know that they aren't the same thing. :)
montrom wrote:Hi, as long as the Boot Loader you use has the ability to set the VBE graphics mode, then you will be able to program the graphics code using the C language. You could also set the graphics mode after boot, using a vm86 method.
I'm going to take a look at vm86. Thanks.
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: OS Development Under MS-DOS

Post by qw »

Nathan, if you're developing a real mode OS, you don't need Virtual 8086 Mode at all.
Post Reply