mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
OSFromFirmBuf構造体の追加
OS_FromBromToMenu()の追加 hash_table_hashをall 0に変更 git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@158 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
b3e7757c54
commit
7d3ebdc23e
@ -198,3 +198,37 @@ asm void OSi_BootCore( ROM_Header* rom_header )
|
|||||||
|
|
||||||
bx lr
|
bx lr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <twl/codereset.h>
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Name: OSi_FromBromToMenu
|
||||||
|
|
||||||
|
Description: convert OSFromBromBuf to OSFromFirmBuf
|
||||||
|
|
||||||
|
Arguments: None
|
||||||
|
|
||||||
|
Returns: FALSE if FromBrom is broken
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
BOOL OSi_FromBromToMenu( void )
|
||||||
|
{
|
||||||
|
OSFromBromBuf* fromBromBuf = OSi_GetFromBromAddr();
|
||||||
|
BOOL result = TRUE;
|
||||||
|
int i;
|
||||||
|
// check offset (why not to omit by compiler?)
|
||||||
|
if ( OSi_GetFromFirmAddr()->rsa_pubkey != fromBromBuf->rsa_pubkey ) // same area without header
|
||||||
|
{
|
||||||
|
result = FALSE;
|
||||||
|
}
|
||||||
|
// check unused signature area
|
||||||
|
for (i = 0; i < sizeof(fromBromBuf->hash_table_hash); i++) // check all values are same
|
||||||
|
{
|
||||||
|
if (fromBromBuf->hash_table_hash[i] != 0x00)
|
||||||
|
{
|
||||||
|
result = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// clear out of OSFromFirmBuf area
|
||||||
|
MI_CpuClearFast( fromBromBuf->header.max, sizeof(fromBromBuf->header.max) );
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|||||||
@ -38,7 +38,8 @@ CRT0_O = crt0_firm.o
|
|||||||
|
|
||||||
include $(TWLIPL_ROOT)/build/buildtools/commondefs
|
include $(TWLIPL_ROOT)/build/buildtools/commondefs
|
||||||
|
|
||||||
LLIBRARIES = libaes_sp$(TWL_LIBSUFFIX).a
|
LLIBRARIES = libaes_sp$(TWL_LIBSUFFIX).a
|
||||||
|
MAKELCF_FLAGS += -DADDRESS_LTDWRAM='0x037c0000'
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@ -27,8 +27,6 @@
|
|||||||
|
|
||||||
static u8 fatfsHeap[FATFS_HEAP_SIZE] __attribute__ ((aligned (32)));
|
static u8 fatfsHeap[FATFS_HEAP_SIZE] __attribute__ ((aligned (32)));
|
||||||
|
|
||||||
static SDPortContextData nandContext; // 一時待避用 (次に渡すならSHAREDのどこかのアドレスにする)
|
|
||||||
|
|
||||||
#ifndef SDK_FINALROM
|
#ifndef SDK_FINALROM
|
||||||
static u8 step = 0x80;
|
static u8 step = 0x80;
|
||||||
#endif
|
#endif
|
||||||
@ -45,22 +43,18 @@ u32 pf_cnt = 0;
|
|||||||
/***************************************************************
|
/***************************************************************
|
||||||
PreInit
|
PreInit
|
||||||
|
|
||||||
FromBootの対応をまとめる&メインメモリの初期化
|
FromBootの対応&メインメモリの初期化
|
||||||
OS_Init前なので注意 (ARM9によるメインメモリ初期化で消されないように注意)
|
OS_Init前なので注意 (ARM9によるメインメモリ初期化で消されないように注意)
|
||||||
***************************************************************/
|
***************************************************************/
|
||||||
static void PreInit(void)
|
static void PreInit(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FromBrom関連
|
FromBrom関連
|
||||||
*/
|
*/
|
||||||
|
if ( !OSi_FromBromToMenu() )
|
||||||
/* 鍵はどこへ? */
|
{
|
||||||
|
OS_Terminate();
|
||||||
// NANDパラメータの待避
|
}
|
||||||
nandContext = OSi_GetFromBromAddr()->SDNandContext;
|
|
||||||
|
|
||||||
MIi_CpuClearFast( 0, (void*)OSi_GetFromBromAddr(), sizeof(OSFromBromBuf) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************
|
/***************************************************************
|
||||||
@ -127,7 +121,7 @@ void TwlSpMain( void )
|
|||||||
|
|
||||||
OS_SetDebugLED(++step);
|
OS_SetDebugLED(++step);
|
||||||
|
|
||||||
if ( FATFS_InitFIRM( &nandContext ) )
|
if ( FATFS_InitFIRM( &(OSi_GetFromFirmAddr()->SDNandContext) ) )
|
||||||
{
|
{
|
||||||
#ifndef SDK_FINALROM
|
#ifndef SDK_FINALROM
|
||||||
// 3: after FATFS
|
// 3: after FATFS
|
||||||
|
|||||||
@ -44,27 +44,44 @@ u32 pf_cnt = 0;
|
|||||||
/***************************************************************
|
/***************************************************************
|
||||||
PreInit
|
PreInit
|
||||||
|
|
||||||
FromBootの対応をまとめる&メインメモリの初期化
|
FromBootの対応&OS_Init前に必要なメインメモリの初期化
|
||||||
OS_Init前なので注意
|
|
||||||
***************************************************************/
|
***************************************************************/
|
||||||
static void PreInit(void)
|
static void PreInit(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
メインメモリ関連
|
メインメモリ関連
|
||||||
*/
|
*/
|
||||||
|
// SHARED領域クリア (ここだけでOK?)
|
||||||
// SHARED領域クリア (IS-TWL-DEBUGGERの更新待ち)
|
MIi_CpuClearFast( 0, (void*)HW_PXI_SIGNAL_PARAM_ARM9, HW_MAIN_MEM_SHARED_END-HW_PXI_SIGNAL_PARAM_ARM9);
|
||||||
#ifdef SDK_FINALROM
|
|
||||||
MIi_CpuClearFast( 0, (void*)HW_MAIN_MEM_SHARED, HW_MAIN_MEM_SHARED_END-HW_MAIN_MEM_SHARED );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FromBrom関連
|
FromBrom関連
|
||||||
*/
|
*/
|
||||||
|
if ( !OSi_FromBromToMenu() )
|
||||||
|
{
|
||||||
|
OS_Terminate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* 鍵はどこへ? */
|
/***************************************************************
|
||||||
|
PostInit
|
||||||
|
|
||||||
MIi_CpuClearFast( 0, (void*)OSi_GetFromBromAddr(), sizeof(OSFromBromBuf) );
|
MI_LoadHeader前にかなり(数100msec)時間があるので、可能なら
|
||||||
|
OS_Init後にいろいろ処理したい!
|
||||||
|
メインメモリの初期化
|
||||||
|
***************************************************************/
|
||||||
|
extern u32 SDK_SECTION_ARENA_DTCM_START;
|
||||||
|
static void PostInit(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
メインメモリ関連
|
||||||
|
*/
|
||||||
|
// (DTCMの手前までの領域を全クリア)
|
||||||
|
//MI_CpuClearFast( (void*)HW_DELIVER_ARG_BUF_END, SDK_SECTION_ARENA_DTCM_START-HW_DELIVER_ARG_BUF_END );
|
||||||
|
// (ARM9領域を全クリア)
|
||||||
|
MI_CpuClearFast( (void*)HW_DELIVER_ARG_BUF_END, HW_MAIN_MEM_MAIN_END-HW_DELIVER_ARG_BUF_END );
|
||||||
|
|
||||||
|
DC_FlushAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************
|
/***************************************************************
|
||||||
@ -111,6 +128,8 @@ void TwlMain( void )
|
|||||||
|
|
||||||
SVC_InitSignHeap( &acPool, acHeap, sizeof(acHeap) );
|
SVC_InitSignHeap( &acPool, acHeap, sizeof(acHeap) );
|
||||||
|
|
||||||
|
PostInit();
|
||||||
|
|
||||||
// load menu
|
// load menu
|
||||||
if ( MI_LoadHeader( &acPool, RSA_KEY_ADDR ) && CheckHeader() && MI_LoadStatic() )
|
if ( MI_LoadHeader( &acPool, RSA_KEY_ADDR ) && CheckHeader() && MI_LoadStatic() )
|
||||||
{
|
{
|
||||||
|
|||||||
@ -38,7 +38,8 @@ CRT0_O = crt0_firm.o
|
|||||||
|
|
||||||
include $(TWLIPL_ROOT)/build/buildtools/commondefs
|
include $(TWLIPL_ROOT)/build/buildtools/commondefs
|
||||||
|
|
||||||
LLIBRARIES = libaes_sp$(TWL_LIBSUFFIX).a
|
LLIBRARIES = libaes_sp$(TWL_LIBSUFFIX).a
|
||||||
|
MAKELCF_FLAGS += -DADDRESS_LTDWRAM='0x037c0000'
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@ -32,8 +32,6 @@
|
|||||||
|
|
||||||
static u8 fatfsHeap[FATFS_HEAP_SIZE] __attribute__ ((aligned (32)));
|
static u8 fatfsHeap[FATFS_HEAP_SIZE] __attribute__ ((aligned (32)));
|
||||||
|
|
||||||
static SDPortContextData nandContext; // 一時待避用 (次に渡すならSHAREDのどこかのアドレスにする)
|
|
||||||
|
|
||||||
#ifndef SDK_FINALROM
|
#ifndef SDK_FINALROM
|
||||||
static u8 step = 0x80;
|
static u8 step = 0x80;
|
||||||
#endif
|
#endif
|
||||||
@ -55,7 +53,7 @@ u32 pf_cnt = 0;
|
|||||||
/***************************************************************
|
/***************************************************************
|
||||||
PreInit
|
PreInit
|
||||||
|
|
||||||
FromBootの対応をまとめる&メインメモリの初期化
|
FromBootの対応&メインメモリの初期化
|
||||||
OS_Init前なので注意 (ARM9によるメインメモリ初期化で消されないように注意)
|
OS_Init前なので注意 (ARM9によるメインメモリ初期化で消されないように注意)
|
||||||
***************************************************************/
|
***************************************************************/
|
||||||
static void PreInit(void)
|
static void PreInit(void)
|
||||||
@ -63,11 +61,10 @@ static void PreInit(void)
|
|||||||
/*
|
/*
|
||||||
FromBrom関連
|
FromBrom関連
|
||||||
*/
|
*/
|
||||||
|
if ( !OSi_FromBromToMenu() )
|
||||||
// NANDパラメータの待避
|
{
|
||||||
nandContext = OSi_GetFromBromAddr()->SDNandContext;
|
OS_Terminate();
|
||||||
|
}
|
||||||
MIi_CpuClearFast( 0, (void*)OSi_GetFromBromAddr(), sizeof(OSFromBromBuf) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************
|
/***************************************************************
|
||||||
@ -138,7 +135,7 @@ void TwlSpMain( void )
|
|||||||
OS_SetDebugLED(++step);
|
OS_SetDebugLED(++step);
|
||||||
PRODUCTION_CHECK();
|
PRODUCTION_CHECK();
|
||||||
|
|
||||||
if ( FATFS_InitFIRM( &nandContext ) )
|
if ( FATFS_InitFIRM( NULL ) )
|
||||||
{
|
{
|
||||||
#ifndef SDK_FINALROM
|
#ifndef SDK_FINALROM
|
||||||
// 3: after FATFS
|
// 3: after FATFS
|
||||||
|
|||||||
@ -47,29 +47,23 @@ u32 pf_cnt = 0;
|
|||||||
/***************************************************************
|
/***************************************************************
|
||||||
PreInit
|
PreInit
|
||||||
|
|
||||||
FromBootの対応をまとめる&メインメモリの初期化
|
FromBootの対応&OS_Init前に必要なメインメモリの初期化
|
||||||
OS_Init前なので注意
|
|
||||||
MI_LoadHeader前にかなり(数100msec)時間があるので、可能なら
|
|
||||||
OS_Init後にいろいろ処理したい!
|
|
||||||
***************************************************************/
|
***************************************************************/
|
||||||
static void PreInit(void)
|
static void PreInit(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
メインメモリ関連
|
メインメモリ関連
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// SHARED領域クリア (IS-TWL-DEBUGGERの更新待ち)
|
|
||||||
#ifdef SDK_FINALROM
|
|
||||||
//MIi_CpuClearFast( 0, (void*)HW_MAIN_MEM_SHARED, HW_MAIN_MEM_SHARED_END-HW_MAIN_MEM_SHARED );
|
|
||||||
#endif
|
|
||||||
// SHARED領域クリア (ここだけでOK?)
|
// SHARED領域クリア (ここだけでOK?)
|
||||||
MIi_CpuClearFast( 0, (void*)HW_PXI_SIGNAL_PARAM_ARM9, HW_MAIN_MEM_SHARED_END-HW_PXI_SIGNAL_PARAM_ARM9);
|
MIi_CpuClearFast( 0, (void*)HW_PXI_SIGNAL_PARAM_ARM9, HW_MAIN_MEM_SHARED_END-HW_PXI_SIGNAL_PARAM_ARM9);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FromBrom関連
|
FromBrom関連
|
||||||
*/
|
*/
|
||||||
|
if ( !OSi_FromBromToMenu() )
|
||||||
MIi_CpuClearFast( 0, (void*)OSi_GetFromBromAddr(), sizeof(OSFromBromBuf) );
|
{
|
||||||
|
OS_Terminate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************
|
/***************************************************************
|
||||||
@ -79,13 +73,17 @@ static void PreInit(void)
|
|||||||
OS_Init後にいろいろ処理したい!
|
OS_Init後にいろいろ処理したい!
|
||||||
メインメモリの初期化
|
メインメモリの初期化
|
||||||
***************************************************************/
|
***************************************************************/
|
||||||
|
extern u32 SDK_SECTION_ARENA_DTCM_START;
|
||||||
static void PostInit(void)
|
static void PostInit(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
メインメモリ関連 (ARM9用の領域を全クリア)
|
メインメモリ関連
|
||||||
*/
|
*/
|
||||||
|
// (DTCMの手前までの領域を全クリア)
|
||||||
|
//MI_CpuClearFast( (void*)HW_DELIVER_ARG_BUF_END, SDK_SECTION_ARENA_DTCM_START-HW_DELIVER_ARG_BUF_END );
|
||||||
|
// (ARM9領域を全クリア)
|
||||||
|
MI_CpuClearFast( (void*)HW_DELIVER_ARG_BUF_END, HW_MAIN_MEM_MAIN_END-HW_DELIVER_ARG_BUF_END );
|
||||||
|
|
||||||
MIi_CpuClearFast( 0, (void*)HW_DELIVER_ARG_BUF_END, HW_TWL_MAIN_MEM_MAIN_SIZE-HW_DELIVER_ARG_BUF_SIZE );
|
|
||||||
DC_FlushAll();
|
DC_FlushAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -937,7 +937,7 @@ static BOOL InitializeGcdfirmFile(void)
|
|||||||
{
|
{
|
||||||
ReadRomHeaderFile( GetSrcPath(GetAppBaseName(), DEFAULT_ROMHEADER_TEMPLATE) );
|
ReadRomHeaderFile( GetSrcPath(GetAppBaseName(), DEFAULT_ROMHEADER_TEMPLATE) );
|
||||||
|
|
||||||
memset(&signedContext.hash[FIRM_SIGNED_HASH_IDX_HASH_TABLE], 0xff, sizeof(signedContext.hash[0]));
|
memset(&signedContext.hash[FIRM_SIGNED_HASH_IDX_HASH_TABLE], 0x00, sizeof(signedContext.hash[0]));
|
||||||
gcdHeader.h.w = wram_regs_init;
|
gcdHeader.h.w = wram_regs_init;
|
||||||
InitializeAesKey();
|
InitializeAesKey();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
@ -909,7 +909,7 @@ static BOOL InitializeAesKey(void)
|
|||||||
|
|
||||||
static BOOL InitializeNandfirmFile(void)
|
static BOOL InitializeNandfirmFile(void)
|
||||||
{
|
{
|
||||||
memset(&signedContext.hash[FIRM_SIGNED_HASH_IDX_HASH_TABLE], 0xff, sizeof(signedContext.hash[0]));
|
memset(&signedContext.hash[FIRM_SIGNED_HASH_IDX_HASH_TABLE], 0x00, sizeof(signedContext.hash[0]));
|
||||||
nandHeader.o.h.w = wram_regs_init;
|
nandHeader.o.h.w = wram_regs_init;
|
||||||
nandHeader.m.h.w = wram_regs_init;
|
nandHeader.m.h.w = wram_regs_init;
|
||||||
InitializeAesKey();
|
InitializeAesKey();
|
||||||
|
|||||||
@ -934,7 +934,7 @@ static BOOL InitializeAesKey(void)
|
|||||||
static BOOL InitializeNorfirmFile(void)
|
static BOOL InitializeNorfirmFile(void)
|
||||||
{
|
{
|
||||||
memset(norHeader.wl_params, 0xff, sizeof(norHeader.wl_params));
|
memset(norHeader.wl_params, 0xff, sizeof(norHeader.wl_params));
|
||||||
memset(&signedContext.hash[FIRM_SIGNED_HASH_IDX_HASH_TABLE], 0xff, sizeof(signedContext.hash[0]));
|
memset(&signedContext.hash[FIRM_SIGNED_HASH_IDX_HASH_TABLE], 0x00, sizeof(signedContext.hash[0]));
|
||||||
norHeader.l.boot_nandfirm = TRUE;
|
norHeader.l.boot_nandfirm = TRUE;
|
||||||
InitializeAesKey();
|
InitializeAesKey();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
@ -44,7 +44,13 @@ typedef struct SDportContextData
|
|||||||
}
|
}
|
||||||
SDPortContextData;
|
SDPortContextData;
|
||||||
|
|
||||||
|
/*
|
||||||
|
hash_table_hashは、ファームヘッダの署名の中に埋められた値(現状0xffで埋められている)
|
||||||
|
ファームブート後に追加データをメインメモリにロードする必要に駆られた場合、
|
||||||
|
そのハッシュ値をmakenandfirm等で埋め込むようにすることで保護できる。
|
||||||
|
(Static部分に埋めても大差ないと思われるが・・・)
|
||||||
|
未使用の場合(現状)、0xffで埋められていることを確認すべき
|
||||||
|
*/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
union
|
union
|
||||||
|
|||||||
69
include/firm/format/from_firm.h
Normal file
69
include/firm/format/from_firm.h
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Project: TwlFirm - format - from_firm
|
||||||
|
File: from_firm.h
|
||||||
|
|
||||||
|
Copyright 2007 Nintendo. All rights reserved.
|
||||||
|
|
||||||
|
These coded instructions, statements, and computer programs contain
|
||||||
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||||||
|
Company Ltd., and are protected by Federal copyright law. They may
|
||||||
|
not be disclosed to third parties or copied or duplicated in any form,
|
||||||
|
in whole or in part, without the prior written consent of Nintendo.
|
||||||
|
|
||||||
|
$Date:: 2007-09-06$
|
||||||
|
$Rev$
|
||||||
|
$Author$
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
#ifndef FIRM_FORMAT_FROM_FIRM_H_
|
||||||
|
#define FIRM_FORMAT_FROM_FIRM_H_
|
||||||
|
|
||||||
|
#include <firm/gcd/blowfish.h>
|
||||||
|
#include <firm/format/from_brom.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SDK_ARM9
|
||||||
|
#define RSA_PUBKEY_NUM_FROM_FIRM 8
|
||||||
|
#define AESKEY_NUM_FROM_FIRM 8
|
||||||
|
#else // SDK_ARM7
|
||||||
|
#define RSA_PUBKEY_NUM_FROM_FIRM 4
|
||||||
|
#define AESKEY_NUM_FROM_FIRM 4
|
||||||
|
#endif // SDK_ARM7
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
u8 rsa_pubkey[RSA_PUBKEY_NUM_FROM_FIRM][ACS_PUBKEY_LEN]; // 1KB
|
||||||
|
u8 aes_key[AESKEY_NUM_FROM_FIRM][ACS_AES_LEN]; // 128B
|
||||||
|
u8 reserved[ACS_HASH_LEN]; // 20B
|
||||||
|
|
||||||
|
BLOWFISH_CTX ds_blowfish; // 4KB + ƒ¿
|
||||||
|
BLOWFISH_CTX twl_blowfish; // 4KB + ƒ¿
|
||||||
|
}
|
||||||
|
OSFromFirm9Buf;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
u8 rsa_pubkey[RSA_PUBKEY_NUM_FROM_FIRM][ACS_PUBKEY_LEN]; // 512B
|
||||||
|
u8 aes_key[AESKEY_NUM_FROM_FIRM][ACS_AES_LEN]; // 64B
|
||||||
|
u8 reserved[ACS_HASH_LEN]; // 20B
|
||||||
|
|
||||||
|
BLOWFISH_CTX twl_blowfish[2]; // (4KB + ƒ¿) * 2
|
||||||
|
|
||||||
|
SDPortContextData SDNandContext;
|
||||||
|
}
|
||||||
|
OSFromFirm7Buf;
|
||||||
|
|
||||||
|
#ifdef SDK_ARM9
|
||||||
|
typedef OSFromFirm9Buf OSFromFirmBuf;
|
||||||
|
#else // SDK_ARM7
|
||||||
|
typedef OSFromFirm7Buf OSFromFirmBuf;
|
||||||
|
#endif // SDK_ARM7
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} /* extern "C" */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // FIRM_FORMAT_FROM_FIRM_H_
|
||||||
@ -41,6 +41,11 @@ extern "C" {
|
|||||||
#define HW_FIRM_FROM_BROM_BUF_END (HW_WRAM_AREA_END - 0x1000) // END - 4KB
|
#define HW_FIRM_FROM_BROM_BUF_END (HW_WRAM_AREA_END - 0x1000) // END - 4KB
|
||||||
#define HW_FIRM_FROM_BROM_BUF_SIZE 0x3000 // 12KB
|
#define HW_FIRM_FROM_BROM_BUF_SIZE 0x3000 // 12KB
|
||||||
|
|
||||||
|
//------------------------------------- HW_FIRM_FROM_FIRM_BUF
|
||||||
|
#define HW_FIRM_FROM_FIRM_BUF (HW_FIRM_FROM_FIRM_BUF_END - HW_FIRM_FROM_FIRM_BUF_SIZE)
|
||||||
|
#define HW_FIRM_FROM_FIRM_BUF_END (HW_WRAM_AREA_END - 0x1000) // END - 4KB
|
||||||
|
#define HW_FIRM_FROM_FIRM_BUF_SIZE 0x2C00 // 11KB
|
||||||
|
|
||||||
//------------------------------------- HW_FIRM_APP_BUF
|
//------------------------------------- HW_FIRM_APP_BUF
|
||||||
#define HW_FIRM_APP_BUF (HW_MAIN_MEM_HI_EX_END - HW_FIRM_APP_BUF_SIZE)
|
#define HW_FIRM_APP_BUF (HW_MAIN_MEM_HI_EX_END - HW_FIRM_APP_BUF_SIZE)
|
||||||
#define HW_FIRM_APP_BUF_END (HW_FIRM_APP_BUF + HW_FIRM_APP_BUF_SIZE)
|
#define HW_FIRM_APP_BUF_END (HW_FIRM_APP_BUF + HW_FIRM_APP_BUF_SIZE)
|
||||||
|
|||||||
@ -31,6 +31,11 @@ extern "C" {
|
|||||||
#define HW_FIRM_FROM_BROM_BUF_END (HW_ITCM_END - 0x1000) // END - 4KB
|
#define HW_FIRM_FROM_BROM_BUF_END (HW_ITCM_END - 0x1000) // END - 4KB
|
||||||
#define HW_FIRM_FROM_BROM_BUF_SIZE 0x3000 // 12KB
|
#define HW_FIRM_FROM_BROM_BUF_SIZE 0x3000 // 12KB
|
||||||
|
|
||||||
|
//------------------------------------- HW_FIRM_FROM_FIRM_BUF
|
||||||
|
#define HW_FIRM_FROM_FIRM_BUF (HW_FIRM_FROM_FIRM_BUF_END - HW_FIRM_FROM_FIRM_BUF_SIZE)
|
||||||
|
#define HW_FIRM_FROM_FIRM_BUF_END (HW_ITCM_END - 0x1000) // END - 4KB
|
||||||
|
#define HW_FIRM_FROM_FIRM_BUF_SIZE 0x2C00 // 11KB
|
||||||
|
|
||||||
//------------------------------------- HW_FIRM_APP_BUF
|
//------------------------------------- HW_FIRM_APP_BUF
|
||||||
#define HW_FIRM_APP_BUF (HW_MAIN_MEM_HI_EX_END - HW_FIRM_APP_BUF_SIZE)
|
#define HW_FIRM_APP_BUF (HW_MAIN_MEM_HI_EX_END - HW_FIRM_APP_BUF_SIZE)
|
||||||
#define HW_FIRM_APP_BUF_END (HW_FIRM_APP_BUF + HW_FIRM_APP_BUF_SIZE)
|
#define HW_FIRM_APP_BUF_END (HW_FIRM_APP_BUF + HW_FIRM_APP_BUF_SIZE)
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <firm.h>
|
#include <firm.h>
|
||||||
#include <firm/format/from_brom.h>
|
#include <firm/format/from_brom.h>
|
||||||
|
#include <firm/format/from_firm.h>
|
||||||
#include <twl/os/common/format_rom.h>
|
#include <twl/os/common/format_rom.h>
|
||||||
|
|
||||||
#include <nitro/hw/common/armArch.h>
|
#include <nitro/hw/common/armArch.h>
|
||||||
@ -63,6 +64,17 @@ void OSi_Finalize(void);
|
|||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void OSi_ClearWorkArea( void );
|
void OSi_ClearWorkArea( void );
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Name: OSi_FromBromToMenu
|
||||||
|
|
||||||
|
Description: convert OSFromBromBuf to OSFromFirmBuf
|
||||||
|
|
||||||
|
Arguments: None
|
||||||
|
|
||||||
|
Returns: FALSE if FromBrom is broken
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
BOOL OSi_FromBromToMenu( void );
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OSi_GetFromBromAddr
|
Name: OSi_GetFromBromAddr
|
||||||
|
|
||||||
@ -77,6 +89,19 @@ static inline OSFromBromBuf* OSi_GetFromBromAddr( void )
|
|||||||
return (OSFromBromBuf*)HW_FIRM_FROM_BROM_BUF;
|
return (OSFromBromBuf*)HW_FIRM_FROM_BROM_BUF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*
|
||||||
|
Name: OSi_GetFromFirmAddr
|
||||||
|
|
||||||
|
Description: data address from firm to menu
|
||||||
|
|
||||||
|
Arguments: None
|
||||||
|
|
||||||
|
Returns: address
|
||||||
|
*---------------------------------------------------------------------------*/
|
||||||
|
static inline OSFromFirmBuf* OSi_GetFromFirmAddr( void )
|
||||||
|
{
|
||||||
|
return (OSFromFirmBuf*)HW_FIRM_FROM_FIRM_BUF;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Project: TwlSDK - include
|
# Project: TwlSDK - include
|
||||||
# File: ARM7-BB.lcf.template
|
# File: ARM7-TS-FIRM.lcf.template
|
||||||
#
|
#
|
||||||
# Copyright 2007 Nintendo. All rights reserved.
|
# Copyright 2007 Nintendo. All rights reserved.
|
||||||
#
|
#
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Project: TwlFirm - include
|
# Project: TwlFirm - include
|
||||||
# File: ARM7-TS-NORFIRM.lsf
|
# File: ARM7-TS-FIRM.lsf
|
||||||
#
|
#
|
||||||
# Copyright 2007 Nintendo. All rights reserved.
|
# Copyright 2007 Nintendo. All rights reserved.
|
||||||
#
|
#
|
||||||
@ -29,3 +29,14 @@ Static $(TARGET_NAME)
|
|||||||
Object * (.ltdmain)
|
Object * (.ltdmain)
|
||||||
StackSize 1024 1024
|
StackSize 1024 1024
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#Autoload WRAM
|
||||||
|
#{
|
||||||
|
# Address $(ADDRESS_LTDWRAM)
|
||||||
|
#}
|
||||||
|
|
||||||
|
#Ltdautoload LTDMAIN
|
||||||
|
#{
|
||||||
|
## Address 0x02f88000
|
||||||
|
# Address 0x02380000
|
||||||
|
#}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user