home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / linux / 25527 < prev    next >
Encoding:
Text File  |  1993-01-26  |  2.4 KB  |  47 lines

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