Pin windows and linux memory layout, document baud rate.

This commit is contained in:
Brad Nelson
2021-02-23 20:41:14 -08:00
parent 11edf4e871
commit e00c2643ba
4 changed files with 14 additions and 2 deletions

View File

@ -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 \

View File

@ -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;

View File

@ -66,6 +66,13 @@ Choose these options under Tools.
</ul>
</p>
<h2>Use</h2>
<p>
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: <code>baud rate = 115200, data bits = 8, stop bits = 1, and parity = N</code>.
</p>
<h2>ESP32forth Features</h2>
<h3>ESP32forth Specific Words</h3>

View File

@ -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); }
}