home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / linux / 17057 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  2.8 KB

  1. Path: sparky!uunet!ogicse!uwm.edu!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!casbah.acns.nwu.edu!hpa
  2. From: hpa@casbah.acns.nwu.edu (H. Peter Anvin N9ITP)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: Assembler help needed.  Real bad like.
  5. Message-ID: <1992Nov18.100812.21144@news.acns.nwu.edu>
  6. Date: 18 Nov 92 10:08:12 GMT
  7. Article-I.D.: news.1992Nov18.100812.21144
  8. References: <1992Nov18.062004.545@newshub.ariel.yorku.ca>
  9. Sender: usenet@news.acns.nwu.edu (Usenet on news.acns)
  10. Reply-To: hpa@nwu.edu (H. Peter Anvin)
  11. Organization: You must be kidding!
  12. Lines: 59
  13.  
  14. In article <1992Nov18.062004.545@newshub.ariel.yorku.ca> of comp.os.linux,
  15.   cs911461@ariel.yorku.ca (CHRISTIAN D. ARMOUR) writes:
  16. >
  17. > 1) I'm using as86 because it uses the mnemonics which I like
  18. > and am used to (Intel 8086).  Should I use the slightly weird
  19. > gas instead?  How can I learn how to use it?  Where are the
  20. > docs/man pages for these things hidden in this vast world?  
  21.  
  22. This is WRONG.  as86 produces 16-BIT REAL MODE CODE.  Linux uses 32-BIT
  23. PROTECTED MODE.  The two are NOT compatible, you *have* to use gas.
  24.  
  25. > 2) Why does as86 give me the following error:
  26. >          MOV    DX,ES:[BX]
  27. > ---------------------^
  28. > Junk after operands
  29.  
  30. The syntax used by as86 is:
  31.  
  32.     seg es
  33.     mov dx,(bx)
  34.  
  35. But, as I said above, don't use as86.  Also, under Linux in user mode,
  36. DS == ES == SS; CS points to the same memory as well but is an executable
  37. segment descriptor instead of a data segment descriptor.  In either case,
  38. you should never need to use a segment override unless you are hacking the
  39. kernel (in which case you use an FS dereference to access user space).
  40.  
  41. Also, note that writing to the TEXT portion of your program will cause a
  42. segment violation.
  43.  
  44. > 3) How is the video controller programmed directly under Linux,
  45. > or for that matter, any Unix-style O/S?
  46.  
  47. Same way it is otherwise.  BIOS is useless under Linux, or any other OS
  48. that uses protected mode (although OS/2 actually lets you access BIOS in a
  49. virtual 8086 session).  Your program needs to be run as root and request
  50. I/O privileges from the kernel.
  51.  
  52. > 4) What is an "unbound label"?
  53.  
  54. A label that doesn't reference an address, i.e. is undefined.
  55.  
  56. > 5) How hard/easy is it to mix C and assembler under Linux?  I have
  57. > experience doing this under DOS (386) and Ultrix (MIPS) but am a
  58. > little scared to try under Linux.  I'm trying to port my extensive
  59. > library of VGA code from the DOS environment.  So far, no problems
  60. > except from the assembler.
  61.  
  62. It shouldn't be hard at all.  Either use separate modules or use GCC inline
  63. code.  Also, don't miss checking out VGALib... already ann extensive
  64. collection of VGA code to my understanding.
  65.  
  66.     /hpa
  67. -- 
  68. INTERNET:  hpa@nwu.edu   TALK:      hpa@casbah.acns.nwu.edu
  69. BITNET:    HPA@NUACC     IBMNET:    16331@IBMX400
  70. HAM RADIO: N9ITP         NeXTMAIL:  hpa@lenny.acns.nwu.edu
  71. Keyboard not found, press F1 to continue or Ctrl-Esc for setup
  72.