-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
873e649
commit b3edf9f
Showing
5 changed files
with
82 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Hrb file format | ||
|
||
From 22.5 | ||
|
||
0x0000 (DWORD) ......请求操作系统为应用程序准备的数据段的大小 | ||
0x0004 (DWORD) ......"Hari"(.hrb 文件的标记) | ||
0x0008 (DWORD) ......数据段内预备空间的大小 | ||
0x000c (DWORD) ......ESP 初始值&数据部分传送目的地址 | ||
0x0010 (DWORD) ......hrb 文件內数据部分的大小 | ||
0×0014 (DWORD) ......hrb 文件内数据部分从哪里开始 | ||
0x0018 (DWORD) ......Oxe9000000 | ||
0x001c (DWORD) ......应用程序运行入口地址 - 0x20 | ||
0x0020 (DWORD) ......malloc 空间的起始地址 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
From 22 day section 5 | ||
|
||
0x0000 (DWORD) ......Size of the data segment requested by the operating system for the application | ||
0x0004 (DWORD) ......"Hari" (signature of the .hrb file) | ||
0x0008 (DWORD) ......Size of the pre-allocated space in the data segment | ||
0x000c (DWORD) ......Initial value of ESP & transfer destination address of the data segment | ||
0x0010 (DWORD) ......Size of the data segment in the .hrb file | ||
0x0014 (DWORD) ......Starting point of the data segment in the .hrb file | ||
0x0018 (DWORD) ......0xe9000000 | ||
0x001c (DWORD) ......Entry address of the application - 0x20 | ||
0x0020 (DWORD) ......Starting address of the malloc space | ||
*/ | ||
|
||
OUTPUT_FORMAT("binary"); | ||
|
||
/* Define parameters with default values */ | ||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : 64 * 1024; | ||
SIGNATURE = 0x69726148; /* 'H' = 0x48, 'a' = 0x61, 'r' = 0x72, 'i' = 0x69 */ | ||
MMAREA_SIZE = 0; | ||
STACK_INIT = DEFINED(STACK_INIT) ? STACK_INIT : 0x310000; | ||
DATA_SIZE = SIZEOF(.data); | ||
DATA_INIT_ADDR = LOADADDR(.data); | ||
CONSTANT_0xE9000000 = 0xE9000000; | ||
ENTRY_ADDR_OFFSET = _HariMain - 0x20; | ||
HEAP_START_ADDR = DEFINED(HEAP_START_ADDR) ? HEAP_START_ADDR : 0; | ||
|
||
SECTIONS | ||
{ | ||
.head 0x0 : { | ||
LONG(STACK_SIZE) | ||
LONG(SIGNATURE) | ||
LONG(MMAREA_SIZE) | ||
LONG(STACK_INIT) | ||
LONG(DATA_SIZE) | ||
LONG(DATA_INIT_ADDR) | ||
LONG(CONSTANT_0xE9000000) | ||
LONG(ENTRY_ADDR_OFFSET) | ||
LONG(HEAP_START_ADDR) | ||
} | ||
|
||
.text : { *(.text) } | ||
|
||
.data STACK_INIT : AT ( ADDR(.text) + SIZEOF(.text) ) { | ||
*(.data) | ||
*(.rodata*) | ||
*(.bss) | ||
} | ||
|
||
/DISCARD/ : { *(.eh_frame) } | ||
} |