-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathld.cfg
executable file
·66 lines (52 loc) · 2.57 KB
/
ld.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# our cartridge is configured with 128K of RAM and 1M of ROM.
# the MMC5 mapper uses 8K banks. that gives us 16 RAM banks and 128 ROM banks.
# the MMC5 is configured to use 16K ROM windows to view 2 contiguous 8K banks at a time.
# read the MMC5 documentation for more details.
# https://www.nesdev.org/wiki/MMC5
MEMORY {
# system RAM.
ZEROPAGE: file = "", start = $0000, size = $0100, type = rw;
STACK: file = "", start = $0100, size = $0100, type = rw;
SYS_RAM: file = "", start = $0200, size = $0600, type = rw;
# 128K of cartridge RAM dedicated to x86 processes.
X86_RAM: file = "", start = $0000, size = $20000, type = rw, define = yes;
# iNES/NES 2.0 file header.
HEADER: file = %O, start = $0000, size = $0010, type = ro, fill = yes;
# 896K of ROM dedicated to x86 code and data.
X86_ROM: file = %O, start = $20000, size = $E0000, type = ro, fill = yes, define = yes;
# unused ROM space
UNUSED: file = %O, start = $0000, size = $1C000, type = ro, fill = yes;
# emulator code and data.
EMU_ROM: file = %O, start = $C000, size = $4000, type = ro, fill = yes;
# character ROM.
CHR_ROM: file = %O, start = $0000, size = $2000, type = ro, fill = yes;
}
SEGMENTS {
# system RAM.
TEMP: load = ZEROPAGE, type = zp, define = yes;
ZEROPAGE: load = ZEROPAGE, type = zp, define = yes;
STACK: load = STACK, type = bss, define = yes, optional = true;
OAM: load = SYS_RAM, type = bss, define = yes, optional = true;
BSS: load = SYS_RAM, type = bss, define = yes;
# cartridge RAM.
RAM: load = X86_RAM, type = bss, define = yes, optional = true;
# iNES/NES 2.0 file header.
HEADER: load = HEADER, type = ro, define = yes;
# ELKS ROM filesystem.
ROMFS: load = X86_ROM, type = ro, define = yes, start=$80000;
# ELKS boot code.
BOOT: load = X86_ROM, type = ro, define = yes, start=$E0000;
# PC BIOS.
BIOS: load = X86_ROM, type = ro, define = yes, start=$F0000;
# read-only data.
RODATA: load = EMU_ROM, type = ro, define = yes;
# executable code.
CODE: load = EMU_ROM, type = ro, define = yes;
# code and data that is available immediately after reset and will always remain available.
# i.e. interrupt handlers and early initialization code.
LOWCODE: load = EMU_ROM, type = ro, define = yes, start=$F000;
# interrupt vectors.
VECTORS: load = EMU_ROM, type = ro, define = yes, start=$FFFA;
# character ROM.
CHR: load = CHR_ROM, type = ro;
}