30 January 2019, 09:06 | #1 |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 881
|
Supervisor stack size?
So if I understand correctly, when you have an interrupt server it will be run in supervisor mode using the supervisor stack.
How big is the supervisor stack ? Is this documented anywhere ? |
30 January 2019, 09:21 | #2 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,352
|
You will find this info in SysStkUpper/SysStkLower fields in ExecBase.
|
30 January 2019, 09:49 | #3 |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 881
|
|
30 January 2019, 10:39 | #4 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,352
|
Moving the supervisor stack is possible, i even have code for doing it, but i wouldn't recommend doing that all the time...
Quote:
However, normally the supervisor stack should be big enough. If you're doing heavy duty work it might be better to create a new task and send it some signal from the interrupt server. |
|
30 January 2019, 14:00 | #5 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,303
|
You can allocate a new supervisor stack - all provided you insert this information into execbase as otherwise graphics below v45 gets a hickup. However - what for? The supervisor stack is only needed for interrupt processing, and its default size of 6K is really large enough. There is no "own supervisor stack", there is only "one supervisor stack". So I wonder - why do you think that the default size is not large enough? Note well, the supervisor stack is completely separate from the user stack which is separate for each task, and which has a size that is task-dependent and configurable individually, for example with the magic $STACK: cookie in the code hunk.
|
30 January 2019, 14:33 | #6 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
|
30 January 2019, 16:13 | #7 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,637
|
|
30 January 2019, 17:05 | #8 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,352
|
From what i know setting stack size this way requires at least kick 3.1.
I prefer using a pair of StackSwap() calls. |
30 January 2019, 23:18 | #9 | |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 881
|
Quote:
I could imagine for example if you wanted to do a quick and dirty conversion of a non system friendly game, to make it system friendly that had it's main loop running out of the VBL and it used a lot of stack. Obviously there are other ways around it, but the OS provides a way of adding these interrupt servers, yet there are (unwritten?) rules about what you can do in them. Last edited by alpine9000; 31 January 2019 at 06:10. |
|
13 February 2019, 07:41 | #10 |
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,710
|
|
19 February 2019, 17:42 | #11 |
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 874
|
AFAIK this is OS4 only.
|
02 June 2019, 20:59 | #12 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,303
|
|
03 June 2019, 19:58 | #13 |
Amigan
Join Date: Feb 2012
Location: London
Posts: 1,316
|
It appears to be this:
https://wiki.amigaos.net/wiki/Contro...lication_Stack Code:
static const char USED min_stack[] = "$STACK:102400"; |
03 June 2019, 20:46 | #14 | |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,303
|
Quote:
|
|
03 June 2019, 21:50 | #15 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,637
|
|
03 June 2019, 22:27 | #16 |
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 874
|
Still unclear to me what logic applies if CLI or WB-icon specifies a larger stack than the cookie.
In my tests it didn't work in 3.9. |
04 June 2019, 07:26 | #17 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,303
|
You can only increase the stack size, not decrease it. And sure, it does work. The feature came in with the updated shell in one of the BoingBags, the cookie must be in the first hunk, and it requires a line feed and a \0 beyond the number. The workbench does not honor it before 3.1.4.
|
04 June 2019, 12:37 | #18 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
So to summarize, it's
$STACK:1234\n\0inserted into the first hunk, and it only works correctly in AmigaOS 3.1.4 (both in the shell and on the Workbench) and the stack size will be set to the largest of the three indicators? |
04 June 2019, 13:15 | #19 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,303
|
It already works with the V45 shell which was first delivered with one of the boingbags, I forgot which. The shell was not updated in the original 3.9 release IIRC.
|
05 June 2019, 04:42 | #20 |
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,710
|
So not very useful then - and also a disgusting kludge. Though I guess it's better than expecting users to type a 'stack' command before running programs from the CLI, and then unceremoniously crashing when they don't.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Moving supervisor stack | roondar | Coders. Asm / Hardware | 6 | 18 July 2017 17:13 |
Stack available | mritter0 | Coders. General | 4 | 03 August 2014 18:31 |
TCP/IP Stack | redneon | Amiga scene | 18 | 24 July 2005 16:01 |
Stack Up | Galaxy | request.Old Rare Games | 5 | 08 September 2004 03:06 |
Who wants a stack of originals? | FromWithin | Games images which need to be WHDified | 41 | 31 July 2003 09:31 |
|
|