LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Prevent Linux from using some x86 peripherals (https://www.linuxquestions.org/questions/linux-kernel-70/prevent-linux-from-using-some-x86-peripherals-837996/)

pmil 10-14-2010 05:04 AM

Prevent Linux from using some x86 peripherals
 
Hi all,

I am trying to prevent Linux from using some x86 peripherals. For instance, I want to prevent Linux from using the PCI and the serial port 1. Do you have any idea on how to achieve this?

I though that an idea might be to edit the Linux GDT and exclude the I/O port and memory mapped locations of the peripherals I don't want it to have access to, but this will lead to a non flat model which is what Linux assumes.

Any thoughts would be much appreciated.

prayag_pjs 10-14-2010 05:29 AM

Hi,

Compile kernel and disable the drivers for PCI.Serial etc.

You can also remove the modules using rmmod or modprobe -r

pmil 10-14-2010 06:09 AM

Quote:

Originally Posted by prayag_pjs (Post 4126979)
Hi,

Compile kernel and disable the drivers for PCI.Serial etc.

You can also remove the modules using rmmod or modprobe -r

Hi and thanks for your response. Unfortunately what I intent to achieve is not getting solved by just removing the drivers from the kernel. For example, a user can write a user-process or a module by which he/she accesses the I/O ports of e.g. the serial. So, access to the registers of the serial will be achieved despite the lack of a serial driver.

What I want is that every one that tries to access some particular I/O ports (e.g. 3F8h – 3FFh for serial port 1) and some particular addresses of memory mapped peripherals (e.g. PCI), not be able to do it.

I hope it is clearer now what I want to achieve.

Thanks.

prayag_pjs 10-14-2010 06:20 AM

Why can't a user can write a user-process or a module by which he/she for any thing else we do ( if we prevent one that tries to access some particular I/O ports (e.g. 3F8h – 3FFh for serial port 1) and some particular addresses of memory mapped peripherals (e.g. PCI), not be able to do it. some how?)

pmil 10-14-2010 07:41 AM

Quote:

Originally Posted by prayag_pjs (Post 4127019)
Why can't a user can write a user-process or a module by which he/she for any thing else we do ( if we prevent one that tries to access some particular I/O ports (e.g. 3F8h – 3FFh for serial port 1) and some particular addresses of memory mapped peripherals (e.g. PCI), not be able to do it. some how?)

Excuse me but I find it difficult to follow you thought...

cadillackid 10-14-2010 08:44 AM

what if you load the drivers for those devices and then start a process that uses the devices... will that not effectively block a user from accessing the said device because it is already busy?

or what if you chmod the users out of the devices you dont want them to use?

-Christopher

pmil 10-14-2010 11:33 AM

Quote:

Originally Posted by cadillackid (Post 4127181)
what if you load the drivers for those devices and then start a process that uses the devices... will that not effectively block a user from accessing the said device because it is already busy?

or what if you chmod the users out of the devices you dont want them to use?

Hi! I would like just to prevent the access to some particular memory locations if that's possible. For example, I want Linux not being able to see particular locations.

Thanks.


All times are GMT -5. The time now is 09:12 AM.