Skip to contentSkip to conversation

Access MSR functions in userspace?

DISCUSSION H. Peter Anvin 1 participant 1 message Feb 7, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 9 lines · Hasan Rashid

I am using kernel 2.4.32. Inside msr.c it is trying to register cpu/msr as shown here.

int __init msr_init(void)
{

  if (register_chrdev(MSR_MAJOR, "cpu/msr", &msr_fops)) {
    printk(KERN_ERR "msr: unable to get major %d for msr\n",
	   MSR_MAJOR);
    return -EBUSY;
Quoted 7 lines

}

return 0;
}

I did use the MAKEDEV script with the tools but since the msr module isn't trying to register at any of those locations, they don't work.

Nonsense. All that matters is major:minor.

Quoted 2 lines

There is only one processor on my board, I am going to register device under cpu/0/msr and see if that solves the issue.

It's irrelevant where it "registers" (on your kernel it only affects /proc/devices, nothing else, unless you're using devfs, in which case, well, don't.) The MAKEDEV script with the tools creates the appropriate device entries.

-hpa