From 0e4915e4ac2ba3ef9f8c99b80865143aa3e48796 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Fri, 26 Jun 2026 00:14:45 +0900 Subject: [PATCH 1/2] amiga: raise the minimum handler stack to 16K The handler's deep paths (directory traversal, name normalization) can use more stack than a mountlist typically grants. The previous 4K/8K swap thresholds let a small mountlist stack through unhelped, risking an overflow; guarantee at least 16K by swapping to a private stack when the supplied one is smaller. --- platform/amiga/startup.S | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/platform/amiga/startup.S b/platform/amiga/startup.S index 006c718..57748f9 100644 --- a/platform/amiga/startup.S +++ b/platform/amiga/startup.S @@ -36,8 +36,13 @@ #define MEMF_PUBLIC 0x00000001 #define MEMF_CLEAR 0x00010000 -#define MIN_STACK 4096 -#define SWAP_STACK 8192 +/* + * The handler's deep paths (directory traversal, name normalization) can use + * more stack than a mountlist typically grants. Guarantee a minimum by swapping + * to a private stack of this size when the supplied one is smaller. + */ +#define MIN_STACK 16384 +#define SWAP_STACK 16384 _start: _entrypoint: From 6f96674331ccdb5dbd2daa6d45b8731f0c8ed6aa Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Fri, 26 Jun 2026 00:18:57 +0900 Subject: [PATCH 2/2] docs: use 16K StackSize in mountlist examples Match the handler's minimum stack so example mountlists don't trigger a stack swap on first use. --- README.md | 2 +- docs/mountlist.example | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 386b0ed..6c0fe59 100644 --- a/README.md +++ b/README.md @@ -290,7 +290,7 @@ If you want a plain Mountlist entry instead, add one such as: ```text CD0: Handler = L:ODFileSystem - Stacksize = 8192 + Stacksize = 16384 Priority = 5 GlobVec = -1 DosType = 0x43443031 diff --git a/docs/mountlist.example b/docs/mountlist.example index e7aed08..abbae9d 100644 --- a/docs/mountlist.example +++ b/docs/mountlist.example @@ -14,7 +14,7 @@ CD0: Handler = L:ODFileSystem - Stacksize = 8192 + Stacksize = 16384 Priority = 5 GlobVec = -1 DosType = 0x43443031