Page 1 of 1

What are the code running into the kernel on the AmigaOS

Posted: Mon Nov 20, 2023 5:53 pm
by gdridi

It is difficult to make boundaries on what’s running on kernel mode in the AmigaOS because of the type of kernel choose on AmigaOS: exo-kernel . That’s to postponed interrupt task or immediate task which normally runs the kernel(traps) to user mode. This is done,
By the means of signal and message passing to delegate or differed job to ‘lower’ task priority.
So (perhaps I’m slightly wrong) except immediate task (interrupt routine which have superuser mode set on CPU) all tasks running above 5(AmigaDOS handler task) are considered ´kernel’ code too.
Then it’s nice not to set a common program not above 4 with a changetaskpri AmigaDOS command. Normally, iirm Workbench is 1 in priority.
A nice Unix command equivalent to AmigaDOS nice is to decrease priority of task to -1 negative value.
Alternatively if you want your application to go faster there’s the solution to set 1 to 4 in priorities but at your own risk, above 4: 5-10-20 are considered or equivalent Unix to kernel rings of literature (in Unix books..).
We have critical code in disable()/enable() kernel code but even with multicore, we have to keep them very short time, so spinlock at this level are perhaps not the solution.
For ´normal’ kernel mode we have forbid()/permit() to stops multitasking; here we can use spinlock but the ideal would be not to stops multitasking on all cores. Isn’t it?
Despite we have not to use spinlock for user.
And have a true message passing for PutMsg()/SendIO() which duplicates data message (up to 64Ko limits) to avoid race condition (or ) when PutMsg() is done to a task on different core; between cores. That’s the difficulty! How to detect task belonging to a core or even migrating to another core during its lifetime..
No need to rewrite solely SendIO() to duplicate data message, if both kernel code and application user code(those using SendIO() ), run on the same core.

DGILLES - 18/12/2022

Re: What are the code running into the kernel on the AmigaOS

Posted: Fri Feb 09, 2024 8:50 pm
by gdridi
Some french interesting talk by Profesor at College-de-France ; premise to thread and scheduler : generator, coroutines as linguistic constructs in programming language.
Note : Coroutines were added in BCPL programming language (compiler) an ancestor of C language… and C++

Re: What are the code running into the kernel on the AmigaOS

Posted: Tue Feb 13, 2024 11:58 pm
by gdridi
Some ad(d)s

DoIO() on the same core is Ok
But DoIO() on different cores must be ´degrade’ to SendIO() with true copy for message passing if possible and if not one’s can optimize this SendIO() without copy.
Finally, all calls in Amiga programs using directly BeginIO[] raw vector library which is called by DoIO() (this one with the tricky Quick I/O bit test [set by the device] eventually replace the immediate DoIO() by a SendIO() ) and used by SendIO(), so direct call to BeginIO[] vector must be trapped to use DoIO() {or SendIO() } instead, and follows the same core rule explained above at the start of this message!

Work, work (´money’ says The Rolling Stones song and Pink Floyd also)