In article <1992Aug29.065940.1256@athena.mit.edu> hammond@kwhpc.caseng.com (Kevin W. Hammond) writes:Yes, 0.97.pl2 has support for a vm86 mode: note that this is /not/ the same as a DOS emulator, but it can be used for that. The interface looks like this: void vm86(struct vm86_struct * info); where vm86_struct is defined in linux/vm86.h, and currently looks like this: struct vm86_struct { struct vm86_regs regs; unsigned long flag; } The flag value is not currently used, and I assume some additional fields will be added eventually (a page dirty map for efficient screen updating etc), but the above is enough for a simple DOS emulator. The vm86() system call is pretty simple: it loads the registers with the values in the 'regs' structure, and starts executing in vm86 mode. It will return to protected mode when a signal happens: when this happens the vm86 state is saved in the info structure and the signal handler is executed in normal 32-bit mode. The signal handlers can then use the vm86_struct information to see what is going on, and correcting any errors etc. A simple DOS emulator would look like this (pseudo-code): global struct vm86_struct info; main() { set up the DOS memory image at 0 - 1MB set up SIGSEGV and SIGILL etc signal handlers set up the initial regs etc in 'info' while (1) vm86(&info); } SIGILL_handler() { read 'info' to see why we got a SIGILL - if we can emulate it, update 'info' and return, else exit } SIGSEGV_handler() { see SIGILL } SIGALRM_handler() { check the screen memory in the vm86 box, and update the real screen every now and then. Do any other regular house-keeping fn's. } Note that all this happens in user mode - the kernel doesn't really do anything special about vm86 mode. And as the emulator and vm86 code is in the same process, is should be possible to make it all relatively efficient. Linus
| Andrew Morton | Re: 2.6.24-rc6-mm1 |
| Glauber de Oliveira Costa | [PATCH 8/19] modify write_ldt function |
| Steven Rostedt | Re: Major regression on hackbench with SLUB |
| Satyam Sharma | Re: 2.6.23-rc4-mm1 |
git: | |
| Chris Ortman | [FEATURE REQUEST] git-svn format-patch |
| Bill Lear | Meaning of "fatal: protocol error: bad line length character"? |
| Scott Chacon | Git Community Book |
| Catalin Marinas | Re: [ANNOUNCE] pg - A patch porcelain for GIT |
| Richard Stallman | Real men don't attack straw men |
| frantisek holop | nptd regression in 4.2 |
| Kevin | uvm_mapent_alloc: out of static map entries on 4.3 i386 |
| Vim Visual | GRAPE cluster supercomputer + OpenBSD |
| John Stoffel | Re: [PATCH] LogFS take three |
| hooanon05 | [PATCH 62/67] aufs magic sysrq handler |
| Chris Mason | Re: [PATCH][RFC] fast file mapping for loop |
| Chris Mason | Re: [ANNOUNCE] Btrfs v0.12 released |
