Skip to content

Commit

Permalink
Merge pull request #12 from ProjectRevoTPP/dump_init_ptrs
Browse files Browse the repository at this point in the history
Dump some init tables and OS.s strings.
  • Loading branch information
RevoSucks authored May 24, 2021
2 parents d9e81f2 + 1da42a5 commit 3982d01
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 60 deletions.
52 changes: 35 additions & 17 deletions asm/os/OS.s
Original file line number Diff line number Diff line change
Expand Up @@ -691,42 +691,60 @@ __OSGetDIConfig:
/* 8008CE80 00089DC0 4E 80 00 20 */ blr

.section .data, "wa" # 0x803A8380 - 0x803E6000
.balign 8
$$284:
.incbin "baserom.dol", 0x3AC0C0, 0x20
.asciz "\nDolphin OS $Revision: 54 $.\n"
.balign 8
$$285:
.incbin "baserom.dol", 0x3AC0E0, 0x18
.asciz "Kernel built : %s %s\n"
.balign 8
$$286:
.incbin "baserom.dol", 0x3AC0F8, 0xC
.asciz "Jun 5 2002"
.balign 4
$$287:
.incbin "baserom.dol", 0x3AC104, 0xC
.asciz "02:09:12"
.balign 8
$$288:
.incbin "baserom.dol", 0x3AC110, 0x10
.asciz "Console Type : "
.balign 8
$$289:
.incbin "baserom.dol", 0x3AC120, 0xC
.asciz "Retail %d\n"
.balign 4
$$290:
.incbin "baserom.dol", 0x3AC12C, 0x10
.asciz "Mac Emulator\n"
.balign 4
$$291:
.incbin "baserom.dol", 0x3AC13C, 0x10
.asciz "PC Emulator\n"
.balign 4
$$292:
.incbin "baserom.dol", 0x3AC14C, 0x10
.asciz "EPPC Arthur\n"
.balign 4
$$293:
.incbin "baserom.dol", 0x3AC15C, 0x10
.asciz "EPPC Minnow\n"
.balign 4
$$294:
.incbin "baserom.dol", 0x3AC16C, 0x14
.asciz "Development HW%d\n"
.balign 4
$$295:
.incbin "baserom.dol", 0x3AC180, 0x10
.asciz "Memory %d MB\n"
.balign 4
$$296:
.incbin "baserom.dol", 0x3AC190, 0x18
.asciz "Arena : 0x%x - 0x%x\n"
.balign 4
__OSExceptionLocations:
.incbin "baserom.dol", 0x3AC1A8, 0x3C
$$2130:
.incbin "baserom.dol", 0x3AC1E4, 0x1C
.asciz "Installing OSDBIntegrator\n"
.balign 4
$$2131:
.incbin "baserom.dol", 0x3AC200, 0x30
.asciz ">>> OSINIT: exception %d commandeered by TRK\n"
.balign 4
$$2132:
.incbin "baserom.dol", 0x3AC230, 0x30
.asciz ">>> OSINIT: exception %d vectored to debugger\n"
.balign 4
$$2133:
.incbin "baserom.dol", 0x3AC260, 0x20
.asciz "Exceptions initialized...\n"
.balign 8

.section .bss, "wa" # 0x803E6000 - 0x80408AC0
DriveInfo:
Expand Down
104 changes: 61 additions & 43 deletions asm/os/__ppc_eabi_init.s
Original file line number Diff line number Diff line change
Expand Up @@ -31,53 +31,71 @@ lbl_80005474:

.global lbl_80005494
lbl_80005494:
/* 80005494 00002494 80 00 31 00 */ lwz r0, 0x3100(0)
/* 80005498 00002498 80 00 31 00 */ lwz r0, 0x3100(0)
/* 8000549C 0000249C 00 00 24 30 */ .4byte 0x00002430 /* unknown instruction */
/* 800054A0 000024A0 80 00 55 40 */ lwz r0, 0x5540(0)
/* 800054A4 000024A4 80 00 55 40 */ lwz r0, 0x5540(0)
/* 800054A8 000024A8 00 00 00 48 */ .4byte 0x00000048 /* unknown instruction */
/* 800054AC 000024AC 80 00 55 A0 */ lwz r0, 0x55a0(0)
/* 800054B0 000024B0 80 00 55 A0 */ lwz r0, 0x55a0(0)
/* 800054B4 000024B4 00 00 00 5C */ .4byte 0x0000005C /* unknown instruction */
/* 800054B8 000024B8 80 00 56 00 */ lwz r0, 0x5600(0)
/* 800054BC 000024BC 80 00 56 00 */ lwz r0, 0x5600(0)
/* 800054C0 000024C0 00 36 A5 88 */ .4byte 0x0036A588 /* unknown instruction */
/* 800054C4 000024C4 80 36 FB A0 */ lwz r1, -0x460(r22)
/* 800054C8 000024C8 80 36 FB A0 */ lwz r1, -0x460(r22)
/* 800054CC 000024CC 00 00 03 C4 */ .4byte 0x000003C4 /* unknown instruction */
/* 800054D0 000024D0 80 36 FF 80 */ lwz r1, -0x80(r22)
/* 800054D4 000024D4 80 36 FF 80 */ lwz r1, -0x80(r22)
/* 800054D8 000024D8 00 00 00 10 */ .4byte 0x00000010 /* unknown instruction */
/* 800054DC 000024DC 80 36 FF A0 */ lwz r1, -0x60(r22)
/* 800054E0 000024E0 80 36 FF A0 */ lwz r1, -0x60(r22)
/* 800054E4 000024E4 00 03 83 D7 */ .4byte 0x000383D7 /* unknown instruction */
/* 800054E8 000024E8 80 3A 83 80 */ lwz r1, -0x7c80(r26)
/* 800054EC 000024EC 80 3A 83 80 */ lwz r1, -0x7c80(r26)
/* 800054F0 000024F0 00 03 DC 6C */ .4byte 0x0003DC6C /* unknown instruction */
/* 800054F4 000024F4 80 40 8A C0 */ lwz r2, -0x7540(0)
/* 800054F8 000024F8 80 40 8A C0 */ lwz r2, -0x7540(0)
/* 800054FC 000024FC 00 00 0C EC */ .4byte 0x00000CEC /* unknown instruction */
/* 80005500 00002500 80 40 B4 60 */ lwz r2, -0x4ba0(0)
/* 80005504 00002504 80 40 B4 60 */ lwz r2, -0x4ba0(0)
/* 80005508 00002508 00 00 8B A4 */ .4byte 0x00008BA4 /* unknown instruction */
/* 8000550C 0000250C 00 00 00 00 */ .4byte 0x00000000 /* unknown instruction */
/* 80005510 00002510 00 00 00 00 */ .4byte 0x00000000 /* unknown instruction */
/* 80005514 00002514 00 00 00 00 */ .4byte 0x00000000 /* unknown instruction */
.4byte _f_init
.4byte _f_init
.4byte _size_init_reduced

.4byte _fextab_
.4byte _fextab_
.4byte _size_extab_reduced

.4byte _fextabindex_
.4byte _fextabindex_
.4byte _size_extabindex_reduced

.4byte _f_text
.4byte _f_text
.4byte _size_text_reduced

.4byte _f_ctors
.4byte _f_ctors
.4byte _size_ctors_reduced

.4byte _f_dtors
.4byte _f_dtors
.4byte _size_dtors_reduced

.4byte _f_rodata
.4byte _f_rodata
.4byte _size_rodata_reduced

.4byte _f_data
.4byte _f_data
.4byte _size_data_reduced

.4byte _f_sdata
.4byte _f_sdata
.4byte _size_sdata_reduced

.4byte _f_sdata2
.4byte _f_sdata2
.4byte _size_sdata2_reduced

/* terminating? */
.4byte 0
.4byte 0
.4byte 0

.balign 4
.global lbl_80005518
lbl_80005518:
/* 80005518 00002518 80 3E 60 00 */ lwz r1, 0x6000(r30)
/* 8000551C 0000251C 00 02 2A C0 */ .4byte 0x00022AC0 /* unknown instruction */
/* 80005520 00002520 80 40 97 C0 */ lwz r2, -0x6840(0)
/* 80005524 00002524 00 00 1C 9C */ .4byte 0x00001C9C /* unknown instruction */
/* 80005528 00002528 00 00 00 00 */ .4byte 0x00000000 /* unknown instruction */
/* 8000552C 0000252C 00 00 00 00 */ .4byte 0x00000000 /* unknown instruction */
/* 80005530 00002530 00 00 00 00 */ .4byte 0x00000000 /* unknown instruction */
/* 80005534 00002534 00 00 00 00 */ .4byte 0x00000000 /* unknown instruction */
/* 80005538 00002538 00 00 00 00 */ .4byte 0x00000000 /* unknown instruction */
/* 8000553C 0000253C 00 00 00 00 */ .4byte 0x00000000 /* unknown instruction */
.4byte _f_bss
.4byte _size_bss
.4byte _f_sbss
.4byte _size_sbss

/* terminating? */
.4byte 0
.4byte 0

/* We need these 4 bytes for the full .init size in the header, even */
/* though the above table doesn't see these. TODO: What's the discrepency? */
.4byte 0
.4byte 0
.4byte 0
.4byte 0

.balign 8
.section .text, "ax" # 0x80005600 - 0x8036FBA0
.global __init_user
__init_user:
Expand Down
28 changes: 28 additions & 0 deletions ldscript.lcf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,34 @@ SECTIONS {
_db_stack_end = _stack_addr;
__ArenaLo = (_db_stack_addr + 0x1f) & ~0x1f;
__ArenaHi = 0x81700000;

/* Sizes */
_size_init = SIZEOF(.init);
_size_extab = SIZEOF(extab_);
_size_extabindex = SIZEOF(extabindex_);
_size_text = SIZEOF(.text);
_size_ctors = SIZEOF(.ctors);
_size_dtors = SIZEOF(.dtors);
_size_rodata = SIZEOF(.rodata);
_size_data = SIZEOF(.data);
_size_sdata = SIZEOF(.sdata);
_size_sdata2 = SIZEOF(.sdata2);
_size_bss = SIZEOF(.bss); /* unlike the other sections, we can use this size symbol as-is. */
_size_sbss = SIZEOF(.sbss);

/* Sizes, but reduced to match lbl_80005494 entries. */
/* TODO: Figure out why they're reduced with seemingly */
/* random offsets? */
_size_init_reduced = _size_init-0x10;
_size_extab_reduced = _size_extab-0x18;
_size_extabindex_reduced = _size_extabindex-0x4;
_size_text_reduced = _size_text-0x18;
_size_ctors_reduced = _size_ctors-0x1C;
_size_dtors_reduced = _size_dtors-0x10;
_size_rodata_reduced = _size_rodata-0x9;
_size_data_reduced = _size_data-0x14;
_size_sdata_reduced = _size_sdata-0x14;
_size_sdata2_reduced = _size_sdata2-0x1C;
}

FORCEFILES {
Expand Down

0 comments on commit 3982d01

Please sign in to comment.