From e00c2643ba78d61996ee8bfbf6931d80d010c183 Mon Sep 17 00:00:00 2001
From: Brad Nelson
Date: Tue, 23 Feb 2021 20:41:14 -0800
Subject: [PATCH] Pin windows and linux memory layout, document baud rate.
---
ueforth/Makefile | 2 ++
ueforth/posix/posix_main.c | 4 +++-
ueforth/site/ESP32forth.html | 7 +++++++
ueforth/windows/windows_main.c | 3 ++-
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/ueforth/Makefile b/ueforth/Makefile
index d6b63f4..74805e5 100644
--- a/ueforth/Makefile
+++ b/ueforth/Makefile
@@ -26,8 +26,10 @@ CFLAGS_MINIMIZE = \
-ffunction-sections -fdata-sections \
-fmerge-all-constants
CFLAGS = $(CFLAGS_COMMON) \
+ $(CFLAGS_MINIMIZE) \
-Wall \
-Werror \
+ -no-pie \
-Wl,--gc-sections
STRIP_ARGS = -S \
--strip-unneeded \
diff --git a/ueforth/posix/posix_main.c b/ueforth/posix/posix_main.c
index 68bc9de..2a1ce03 100644
--- a/ueforth/posix/posix_main.c
+++ b/ueforth/posix/posix_main.c
@@ -18,7 +18,9 @@
#include "gen/posix_boot.h"
int main(int argc, char *argv[]) {
- void *heap = mmap(0, HEAP_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ void *heap = mmap(
+ (void *) 0x8000000, HEAP_SIZE,
+ PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
forth_init(argc, argv, heap, boot, sizeof(boot));
for (;;) { g_sys.rp = forth_run(g_sys.rp); }
return 1;
diff --git a/ueforth/site/ESP32forth.html b/ueforth/site/ESP32forth.html
index 694b2cf..9147ca0 100644
--- a/ueforth/site/ESP32forth.html
+++ b/ueforth/site/ESP32forth.html
@@ -66,6 +66,13 @@ Choose these options under Tools.
+Use
+
+Initially ESP32forth can be interacted with over a serial port (over USB).
+You can do this from the Arduino IDE's Serial Monitor option.
+Be sure to config the serial port to: baud rate = 115200, data bits = 8, stop bits = 1, and parity = N.
+
+
ESP32forth Features
ESP32forth Specific Words
diff --git a/ueforth/windows/windows_main.c b/ueforth/windows/windows_main.c
index 4f43f9f..5323dfa 100644
--- a/ueforth/windows/windows_main.c
+++ b/ueforth/windows/windows_main.c
@@ -38,7 +38,8 @@ int WINAPI WinMainCRTStartup(void) {
int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmd, int show) {
#endif
void *heap = VirtualAlloc(
- NULL, HEAP_SIZE, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
+ (void *) 0x8000000, HEAP_SIZE,
+ MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
forth_init(0, 0, heap, boot, sizeof(boot));
for (;;) { g_sys.rp = forth_run(g_sys.rp); }
}