This is a docker environment that builds a mainline linux distro that is bootable on the Sega Dreamcast. The latest bootable CDI image can be found under the Releases.
It is actually tested on real hardware.
My main testcase is via serial and NFS chroot, so it doesn't contain many useful applications by itself. This is certainly an area of improvement. Furthermore the build-process is currently a bit sophisticated, meaning its not really reproducible right know, like the patches not applied automatically.
Tested Devices, feel free to add PR to add your test device:
| Medium | Revision | Works | Description |
|---|---|---|---|
| GDEMU, dcload-serial, dcload-ip | HKT-3030, PAL E, Rev. 1 | ✔️ Yes | framebuffer, serial console, network |
| GDROM, dcload-serial | HKT-3000, NTSC J, Ugo Denshi 670-14071E | ✔️ Yes | framebuffer, serial console, (has no bba) |
| GDEMU | HKT-3020, NTSC U, Rev. 1 | ❌ No | stays at sega screen |
| GDROM | HKT-3030, PAL E, Rev. 1 | soon to be tested | |
| GDROM | HKT-3020, NTSC U, Rev. 1 | soon to be tested | |
| CDI | GXemul 0.7.0+dfsg | ❌ No | [ exception 0x160, pc=0x8c4abede vaddr=0x00000000 ] see gxemul-analyze.txt |
| CDI | lxdream 0.9.1 | ❌ No | stays at sega screen, with memset/memcpy sh4-specifics removed, boots to console, but no interaction possible see lxdream-analyze.txt |
| CDI | flycast 2.6 | ❌ No | stays at sega screen, see flycast-analyze.txt |
| CDI | redream 1.5.0 | ❌ No | redream-analyze.txt |
ATTENTION: You need to customize the .dreamcast/src/linux-xx/arch/sh/Kconfig to modify BOOT_LINK_OFFSET, aligned to .dreamcast/src/sh-boot/tools/dreamcast/kernel-boot.S L_binary_zImage_bin_dest: and L_entry:. (The memory position of the zipped kernel image, depending on how big it is). In the example below, we chose 0x00600000 / 0xac600000.
config BOOT_LINK_OFFSET
hex
default "0x00210000" if SH_SHMIN
default "0x00600000" if SH_DREAMCAST
default "0x00810000" if SH_7780_SOLUTION_ENGINE
default "0x009e0000" if SH_TITAN
default "0x01800000" if SH_SDK7780
default "0x02000000" if SH_EDOSK7760
default "0x00800000"
help
This option allows you to set the link address offset of the zImage.
This can be useful if you are on a board which has a small amount of
memory.
I use kernel-integrated initramfs and not the sh-boot initrd. The path to the initramfs is defined in the kernel-config. (CONFIG_INITRAMFS_SOURCE="/usr/src/dreamcast/initrd" )
dreamcast-linux/.dreamcast/src/linux-6.19.9 ❯ patch -p1 < ../../../hotfix-dreamcast-*.patch
dreamcast-linux/.dreamcast/src/linux-6.19.9 ❯ patch -p1 < ../../../hotfix-vmu*.patch
Creates a cross-compilation environment for the SH4 architecture using:
- gcc
- glibc
- linux
- binutils
- busybox
Docker on Linux.
Please inspect the local variables in the
dreamcast/build-dreamcast.shscript before running this. Some options might not fit your setup.
make
You should now have the final images in build/ folder.
All building happens in .dreamcast/.
- https://github.com/foxdrodd/dc-hacking
- http://linuxdevices.org/running-linux-on-the-sega-dreamcast-a/
- https://github.com/foxdrodd/sh-boot/
- https://asciinema.org/a/722003?t=5
This source is licensed under MIT. See attached licenses for third party libraries included for more information.