Here's a small patch against 2000_0802a.tar.gz.. It's fairly self explanatory.
Also note that I wasn't able to boot the windows 95 version of DOS. (I
can't find a copy of 6.22 :) I also tried a freedos boot disk and a beos
one. Neither got very far. Oh well.
--Josh
At 15:42 on 08/02/2000 EDT, Kevin Lawton <[EMAIL PROTECTED]> wrote:
> ftp://ftp.plex86.org/pub/plex86/plex86-2000_0802a.tar.gz
>
> Okey dokey, before I break anything else, here's a snapshot of
> my newest code. Note that I don't have anything final to tell
> you about using the VGA BIOS from Elpin at this time, and I
> didn't include it in this release. You will need a VGA BIOS
> if you want to try and boot DOS. The one in the bochs
> distribution is licensed for use with bochs.
>
>
> -Kevin
>
>
> >From the ChangeLog:
>
> - "Kevin P. Lawton" <[EMAIL PROTECTED]>: Wed Aug 2 15:30:46 EDT 2000
> DOS 6.22 boots from floppy and disk image file. Anything other
> than booting and typing 'DIR' will likely resulting in a panic,
> since I only implemented enough instruction to get there.
> Added running real-mode guest code capability to the VM. Code
> is run in v86 mode in the VM. Modified the guest_context
> stack frame conventions a little to accommodate the extra
> data seg selector pushes in v86 mode.
> Added more emulation of instructions.
> Rearranged the user/plugin code to add more flexibility to
> the plex86.conf initialization.
> Plex86.conf can now pass bochs options to the bochs plugins.
> Moved the BIOS over from bochs. A precompiled BIOS is available
> in bios/BIOS-plex86-*. Added instructions to the toplevel README
> on how to compile your own.
> You can now load a system BIOS and VGA BIOS into memory. If
> you load a VGA BIOS, then you don't need to use the replay_io
> plugin.
> Hacks:
> Int 0x15, AH=0x87 is hacked in kernel/emulation/soft_int.c to
> return CF=1 (error). This is because I don't support a
> transition to PM yet from RM, necessary for extended memory
> BIOS operations.
> SBE is effectively disabled for running RM guest code. In
> kernel/fault.c, there is a goto hack. I will take this
> out at some point, after I get more instructions emulated,
> so that SBE works.
> In user/plugin.c, there are hacks to inport and output routines
> for port 0x01f0 (hard disk).
>
diff -cr plex86-kevin.old/user/plex86.c plex86-kevin/user/plex86.c
*** plex86-kevin.old/user/plex86.c Wed Aug 2 07:17:56 2000
--- plex86-kevin/user/plex86.c Thu Aug 3 01:17:25 2000
***************
*** 72,77 ****
--- 72,78 ----
vm_conf.stack_address = -1;
vm_conf.verbose = 0;
vm_conf.dump_vm = 0;
+ vm_conf.exit_wait = 0;
vm_conf.syntax = SX_NONE;
***************
*** 95,100 ****
--- 96,102 ----
printf ("-h ... Print this helpful help\n");
printf ("-m ... Megs of memory for VM\n");
printf ("-s ... Select disassembly syntax (\"intel\" or \"att\")\n");
+ printf ("-w ... Wait <n> seconds before exiting when a panic occurs\n");
printf ("-v ... Print debug messages (verbose)\n");
exit (0);
break;
***************
*** 103,108 ****
--- 105,114 ----
vm_conf.max_memory = atoi (&argv[i][3]);
break;
+ case 'w':
+ vm_conf.exit_wait = atoi (&argv[i][3]);
+ break;
+
case 'f':
strncpy (config_file_name, &argv[i][3], 255);
break;
***************
*** 208,213 ****
--- 214,230 ----
vm_conf.prescanDepth = atoi (&line[line_index]);
vm_init_prescan_depth(vm_conf.prescanDepth);
}
+ else if (!strncmp (line, "exit_wait", line_index))
+ {
+ if (vm_conf.exit_wait != 0)
+ {
+ line_index = 0;
+ continue;
+ } // command line overwrites config file settings;
+ while ((line[line_index] == ' ') || (line[line_index] == '='))
+ line_index++;
+ vm_conf.exit_wait = atoi (&line[line_index]);
+ }
else if (!strncmp (line, "plugin", line_index))
{
int parm_index;
diff -cr plex86-kevin.old/user/plugins/bios/bin.c plex86-kevin/user/plugins/bios/bin.c
*** plex86-kevin.old/user/plugins/bios/bin.c Wed Aug 2 09:48:03 2000
--- plex86-kevin/user/plugins/bios/bin.c Thu Aug 3 00:05:51 2000
***************
*** 24,29 ****
--- 24,30 ----
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
+ #include <errno.h>
#include "bios.h"
#include "multiboot.h"
***************
*** 49,61 ****
virtno = open (guest_file_name, O_RDONLY);
if (virtno < 0)
{
! perror ("bios: open");
return 1;
}
if (fstat (virtno, &stat_buf) != 0)
{
! perror ("bios: fstat");
return 1;
}
--- 50,62 ----
virtno = open (guest_file_name, O_RDONLY);
if (virtno < 0)
{
! fprintf(stderr, "\nbios: open %s: %s\n", guest_file_name, strerror(errno));
return 1;
}
if (fstat (virtno, &stat_buf) != 0)
{
! fprintf(stderr, "\nbios: fstat %s: %s\n", guest_file_name, strerror(errno));
return 1;
}
diff -cr plex86-kevin.old/user/plugins/bios/rom.c plex86-kevin/user/plugins/bios/rom.c
*** plex86-kevin.old/user/plugins/bios/rom.c Fri Jul 28 17:19:33 2000
--- plex86-kevin/user/plugins/bios/rom.c Thu Aug 3 00:06:20 2000
***************
*** 26,31 ****
--- 26,32 ----
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
+ #include <errno.h>
#include "bios.h"
***************
*** 60,70 ****
fileno = open(filename_p, O_RDONLY);
if (fileno < 0) {
! perror("rom: open");
return 1;
}
if (fstat(fileno, &stat_buf) != 0) {
! perror("rom: fstat");
return 1;
}
fprintf(stderr, "ROM: loading image '%s' @ 0x%x (%u bytes)\n",
--- 61,71 ----
fileno = open(filename_p, O_RDONLY);
if (fileno < 0) {
! fprintf(stderr, "rom: open %s: %s\n", filename_p, strerror(errno));
return 1;
}
if (fstat(fileno, &stat_buf) != 0) {
! fprintf(stderr, "rom: fstat %s: %s\n", filename_p, strerror(errno));
return 1;
}
fprintf(stderr, "ROM: loading image '%s' @ 0x%x (%u bytes)\n",
diff -cr plex86-kevin.old/user/user.c plex86-kevin/user/user.c
*** plex86-kevin.old/user/user.c Wed Aug 2 09:43:11 2000
--- plex86-kevin/user/user.c Thu Aug 3 01:21:34 2000
***************
*** 20,31 ****
--- 20,33 ----
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+ #include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
+ #include <errno.h>
#include "plex86.h"
#include "user.h"
***************
*** 79,88 ****
}
}
-
void
vm_abort (void)
{
/* deinitialize all plugins */
fprintf (stderr, "Shutting down plugins\n");
--- 81,107 ----
}
}
void
vm_abort (void)
{
+ static int was_waiting = 0;
+
+ if (! was_waiting && vm_conf.exit_wait > 0) {
+ struct timeval tv;
+
+ was_waiting = 1;
+ tv.tv_sec = vm_conf.exit_wait;
+ tv.tv_usec = 0;
+
+ printf("Delaying exit by %d seconds\n", (int)tv.tv_sec);
+ while (1) {
+ select(0, NULL, NULL, NULL, &tv);
+ if (errno == EINTR && tv.tv_sec > 0)
+ continue;
+ break;
+ }
+ }
+
/* deinitialize all plugins */
fprintf (stderr, "Shutting down plugins\n");
diff -cr plex86-kevin.old/user/user.h plex86-kevin/user/user.h
*** plex86-kevin.old/user/user.h Wed Aug 2 07:16:48 2000
--- plex86-kevin/user/user.h Thu Aug 3 01:17:30 2000
***************
*** 37,42 ****
--- 37,43 ----
Bit32u stack_address;
int verbose;
int dump_vm;
+ int exit_wait;
enum i386_asm_syntax syntax;
unsigned prescanDepth;
} config_info_t;