en:develop:guidelines

This is an old revision of the document!


Getting started

Before you start coding, look at the sources and determine area in which you are interested to develop. We have wide range of tasks and, most probably, one of them will be interested for you. Only remember, our current main goal is to provide less or more full set of OS/2 API on top of L4 microkernel.

Development Tools

Language Compiler
C Open Watcom
C++ Open Watcom
Assembler Open Watcom/JWasm
FORTRAN Open Watcom
Pascal FreePascal
REXX ReginaREXX

Other languages may be used to develop parts of the OS. However, they must be Open Source and use OS/2 API. Usage of non-free, even shareware (read: can be downloaded from lot of places, but cost money and whose licenses have many limitations) not recommended. Also, use the Watcom tools to build this source.

When conflicting tools exists (ex. NMAKE and WMAKE) always use the Open Watcom tool.

Downloading and Compiling

osFree sources are hosted at GitHub. GitHub also provides a possibility to download a snapshot as a .tar.gz archive.

osFree sources consist of the main Git repository and several submodules. The main git repo is osfree, and submodules are:

FamilyAPI, MacroLib, fat32, jfs, os3 and others.

Hence, you need to clone the main osfree repo first, and then pull the submodules:

    git clone https://github.com/osfree-project/osfree.git

    git submodule update --init --recursive

    git submodule update --remote --recursive

You need to download all above tools for your platform from corresponding sites. Use:

%root%\conf\scripts\_setup.{cmd|sh|bat}

, to pull the build dependencies.

_wcc{cmd|sh}

build process will be started.

For more information about build system read Build system document.

The Directory Tree

Please look at the source code tree to understand how files are to be placed. Please understand that the osFree source tree contains the code for an operating system and some toolkit tools. Please, DO NOT place unrelated tools or applications in this tree. The Toolkit is a set of helper utilities, which are built for development system (under which the OS is built). They are necessary for OS files building.

Global/Shared/Private Headers

Each level of the source tree contains two standard directories:

FIX THIS! Now it's slightly different!
shared Contains code shared among all source at this level and deeper levels
include Contains header files for the above

Each levels/part of the OS should have a specific prefix that allows a developer to easily find what part of the OS a header/library file belongs to. For example code shared by the whole tree should be included with:

#include <all_shared.h>

and code shared by all commandline tools should include:

#include <cmd_shared.h>

Try to create as few shared code headers as possible. Each “shared” directory should contain one (1) library (.lib) file (xxx_shared.lib) with all shared code and each “include” directory should contain one main header file including all other (xxx_shared.h).

Example of use of common files:

// Use the normal OS/2 INCL_ since our toolkit is the OS/2 toolkit
#define INCL_DOSERROR
 
// Include os2.h
#include <os2.h>
 
// Include any needed normal C library
#include <malloc.h>
#include <string.h>
 
// Include all shared code and shared code for command line tools
#include <all_shared.h>
#include <cmd_shared.h>

Documentation

  • Private code (not shared with other code) should be documented only in the source.
  • Shared code (shared with code at the same level or at all levels) should be documented in source and in a “Building and developing” document.
  • The API of the OS and the tools documentation should NOT be documented in the source tree but in the toolkit and release tree.
  • Source code should be documented in the source file (not the header files).
  • Each function should be prefixed with a description of what it does, what parameters it uses (in and out) and any external references it uses.
  • Place comments in the source that helps the reader to understand the logic and don't overdo it.

When Developing

  • Use static linking, do not use dynamic libraries (LIBC style) or dynamic runtime.
  • Use the makefiles provided with the source tree, don't “do your own”.
  • Currently osFree development is done on OS/2 (minimum Warp 4), Windows and Linux but in the future development will be hosted on osFree.
  • We use Git to share code among developers.
  • We use Doxygen and Wiki to document our work.

Discussion

Enter your comment. Wiki syntax is allowed:
107 +1᠎ =᠎