basically you have two choices:
full emulation: you read a byte from (emulated) ram and
interpret/execute it (use a huge switch-statement). then advance to the
next byte and interpret/execute it, ...
the virtualpc/qemu-with-accelerator/vmware/...-way: run the code as
ring3-process. catch every exception and emulate the thing that caused
the exception (i/o ports, mmu-stuff, ...)
but i suggest starting with something similar to dosbox
(
http://dosbox.sf.net/). create a real-mode-only-emulator first. messing
around with page-tables and exceptions makes emulation quite difficult
to get right...
regards,
simon
Gromer wrote:
> Hi all,
>
> I'm interested to understand the processor architecture in depth. So i
> decided on emulating the processor itself (as my project). The best one
> to start would be 386.
>
> So i wud require some documents which explains on how to emulate any
> processor or devices. ( Apart from the Intel Architecture documents
> available).
> How to emulate a 386 processor. I want to kno how usually this is done.
> I wonder how bochs has been developed so elegantly...the resource
> they've used.
>
> It wud be appreciable if someone can guide me on any documents or
> reference books avaliable on Emulating processors and devices.
>
> .
> Wht are the resources I should have in hand to start up up this
> project.
>
> Thanks,
> Gromer
>