Removed legacy "load32bitOShack" feature. In the early days of Bochs some hacks

were required to load a 32 bit OS. In the meantime Bochs has been made capable
of loading 32 and 64 bit OS's without hacking.
This commit is contained in:
Volker Ruppert 2020-06-07 17:28:54 +00:00
parent 4313db542d
commit c05cb5e1d7
8 changed files with 12 additions and 427 deletions

View File

@ -1240,14 +1240,6 @@ speaker: enabled=1, mode=sound
#=======================================================================
#port_e9_hack: enabled=1
#=======================================================================
# other stuff
#=======================================================================
# WARNING: This Bochs feature is not maintained yet. Is it still used ?
# To use it, set BX_LOAD32BITOSHACK in config.h to 1 and recompile Bochs.
#load32bitOSImage: os=nullkernel, path=../kernel.img, iolog=../vga_io.log
#load32bitOSImage: os=linux, path=../linux.img, iolog=../vga_io.log, initrd=../initrd.img
#=======================================================================
# fullscreen: ONLY IMPLEMENTED ON AMIGA
# Request that Bochs occupy the entire screen instead of a

View File

@ -3,6 +3,7 @@ Changes after 2.6.11:
- General
- Save/Restore bugfixes
- Removed legacy "load32bitOShack" feature.
- CPU/CPUDB
- Bugfixes for CPU emulation correctness (CPUID/VMX initialization fixes to support Windows Hyper-V as guest in Bochs)

View File

@ -137,7 +137,6 @@ NONINLINE_OBJS = \
logio.o \
main.o \
config.o \
load32bitOShack.o \
pc_system.o \
osdep.o \
plugin.o \
@ -148,7 +147,6 @@ NONINLINE_OBJS = \
EXTERN_ENVIRONMENT_OBJS = \
main.o \
config.o \
load32bitOShack.o \
pc_system.o
DEBUGGER_LIB = bx_debug/libdebug.a
@ -784,6 +782,9 @@ install_macosx: all download_dlx install_man @INSTALL_DOCBOOK_VAR@
# dependencies generated by
# gcc -MM -I. -Iinstrument/stubs *.cc | sed -e 's/\.cc/.@CPP_SUFFIX@/g' -e 's,cpu/,cpu/,g'
###########################################
bxdisasm_new.o: bxdisasm_new.@CPP_SUFFIX@ config.h cpu/decoder/instr.h
bxdisasm_old.o: bxdisasm_old.@CPP_SUFFIX@ config.h disasm/disasm.h config.h \
cpu/decoder/decoder.h
bxthread.o: bxthread.@CPP_SUFFIX@ bochs.h config.h osdep.h bx_debug/debug.h \
config.h osdep.h gui/siminterface.h cpudb.h gui/paramtree.h \
memory/memory-bochs.h pc_system.h gui/gui.h \
@ -800,24 +801,15 @@ gdbstub.o: gdbstub.@CPP_SUFFIX@ bochs.h config.h osdep.h bx_debug/debug.h config
cpu/cpu.h cpu/decoder/decoder.h cpu/i387.h cpu/fpu/softfloat.h \
cpu/fpu/tag_w.h cpu/fpu/status_w.h cpu/fpu/control_w.h cpu/crregs.h \
cpu/descriptor.h cpu/decoder/instr.h cpu/lazy_flags.h cpu/tlb.h \
cpu/icache.h cpu/apic.h cpu/xmm.h cpu/vmx.h cpu/svm.h cpu/cpuid.h \
cpu/stack.h cpu/access.h
load32bitOShack.o: load32bitOShack.@CPP_SUFFIX@ bochs.h config.h osdep.h \
bx_debug/debug.h config.h osdep.h gui/siminterface.h cpudb.h \
gui/paramtree.h memory/memory-bochs.h pc_system.h gui/gui.h \
instrument/stubs/instrument.h param_names.h cpu/cpu.h \
cpu/decoder/decoder.h cpu/i387.h cpu/fpu/softfloat.h cpu/fpu/tag_w.h \
cpu/fpu/status_w.h cpu/fpu/control_w.h cpu/crregs.h cpu/descriptor.h \
cpu/decoder/instr.h cpu/lazy_flags.h cpu/tlb.h cpu/icache.h cpu/apic.h \
cpu/xmm.h cpu/vmx.h cpu/svm.h cpu/cpuid.h cpu/access.h iodev/iodev.h \
bochs.h plugin.h extplugin.h param_names.h
cpu/icache.h cpu/apic.h cpu/xmm.h cpu/vmx.h cpu/cpuid.h cpu/stack.h \
cpu/access.h
logio.o: logio.@CPP_SUFFIX@ bochs.h config.h osdep.h bx_debug/debug.h config.h \
osdep.h gui/siminterface.h cpudb.h gui/paramtree.h memory/memory-bochs.h \
pc_system.h gui/gui.h instrument/stubs/instrument.h bxthread.h cpu/cpu.h \
cpu/decoder/decoder.h cpu/i387.h cpu/fpu/softfloat.h cpu/fpu/tag_w.h \
cpu/fpu/status_w.h cpu/fpu/control_w.h cpu/crregs.h cpu/descriptor.h \
cpu/decoder/instr.h cpu/lazy_flags.h cpu/tlb.h cpu/icache.h cpu/apic.h \
cpu/xmm.h cpu/vmx.h cpu/svm.h cpu/cpuid.h cpu/access.h
cpu/xmm.h cpu/vmx.h cpu/cpuid.h cpu/access.h
main.o: main.@CPP_SUFFIX@ bochs.h config.h osdep.h bx_debug/debug.h config.h \
osdep.h gui/siminterface.h cpudb.h gui/paramtree.h memory/memory-bochs.h \
pc_system.h gui/gui.h instrument/stubs/instrument.h bxversion.h \
@ -825,8 +817,8 @@ main.o: main.@CPP_SUFFIX@ bochs.h config.h osdep.h bx_debug/debug.h config.h \
cpu/i387.h cpu/fpu/softfloat.h cpu/fpu/tag_w.h cpu/fpu/status_w.h \
cpu/fpu/control_w.h cpu/crregs.h cpu/descriptor.h cpu/decoder/instr.h \
cpu/lazy_flags.h cpu/tlb.h cpu/icache.h cpu/apic.h cpu/xmm.h cpu/vmx.h \
cpu/svm.h cpu/cpuid.h cpu/access.h iodev/iodev.h bochs.h plugin.h \
extplugin.h param_names.h
cpu/cpuid.h cpu/access.h iodev/iodev.h bochs.h plugin.h extplugin.h \
param_names.h
osdep.o: osdep.@CPP_SUFFIX@ bochs.h config.h osdep.h bx_debug/debug.h config.h \
osdep.h gui/siminterface.h cpudb.h gui/paramtree.h memory/memory-bochs.h \
pc_system.h gui/gui.h instrument/stubs/instrument.h bxthread.h
@ -837,8 +829,8 @@ pc_system.o: pc_system.@CPP_SUFFIX@ bochs.h config.h osdep.h bx_debug/debug.h \
cpu/fpu/softfloat.h cpu/fpu/tag_w.h cpu/fpu/status_w.h \
cpu/fpu/control_w.h cpu/crregs.h cpu/descriptor.h cpu/decoder/instr.h \
cpu/lazy_flags.h cpu/tlb.h cpu/icache.h cpu/apic.h cpu/xmm.h cpu/vmx.h \
cpu/svm.h cpu/cpuid.h cpu/access.h iodev/iodev.h bochs.h plugin.h \
extplugin.h param_names.h
cpu/cpuid.h cpu/access.h iodev/iodev.h bochs.h plugin.h extplugin.h \
param_names.h
plugin.o: plugin.@CPP_SUFFIX@ bochs.h config.h osdep.h bx_debug/debug.h config.h \
osdep.h gui/siminterface.h cpudb.h gui/paramtree.h memory/memory-bochs.h \
pc_system.h gui/gui.h instrument/stubs/instrument.h iodev/iodev.h \

View File

@ -151,11 +151,6 @@ boot_params
boot_drive2
boot_drive3
floppy_sig_check
load32bitos
which
path
iolog
initrd
floppy
0

View File

@ -1136,43 +1136,6 @@ void bx_init_options()
"Skips check for the 0xaa55 signature on floppy boot device.",
0);
#if BX_LOAD32BITOSHACK
// loader hack
bx_list_c *load32bitos = new bx_list_c(boot_params, "load32bitos", "32-bit OS Loader Hack");
static const char *loader_os_names[] = { "none", "linux", "nullkernel", NULL };
bx_param_enum_c *whichOS = new bx_param_enum_c(load32bitos,
"which",
"Which operating system?",
"Which OS to boot",
loader_os_names,
Load32bitOSNone,
Load32bitOSNone);
path = new bx_param_filename_c(load32bitos,
"path",
"Pathname of OS to load",
"Pathname of the 32-bit OS to load",
"", BX_PATHNAME_LEN);
bx_param_filename_c *iolog = new bx_param_filename_c(load32bitos,
"iolog",
"Pathname of I/O log file",
"I/O logfile used for initializing the hardware",
"", BX_PATHNAME_LEN);
bx_param_filename_c *initrd = new bx_param_filename_c(load32bitos,
"initrd",
"Pathname of initrd",
"Pathname of the initial ramdisk",
"", BX_PATHNAME_LEN);
whichOS->set_ask_format("Enter OS to load: [%s] ");
path->set_ask_format("Enter pathname of OS: [%s]");
iolog->set_ask_format("Enter pathname of I/O log: [%s] ");
initrd->set_ask_format("Enter pathname of initrd: [%s] ");
load32bitos->set_options(menu->SERIES_ASK);
whichOS->set_dependent_list(load32bitos->clone(), 1);
whichOS->set_dependent_bitmap(Load32bitOSNone, 0);
whichOS->set(Load32bitOSNone);
#endif
boot_params->set_options(menu->SHOW_PARENT);
// floppy subtree
@ -3032,40 +2995,7 @@ static int parse_line_formatted(const char *context, int num_params, char *param
PARSE_ERR(("%s: port_e9_hack directive malformed.", context));
}
} else if (!strcmp(params[0], "load32bitOSImage")) {
#if BX_LOAD32BITOSHACK
if ((num_params!=4) && (num_params!=5)) {
PARSE_ERR(("%s: load32bitOSImage directive: wrong # args.", context));
}
if (strncmp(params[1], "os=", 3)) {
PARSE_ERR(("%s: load32bitOSImage: directive malformed.", context));
}
if (!strcmp(&params[1][3], "nullkernel")) {
SIM->get_param_enum(BXPN_LOAD32BITOS_WHICH)->set(Load32bitOSNullKernel);
}
else if (!strcmp(&params[1][3], "linux")) {
SIM->get_param_enum(BXPN_LOAD32BITOS_WHICH)->set(Load32bitOSLinux);
}
else {
PARSE_ERR(("%s: load32bitOSImage: unsupported OS.", context));
}
if (strncmp(params[2], "path=", 5)) {
PARSE_ERR(("%s: load32bitOSImage: directive malformed.", context));
}
if (strncmp(params[3], "iolog=", 6)) {
PARSE_ERR(("%s: load32bitOSImage: directive malformed.", context));
}
SIM->get_param_string(BXPN_LOAD32BITOS_PATH)->set(&params[2][5]);
SIM->get_param_string(BXPN_LOAD32BITOS_IOLOG)->set(&params[3][6]);
if (num_params == 5) {
if (strncmp(params[4], "initrd=", 7)) {
PARSE_ERR(("%s: load32bitOSImage: directive malformed.", context));
}
SIM->get_param_string(BXPN_LOAD32BITOS_INITRD)->set(&params[4][7]);
}
PARSE_WARN(("%s: WARNING: This Bochs feature is not maintained yet", context));
#else
PARSE_ERR(("%s: load32bitOSImage: BX_LOAD32BITOSHACK must be set to 1.", context));
#endif
PARSE_ERR(("%s: load32bitOSImage: This legacy feature is no longer supported.", context));
} else if (!strcmp(params[0], "user_plugin")) {
#if BX_PLUGINS
char tmpname[80];
@ -3223,22 +3153,6 @@ int bx_write_usb_options(FILE *fp, int maxports, bx_list_c *base)
return 0;
}
#if BX_LOAD32BITOSHACK
int bx_write_loader_options(FILE *fp)
{
if (SIM->get_param_enum(BXPN_LOAD32BITOS_WHICH)->get() == Load32bitOSNone) {
fprintf(fp, "# no loader\n");
return 0;
}
fprintf (fp, "load32bitOSImage: os=%s, path=%s, iolog=%s, initrd=%s\n",
SIM->get_param_enum(BXPN_LOAD32BITOS_WHICH)->get_selected(),
SIM->get_param_string(BXPN_LOAD32BITOS_PATH)->getptr(),
SIM->get_param_string(BXPN_LOAD32BITOS_IOLOG)->getptr(),
SIM->get_param_string(BXPN_LOAD32BITOS_INITRD)->getptr());
return 0;
}
#endif
int bx_write_clock_cmos_options(FILE *fp)
{
fprintf(fp, "clock: sync=%s", SIM->get_param_enum(BXPN_CLOCK_SYNC)->get_selected());
@ -3464,9 +3378,6 @@ int bx_write_configuration(const char *rc, int overwrite)
fprintf(fp, "screenmode: name=\"%s\"\n", SIM->get_param_string(BXPN_SCREENMODE)->getptr());
#endif
bx_write_clock_cmos_options(fp);
#if BX_LOAD32BITOSHACK
bx_write_loader_options(fp);
#endif
bx_write_log_options(fp, (bx_list_c*) SIM->get_param("log"));
bx_write_param_list(fp, (bx_list_c*) SIM->get_param(BXPN_KEYBOARD), NULL, 0);
bx_write_param_list(fp, (bx_list_c*) SIM->get_param(BXPN_MOUSE), NULL, 0);

View File

@ -893,9 +893,6 @@ typedef Bit32u bx_bool;
// I/O Interface to debugger
#define BX_SUPPORT_IODEBUG 0
// Legacy feature disabled by default
#define BX_LOAD32BITOSHACK 0
#ifdef WIN32
#define BX_FLOPPY0_NAME "Floppy Disk A:"
#define BX_FLOPPY1_NAME "Floppy Disk B:"

View File

@ -1,297 +0,0 @@
/////////////////////////////////////////////////////////////////////////
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2017 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
#include "bochs.h"
#include "param_names.h"
#include "cpu/cpu.h"
#include "iodev/iodev.h"
#define LOG_THIS genlog->
#if BX_LOAD32BITOSHACK
static void bx_load_linux_hack(void);
static void bx_load_null_kernel_hack(void);
static Bit32u bx_load_kernel_image(char *path, Bit32u paddr);
void bx_load32bitOSimagehack(void)
{
if (SIM->get_param_string(BXPN_LOAD32BITOS_IOLOG) &&
(SIM->get_param_string(BXPN_LOAD32BITOS_IOLOG)->getptr()[0] != '\0'))
{
// Replay IO from log to initialize IO devices to
// a reasonable state needed for the OS. This is done
// in lieu of running the 16-bit BIOS to init things,
// since we want to test straight 32bit stuff for
// freemware.
FILE *fp = fopen(SIM->get_param_string(BXPN_LOAD32BITOS_IOLOG)->getptr(), "r");
if (fp == NULL) {
BX_PANIC(("could not open IO init file."));
}
while (1) {
unsigned len, op, port, val;
int ret;
ret = fscanf(fp, "%u %u %x %x\n", &len, &op, &port, &val);
if (ret != 4) {
BX_PANIC(("could not open IO init file."));
}
if (op == 0) {
// read
bx_devices.inp(port, len);
}
else if (op == 1) {
// write
bx_devices.outp(port, val, len);
}
else {
BX_PANIC(("bad IO op in init filen"));
}
if (feof(fp)) break;
}
fclose(fp);
} //if iolog file to load
// Invoke proper hack depending on which OS image we're loading
switch (SIM->get_param_enum(BXPN_LOAD32BITOS_WHICH)->get()) {
case Load32bitOSLinux:
bx_load_linux_hack();
break;
case Load32bitOSNullKernel:
bx_load_null_kernel_hack();
break;
default:
BX_PANIC(("load32bitOSImage: OS not recognized"));
}
}
struct gdt_entry
{
Bit32u low;
Bit32u high;
};
struct linux_setup_params
{
/* 0x000 */ Bit8u orig_x;
/* 0x001 */ Bit8u orig_y;
/* 0x002 */ Bit16u memory_size_std;
/* 0x004 */ Bit16u orig_video_page;
/* 0x006 */ Bit8u orig_video_mode;
/* 0x007 */ Bit8u orig_video_cols;
/* 0x008 */ Bit16u unused1;
/* 0x00a */ Bit16u orig_video_ega_bx;
/* 0x00c */ Bit16u unused2;
/* 0x00e */ Bit8u orig_video_lines;
/* 0x00f */ Bit8u orig_video_isVGA;
/* 0x010 */ Bit16u orig_video_points;
/* 0x012 */ Bit8u pad1[0x40 - 0x12];
/* 0x040 */ Bit8u apm_info[0x80 - 0x40];
/* 0x080 */ Bit8u hd0_info[16];
/* 0x090 */ Bit8u hd1_info[16];
/* 0x0a0 */ Bit8u pad2[0x1e0 - 0xa0];
/* 0x1e0 */ Bit32u memory_size_ext;
/* 0x1e4 */ Bit8u pad3[0x1f1 - 0x1e4];
/* 0x1f1 */ Bit8u setup_sects;
/* 0x1f2 */ Bit16u mount_root_rdonly;
/* 0x1f4 */ Bit16u sys_size;
/* 0x1f6 */ Bit16u swap_dev;
/* 0x1f8 */ Bit16u ramdisk_flags;
/* 0x1fa */ Bit16u vga_mode;
/* 0x1fc */ Bit16u orig_root_dev;
/* 0x1fe */ Bit16u bootsect_magic;
/* 0x200 */ Bit8u pad4[0x210 - 0x200];
/* 0x210 */ Bit32u loader_type;
/* 0x214 */ Bit32u kernel_start;
/* 0x218 */ Bit32u initrd_start;
/* 0x21c */ Bit32u initrd_size;
/* 0x220 */ Bit8u pad5[0x400 - 0x220];
/* 0x400 */ struct gdt_entry gdt[128];
/* 0x800 */ Bit8u commandline[2048];
};
static void bx_load_linux_setup_params(Bit32u initrd_start, Bit32u initrd_size)
{
struct linux_setup_params *params =
(struct linux_setup_params *) BX_MEM(0)->get_vector(0x00090000);
memset(params, '\0', sizeof(*params));
/* Video settings (standard VGA) */
params->orig_x = 0;
params->orig_y = 0;
params->orig_video_page = 0;
params->orig_video_mode = 3;
params->orig_video_cols = 80;
params->orig_video_lines = 25;
params->orig_video_points = 16;
params->orig_video_isVGA = 1;
params->orig_video_ega_bx = 3;
/* Memory size (total mem - 1MB, in KB) */
params->memory_size_ext = (Bit32u)(BX_MEM(0)->get_memory_len()/(1024*1024) - 1) * 1024;
/* Boot parameters */
params->loader_type = 1;
params->bootsect_magic = 0xaa55;
params->mount_root_rdonly = 0;
params->orig_root_dev = 0x0100;
params->initrd_start = initrd_start;
params->initrd_size = initrd_size;
/* Initial GDT */
params->gdt[2].high = 0x00cf9a00;
params->gdt[2].low = 0x0000ffff;
params->gdt[3].high = 0x00cf9200;
params->gdt[3].low = 0x0000ffff;
}
void bx_load_linux_hack(void)
{
Bit32u initrd_start = 0, initrd_size = 0;
// The RESET function will have been called first.
// Set CPU and memory features which are assumed at this point.
// Load Linux kernel image
bx_load_kernel_image(SIM->get_param_string(BXPN_LOAD32BITOS_PATH)->getptr(), 0x100000);
// Load initial ramdisk image if requested
char *tmpPtr = SIM->get_param_string(BXPN_LOAD32BITOS_INITRD)->getptr();
if (tmpPtr && tmpPtr[0]) /* The initial value is "" and not NULL */
{
initrd_start = 0x00800000; /* FIXME: load at top of memory */
initrd_size = bx_load_kernel_image(tmpPtr, initrd_start);
}
// Setup Linux startup parameters buffer
bx_load_linux_setup_params(initrd_start, initrd_size);
// Enable A20 line
BX_SET_ENABLE_A20(1);
// Setup PICs the way Linux likes it
BX_OUTP(0x20, 0x11, 1);
BX_OUTP(0xA0, 0x11, 1);
BX_OUTP(0x21, 0x20, 1);
BX_OUTP(0xA1, 0x28, 1);
BX_OUTP(0x21, 0x04, 1);
BX_OUTP(0xA1, 0x02, 1);
BX_OUTP(0x21, 0x01, 1);
BX_OUTP(0xA1, 0x01, 1);
BX_OUTP(0x21, 0xFF, 1);
BX_OUTP(0xA1, 0xFB, 1);
// Disable interrupts and NMIs
BX_CPU(0)->clear_IF();
BX_OUTP(0x70, 0x80, 1);
// Enter protected mode
// Fixed by george (kyriazis at nvidia.com)
BX_CPU(0)->cr0.set_PE(1); // protected mode
// load esi with real_mode
BX_CPU(0)->gen_reg[BX_32BIT_REG_ESI].dword.erx = 0x90000;
// Set up initial GDT
BX_CPU(0)->gdtr.limit = 0x400;
BX_CPU(0)->gdtr.base = 0x00090400;
// Jump to protected mode entry point
BX_CPU(0)->jump_protected(NULL, 0x10, 0x100000);
}
void bx_load_null_kernel_hack(void)
{
// The RESET function will have been called first.
// Set CPU and memory features which are assumed at this point.
bx_load_kernel_image(SIM->get_param_string(BXPN_LOAD32BITOS_PATH)->getptr(), 0x100000);
// EIP deltas
BX_CPU(0)->prev_rip = BX_CPU(0)->gen_reg[BX_32BIT_REG_EIP].dword.erx = 0x100000;
// CS deltas
BX_CPU(0)->sregs[BX_SEG_REG_CS].cache.u.segment.base = 0x00000000;
BX_CPU(0)->sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled = 0xFFFFFFFF;
BX_CPU(0)->sregs[BX_SEG_REG_CS].cache.u.segment.g = 1; // page granularity
BX_CPU(0)->sregs[BX_SEG_REG_CS].cache.u.segment.d_b = 1; // 32bit
// DS deltas
BX_CPU(0)->sregs[BX_SEG_REG_DS].cache.u.segment.base = 0x00000000;
BX_CPU(0)->sregs[BX_SEG_REG_DS].cache.u.segment.limit_scaled = 0xFFFFFFFF;
BX_CPU(0)->sregs[BX_SEG_REG_DS].cache.u.segment.g = 1; // page granularity
BX_CPU(0)->sregs[BX_SEG_REG_DS].cache.u.segment.d_b = 1; // 32bit
// CR0 deltas
BX_CPU(0)->cr0.set_PE(1); // protected mode
BX_CPU(0)->handleCpuModeChange();
}
Bit32u bx_load_kernel_image(char *path, Bit32u paddr)
{
struct stat stat_buf;
int fd, ret;
unsigned long size, offset;
Bit32u page_size;
// read in ROM BIOS image file
fd = open(path, O_RDONLY
#ifdef O_BINARY
| O_BINARY
#endif
);
if (fd < 0) {
BX_INFO(("load_kernel_image: couldn't open image file '%s'.", path));
BX_EXIT(1);
}
ret = fstat(fd, &stat_buf);
if (ret) {
BX_INFO(("load_kernel_image: couldn't stat image file '%s'.", path));
BX_EXIT(1);
}
size = (unsigned long) stat_buf.st_size;
page_size = ((Bit32u)size + 0xfff) & ~0xfff;
if ((paddr + size) > BX_MEM(0)->get_memory_len()) {
BX_INFO(("load_kernel_image: address range > physical memsize!"));
BX_EXIT(1);
}
offset = 0;
while (size > 0) {
ret = read(fd, (bx_ptr_t) BX_MEM(0)->get_vector(paddr + offset), size);
if (ret <= 0) {
BX_INFO(("load_kernel_image: read failed on image"));
BX_EXIT(1);
}
size -= ret;
offset += ret;
}
close(fd);
BX_INFO(("load_kernel_image: '%s', size=%u read into memory at %08x",
path, (unsigned) stat_buf.st_size, (unsigned) paddr));
return page_size;
}
#endif

View File

@ -125,12 +125,6 @@
#define BXPN_BOOTDRIVE2 "boot_params.boot_drive2"
#define BXPN_BOOTDRIVE3 "boot_params.boot_drive3"
#define BXPN_FLOPPYSIGCHECK "boot_params.floppy_sig_check"
#if BX_LOAD32BITOSHACK
#define BXPN_LOAD32BITOS_WHICH "boot_params.load32bitos.which"
#define BXPN_LOAD32BITOS_PATH "boot_params.load32bitos.path"
#define BXPN_LOAD32BITOS_IOLOG "boot_params.load32bitos.iolog"
#define BXPN_LOAD32BITOS_INITRD "boot_params.load32bitos.initrd"
#endif
#define BXPN_FLOPPYA "floppy.0"
#define BXPN_FLOPPYA_DEVTYPE "floppy.0.devtype"
#define BXPN_FLOPPYA_PATH "floppy.0.path"