#help_index "Misc/TOS/Config"

#define SLOP        BLK_SIZE

U0 TOSDebugDistro1()
{
    CZXE *zxe = mem_boot_base - sizeof(CZXE);

    zxe(I64) += zxe->file_size - 1;
    DefinePrint("TOS_DEBUG_DISTRO", "0x%X", CeilI64(SYS_KERNEL_END  + SLOP, BLK_SIZE));
    DefinePrint("TOS_DEBUG_DISTRO_END", "0x%X",
            FloorI64((BOOT_RAM_LIMIT - (BOOT_STACK_SIZE + DVD_BOOT_LOADER_SIZE)) >> 4 << 4 -
            (zxe(I64) - SYS_KERNEL_END) - SLOP, BLK_SIZE));
    DefinePrint("CONFIG_DEBUG_DISTRO_FILE", "\"/Tmp/DebugDistro.BIN\"");

} TOSDebugDistro1;

U0 TOSDebugDistro2()
{
    DefinePrint("CONFIG_DEBUG_DISTRO", "\"a0x%X\n0x%X\n\"", TOS_DEBUG_DISTRO,
            (TOS_DEBUG_DISTRO_END - TOS_DEBUG_DISTRO) / BLK_SIZE);
    DefinePrint("CONFIG_DEBUG_DISTRO_START", "\"0x%X\"", TOS_DEBUG_DISTRO);

} TOSDebugDistro2;

U0 TOSInit()
{
    switch (INS_REG_MACHINE_NUM)
    {
        case 1: //TAD Native Machine
            DefinePrint("CONFIG_RAM_DRIVES",  "\"B\nScale2Mem(2048,0x100000,4*1024*1024*1024)\n\"");
            DefinePrint("CONFIG_HARD_DRIVES", "\"C\ns0xFE00\n0xFE10\n0\"");
            DefinePrint("CONFIG_DVD_DRIVES",  "\"Ts0x1F0\n1\"");
            DefinePrint("CONFIG_DISK_CACHE",  "\"Scale2Mem(0x80000,0x8000000)\n\"");
            DefinePrint("TOS_HDS", "\"CD\"");
            DefinePrint("TOS_MASTER_BOOT_DRIVES", "\"C\"");
            break;

        default:
            DefinePrint("CONFIG_RAM_DRIVES",  "\"B\nScale2Mem(2048,0x100000,4*1024*1024*1024)\n\"");
            DefinePrint("CONFIG_HARD_DRIVES", "\"\"");
            DefinePrint("CONFIG_DVD_DRIVES",  "\"\"");
            DefinePrint("CONFIG_DISK_CACHE",  "\"Scale2Mem(0x80000,0x8000000)\n\"");
            DefinePrint("TOS_HDS", "\"CD\"");
            DefinePrint("TOS_MASTER_BOOT_DRIVES", "\"C\"");
    }

} TOSInit;

#define TOS_ISO_NAME        "B:/TOS_Distro.ISO.C"
#define TOS_DISTRO_DIR      "B:/Distro"
#define CONFIG_OPTS         "MountAHCIAuto\nCT\n"
#define CONFIG_DEBUG_OPTS   "MountAHCIAuto\nCTHeapInit\n130\nMemInit\n131\nVarInit\n132\n\n"
#define CONFIG_DEBUGZ_OPTS  "MountAHCIAuto\nCTHeapInit\n0\nMemInit\n0\nVarInit\n0\n\n"
#define TOS_CONFIG          "\n" CONFIG_RAM_DRIVES CONFIG_DVD_DRIVES CONFIG_HARD_DRIVES "\n" CONFIG_DISK_CACHE CONFIG_OPTS
#define TOS_DVD_CONFIG      "TB\n0x20000\nT\n\n\nMountAHCIAuto\nCT\n"

#define TOS_DVD_DEBUG_CONFIG "A" CONFIG_DEBUG_DISTRO\
                             "B\nScale2Mem(2048,0x40000)\n\n\n"\
                             "NoMP\nDebugDistro\n"\
                             "C:" CONFIG_DEBUG_DISTRO_FILE "\n" CONFIG_DEBUG_DISTRO_START "\n\n"