Bienvenido a mi rincon MSX ! ¡
Welcome to my MSX corner !
   

SymbOS 2.0, The Operating System

SymbOS is an operating system based on CPC and MSX computers. This OS can be managed using a windows interface but there is a Shell Command interpreter too. You can find more information in looking for Internet or in the oficial site (http://www.symbos.de/)

SDCC Compiler

The Windows development kit is based on the SDCC freeware compiler. You can find it in the oficial site: (http://sdcc.sourceforge.net/)

SDK Files

To use the SDK is needed to have installed the compiler and tools of SDCC. The SDK Pack comes with an executable "SymbosMake.exe" that calls SDCC compiler and linker and generates an EXE/COM SymboOS compliant.

My first SymbOS app

We are going to start with an easy sample, the typical "Hello World!".
To make that "SymbosMake.exe" works correctly is needed that in the same folder we have a text file "Make.ini" with a format like this:

MACROS = MSX_VERSION=MSX2
SOURCE_PATH = .\
RESOURCE_FILE = main.rc
LIBRARY = symbos/symbos.lib
ENGINE_SOURCES =
MODULE_SOURCES =
MAIN_SOURCE = main
RELEASE_PATH = .\release
C_MODULE_PATH = .\
C_ENGINE_PATH = .\
BIN_PATH = .\
STACK_SIZE = 512
APP_NAME = HELLO_WORLD
SMALL_ICON = smallicon.sgx
BIG_ICON = bigicon.sgx
OUTPUT_NAME = hello.exe


The file "Main.rc" will contain the needed resources for making our EXE. We will detail RC Files more later:

ICON IDI_ICON "smallicon.sgx"

CONTROL_GROUP_DATA_RECORD CGDR_Form1
{
  CONTROL_DATA_RECORD { ID = 0, TYPE = 255, X = 0, Y = 0, W = 10000, H = 10000, PARAM = 0 }
}

WINDOW IDD_MAIN
{
  STATUS_NORMAL,
  IS_SUPERWINDOW,
  X = 0,
  Y = 0,
  WIDTH = 10000,
  HEIGHT = 10000,
  OFF_X = 0,
  OFF_Y = 0,
  FULL_WIDTH = 10000,
  FULL_HEIGHT = 10000,
  MIN_WIDTH = 10000,
  MIN_HEIGHT = 10000,
  MAX_WIDTH = 10000,
  MAX_HEIGHT = 10000,
  ICON = IDI_ICON,
  TITLE_STRING = null,
  STATUS_STRING = null,
  MENU_DATA_RECORD = null,
  CONTROL_GROUP_DATA_RECORD = CGDR_Form1,
  CONTROL_GROUP_DATA_RECORD_TOOLBAR = null,
  TOOLBAR_HEIGHT = 0,
}

And finally the "Main.c" file:

#include "symbos\symbos.h"
#include "symbos\symbos_system.h"
#include "symbos\symbos_desktop.h"
#include "symbos\symbos_device.h"
#include "symbos\symbos_kernel.h"
#include "symbos\symbos_memory.h"
#include "symbos\symbos_shell.h"
#include "symbos\symbos_file.h"
#include "string.h"
#include "resource.h"

#include "symbos\symbos_transfer_area_start.h"
#include "symbos\symbos_transfer_area_end.h"

void main (void)
{
  MESSAGEBOX ("Hello World");
  Sys_Program_End (GET_APPLICATION_ID());
  while (1) Multitasking_SoftInterrupt();
}

Here you can download a RAR file with the previous sample. You will need to install Symbos SDK in the same directory to compile it. Try to generate the "Hello.exe" and run it in Symbos 2.0. The next, we are going to explain better all the saw until now.

Download RAR with Symbos SDK
Download RAR with the sample "Hello World"

Make.INI

The resource file (.RC)

SymbOS Memory Model

An app has 3 areas defined: CODE, DATA, TRANSFER
When SDK compile and makes the Symbos APP take in account all this. All the code declared in C will be put in the CODE AREA, all the data vars, etc. declared will be put in DATA AREA and all the resources added will be put in TRANSFER AREA.
If you want to add variables or data declared in C into TRANSFER AREA, you will need to put them inside of this #includes.

#include "symbos\symbos_transfer_area_start.h"
#include "symbos\symbos_transfer_area_end.h"

It's very important to declare this #includes at the end of all the data declared. We need that compiler generate the bigger address for our transfer area. Then we could have something like:

unsigned char g_data;
#include "symbos\symbos_transfer_area_start.h"
unsigned char g_t_data;
#include "symbos\symbos_transfer_area_end.h"

But no!

#include "symbos\symbos_transfer_area_start.h"
unsigned char g_t_data;
#include "symbos\symbos_transfer_area_end.h"

unsigned char g_data;


API Symbos SDK v.0.0.1 <DOC> <DOWNLOAD>

More Samples...

It shows you how to create a Timer and play a PT3 file, furthermore you can know how to open a file system dialog and capture window messages.
<DOWNLOAD>