RE: [uCsimm] Assembler code problems with uCsimm C compiler

From: Paugam Luc (PAUGAML@thmulti.com)
Date: Tue Nov 28 2000 - 03:59:18 EST


Hi Robert,

>Hi Luc,
> yr. solution worked very well but as soon as I ran my program I
>experienced a new problem :-((
>As soon as my program reach the first asm line (the one that disables the
>interrupt) my uCLinux system crashed and printed at console the string
>"privilege violation" along with the dump of the Address and Data register.
>I red on the MC68000 Users Manual that only a part of the SR register (the
>last 5 bits) is available in the users mode, and the interrupt control
flags
>are not among these five bits.

You are not allowed to play with SR content at the USER priviledge level.

>Do you know the procedure to switch between the user mode and the
supervisor
>one in order to set the SR register without crash the system?

If the S-bit (bit number 13, mask=0x2000) in the SR is set, SUPERVISOR
priviledge level applies.
All exception processing is performed at the supervisor level. All bus
cycles generated during
exception processing are supervisor references, and all stack accesses use
the SSP.

Instructions that have important effects can only be executed at supervisor
level. To prevent
a user program from gaining priviledged access, except in a controlled
manner, instructions
that can alter the S-bit in the SR are priviledged. The TRAP #n instruction
provides controlled
user access to operating system devices.

The Linux kernel is executed at the supervisor level. The way to change the
priviledge from USER (application)
to the SUPERVISOR (Linux kernel) level is done by executing system calls
(TRAP #0).

>Regards
>
>Robert

Hope this help.
Luc

This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:39 EST