Tutorial: Compile and Use FreeDOS 1.2

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Post Reply
User avatar
~
Member
Member
Posts: 1226
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Tutorial: Compile and Use FreeDOS 1.2

Post by ~ »

Watch the video tutorial (contains download, compilation and a test run in a 386DX):
http://www.youtube.com/watch?v=Uwk91x5KgPc


After watching this 40-minute tutorial and trying out the accompanying sample source distribution ZIP file, you should be able to compile and install FreeDOS 1.2, that is, the kernel and the COMMAND.COM console by yourself with no complications.

It shows you how to install to a floppy, but you can use Rufus to set up other media such as USB drives. You just need to replace the FreeDOS core system files created by Rufus, by the ones you compile.


For this tutorial you can use DOSBox, any 16 or 32-bit Windows or Wine, anything that has access to DOS.

For this we need:

- To compile the FreeDOS kernel with Turbo C++ 2.01.
- To compile COMMAND.COM (FreeCOM) with Turbo C++ 1.01.

It is critical that we use those versions, mainly for COMMAND.COM. If we don't , the console will lock up as soon as we execute a DIR command, before showing the file/free/size bytes information.

Apparently we can also use OpenWatcom for the kernel, but the cleanest tool options are indicated by default in the MAK scripts and BAT files (CLEAN.BAT, CONFIG.BAT and BUILD.BAT).


Source code and tools to install (contains a directory with the kernel and COMMAND.COM already compiled, and the config/build scripts already set up to make the process totally clear):
https://archive.org/download/FreeDOS1.2_2017_04_28/FreeDOS%201.2.zip



For FreeDOS 1.2, it's vital that we execute a DIR command right after it finishes loading, since it will show us if COMMAND.COM has been correctly compiled with the right tools (Turbo C++ 1.01).
_______________________________________________
_______________________________________________


Baseically, we need to set the following variables using SET, in CONFIG.BAT:


XNASM - Must point to the absolute path to NASM 0.98 for DOS.

TC2_BASE - Turbo C 2.01 - Base directory that contains BIN, H, LIB, BGI (for the kernel)...

TP1_BASE - Turbo C 1.01 - Base directory that contains BIN, H, LIB, BGI (for COMMAND.COM/FreeCOM)...

XUPX - We must comment it out or the compilation will think that the binaries are too big for a COM (or search an adequate UPX version).

XCPU - For Turbo C it must be 86, for OpenWatcom it can be 386.

XFAT - It's better for it to be 32 unless we don't want FAT32 support.

PATH - Must contain %TC2_BASE% and probably %TC2BASE%\bin . It must also contain %TP1_BASE% and probably %TP1_BASE%\bin .

NOTE: Once we compile the kernel, we must delete the install directory for Turbo C 2.01 or remove it from the PATH and start a new DOS console, for being able to cleanly use Turbo C 1.01 to compile COMMAND.COM .
YouTube:
http://youtube.com/@AltComp126

My x86 emulator/kernel project and software tools/documentation:
http://master.dl.sourceforge.net/projec ... 7z?viasf=1
User avatar
iansjack
Member
Member
Posts: 4685
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Tutorial: Compile and Use FreeDOS 1.2

Post by iansjack »

If you feel that the information presented in the documentation for the FreeDOS project is inadequate, and that you are providing information of substance that is lacking there (which I'm not convinced is the case), wouldn't it be more productive to offer your material to them? It could then be incorporated into their documentation, where it would be read by anyone interested in compiling FreeDOS. If that doesn't appeal to you, would it not be more appropriate as an article in the Wiki? As it is, posting it on this forum, where 99.9% of the readers will have no interest in it, means that it will soon be lost to view and all your work will be in vain.

As an aside, is this an Announcement, a Test Request, or a Job Opening?
User avatar
~
Member
Member
Posts: 1226
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Re: Tutorial: Compile and Use FreeDOS 1.2

Post by ~ »

iansjack wrote:If you feel that the information presented in the documentation for the FreeDOS project is inadequate, and that you are providing information of substance that is lacking there (which I'm not convinced is the case), wouldn't it be more productive to offer your material to them? It could then be incorporated into their documentation, where it would be read by anyone interested in compiling FreeDOS. If that doesn't appeal to you, would it not be more appropriate as an article in the Wiki? As it is, posting it on this forum, where 99.9% of the readers will have no interest in it, means that it will soon be lost to view and all your work will be in vain.

As an aside, is this an Announcement, a Test Request, or a Job Opening?
It's a tutorial like those from neon, directly related to an important OS project for the PC.

It took me 1 day to figure out how to compile FreeDOS 1.2, and another day to figure out how to compile the old DOS-C 0.90 IPL.SYS and the COMMAND.COM from DOS-C 1.0b2 and join them.

I know that it will greatly help many people to learn to handle the FreeDOS code in just 40 minutes, not days, months nor years.
YouTube:
http://youtube.com/@AltComp126

My x86 emulator/kernel project and software tools/documentation:
http://master.dl.sourceforge.net/projec ... 7z?viasf=1
User avatar
iansjack
Member
Member
Posts: 4685
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Tutorial: Compile and Use FreeDOS 1.2

Post by iansjack »

~ wrote:It's a tutorial like those from neon, directly related to an important OS project for the PC.
Let's not get into the question of whether a clone of an ancient, 16-bit operating system is "an important OS project for the PC". I can't find any tutorials by neon in this forum, just links to tutorials hosted elsewhere. But I didn't spend too much time searching, so I'll take your word for it. If I saw any I would make the same comment - they would more appropriately appear in the Wiki or (as in the cases I found) be links to tutorials elsewhere.
I know that it will greatly help many people to learn to handle the FreeDOS code in just 40 minutes, not days, months nor years.
Then you should certainly offer your tutorial to the FreeDOS project rather than just hiding it here.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Tutorial: Compile and Use FreeDOS 1.2

Post by Brendan »

Hi,
iansjack wrote:
~ wrote:It's a tutorial like those from neon, directly related to an important OS project for the PC.
Let's not get into the question of whether a clone of an ancient, 16-bit operating system is "an important OS project for the PC". I can't find any tutorials by neon in this forum, just links to tutorials hosted elsewhere. But I didn't spend too much time searching, so I'll take your word for it. If I saw any I would make the same comment - they would more appropriately appear in the Wiki or (as in the cases I found) be links to tutorials elsewhere.
Even if FreeDOS was the most important OS that ever existed, and even if that video was the best possible video; I'd still be tempted to suggest that the video isn't useful for people creating their own OS (who aren't working on any existing OS and have no reason to want to build FreeDOS) and therefore doesn't really belong here (in these forums or on the wiki).
~ wrote:I know that it will greatly help many people to learn to handle the FreeDOS code in just 40 minutes, not days, months nor years.
It takes about 5 minutes to read something like this; and somehow you've managed to turn that into a massive 40 whole minutes?


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.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Tutorial: Compile and Use FreeDOS 1.2

Post by neon »

Hello,

We don't release video tutorials -- we release publications that we believe might be helpful or interesting to future system programmers and operating system developers. It is the feedback that is important to us, and this community provides excellent feedback.

I can see that you put a lot of work in making this tutorial. Consider the target audience -- they would be able to provide the best feedback for you. I suppose the confusion here is that you are sharing a video on FreeDOS on an OS development forum. I suspect you are targeting the wrong audience. It would be better to post this on a forum dedicated to FreeDOS since they would be able to provide the best feedback. (Of course, if you want to discuss ideas or research into implementations or concepts used by FreeDOS or other operating systems that pertain to OS design and theory, that would certainly be something for this forum.)
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Post Reply