summaryrefslogtreecommitdiff
path: root/05/constants.b
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-02-10 16:06:17 -0500
committerpommicket <pommicket@gmail.com>2022-02-10 16:06:17 -0500
commitd8bb5b8957f705c3b0489878b19463f52ffb95ed (patch)
tree26adc60807704bf14cba7d37d74e5c896da6b8f0 /05/constants.b
parentb88de92fc7276a1548abbd8d30ed83d554db4146 (diff)
first working executable!
Diffstat (limited to '05/constants.b')
-rw-r--r--05/constants.b7
1 files changed, 5 insertions, 2 deletions
diff --git a/05/constants.b b/05/constants.b
index c6555ee..67825a3 100644
--- a/05/constants.b
+++ b/05/constants.b
@@ -1,15 +1,18 @@
; this is the format of the executables we produce:
; elf header 2MB addresses 0x000000-0x200000 (no, it won't actually take up that much space)
; entry point 2MB addresses 0x200000-0x3fffff this is where we put the code to call main(), etc. (again, it won't actually take up that much space)
-; code (functions) 4MB addresses 0x400000-0x7fffff
+; functions 4MB addresses 0x400000-0x7fffff
; read-only data 4MB addresses 0x800000-0xbfffff
; read-write data 4MB addresses 0xc00000-0xffffff
; note that file offsets and runtime addresses are the same.
-; you should be able to change these constants without breaking anything:
+; you should be able to change these constants (in a way that's consistent) without breaking anything:
#define ENTRY_ADDR 0x200000
#define FUNCTIONS_ADDR 0x400000
+#define TOTAL_CODE_SIZE 0x600000
#define RODATA_ADDR 0x800000
+#define RODATA_SIZE 0x400000
#define RWDATA_ADDR 0xc00000
+#define RWDATA_SIZE 0x400000
#define RWDATA_END 0x1000000
#define EXECUTABLE_SIZE 0x1000000