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

  1. Path: sparky!uunet!spool.mu.edu!agate!doc.ic.ac.uk!uknet!cam-orl!iwj
  2. From: iwj@cam-orl.co.uk (Ian Jackson)
  3. Newsgroups: comp.os.linux
  4. Subject: Virtual 386 [wasRe: Packaging Linux]
  5. Summary: impossible due to brokennesses in the 386's design
  6. Keywords: emulation, 386, virtual
  7. Message-ID: <1992Nov23.125729.27573@cam-orl.co.uk>
  8. Date: 23 Nov 92 12:57:29 GMT
  9. References: <17612@mindlink.bc.ca> <By1KJ8.5u8@dcs.ed.ac.uk>
  10. Organization: Olivetti Research Ltd
  11. Lines: 49
  12.  
  13. >I'd go with this.  Linux already has an 8086 emulation mode, I believe;
  14. >is it really hard to do an "80386-in-priv-mode" emulation?  It means
  15. >catching all the exceptions when it tries to execute a privileged
  16. >instruction, doing ``the right thing'' for that instruction, and
  17. >returning control; but it means that people can run Windows in a
  18. >compatibility box.
  19.  
  20. Unfortunately due to brain-dead design decisions by Intel that's
  21. completely impossible.
  22.  
  23. For example, the status register priveliged bits (ie the ones you'd
  24. have to emulate, eg privelige level etc.) and the normal flags (the
  25. ones you'd want to let the processor get on with using, eg carry etc.)
  26. are all mixed up in the same register. Reading that register is not a
  27. priveliged instruction, so your program running in the "virtual 386"
  28. would be able to tell it wasn't _really_ priveliged simply by reading
  29. the status register.
  30.  
  31. Even worse, writing the same status register isn't a priveliged
  32. instruction either ! The processor simply ignores attempts to set the
  33. "protected" bits and leaves them as they are, with no opportunity for
  34. a 386-emulating supervisor program to set some software copy of the
  35. flags and then restart the program.
  36.  
  37. Also, even if that wasn't the case, the memory management of the 386's
  38. weird segmented architecture would be very hard work to simulate in
  39. software !
  40.  
  41. All this for backwards compatibility. Urgh. Yuck. Blech.
  42.  
  43. So, sorry, but if you want to have virtual machines you'll have to buy
  44. a Motorola 68020/30/40 or an IBM 370 or some other processor whose
  45. designers actually knew what they were doing.
  46.  
  47. ** WARNING RELIGIOUS RANT  Followups by MAIL please to this bit! **
  48. PS Has anyone noticed how the 486 manual has all sorts of stupid VERY
  49. LARGE BOLD TYPE WARNINGS telling programmers not to do things that no
  50. sane programmer would do, like relying on undocumented status flags
  51. etc. ? Other processor manufacturers don't seem to feel the need to do
  52. that. Intel have obviously had problems with DOS programmers. And I
  53. haven't even started on the two pages of muddled thinking where they
  54. try (unsucessfully, in my case) to convice the reader that the 486's
  55. segmented architecture was a Good Idea.
  56. ** END RELIGIOUS RANT  Followups by MAIL please to this bit! **
  57.  
  58. -- 
  59. Ian Jackson  iwj@cam-orl.co.uk ..!uknet!cam-orl!iwj  These opinions are my own.
  60. Olivetti Research Ltd, Old Addenbrookes Site, Trumpington St, Cambridge, UK;
  61. Home: 35 Molewood Close, Cambridge, CB4 3SR; +44 223 327029.     +44 223 343398
  62.