Close

KOS and the SDK setup

A project log for Dreamdrive - Dreamcast Edition

Dreamcast ODE using Dual RP2040 MUCs

kaili-hillKaili Hill 05/04/2023 at 21:350 Comments

KOS - KallistiOS

While I wait for the new PCBs to be assembled, I thought I should get a Dreamcast sdk setup. I need to write a menu like I did for the Nintendo 64's Dreamdrive64 project. This is useful for navigating the SD card contents, loading selected files, basically what I like to call "DreamOS". Dream is pretty overloaded for this project lol.

KallistiOS is an open source Dreamcast sdk. Pretty much the only one. 

I setup KOS in my Linux virtual machine and got Redream (a Dreamcast emulator) up and running. Since virtual box doesn't have hardware opengl 3 support, to run Redream in virtual box I created a small shell script:

 `LIBGL_ALWAYS_SOFTWARE=true GALLIUM_DRIVER=llvmpipe ./redream`

This basically runs it in software, which for development won't be an issue as my use case is rather limited in scope and complexity.

KOS Setup

To set up KOS I followed the instructions for Ubuntu from this page https://dreamcast.wiki/Getting_Started_with_Dreamcast_development It has all the terminal commands and explanations of what's going on. Overall a rather simple process and I didn't really run into any trouble.

VSCode

For code completions and such in VSCode my `c_cpp_properties.json` file contains this 

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**",
                "/opt/toolchains/dc/kos/include/**",
                "/opt/toolchains/dc/kos-ports/**",
                "/opt/toolchains/dc/arm-eabi/include/**",
                "/opt/toolchains/dc/sh-elf/**",
		"/opt/toolchains/dc/kos/kernel/arch/dreamcast/include/**",
		"/opt/toolchains/dc/kos/addons/include/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c17",
            "cppStandard": "gnu++17",
            "intelliSenseMode": "clang-x64",
            "configurationProvider": "ms-vscode.makefile-tools"
        }
    ],
    "version": 4
}

Development

In order to actually use the compiled elf files with the Redream emulator, then need to be turned into some kind of cd image. I'm using `mkdcdisc` available here

I wrote another little shell script that wraps up the args so you need only call `./mkdisc.sh filename_without_ext`

Shell script:

#!/bin/bash

# Take in a filename (without the elf extension) and add extensions for the binary and output files
mkdcdisc -v 3 -e $1.elf -o $1.cdi

I'm still digging into the examples to get an idea of what I need to do, but should have something up and running soon. More to come!

Discussions