IP.BIN: Difference between revisions

From dreamcast.wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
The Dreamcast bootsector (commonly named '''IP.BIN''') is placed on a [[GD-ROM]] or a [[MIL-CD]] in the first 16 sectors of the data track from which the Dreamcast is booting. It contains information about the software on the disc, including [[region protection]], as well as the code that displays the Sega copyright screen and prepares the system for the launch of a game title.
Originally the bootsector was lifted from Dreamcast games to boot homebrew software, but technically using this copyrighted code was illegal in some jurisdictions. Homebrew coder [[LiENUS]] originally [[LiENUS's IP.BIN|rewrote the IP.BIN file]], replacing as much as possible with free code. The only code that remains in this homebrew IP.BIN is Sega's copyright screen code, which is required to be unmodified in order for the disc to boot (the system checks it against a copy of the code held within the BIOS ROM). It is believed by some that using this last bit of code is legal due to the legal precedent set by ''[http://digital-law-online.info/cases/24PQ2D1561.htm Sega v. Accolade]''.
New, additional functionality has been added to the IP.BIN in the [[neoIP]] replacement IP.BIN project. It is currently able to load homebrew and official Katana or Windows CE binaries from either [[GD-ROM]] or [[CD-ROM]].
== Basic Overview ==
== Basic Overview ==
* Loaded and ran from Disc ([[GD-ROM]], [[CD-ROM]])
* Loaded and ran from Disc ([[GD-ROM]], [[CD-ROM]])
Line 60: Line 66:
This is Generally where all the base setup code is kept so our binary has a known, and clean execution environment in which it starts.
This is Generally where all the base setup code is kept so our binary has a known, and clean execution environment in which it starts.
In [[Warez]] releases this is the area that is responsible for a very sneaky trick. The [[1ST_READ.BIN]] binary is kept as is on the disc, but then when scramble loaded by the bios (See [[Dreamcast_Boot_Process]] for further)) it will be unusable, so code was written to unscramble, the now ruined binary, in-place. The second part of this trick also reinitializes the [[GD-ROM]] drive and passes the [[HOLLY]] bios check so that the game may access the data on the disc and execute normally.
In [[Warez]] releases this is the area that is responsible for a very sneaky trick. The [[1ST_READ.BIN]] binary is kept as is on the disc, but then when scramble loaded by the bios (See [[Dreamcast_Boot_Process]] for further)) it will be unusable, so code was written to unscramble, the now ruined binary, in-place. The second part of this trick also reinitializes the [[GD-ROM]] drive and passes the [[HOLLY]] bios check so that the game may access the data on the disc and execute normally.
==== Other uses ====
* [[neoIP]] is a complete open source replacement for these bootstraps and is currently able to load: homebrew, official Katana and WINCE binaries from either a [[GD-ROM]] or [[CD-ROM]] developed by [[HaydenKow]]
* [[IP.BIN Replacement]] This as far as I know is the first LEGAL ip.bin replacement for the dc, however it is pretty much untested. Developed by LiENUS


==References==
==References==
<references/>
<references/>

Revision as of 02:50, 11 January 2020

The Dreamcast bootsector (commonly named IP.BIN) is placed on a GD-ROM or a MIL-CD in the first 16 sectors of the data track from which the Dreamcast is booting. It contains information about the software on the disc, including region protection, as well as the code that displays the Sega copyright screen and prepares the system for the launch of a game title.

Originally the bootsector was lifted from Dreamcast games to boot homebrew software, but technically using this copyrighted code was illegal in some jurisdictions. Homebrew coder LiENUS originally rewrote the IP.BIN file, replacing as much as possible with free code. The only code that remains in this homebrew IP.BIN is Sega's copyright screen code, which is required to be unmodified in order for the disc to boot (the system checks it against a copy of the code held within the BIOS ROM). It is believed by some that using this last bit of code is legal due to the legal precedent set by Sega v. Accolade.

New, additional functionality has been added to the IP.BIN in the neoIP replacement IP.BIN project. It is currently able to load homebrew and official Katana or Windows CE binaries from either GD-ROM or CD-ROM.

Basic Overview

  • Loaded and ran from Disc (GD-ROM, CD-ROM)
  • Contains basic meta information for a disc
  • Draws the Sega License Screen
  • Possibly holds an MR Image
  • Has space to run Code that is typically used in setting up the basic hardware then launching the binary on disc

General Header Information

Overview of Each piece of the IP.BIN listing file offset and memory location when loaded [1]

Offset Size Load address Contents
0x0000-00FF 0x00FF : 256 Bytes 8C008000-8C0080FF Meta information
0x0100-02FF 0x01FF : 512 Bytes 8C008100-8C0082FF Table of contents
0x0300-36FF 0x33FF : 13312 Bytes 8C008300-8C00B6FF SEGA license screen code
0x3700-37FF 0x00FF : 256 Bytes 8C00B700-8C00B7FF Area protection symbols
0x3800-5FFF 0x47FF : 18432 Bytes 8C00B800-8C00DFFF Bootstrap 1
0x6000-7FFF 8C00E000-8C00FFFF Bootstrap 2 (Not Required #Bootstraps)

Execution Flow Overview

bleh

Deeper Look into User Code

All IP.BIN files from Sega are generally made with the IP Maker software and follow the same basic layout codewise. Bootstrap 1 is very small and is responsible for setting some minor hardware registers then jumps immediately to Bootstrap 2. This second Bootstrap actually does the bulk of the work and handles setting up the stack, VBR, disables cpu caching and then handles the jump to 1ST_READ.BIN which is loaded to address 0x8C010000.

Bootstraps

This is the area in the IP.BIN that is completely unregulated and can be used however someone would like.

Bootstrap 1

This piece of code is generally very small, under 32 bytes and sets hardware registers.

  • A custom MR Image can also live within this section at offset 0x3820, Address 0x8C00B820 and will be displayed on the license screen.

Bootstrap 2

This is Generally where all the base setup code is kept so our binary has a known, and clean execution environment in which it starts. In Warez releases this is the area that is responsible for a very sneaky trick. The 1ST_READ.BIN binary is kept as is on the disc, but then when scramble loaded by the bios (See Dreamcast_Boot_Process for further)) it will be unusable, so code was written to unscramble, the now ruined binary, in-place. The second part of this trick also reinitializes the GD-ROM drive and passes the HOLLY bios check so that the game may access the data on the disc and execute normally.

References

  1. [1], Dreamcast Programming: IP.BIN, Marcus Comstedt