home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!torvalds
- From: torvalds@klaava.Helsinki.FI (Linus Torvalds)
- Subject: Re: ?? Why no out/in in assembler ??
- Message-ID: <1993Jan26.113924.5911@klaava.Helsinki.FI>
- Organization: University of Helsinki
- References: <C1DpM9.H6L@helios.physics.utoronto.ca> <C1E98M.4JE@ichaos.nullnet.fi> <C1Fno4.IBI@helios.physics.utoronto.ca>
- Date: Tue, 26 Jan 1993 11:39:24 GMT
- Lines: 36
-
- In article <C1Fno4.IBI@helios.physics.utoronto.ca> grindley@helios.physics.utoronto.ca (Robin Grindley) writes:
- >
- >Sorry, i should have been a little clearer. I realize that user tasks will
- >run at different privileges and IOPL's. Any normal code should not be allowed
- >to do what i want. But if one wants to debug a system one has to have access
- >to tools that can bypass normal security. My question is, IF i do setup
- >a task to run as root and i make sure i have the correct IOPL, the assembler
- >does not even have the capability to generate these instructions (they are
- >not in its "dictionary").
-
- gas *does* support inb/outb quite happily: that's how the linux kernel
- uses them, and your problems are with something else. You are either
- using the incorrect syntax (gas syntax is NOT the braindead intel syntax
- that DOS people have gotten used to), or you are doing something wrong
- in gcc if you are trying to get the IO instructions compiled using the
- __asm__ statements.
-
- In the linux sources, I define the inline functions inb()/outb() for
- these kinds of things, but they are neither part of gas nor of gcc -
- they are part of the linux sources, and may not work for you unless you
- use them the way they were meant to be used. Specifically, they are
- defined as inline functions, which means that you have to either give
- the -finline-functions option to gcc to get them compiled in at all, or
- have to use optimizations (linux uses -O6 just because I can always hope
- that it will mean something for some future gcc..). If you are seeing
- unresolved _inb references at the linker stage, this is probably the
- reason: the inb/outb functions aren't in the standard library, and
- certainly should not be added to it either.
-
- I'd suggest printing out the gcc documentations (yes, it's 300+ pages),
- and look for a file called 'gas-doc.tar.Z' (at least available on
- nic.funet.fi) which contains a small manual for the GNU assembler. The
- gas manual isn't very good, though (unless it has been updated in the
- last few years).
-
- Linus
-