3 ms·
Oh, this is very interesting—I just finished the Virtual Memory assignment for my Operating Systems class. (We had to use Bochs, and it was slow.) Why is emulat
by twicetwice 6y ago
Oh, this is very interesting—I just finished the Virtual Memory assignment for my Operating Systems class. (We had to use Bochs, and it was slow.) Why is emulating an MMU particularly painful?
- avhon1 6y agoIt adds a layer of indirection (which has to be intercepted and emulated) for every single access to RAM.
- ineedasername 6y agoJust curious, what OS were you using with Bochs? Last I used it around 8-10 years ago, playing around with Win95. It was painfully slow then, unusable, but I'd be curious about the level of improvement: was it minimally usable?
- twicetwice 6y agoThe one we wrote for the class :) Well, sort of. The first assignment was to write a bootloader in x86 assembly. For the second assignment we were given a bootloader and a partially-implemented kernel, and we had to finish the kernel by writing a non-preemptive (cooperative) scheduler (including implementing context switching and so on). Third assignment same thing but a preemptive scheduler. And so on. The partially-implemented kernel is very rudimentary—kernel threads but no userspace threads or forking, no filesystem, no virtual memory and no actual difference between kernel mode and user mode (until the virtual memory assignment, in which the partial kernel we were given did actually do ring transitions), etc. Anyway all this is to say that we were running a very very bare-bones, stripped-down kernel, and even then it was annoyingly slow, so I expect that it would be still be extremely slow running a "real" OS. It's my understanding that that's not really what Bochs is for, though. If you want to run Win95 use a normal VM; Bochs is meant to be a low-level x86 development tool. Though again that's just my impression, so I could be wiong in that.