# FreeRTOS on x86 without DOS?

**URL:** <https://forums.freertos.org/t/freertos-on-x86-without-dos/1231>\
**Category:** Kernel\
**Created:** [December 7, 2011, 7:30pm UTC](https://forums.freertos.org/t/freertos-on-x86-without-dos/1231 "2011-12-07T19:30:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 7, 2011, 7:30pm UTC](https://forums.freertos.org/t/freertos-on-x86-without-dos/1231/1 "2011-12-07T19:30:42Z")

</div>

**[asmbutter](https://sourceforge.net/u/asmbutter/)** wrote on [Wednesday, December 07, 2011](https://sourceforge.net/p/freertos/discussion/382005/thread/34ac785d/#9db4):

I’m just starting out with FreeRTOS and I’m trying to compile it for an x86 microcontroller.&nbsp;

I am able to compile the provided demo “PC” with the Open Watcom compiler.&nbsp; This results in a .exe file.&nbsp; I understand I’m supposed to run this under DOS with all of the .obj files in the same directory?

I want the FreeRTOS kernel to run directly on x86 hardware without ‘another’ OS under it.&nbsp; To this end, I’ve started trying to write a ‘port’ layer so I can compile it with GCC.&nbsp; This effort is slow and painful.

Is my understanding of the PC demo correct?&nbsp; Is there any path to compile FreeRTOS to run standalone on x86?&nbsp; Or is the route I’m taking of writing a port layer for GCC/x86 the easiest option at this point?

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [December 7, 2011, 7:42pm UTC](https://forums.freertos.org/t/freertos-on-x86-without-dos/1231/2 "2011-12-07T19:42:51Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Wednesday, December 07, 2011](https://sourceforge.net/p/freertos/discussion/382005/thread/34ac785d/#bbda):

The OpenWatcom port uses DOS as a launch mechanism.&nbsp; Once FreeRTOS is running, it replaces the DOS tick with its own, and DOS has no more control of the execution.&nbsp; You should be able to use most of the same port code without DOS to boot the system, but will need a method of booting into FreeRTOS.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 7, 2011, 8:09pm UTC](https://forums.freertos.org/t/freertos-on-x86-without-dos/1231/3 "2011-12-07T20:09:31Z")

</div>

**[asmbutter](https://sourceforge.net/u/asmbutter/)** wrote on [Wednesday, December 07, 2011](https://sourceforge.net/p/freertos/discussion/382005/thread/34ac785d/#9ef8):

I don’t understand how to get anything I know how to boot out of the Open Watcom tools.&nbsp; The current demo spits out a .exe and several 16-bit object files.&nbsp; I don’t have a way to massage those into a single object file I could boot.&nbsp; That was my primary motivation for attempting to move to GCC.&nbsp; I understand it’s outside the scope of FreeRTOS support, but pointers on how to make that jump would be greatly appreciated.

I did try wlink specifying an ELF executable, but it complained of a missing ‘clib’ and eventually failed.&nbsp; I’m digging through their support forums as well trying to figure that side out but documentation is sparse.&nbsp; I have the full Open Watcom demo flow working on Windows and Linux.

It still seems like writing a GCC/x86 port layer is the easiest way to get a single object file.&nbsp; Is there some known stumbling block further down that path?&nbsp; I’m experienced in OS fundamentals and x86 asm.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 7, 2011, 8:10pm UTC](https://forums.freertos.org/t/freertos-on-x86-without-dos/1231/4 "2011-12-07T20:10:32Z")

</div>

**[asmbutter](https://sourceforge.net/u/asmbutter/)** wrote on [Wednesday, December 07, 2011](https://sourceforge.net/p/freertos/discussion/382005/thread/34ac785d/#e200):

Thank you for the help so far!

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 13, 2011, 3:03pm UTC](https://forums.freertos.org/t/freertos-on-x86-without-dos/1231/5 "2011-12-13T15:03:48Z")

</div>

**[asmbutter](https://sourceforge.net/u/asmbutter/)** wrote on [Tuesday, December 13, 2011](https://sourceforge.net/p/freertos/discussion/382005/thread/34ac785d/#b5be):

I’ve got most of the PC demo compiling under gcc (with warnings) now.&nbsp; I’m starting to test it on my simulator.&nbsp; Thanks!
