I want to build a dos and linux compatibile os

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.
Post Reply
alanturing2
Posts: 2
Joined: Fri Jan 19, 2007 5:00 pm

I want to build a dos and linux compatibile os

Post by alanturing2 »

I have write a OS that have a file system and a memory gestion.

Now i want write a loader that car run dos application and linux
terminal application.

Some one can help me?
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

DOS applications are a piece of cake to emulate. All you have to do is implement the same interrupts as DOS does. (That is as long as your os is 16-bit.)

Linux applications are somewhat more difficult. They require that you implement all calls on int 80. Shouldn't be too hard, FreeBSD has a linux compatibility layer you might want to look at.

However, DOS is 16bit and LInux is 32bit. Therefore, I would suggest you implement a DOS layer on top of the Linux layer. (Like DosBox.) This means you don't have to play with virtual x86 mode. :D
C8H10N4O2 | #446691 | Trust the nodes.
alanturing2
Posts: 2
Joined: Fri Jan 19, 2007 5:00 pm

Post by alanturing2 »

Tnx for the answare!!

Ok now i start emuleting 16 bit dos.

Do you know simple (but very simple ) project that do this?
User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Post by inflater »

MiniDOS (www.dex4u.com) is capable of running some small games (not bigger than 64KB due to real mode limit), and FreeDOS (www.freedos.org).

inflater
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
User avatar
gaf
Member
Member
Posts: 349
Joined: Thu Oct 21, 2004 11:00 pm
Location: Munich, Germany

Post by gaf »

Now i want write a loader that car run dos application and linux terminal application.
Building an emulation layer is everything but trivial for a hobby programmer. It's not only the huge number of system-calls that would have to be provided but also the complex system environment that make emulation a rather tedious task. Just have a look at the Wine project to get an idea how much work is really required..

Probably it should also be mentioned that most applications need a decently advanced operating-system to run properly. Being able to run a hello-world application written for linux is nice, but programmes doing something useful usually require things that your kernel just doesn't support yet. My advice is therefore that you continue working on your kernel until it has reached a certain level of maturity before even considering to go for linux or msdos compatibility.
Do you know simple (but very simple ) project that do this?
As already mentioned by Alboin dosbox should allow you to run legacy applications on a modern system. It was obviously written with multi-platform portability in mind as many systems have already adopted it.
inflater wrote:MiniDOS (www.dex4u.com) is capable of running some small games (not bigger than 64KB due to real mode limit), and FreeDOS (www.freedos.org)
Both of which are clones and not emulators. Of course they could be run as v86 tasks but with x86-64 in mind I would personally prefere to have some real emulation independant of the machine architecture.

regards,
gaf
Post Reply