Creating a bootable Dreamcast disc: Difference between revisions

From dreamcast.wiki
Jump to navigation Jump to search
(Created page with "== Workflow == The usual workflow to make self-bootable disc for the Dreamcast is as follows: * Build your source (usually using KOS) * Transform your .elf into bina...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Workflow ==
== Workflow ==


The usual workflow to make self-bootable disc for the [[Dreamcast]] is as follows:
The usual workflow to make self-bootable disc for the [[Dreamcast]] goes like this.


* Build your source (usually using [[KOS]])
* Build your source (usually using [[KallistiOS]])
* Transform your .elf into binary  
* Transform your .elf into binary  
* Scramble the binary
* Scramble the binary
Line 9: Line 9:
* Transform the .iso into a .cdi image
* Transform the .iso into a .cdi image


There are other details that could be taken into account:
* You can make Audio/Data and Data/Data .cdi files. Both can selfboot, but the files will be organized differently on the physical CD. {{Citation needed}}
* You'll need to provide a valid [[IP.BIN]], these can be modified to display a logo during the boot screen, apply patches or execute some code.
* It is possible to make CDDA compatible images, this process in not currently covered here.


== Linux ==  
== Linux ==  

Latest revision as of 11:11, 16 February 2020

Workflow

The usual workflow to make self-bootable disc for the Dreamcast goes like this.

  • Build your source (usually using KallistiOS)
  • Transform your .elf into binary
  • Scramble the binary
  • Build a .iso image from a directory
  • Transform the .iso into a .cdi image

There are other details that could be taken into account:

  • You can make Audio/Data and Data/Data .cdi files. Both can selfboot, but the files will be organized differently on the physical CD. Citation needed
  • You'll need to provide a valid IP.BIN, these can be modified to display a logo during the boot screen, apply patches or execute some code.
  • It is possible to make CDDA compatible images, this process in not currently covered here.

Linux

This is an example for automating the .cdi image process under Linux. Consider this more like a template as you'll need to edit the paths, names, etc to your own project.

 #! /bin/sh
 PROJECT_DIR=$PWD/build
 PROJECT_NAME="Project_Name"
 TARGET="main.elf"
 # Build your program
 # This assumes that you can properly build your source code. The program main output will be $TARGET
 make $TARGET
 # Elf transform
 sh-elf-objcopy -R .stack -O binary $TARGET output.bin
 # Scrambling process
 $KOS_BASE/utils/scramble/scramble output.bin 1ST_READ.bin
 # Creating a .iso image from a directory 
 # Make sure you have a working IP.BIN in your current directory. Or change IP.BIN path to wherever you like.
 # Useful option for mkisofs is *-m* which allow to exclude files from the iso image (useful to remove .git, or some other folder) 
 mkisofs -C 0,11702 -V $PROJECT_NAME -G IP.BIN -r -J -l -o $PROJECT_NAME.iso $DIR
 # Transform your .iso into a .cdi
 $KOS_BASE/utils/cdi4dc/cdi4dc $PROJECT_NAME.iso $PROJECT_NAME.cdi