[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] xaaes.km calls the AES appl_init() in supervisor mode

Vincent Rivière, 09.03.2013 09:04:59:

 From a kernel module, is it legal to call trap #1?

I did a simple test in xaaes, k_main.c:

# define trap_1_emu   (*KENTRY->vec_misc.trap_1_emu)
# define ROM_Fsfirst(filespec,attr) trap_1_emu(0x04e,filespec,attr)
  ROM_Fsfirst("xxx", 0);

No crash, not run with GEM=ROM.

There's a comment in arch/syscall.h:

 * The trap_1_emu call creates a stack frame and then jumps to the ROM (via
* the old_vec from the XBRA structure). This means that these calls will not

The actual trap_1_emu is in syscall.S (that I don't understand)

Don't know if this helps.

- scrp_write() calls Fsfirst() with trap #1

As MiNT hooks into Trap 1 the MiNT-Fsfirst should be called by EmuTOS in theory. Or EmuTOS did not notice the redirection and things go wrong somehow?

What happens if Fsfirst is called directly in EmuTOS?

BTW: The first define in the above:

# define trap_1_emu   (*KENTRY->vec_misc.trap_1_emu)

was necessary because libkern/kernel_module.h says:

# define trap_1_emu   (*KENTRY->vec.misc.trap_1_emu)

But there is no kentry.vec, only vec_misc. Should this be fixed?

Helmut Karlowski