[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 6502 Multitasking OS announce
jponge@mtu.edu (Joshua P. Onge) writes:
>> The way to get around this is to pass all parameters on the stack, and use separate
>> stacks for the separate tasks.
> All well & good BUT the 6502 does not have a relocatable stack pointer
> so your kinda left with a bit of a problem when it commes to
> multitasking, ie you cant give each process it's own stack without
> copying the whole stack ( maybe just to the current sp value? )during
> each context switch.
>I believe that, from reading Andre's webpage on his OS, the operating
>system saves registers, to keep each program in it's own little world. You
>should read his description, it's quite ineresting.
Yes, but Joshua is right. Each process will need some amount of stackspace
(how much alterable on a task-by-task basis) to be able to call
subroutines. When one task is interrupted the next task despatched will
need it's own stack back, which means that 1) stack space for each
process is limited by the number of tasks running or 2) stack will need
to be saved along with the task's registers on a task switch.
2 is obviously very slow, while 1 may limit stack space severely
(perhaps to 16 bytes each for a dozen tasks+OS).
Things could be worse than a 256-byte stack, though. The 8008 only had
16 bytes (internal to the CPU). Most others will allow up to 64k
for stack.
Frank
--
The famous GIICM now on line: http://www.xs4all.nl/~falstaff/GIICM.html
------------------------------------------------------------------------
Frank A. Vorstenbosch +31-(70)-355 5241 falstaff@xs4all.nl