issuing SIDT _crashes_ the system?!

From: Julien Oster (joster@soft-research.de)
Date: Thu Sep 21 2000 - 21:38:06 EST


Hello,

I tried getting the interrupt descriptor table register (IDTR) using
sidt but... the system crashed? it first told me about a null pointer
dereference (sorry, haven't got the oops any more) and then all processes
died away. on the console i repeatedly got the message "no vm86 information:
BAD"

What's up there? It's probably my mistake due to bad code, but I still
don't understand and I can't find a bug in the module (sorry, it's late :) ).

I passed SIDT a pointer to a structure which contains the 2 byte limit and
the 4 byte base. To ensure that it is actually modified, I put in the two
values 0xDEAD and 0xBABEFACE.

After issuing SIDT, limit and base were 0. It's clear that that isn't the
correct value for the IDTR...

here's my getidt function (NASM):

BITS 32

GLOBAL getidt

getidt: push ebp
                mov ebp, esp
                sidt [ebp - 4]
                pop ebp
                ret

and here's the C part of the module:

#define MODULE
#define __KERNEL__

#include <linux/kernel.h>
#include <linux/module.h>

struct idtr {
        unsigned short limit;
        unsigned char * base;
};

extern void getidt (struct idtr *);

int init_module (void) {
        struct idtr aidtr = {
                0xDEAD,
                (void*)0xBABEFACE
        };

        printk ("1 limit: %hu, base: %p\n", aidtr.limit, aidtr.base);
        getidt (&aidtr);
        printk ("2 limit: %hu, base: %p\n", aidtr.limit, aidtr.base);

        return -1;
}

void cleanup_module (void) {
        return;
}

any ideas?

Julien

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 21:00:26 EST