By the way - under RSX, the loading of the task is not done by the
kernel. It's the responsibility of another task - LDR. But if you have
an inactive task already in memory, then activation is by the kernel,
but then registers and memory content are already defined.
RSX is rather modular, and you could in some sense argue that it's
sortof a microkernel. The kernel itself actually is pretty limited in
what it do, and it depends on various tasks to actually take care of a
lot of things for it to behave like an OS in a way you expect.
There is LDR which is responsible for loading tasks into memory, as well
as for swapping tasks in and out from the swap space.
Then you have TKTN which is responsible for dealing with the termination
of tasks, and possible snapshots of the memory if the task crashed, or
you explicitly ask for a snapshot.
Then you have INS, which is responsible for installing and making tasks
available to the kernel, as well as installing share memory images.
LOA is used to load device drivers.
UNL is used to unload device drivers.
MCD is the command dispatcher for all typed commands by users.
SHF is the memory shuffler, which moves tasks around in memory in order
to defragment physical memory when needed.
RCT is responsible for replacing bad blocks on MSCP disks.
F11ACP is responsible for implementing a file system on disks.
HRC for reconfiguring the hardware related aspects of the system.
And then the list goes on with all kind of more "normal" user programs.
So when you type "RUN FOO", first INS gets invoked to make your program
available to the kernel. Then LDR gets involved in pulling the content
of the task image into actual memory. And that might invoke SHF, if
enough physical memory that is free can't be found. And when your
program finishes, REM gets invoked to remove the task image from the
kernel again, since this isn't a permanent installed task.
But in the end, what you faced was just that previous mode is usermode
for usermode programs. :-)
Johnny
>> >> Handbook does not specify any restrictionsabout using these
>> >> instructions, which is weird.
>> >>
>> >> The only discussion I found was this (PDP-11/40 Handbook):
>> >> 5.7.2 Data
>> >> Data is transferred between modes by two instructions: Move From
>> Pre·
>> >> vious Instruction space (MFPI) and Move ToPrevious Instruction
>> space
>> >> (MTPI). The instructions are fully described in Chapter 4.
>> However, it
>> >> should be noted that these instructions have been designed to
>> allow data
>> >> transfers to be under the control of the inner mode (Kernel)
>> program
>> >> and not the outer, thus providing protection of an inner program
>> from an
>> >> outer.
>> >>
>> >> Thus, it kind-a suggests that I can't movedata from say, user
>> space,
>> >> to kernel space.
>> >> But when you look at the description for the instructions, there
>> seem
>> >> to be no restrictions mentioned.
>> >>
>> >> So does that mean that
>> >>
>> >> .TITLE MTPD
>> >> .MCALL EXIT$S
>> >> START: CLR R1
>> >> MOV #256.,R2
>> >> 1$:
>> >> CLR -(SP)
>> >> MTPD (R1)+
>> >> SOB R2, 1$
>> >> EXIT$S
>> >> .END START
>> >>
>> >> would clear interrupt vectors, assuming the previous CPU mode was
>> >> "0"(kernel), and the interrupt vectors were mapped "natively" at
>> VA 0
>> >> in kernel?
>> >>
>> >> I find it hard to believe. And if itis not supposed to work,