bb_dev_kit.html 11.2 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>/tmp/n46software.html</title>
                                                                        
                                                                        
                              
  <meta http-equiv="content-type"
 content="text/html; charset=ISO-8859-1">
</head>
  <body>
                                         
<h2 align="center">BB Developer Kit for iQue<br>
              </h2>
                       
<div align="center">$Revision: 1.11 $<br>
           $Date: 2003/12/20 00:51:22 $<br>
            </div>
                 <br>
                       
<h3>Purpose</h3>
            Release a developer's kit that can be used initially by iQue
to  develop     applications from scratch for the BB player.<br>
                       
<h3>Assumptions</h3>
                       
<ul>
              <li>Developers will use a RedHat Linux system as the platform 
 on  which    to develop BB apps.</li>
              <li>Developers will not be able to publish games directly at
 iQue.    &nbsp;That   will require using the infrastructure at BroadOn.</li>
              <li>Developers will use players running a real Secure Kernel, 
 but   with   a special version of the viewer app that will launch the game 
 executables     that they generate using the devkit.</li>
              <li>Debugging will be done by downloading over USB and using
     <i>osSyncPrintf</i>.</li>
             <li>We don't want to expose the file system API to general apps
  written    using the DevKit, but the iQue Club App already requires this.</li>
        <li>The BB devkit will be a complete replacement for the N64 devkit,
  meaning  that it will not be necessary for developers to install the original
  N64 devkit.<br>
        </li>
                       
</ul>
                       
<h3>Libultra features</h3>
           The devkit will include both the _FINALROM (<b>libultra_rom.a</b>) 
  and   debugging versions (<b>libultra_d.a</b>) of the  complete <b>libultra</b>, 
    including the BB specific primitives. The  access to the file system 
and   card access calls will be restricted by using  h/w rights when the final
 apps are published. &nbsp;Only  the iQue Club App will be allowed to access
 the file  system. &nbsp;This method makes it unnecessary to have a separate
 version  of the devkit to support the Club App. &nbsp;None of the BB specific
APIs will be documented in the SDK material.<br>
                       
<h3>Build environment</h3>
           The devkit will include the following items:<br>
                     
<ul>
             <li>cross compiler</li>
             <li>libultra</li>
             <li>headers</li>
             <li>tools<br>
             </li>
                                           
  <ul>
               <li>aesrom to encrypt games</li>
       <li>rommd to add metadata to rom files<br>
       </li>
               <li>devsh to talk to devmon</li>
                                           
  </ul>
          <li>source for bbrdb linux driver<br>
          </li>
             <li>online documentation, including that from the Nintendo N64 
 devkit</li>
         <li>sample source code from the Nintendo devkit, as modified to
work   for  our environment (makefile changes)<br>
         </li>
                     
</ul>
       In order to install the devkit environment, the user does the following:<br>
                   
<ul>
            <li>mount the SDK CD:</li>
       
  <ul>
      <li>su<br>
      </li>
       
  </ul>
           
  <ul>
       <li>mkdir /mnt/cdrom (may not be necessary)</li>
       <li>mount /dev/cdrom /mnt/cdrom (may also be unnecessary)</li>
           
  </ul>
     <li>become root to install the parts shared by all users:</li>
           
  <ul>
       <li>su</li>
       <li>./install.sh</li>
           
  </ul>
     <li>each user on the system must install the non-shared portions of
the  devkit relative to their home directory, based on the setting of $ROOT:</li>
           
  <ul>
       <li>login as user</li>
       <li>mkdir ique_root (pathname is only an example)</li>
       <li>setenv ROOT $HOME/ique_root</li>
       <li>ROOT=$HOME/ique_root; export ROOT</li>
       <li>/opt/ique/sdk-v1.0/devkit/install.sh</li>
           
  </ul>
                   
</ul>
          To build an executable, the user adds an invocation of <i>aesrom</i> 
 to makefile to encrypt the rom file:   
<ul>
     <li>aesrom rom game.aes</li>
                   
</ul>
If the game uses saved state, then it may necessary to include an invocation
of <i>rommd</i> to specify the type of state saving used. &nbsp;Once the
game file has been encrypted, use <i>devmon</i> and <i>devsh</i>  to copy
the new game to the cartridge:<br>
     
<ul>
     <li>Connect iQue player to linux host with USB cable</li>
     <li>Bring up <i>devmon</i> on the player</li>
     <li>On the linux host, start "<i>mux</i>" on a separate terminal window</li>
     <li>Then invoke "<i>devsh</i>" in the directory containing the game
rom  file. &nbsp;Using the following <i>devsh</i> commands:</li>
           
  <ul>
       <li>d game.aes</li>
       <li>a game.aes</li>
           
  </ul>
     
</ul>
   The game should appear on the list of available files shown by <i>devmon.</i> 
 &nbsp;The game can be invoked by selecting the appropriate entry, using the
 D pad on the player, and then pushing the A button to launch the game.<br>
                   
<h3>Execution environment</h3>
            The method for allowing a player to execute a locally built game
  without    requiring the services of the normal software signing infrastructure
  is  the  most problematic part of the developer's kit. &nbsp;It is not
practical    to  require that a developer feed the built executable through
the BroadOn    infrastructure  in order to obtain a real ticket and encrypted
.app file   every time they run <i>make</i>. &nbsp;It's too risky to release
a signing   key to anyone outside BroadOn HQ. &nbsp;The development players
will be normal   players, running the real Secure Kernel. &nbsp;The proposal
is to create  a special version of the viewer/sysapp that includes enough
of <i>usbmon</i>    and <i>launch.aes</i>  to allow rom files to be downloaded
onto the cartridge    and executed. &nbsp;This  viewer is the piece that
must be tightly controlled.    &nbsp;This will be done  by using a feature
of the Secure Kernel: &nbsp;there    is a field in the content  metadata
header included in the ticket block  of  an SKSA bundle that is a BBID. &nbsp;For
a normal SKSA bundle, that field    is set to zero, which means that the
Viewer can be launched by the SK on   any BB. &nbsp;If the BBID field is
non-zero, then the SK will only launch   that Viewer bundle on the BB with
the matching ID. The process for producing   an SKSA bundle that is locked
to a particular player requires a special version   of the Content Publisher
script for publishing an SKSA bundle.<br>
      <br>
      The Content Publisher used for creating devkit bundles will use a different
   signer certificate than that used for signing normal apps and viewers.
&nbsp;This   gives us the capability to revoke the certificate later without
affecting   anything other than the development players.<br>
           <br>
           The player is only capable of executing AES encrypted games, so
 we  need   a method for encrypting the game and loading the AES engine with 
 the  appropriate    key to get the game launched. &nbsp;There are two ways 
 to do this:<br>
           
<ul>
        <li>Use the same key to encrypt the game as was used to encrypt the 
 viewer.  &nbsp;This is the mechanism used by the current launcher. &nbsp;In 
 this method,  the AES engine is loaded once by the SK when the viewer app 
 is launched and  the key never changes.</li>
        <li>Create keys at build time in the devkit software. &nbsp;This
could    be a fixed key or even a&nbsp; custom key for each app, although
dynamic   schemes will be more complicated to implement (the key is generated
on the   host, but needs to be accessible to the viewer at runtime on the
player side).  &nbsp;In this case the viewer will need   h/w rights to load
the AES engine  with the key at launch time. </li>
           
</ul>
      The encryption of the game will be done using a script like <i>aesrom</i>
   with the appropriate key corresponding to the method selected above. &nbsp;The
   first method is probably the best solution, but requires that the AES
key    used originally to encrypt the viewer be extracted and then encoded
in the   <i>aesrom</i> script at the time that the devkit package is created.<br>
      <br>
      The special viewer app provided with the devkit will not have the sophisticated
   user interface of the real Viewer App: &nbsp;it will likely be a simple
 menu  based viewer derived from <i>launcher</i>. &nbsp;In order to allow
full testing  of game features by developers and provide reliability, it
must implement  game state saving and single bit error scrubbing as the real
Viewer does.<br>
      &nbsp; <br>
           No debugger is supported for first release. &nbsp;The debugging
 method    is  to use <i>osSyncPrintf</i> to track the state of the program
 under development.<br>
     
<ul>
                     
</ul>
                     
<h3>Documentation</h3>
           The online documentation included with the devkit provides:<br>
                     
<ul>
             <li>The existing N64 DevKit docs from Nintendo.</li>
             <li>An html doc explaining the build environment.</li>
             <li>A separate one page doc explaining how to install the devkit.</li>
                     
</ul>
                     
<h3>Implementation</h3>
                     
<ul>
             <li>Fix bugs in <i>osSyncPrintf </i>that cause it to hang frequently 
 (<i>done</i>)</li>
             <li>Create special viewer app based on launcher, called <i>devmon
 (done)</i></li>
             <li>Write new documents</li>
                                           
  <ul>
               <li>Build how-to <i>(done)</i></li>
               <li>Install how-to <i>(done)</i></li>
                                                       
  </ul>
             <li>Create special publishing script for DevKit SKSA bundles 
locked    to  particular players (requires help from Infrastructure Team)</li>
                       
  <ul>
          <li>Need to keep records of devkit bundles issued and BBIDs. &nbsp;Probably
   does not need to be in the database.<br>
          </li>
                       
  </ul>
         <li>Build and installation scripts <i>(done)</i></li>
        <li>Figure out the subset of headers to be shipped <i>(done)</i></li>
                       
  <ul>
          <li>Probably does not include osBb API headers (most osBb headers
 were not included)</li>
                       
  </ul>
      <li>Do we allow users to create more devkit flash cards (allow T,t,S,s
  commands)? <i>(No, this is not required.)</i></li>
                     
</ul>
            
<h3>Status</h3>
 
<ul>
   <li>First prototype of the SDK given to iQue on 12/04/03 (this version
is officially 1.0, since iQue has built production game roms using it).</li>
   <li>Demo apps and sound files not included.</li>
 
</ul>
           <br>
          <br>
         <br>
        <br>
       <br>
      <br>
     <br>
    <br>
   <br>
  <br>
 <br>
</body>
</html>