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