14 February 2019, 19:02 | #21 | |
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 256
|
Quote:
|
|
14 February 2019, 19:09 | #22 | |
Semi-Retired
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,993
|
Quote:
1) Your code is faulty somewhere 2) You are not really starting from WB and the WB code (ReplyMsg) gets executed anyway. You refer to the wrong part of the RKM. See Toni's remark about that. Last edited by Hedeon; 14 February 2019 at 19:15. |
|
14 February 2019, 20:20 | #23 | ||
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 256
|
Quote:
Quote:
|
||
14 February 2019, 20:30 | #24 | |
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 256
|
Quote:
Yes, this was already clear to me, but thanks for the hint. |
|
15 February 2019, 13:58 | #25 | |
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 256
|
Quote:
|
|
19 February 2019, 09:08 | #26 | ||||||
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 256
|
I analyzed the functions Forbid() and Permit() to check, if there are differences between Kick1.3 and 3.1:
Kickstart 1.3 Code:
Forbid addq.b #1,$127(a6) ;TDNESTCNT rts Code:
Permit subq.b #1,$127(a6) ;TDNESTCNT bge.s $fc1bc ;If counter >=0 then skip tst.b $126(a6) ;IDNESTCNT bge.s $fc1bc ;If counter >=0 then skip btst #7,$124(a6) ;SysFlags beq.s $fc1bc ;If bit7 not set then skip move.l a5,-(a7) lea $fc1be(pc),a5 jsr -$1e(a6) ;Supervisor() move.l (a7)+,a5 $fc1bc rts $fc1be btst #5,(a7) ;Check stack frame format: Format$2 or Format $3 ? beq.s $fc1fc6 ;No -> skip rte $fc1fc6 jmp -$2a(a6) ;Schedule() - check the list of ready tasks and inform if the current task needs to be switched Code:
Forbid addq.b #1,$127(a6) ;TDNESTCNT rts Code:
Permit subq.b #1,$127(a6) ;TDNESTCNT bge.s $f82946 ;If counter >=0 then skip tst.b $126(a6) ;IDNESTCNT bge.s $f82946 ;If counter >=0 then skip tst.w $124(a6) ;SysFlags bmi.s $f82948 ;If bit7 set then skip $f82946 rts $f82948 move.l a5,-(a7) lea $f82956(pc),a5 jsr -$1e(a6) ;Supervisor() move.l (a7)+,a5 rts $f82956 btst #5,(a7) ;Check stack frame format: Format$2 or Format $3 ? bne.s $f82960 ;Yes -> skip jmp -$2a(a6) ;Schedule() - check the list of ready tasks and inform if the current task needs to be switched $f82960 rte Quote:
Quote:
In "AmigaOS – internal structure of operating system" published by Zbigniew Trzcionkowski I found an explanation of the internal exec function Schedule() which is called by Permit() if SysFlag = negative and the stack frame has not the Format$2 or Format $3: Quote:
Quote:
Quote:
Quote:
Generally I was wrong with my assumption about the need to do an extra call of the Permit() function in the case of my test intro. Forbid() and Permit() write directly into the ExecBase structure. On my test system, the exec.library is placed at the beginning of CHIP memory. So if I save the lower 1MB CHIP memory before I execute the intro, I capture the exec base structure at a certain state. This state may change by system interrupts writing to the execbase structure or called exec functions by the intro. If I restore CHIP memory after the intro is quit, I restore an exec base structure with old data which might have changed by interrupts or the intro. If the exec.library is in FAST memory that's unimportant, but in my case this could lead to the strange behaviour of freezing the system. I assume, that the counters TDNestCnt and IDNestCnt contain the wrong values (not negative, but >=0) or other important execbase entries are out of date and make the system freeze after I return to CLI. |
||||||
26 February 2019, 12:01 | #27 | |
Registered User
Join Date: Nov 2018
Location: Germany
Posts: 110
|
Quote:
The former is the case if Permit() was called in supervisor. In that case no rescheduling will take place as it would have very fatal consequences. On the other hand, if Permit() was called in user mode (bit 5 of upper byte of SR - supervisor, is clear) then it will trigger scheduler if TDNestCnt < 0 and IDNestCnt < 0 and ATTN_Resched (bit 7) flag in SysFlags is set. |
|
27 February 2019, 10:46 | #28 | |
Registered User
Join Date: Sep 2015
Location: Germany
Posts: 256
|
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
pc task 4.4:) | 8bitbob | support.Apps | 42 | 25 August 2023 19:29 |
Exit winuae? | magoomba | New to Emulation or Amiga scene | 7 | 26 October 2018 22:50 |
Startup Code (from Icon ) - Forbid function | Asman | Coders. System | 2 | 04 January 2014 10:45 |
Cannot exit from Some games | @UAE | project.WHDLoad | 13 | 19 November 2008 13:28 |
OS 3.9 can't exit and some more problems | Tea | support.WinUAE | 1 | 09 July 2003 12:51 |
|
|