Coder Social home page Coder Social logo

bochs-emu / bochs Goto Github PK

View Code? Open in Web Editor NEW
772.0 21.0 94.0 41.56 MB

Bochs - Cross Platform x86 Emulator Project

Home Page: https://bochs.sourceforge.io/

License: GNU Lesser General Public License v2.1

Shell 3.13% Makefile 2.14% C 20.12% C++ 70.31% ASL 0.15% Assembly 0.06% Perl 0.08% AppleScript 0.02% Lex 0.10% Yacc 0.29% HTML 0.64% Roff 0.38% M4 0.64% Rez 1.95%

bochs's People

Contributors

biswa96 avatar c-nichols avatar danielg4 avatar disba1ancer avatar drchat avatar finnbrudal avatar fweimer-rh avatar fysnet avatar imwux avatar julienfreche avatar mcb30 avatar quircks avatar rofl0r avatar simoc avatar skitt avatar songziming avatar sredna avatar sskras avatar stlintel avatar tandasat avatar therealdreg avatar toddfries avatar torinde avatar ughoavgfhw avatar vort avatar vruppert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bochs's Issues

IRQs produced by the secondary PIC, and lowered before IRQ#2 is raised, become spurius IRQs#15

Hello Bochs team,

I believe I have stumbled upon a bug while developing an ATA PIO driver for my toy operating system. My driver was polling the status register of the primary ATA device, and thus, clearing the interrupt, as I wasn't reading from the secondary.

My IRQs, as usual, are remapped from 0x20 for the Master PIC and from 0x28 for the Slave.

The following log shows a trace of the emulation of the operating system I'm developing. There are some additions and modifications to the log messages.

01759425355i[HD    ] ASDF HARDDRV: raising interrupt 14 {DISK}   
01759425355d[IOAPIC] set_irq_level(): INTIN14: level=1           
01759425355i[PIC   ] ASDF SLAVE IRQ line 14 now high             <------- [1]
01759425355i[PIC   ] ASDF slave irr: 40
01759425355i[PIC   ] ASDF Interrupt requests: 40
01759425355i[PIC   ] ASDF Interrupt mask: 0
01759425355i[PIC   ] ASDF Unmasked Interrupts: 40
01759425355i[PIC   ] ASDF signalling IRQ #14
01759425355i[PIC   ] ASDF MASTER IRQ line 2 now high
01759425355i[PIC   ] ASDF Interrupt requests: 5
01759425355i[PIC   ] ASDF Interrupt mask: 0
01759425355i[PIC   ] ASDF Unmasked Interrupts: 5
01759425489d[IOAPIC] set_irq_level(): INTIN14: level=0
01759425489i[PIC   ] ASDF IRQ line 14 now low                    <------- [2]
01759479170i[CPU0  ] ASDF interrupt(): vector = 20, TYPE = 4, EXT = 0
01759479170d[CPU0  ] interrupt(): INTERRUPT TO SAME PRIVILEGE
01759482224i[PIC   ] ASDF Interrupt requests: 5
01759482224i[PIC   ] ASDF Interrupt mask: 0
01759482224i[PIC   ] ASDF Unmasked Interrupts: 5
01759484885d[CPU0  ] inhibit interrupts mask = 1
01759484886d[CPU0  ] INTERRUPT RETURN TO SAME PRIVILEGE LEVEL
01759484894d[CPU0  ] inhibit interrupts mask = 1
01759484896i[CPU0  ] ASDF InterruptAcknowledge vector: 20
01759484896i[CPU0  ] ASDF interrupt(): vector = 20, TYPE = 0, EXT = 1
01759484896d[CPU0  ] interrupt(): INTERRUPT TO SAME PRIVILEGE
01759487949i[PIC   ] ASDF Interrupt requests: 4
01759487949i[PIC   ] ASDF Interrupt mask: 0
01759487949i[PIC   ] ASDF Unmasked Interrupts: 4
01759487949i[PIC   ] ASDF signalling IRQ #2                   <------ [3]
01759490610d[CPU0  ] inhibit interrupts mask = 1
01759490611d[CPU0  ] INTERRUPT RETURN TO SAME PRIVILEGE LEVEL
01759490612i[PIC   ] ASDF IAC SLAVE_IRQ: 6, SLAVE_OFFSET: 28, VECTOR: 2e (IRR: 0) <------ [4]
01759490612i[PIC   ] ASDF IAC: SLAVE PIC SPURIUS!      
01759490612i[CPU0  ] ASDF InterruptAcknowledge vector: 2f
01759490612p[CPU0  ] >>PANIC<< ASDF interrupt(): 2f
01759490612i[CPU0  ] ASDF interrupt(): vector = 2f, TYPE = 0, EXT = 1            <------- [5]

Has can be deduced from the log, if the IRQ#14 [1] goes low [2] before IRQ#2 is raised [3], Bochs will morph the lowered IRQ#14 interrupt into [4] an spurious IRQ#15 [5].

The aforementioned behavior is produced by line, which will morph any slave interrupt lowered, into an IRQ#15.

    if ((BX_PIC_THIS s.slave_pic.irr & ~BX_PIC_THIS s.slave_pic.imr) == 0) {
      return (BX_PIC_THIS s.slave_pic.interrupt_offset + 7);
    }

I don't know if the behavior I'm describing is intended, but it feels smelly to me, although this has to be well-exercised code path. I'd also like to add that it has been driving me crazy because QEMU treated the interrupt as an IRQ#14.

The logging modifications I've made are available here

Best regards.

Fix boot for vvfat disk

I dump mbr/boot sector from USB flash. Primary partition was align by 1 Mb.
Copy all files to local dir and make vvfat disk.
But after start bochs is crashed.
Quick look on source code:

./vvfat.cc:
first_sectors = new Bit8u[0xc000]; // allocate too small memory :(

Next changes will be fix the problem :

vvfat_image_t::vvfat_image_t(Bit64u size, const char* _redolog_name)
{
const size_t first_sectors_count = 4096;
const size_t first_sectors_size = first_sectors_count * 0x200;
//const size_t first_sectors_size = 0xC000;

if (sizeof(bootsector_t) != 512) {
BX_FATAL(("system error: invalid bootsector structure size"));
}

first_sectors = new Bit8u[first_sectors_size];
memset(&first_sectors[0], 0, first_sectors_size);
...

PS Can be better check size of allocated first_sectors ...

Lags during simulation start and restart

When simulation is started with clock: sync=realtime, there is several seconds delay until BIOS messages appear.

This delay can be seen in logs here:

00000688828i[WINGUI] dimension update x=720 y=400 fontheight=16 fontwidth=9 bpp=8
00346804888i[BIOS  ] Found 1 cpu(s)

If I replace --enable-all-optimizations with --enable-repeat-speedups --enable-fast-function-calls, then Found 1 cpu(s) appears way earlier:

00000518347i[BIOS  ] Found 1 cpu(s)

Here is "empty" configuration, which allows to see this problem: empty.zip.

Version: fde226f

CD-ROM not found with MS-DOS 6.22

Discussed in #102

Originally posted by Vort October 18, 2023
Hello.

I was using teac_cdi.sys driver with DOS for a long time.
It always worked for me, both on real hardware and with virtual machines.

But I can't get it to work with Bochs for some reason.
Not sure if because of some my mistake or because of bugs in Bochs.

Can anyone look at my virtual machine (bochs_dos_cd.zip) and say what's wrong with CD support there?

bochs_no_cd

Large VHD image files

If I have a considerably large VHD file, ~32Gig used/128Gig total usable size, Bochs returns a PANIC at line 325 in harddrv.cc

BX_PANIC(("ata%d-%d: could not open hard drive image file '%s'", channel, device, SIM->get_param_string("path", base)->getptr()));

The offending code is in vpc.cc, line 173:

if (sector_count >= 65535 * 16 * 255) {
  bx_close_image(fd, pathname);
  return -EFBIG;
}

I understand that the VHD specification states that a CHS value limit is 65535/16/63. However, this doesn't mean that Bochs shouldn't be able to access up to the actual 2TB limitation of the VHD when reading sectors, correct?

Therefore, what is the reason for the check at line 173 in vpc.cc shown above? I don't believe it is needed, unless there is somewhere in the Bochs source that relies on the limitation of a CHS value of 65535/16/63. The only limitation would be in the BIOS and it can't access anything past the 1024/254/63 mark anyway, right?

However, if it is actually needed, an additional error to the log file might be warranted. Maybe something like:

if (sector_count >= 65535 * 16 * 255) {
  bx_close_image(fd, pathname);
  BX_ERROR(("VHD file too large: " FMT_LL "u", sector_count));
  return -EFBIG;
}

Thank you,
Ben

Defects in VMLOAD and VMSAVE

When executing in the guest: (does not intercept VMLOAD and VMSAVE)
VMLOAD
VMRUN
or
VMSAVE
VMRUN
When VMEXIT occurs in VMRUN, , vmcbptr will be incorrect.

Shaking text in Commander Keen 5

Text, which is displayed after starting Commander Keen 5, should not have horizontal movement.

Similar problem also occurs with VirtualBox 6.1.36.
However, VMware Workstation 12.5.2 shows animation correctly:

keen5.mp4

Version: c48a501

Toggle Control in OHCI

While working with the USB Hub emulation, I found that there is an issue with the Toggle Control when a device is attached to the OHCI. I never noticed this before.

I will investigate further and hopefully have a PR to fix it.

In the mean-time, please set:

#define HANDLE_TOGGLE_CONTROL 0

so the OHCI works as expected.

Ben

Crash of Bochs / OS with default Voodoo 3 drivers

When I try to load Windows XP SP3 with default Voodoo 3 drivers, one of two things happens:

  1. Either Bochs crashes with >>PANIC<< APIC read at address 0x0000fee00081 spans 32-bit boundary !;
  2. Or OS crashes with TSS selector points to bad TSS.

This problem start to appear after updating from 620d091 to f5b54a4.
Most likely, f5b54a4 is not direct cause of the problem, but it uncovers problem somehow.

Multiple build errors on macOS Monterey

The make and build fails for two issues.

  1. use of deprecated flags
  2. use of C++11 feature

Use of deprecated flags

The first issue looks like this.

% sh .conf.macosx              
checking build system type... x86_64-apple-darwin21.6.0
checking host system type... x86_64-apple-darwin21.6.0
checking target system type... x86_64-apple-darwin21.6.0
checking if you are configuring for another platform... no
checking for standard CFLAGS on this platform... -fpascal-strings -fno-common -Wno-four-char-constants -Wno-unknown-pragmas -Dmacintosh
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/standa/Desktop/class/Bochs/bochs':
configure: error: C compiler cannot create executables
See `config.log' for more details

config.log

clang: error: unknown argument: '-falign-loops-max-skip=15'
clang: error: unknown argument: '-falign-jumps-max-skip=15'

A fix (along with resolving warnings) is alike this.

-CFLAGS="-pipe -O3 -I/sw/include -fomit-frame-pointer -finline-functions -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-labels=16 -falign-loops-max-skip=15 -falign-jumps-max-skip=15 -fprefetch-loop-arrays $CFLAGS"
+CFLAGS="-pipe -O3 -I/sw/include -fomit-frame-pointer -finline-functions $CFLAGS"

Use of C++11 feature

This leads us to the 2nd problem.

In file included from init.cc:25:
./cpu.h:4544:233: error: use of undeclared identifier 'nullptr'
  BX_SMF bx_phy_address translate_guest_physical(bx_phy_address guest_paddr, bx_address guest_laddr, bool guest_laddr_valid, bool is_page_walk, unsigned user_page, unsigned rw, bool supervisor_shadow_stack = false, bool *spp_walk = nullptr);
                                                                                                                                                                                                                                        ^
1 warning and 1 error generated.
make[1]: *** [init.o] Error 1
make: *** [cpu/libcpu.a] Error 2

This nullptr is only one place used in the entire code base, and an easy "fix" is to make it NULL.

What I am unsure is if macOS compiling without C++11 enabled is intentional, since other platform compiles this (ie, uses C++11), and wonder a proper fix is to update configuration files so that it starts building with C++11 enabled (which I am not sure how to)

As a ref, here is the compiler versions. This mac is almost clean install, besides I installed XCode.

% gcc --version
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
% g++ --version
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

error in sha1rnds4 implementation?

The final assignment of A/B/C/D to the destination is

  op1.xmm32u(0) = A[4];
  op1.xmm32u(1) = B[4];
  op1.xmm32u(2) = C[4];
  op1.xmm32u(3) = D[4];

According to Intel manuals it should be in the opposite direction (A in op1.xmm32u(3), all the way down to D in op1.xmm32u(0)), similar to the initial assignment:

  A[0] = op1.xmm32u(3);
  B[0] = op1.xmm32u(2);
  C[0] = op1.xmm32u(1);
  D[0] = op1.xmm32u(0);

Unable to compile instrumentation examples

While compiling with instrumentation support ( ./configure --enable-instrumentation="instrument/example0" ) i get the following error:

cd instrument/example0 && \
make  libinstrument.a
make[1]: Entering directory '/home/hypervisor_dev/real_soft/Bochs/bochs/instrument/example0'
c++ -c -I../.. -I./../.. -I. -I./. -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -Wall -O3 -fomit-frame-pointer -pipe -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES  instrument.cc -o instrument.o
instrument.cc: In function ‘void bx_print_instruction(unsigned int, const instruction_t*)’:
instrument.cc:84:3: error: ‘bx_dbg_disasm_wrapper’ was not declared in this scope
   84 |   bx_dbg_disasm_wrapper(i->is32, i->is64, 0, 0, i->opcode, disasm_tbuf);
      |   ^~~~~~~~~~~~~~~~~~~~~
make[1]: *** [Makefile:51: instrument.o] Error 1
make[1]: Leaving directory '/home/hypervisor_dev/real_soft/Bochs/bochs/instrument/example0'
make: *** [Makefile:363: instrument/example0/libinstrument.a] Error 2

There are also problems while compiling other examples.
My system runs Ubuntu on WSL.

P.s I think we also need more examples covering the instrumentation topic.

Missing AVX-512 masking support for opcodes

The following AVX-512 opcodes missing mask support at load operation.
As result these operations do not have 'masked fault suppression' feature.


bx_define_opcode(BX_IA_V512_VPMOVSXBW_VdqWdq_Kmask, &BX_CPU_C::LOAD_Half_Vector, &BX_CPU_C::VPMOVSXBW_MASK_VdqWdqR, BX_ISA_AVX512_BW, OP_Vdq, OP_mVHV, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VPMOVSXBD_VdqWdq_Kmask, &BX_CPU_C::LOAD_Quarter_Vector, &BX_CPU_C::VPMOVSXBD_MASK_VdqWdqR, BX_ISA_AVX512, OP_Vdq, OP_mVQV, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VPMOVSXBQ_VdqWdq_Kmask, &BX_CPU_C::LOAD_Oct_Vector, &BX_CPU_C::VPMOVSXBQ_MASK_VdqWdqR, BX_ISA_AVX512, OP_Vdq, OP_mVOV, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VPMOVSXWD_VdqWdq_Kmask, &BX_CPU_C::LOAD_Half_Vector, &BX_CPU_C::VPMOVSXWD_MASK_VdqWdqR, BX_ISA_AVX512, OP_Vdq, OP_mVHV, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VPMOVSXWQ_VdqWdq_Kmask, &BX_CPU_C::LOAD_Quarter_Vector, &BX_CPU_C::VPMOVSXWQ_MASK_VdqWdqR, BX_ISA_AVX512, OP_Vdq, OP_mVQV, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VPMOVSXDQ_VdqWdq_Kmask, &BX_CPU_C::LOAD_Half_Vector, &BX_CPU_C::VPMOVSXDQ_MASK_VdqWdqR, BX_ISA_AVX512, OP_Vdq, OP_mVHV, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VPMOVZXBW_VdqWdq_Kmask, &BX_CPU_C::LOAD_Half_Vector, &BX_CPU_C::VPMOVZXBW_MASK_VdqWdqR, BX_ISA_AVX512_BW, OP_Vdq, OP_mVHV, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VPMOVZXBD_VdqWdq_Kmask, &BX_CPU_C::LOAD_Quarter_Vector, &BX_CPU_C::VPMOVZXBD_MASK_VdqWdqR, BX_ISA_AVX512, OP_Vdq, OP_mVQV, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VPMOVZXBQ_VdqWdq_Kmask, &BX_CPU_C::LOAD_Oct_Vector, &BX_CPU_C::VPMOVZXBQ_MASK_VdqWdqR, BX_ISA_AVX512, OP_Vdq, OP_mVOV, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VPMOVZXWD_VdqWdq_Kmask, &BX_CPU_C::LOAD_Half_Vector, &BX_CPU_C::VPMOVZXWD_MASK_VdqWdqR, BX_ISA_AVX512, OP_Vdq, OP_mVHV, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VPMOVZXWQ_VdqWdq_Kmask, &BX_CPU_C::LOAD_Quarter_Vector, &BX_CPU_C::VPMOVZXWQ_MASK_VdqWdqR, BX_ISA_AVX512, OP_Vdq, OP_mVQV, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VPMOVZXDQ_VdqWdq_Kmask, &BX_CPU_C::LOAD_Half_Vector, &BX_CPU_C::VPMOVZXDQ_MASK_VdqWdqR, BX_ISA_AVX512, OP_Vdq, OP_mVHV, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VCVTPH2PS_VpsWps_Kmask, &BX_CPU_C::LOAD_Half_Vector, &BX_CPU_C::VCVTPH2PS_MASK_VpsWpsR, BX_ISA_AVX512, OP_Vps, OP_mVHV, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_BROADCAST)

EDIT: Fixed git tag 02c4f85

Also need to understand what is the fault suppression story for following opcodes:

bx_define_opcode(BX_IA_V512_VPEXPANDD_VdqWdq_Kmask, &BX_CPU_C::LOAD_Vector, &BX_CPU_C::VEXPANDPS_MASK_VpsWpsR, BX_ISA_AVX512, OP_Vdq, OP_mVdq32, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VPEXPANDQ_VdqWdq_Kmask, &BX_CPU_C::LOAD_Vector, &BX_CPU_C::VEXPANDPD_MASK_VpdWpdR, BX_ISA_AVX512, OP_Vdq, OP_mVdq64, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VEXPANDPS_VpsWps_Kmask, &BX_CPU_C::LOAD_Vector, &BX_CPU_C::VEXPANDPS_MASK_VpsWpsR, BX_ISA_AVX512, OP_Vps, OP_mVps32, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VEXPANDPD_VpdWpd_Kmask, &BX_CPU_C::LOAD_Vector, &BX_CPU_C::VEXPANDPD_MASK_VpdWpdR, BX_ISA_AVX512, OP_Vpd, OP_mVpd64, OP_NONE, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)
bx_define_opcode(BX_IA_V512_VPSHUFBITQMB_KGqHdqWdq_Kmask, &BX_CPU_C::LOAD_Vector, &BX_CPU_C::VPSHUFBITQMB_MASK_KGqHdqWdqR, BX_ISA_AVX512_BITALG, OP_KGq, OP_Hdq, OP_mVdq, OP_NONE, BX_PREPARE_EVEX_NO_SAE | BX_PREPARE_EVEX_NO_BROADCAST)

ldgt does not behave consistently with qemu-system-i386

my code is here.

my step:

# bximage -func=create -hd=16M -imgmode="flat" -sectsize=512 -q hd.img
# nasm -I include/ -o mbr.bin mbr.s && dd if=mbr.bin of=./hd.img bs=512 count=1  conv=notrunc
# nasm -I include/ -o loader.bin loader.s && dd if=loader.bin of=./hd.img bs=512 count=4 seek=2 conv=notrunc
# qemu-system-i386 -hda hd.img -d cpu_reset,int -no-reboot

core code:

   ....
   GDT_BASE:   dd    0x00000000 
	                 dd    0x00000000

   CODE_DESC:  dd    0x0000FFFF
	                   dd    DESC_CODE_HIGH4

   DATA_STACK_DESC:  dd    0x0000FFFF
		                       dd    DESC_DATA_HIGH4

   VIDEO_DESC: dd    0x80000007
	                    dd    DESC_VIDEO_HIGH4 
   times 60 dq 0					 ; keep 60 empty slot, 
   GDT_SIZE   equ   $ - GDT_BASE 
   GDT_LIMIT   equ   GDT_SIZE -  1
   SELECTOR_CODE equ (0x0001<<3) + TI_GDT + RPL0
   SELECTOR_DATA equ (0x0002<<3) + TI_GDT + RPL0
   SELECTOR_VIDEO equ (0x0003<<3) + TI_GDT + RPL0

   gdt_ptr  dw  GDT_LIMIT 
	    dd  GDT_BASE
   ...
   lgdt [gdt_ptr]
  ...

lgdt [gdt_ptr] triggers a cpu reset, add cli before the command, the problem disappears on bochs, but it is still on qemu-system-i386.

maybe the problem is times 60 dq 0, because I didn't find information on how to check gdt.

Crash when Voodoo 3 guest resolution is higher than host resolution

I tried to install Sfft1.9.zip drivers for Voodoo 3 to Windows XP.
After restart, guest resolution for some reason changed to 1920x1200.
Because host resolution is 1280x1024, image not fits and Bochs crashes.
Crash also happens with default Windows XP drivers for Voodoo 3 if I set 1920x1200 resolution manually.
Crash most likely happens on this line:

*(tile_ptr2++) = (Bit8u)(colour >> i);

If I put if (xc >= 1280 || yc >= 1024) continue; earlier, no crash happen.
However it looks like SFFT drivers have some other problems, so fixing this particular issue won't be enough to make them work correctly.

To properly reproduce this problem, something should be done with #120. upd. ← this thing is solved.

bx_dbg_read_linear: physical memory read error

env: Ubuntu 22.04

boot.asm:

org 07C00h                 
       mov ax, cs
       mov ds, ax
       mov es, ax
       call DispStr               
       jmp $       
DispStr:
       mov ax, BootMessage
       mov bp, ax               
       mov cx, 16               
       mov ax, 01301h         
       mov bx, 000Ch             
       mov dl, 0
       int 10h                   
       ret
BootMessage:  db "Hello,OS world!"
	times 510-($-$$)   db   0         
	dw 0xaa55

bochsrc:

# how much memorythe emulated machine will have  
megs: 32 
   
# filename of ROMimages  
romimage:file=/usr/share/bochs/BIOS-bochs-latest
vgaromimage:file=/usr/share/vgabios/vgabios.debug.bin
   
# what disk imageswill be used  
floppya:1_44=test.img, status=inserted  
   
# choose the bootdisk.  
boot: floppy  
   
# where do we sendlog messages?  
log: bochsout.txt  
   
# disable themouse  
mouse: enabled=0  
   
# enable keymapping, using Us layout as default  
keyboard:keymap=/usr/share/bochs/keymaps/x11-pc-us.map

display_library:x

bochs:

$ nasm boot.asm -o boot.bin
$ dd if=boot.bin of=test.img bs=512 count=1 conv=notrunc
$ bochs -f bochsrc.conf 
00000000000i[      ] LTDL_LIBRARY_PATH not set. using compile time default '/usr/lib/x86_64-linux-gnu/bochs/plugins'
========================================================================
                        Bochs x86 Emulator 2.7
              Built from SVN snapshot on August  1, 2021
                Timestamp: Sun Aug  1 10:07:00 CEST 2021
========================================================================
00000000000i[      ] BXSHARE not set. using compile time default '/usr/share/bochs'
00000000000i[      ] lt_dlhandle is 0x55def313df20
00000000000i[PLUGIN] loaded plugin libbx_iodebug.so
00000000000i[      ] lt_dlhandle is 0x55def313e1c0
00000000000i[PLUGIN] loaded plugin libbx_unmapped.so
00000000000i[      ] lt_dlhandle is 0x55def3116d80
00000000000i[PLUGIN] loaded plugin libbx_parallel.so
00000000000i[      ] lt_dlhandle is 0x55def30fabd0
00000000000i[PLUGIN] loaded plugin libbx_gameport.so
00000000000i[      ] lt_dlhandle is 0x55def30fb410
00000000000i[PLUGIN] loaded plugin libbx_extfpuirq.so
00000000000i[      ] lt_dlhandle is 0x55def30fbc50
00000000000i[PLUGIN] loaded plugin libbx_serial.so
00000000000i[      ] lt_dlhandle is 0x55def30ffe30
00000000000i[PLUGIN] loaded plugin libbx_biosdev.so
00000000000i[      ] lt_dlhandle is 0x55def3100810
00000000000i[PLUGIN] loaded plugin libbx_speaker.so
00000000000i[      ] reading configuration from 3.conf
00000000000i[      ] lt_dlhandle is 0x55def31416e0
00000000000i[PLUGIN] loaded plugin libbx_textconfig.so
00000000000i[      ] lt_dlhandle is 0x55def3141eb0
00000000000i[PLUGIN] loaded plugin libbx_x_gui.so
00000000000i[      ] installing x module as the Bochs GUI
00000000000i[      ] using log file bochsout.txt
Next at t=0
(0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b          ; ea5be000f0
<bochs:1> c
bx_dbg_read_linear: physical memory read error (phy=0x0000322f3130, lin=0x00000000322f3130)
Next at t=698966
(0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b          ; ea5be000f0
<bochs:2> exit
(0).[698966] [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b          ; ea5be000f0

bochs can't print "Hello,OS world!". And 0x0000322f3130≈803M > megs(32M), what's wrong?

qemu-system-x86_64 -fda test.img is works.

SVM guest cannot trigger shutdown

Set the intercept_shutdown_events bit in VMCB, and guest executes the following instructions:

 645:   31 c0                   xor    eax,eax
 647:   89 44 24 f8             mov    DWORD PTR [rsp-0x8],eax
 64b:   89 44 24 fc             mov    DWORD PTR [rsp-0x4],eax
 64f:   0f 01 5c 24 f8          lidt   [rsp-0x8]
 654:   bc 01 00 00 00          mov    esp,0x1
 659:   50                      push   eax
 65a:   eb fe                   jmp    65a <s32+0x43>

Bochs does not have vmexit.

bochsout.txt:

01203100000p[XGUI  ] >>PANIC<< POWER button turned off.
01203100000i[CPU0  ] CPU is in protected mode (active)
01203100000i[CPU0  ] CS.mode = 32 bit
01203100000i[CPU0  ] SS.mode = 32 bit
01203100000i[CPU0  ] EFER   = 0x00001000
01203100000i[CPU0  ] | EAX=00000000  EBX=00009400  ECX=c0000080  EDX=55aa55aa
01203100000i[CPU0  ] | ESP=fffffffd  EBP=00000000  ESI=00005178  EDI=0000a000
01203100000i[CPU0  ] | IOPL=0 id vip vif ac vm rf nt of df if tf sf ZF af PF cf
01203100000i[CPU0  ] | SEG sltr(index|ti|rpl)     base    limit G D
01203100000i[CPU0  ] |  CS:0008( 0001| 0|  0) 00000000 ffffffff 1 1
01203100000i[CPU0  ] |  DS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
01203100000i[CPU0  ] |  SS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
01203100000i[CPU0  ] |  ES:0010( 0002| 0|  0) 00000000 ffffffff 1 1
01203100000i[CPU0  ] |  FS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
01203100000i[CPU0  ] |  GS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
01203100000i[CPU0  ] | EIP=0000065a (0000065a)
01203100000i[CPU0  ] | CR0=0x00000031 CR2=0x00000000
01203100000i[CPU0  ] | CR3=0x00000000 CR4=0x00000000
01203100000i[CPU0  ] 0x000000000000065a>> jmp .-2 (0x0000065a) : EBFE

Testing with INT n (replacing mov, esp, 1) instruction resulted in bochs restarting.

00316416108e[CPU0  ] interrupt(): vector must be within IDT table limits, IDT.limit = 0x0
00316416108e[CPU0  ] interrupt(): vector must be within IDT table limits, IDT.limit = 0x0
00316416108e[CPU0  ] interrupt(): vector must be within IDT table limits, IDT.limit = 0x0
00316416108i[CPU0  ] CPU is in protected mode (active)
00316416108i[CPU0  ] CS.mode = 32 bit
00316416108i[CPU0  ] SS.mode = 32 bit
00316416108i[CPU0  ] EFER   = 0x00001000
00316416108i[CPU0  ] | EAX=00000000  EBX=00009400  ECX=c0000080  EDX=55aa55aa
00316416108i[CPU0  ] | ESP=00004000  EBP=00000000  ESI=0000517a  EDI=0000a000
00316416108i[CPU0  ] | IOPL=0 id vip vif ac vm RF nt of df if tf sf ZF af PF cf
00316416108i[CPU0  ] | SEG sltr(index|ti|rpl)     base    limit G D
00316416108i[CPU0  ] |  CS:0008( 0001| 0|  0) 00000000 ffffffff 1 1
00316416108i[CPU0  ] |  DS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
00316416108i[CPU0  ] |  SS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
00316416108i[CPU0  ] |  ES:0010( 0002| 0|  0) 00000000 ffffffff 1 1
00316416108i[CPU0  ] |  FS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
00316416108i[CPU0  ] |  GS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
00316416108i[CPU0  ] | EIP=00000654 (00000654)
00316416108i[CPU0  ] | CR0=0x00000031 CR2=0x00000000
00316416108i[CPU0  ] | CR3=0x00000000 CR4=0x00000000
00316416108i[CPU0  ] 0x0000000000000654>> int 0x00 : CD00
00316416108e[CPU0  ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting

Restore State failure

When I try to save and then restore state of machine, I encounter several problems:

  1. Same as #95.
  2. ata0-0: could not open hard drive image file 'hd10meg.img'
  3. cannot find param 'blk64'!

I tested dlxlinux4.tar.gz: started machine, clicked Suspend, selected directory, selected No, restarted Bochs, clicked Restore State and selected the same directory.

Version: 221cac7

Crash on power off when 2 CDs are present

Found with the help of MSVC debug library.

When two CDs are present, this line gets executed twice:

If I understand correctly, in Windows fd value is faked and that's why descriptor 1 gets closed twice, leading to error.

This change allows to get rid of this error for me, but I'm not sure if it is correct.

diff --git a/bochs/iodev/hdimage/cdrom_win32.cc b/bochs/iodev/hdimage/cdrom_win32.cc
index 765b96ee7..8d4db03e9 100644
--- a/bochs/iodev/hdimage/cdrom_win32.cc
+++ b/bochs/iodev/hdimage/cdrom_win32.cc
@@ -147,6 +147,7 @@ cdrom_win32_c::~cdrom_win32_c(void)
   if (fd >= 0) {
     if (hFile != INVALID_HANDLE_VALUE)
       CloseHandle(hFile);
+    fd = -1;
   }
 }

Version: a9a15d3.


By the way, I know about one more problem with CDs.
For some reason, image files are never closed for me, so I can't eject CD, modify image and insert it again.
If this short mention is not enough, I will probably make separate bug report about it in the future.

When emm386 is loaded, log is flooded with "gate descriptor is not valid" messages

Not sure if it is bug or not, but definitely a problem.
When I boot DOS 6.22 with emm386.exe specified in config.sys, Bochs starts lagging and flooding logs with messages like

01104191449e[CPU0  ] interrupt(): gate descriptor is not valid sys seg (vector=0x1a)
01104191721e[CPU0  ] interrupt(): gate descriptor is not valid sys seg (vector=0x16)
01104191904e[CPU0  ] interrupt(): gate descriptor is not valid sys seg (vector=0x16)
01104192051e[CPU0  ] interrupt(): gate descriptor is not valid sys seg (vector=0x1a)
01104192241e[CPU0  ] interrupt(): gate descriptor is not valid sys seg (vector=0x16)
01104192433e[CPU0  ] interrupt(): gate descriptor is not valid sys seg (vector=0x28)

IPS drops from 75M to 0.09M (when logging to console, -) or 16M (when logging to nul).

Files needed to reproduce this problem are in archive dos_emm.zip.

Version: f455fa8.

0xc0000417 crash while exiting with uhci enabled

Version: 2.7
Host OS: Windows 7 SP1 x64

To reproduce problem, start following config file:

plugin_ctrl: usb_uhci=true
usb_uhci: enabled=1, port1=mouse, options1=none, port2=keyboard, options2=none

Then select "Kill simulation" when "No bootable device" error appears.
Result:
image


Also I noticed another crash, not sure if it is related (probably not), but will show it anyway (I don't know how to reproduce it):
image

magic breakpoints problem on XP ntldr

ntldr.zip

On Windows XP SP3:

Enable magic-break-points with bochs debugger

It breaks every time, you cant continue (a lot of magic breakpoints):

(0) Magic breakpoint
(0) Magic breakpoint
(0) Magic breakpoint
(0) Magic breakpoint
(0) Magic breakpoint
(0) Magic breakpoint
bochsdbg.exe
========================================================================
                        Bochs x86 Emulator 2.7
              Built from SVN snapshot on August  1, 2021
                Timestamp: Sun Aug  1 10:07:00 CEST 2021
========================================================================
00000000000i[      ] reading configuration from .bochsrc
00000000000e[      ] .bochsrc:782: ataX-master/slave CHS set to 0/0/0 - autodetection enabled
00000000000e[      ] .bochsrc:783: ataX-master/slave CHS set to 0/0/0 - autodetection enabled
00000000000i[      ] Stopping on magic break points
00000000000i[      ] installing win32 module as the Bochs GUI
00000000000i[      ] using log file bochsout.txt
Next at t=0
(0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b          ; ea5be000f0
<bochs:1> c
(0) Magic breakpoint
Next at t=4287923
(0) [0x000000020264] 2000:0000000000000264 (unk. ctxt): jmp .+1  (0x00020267)     ; eb01
<bochs:2> c
(0) Magic breakpoint
Next at t=4570603
(0) [0x000000020257] 2000:0000000000000257 (unk. ctxt): nop                       ; 90
<bochs:3> c
(0) Magic breakpoint
Next at t=4571118
(0) [0x000000020257] 2000:0000000000000257 (unk. ctxt): nop                       ; 90
<bochs:4> c
(0) Magic breakpoint
Next at t=4571699
(0) [0x000000020257] 2000:0000000000000257 (unk. ctxt): nop                       ; 90
<bochs:5> c
(0) Magic breakpoint
Next at t=4572761
(0) [0x000000020257] 2000:0000000000000257 (unk. ctxt): nop                       ; 90
<bochs:6> c
(0) Magic breakpoint
Next at t=4573864
(0) [0x000000020257] 2000:0000000000000257 (unk. ctxt): nop                       ; 90
<bochs:7> c
(0) Magic breakpoint
Next at t=4575039
(0) [0x000000020257] 2000:0000000000000257 (unk. ctxt): nop                       ; 90
<bochs:8>

Can't change CD while simulation is running

Once operating system is loaded, it is not possible anymore to change CD.
Log message tells than new image is loaded, but OS still sees previous data in CD drive.
Here is test image with DOS: CD.zip, but I also noticed the same behaviour with Windows XP.

bochs_cd.mp4

Version: e896e71 (or very close to it, do not remember exactly)

Bochs hangs on Ubuntu 22.04.3 running on VirtualBox

Hello, just to put some context to it, i'm trying to start up an OS on my own, i'm following a couple of guides like The little book about OS development and Roll your own toy UNIX-clone OS along with a couple of other resources, i have everything set up up to the point of having a basic bootable piece of code but the problem is that when i try to run bochs it opens up and hangs indefinitely with no message, the weird thing is that if don't touch anything it stays there, but when try to move the window it shows an error like the one in the screenshot:
Screenshot 2023-08-21 at 23 20 42
here is the repo where i have everything uploaded, maybe somebody is able to reproduce the error (i really hope is something that i'm doing wrong)
Note: i'm running bochs under Ubuntu 22.04.3 that's running in a Virtual Machine (VirtualBox) with 4GB RAM, 2 Processors, 25GB Disk.
Thanks in advance to anyone that takes some time to take a look at this

Noise in Abuse

Steps to reproduce:

  1. Load abuse.zip;
  2. Start setup.exe;
  3. Select "Test Digital";
  4. Select "Test Digital" again.

Here is video recording. Should be played with sound enabled.

bochs_abuse_noise.mp4

Version: a9d07b5.

Emulation does not work correctly in some 3dfx supported games.

lBochs PC Emulator20230902134350
As shown in the FIFA2000 screenshot above, emulation does not work properly in some 3dfx supported games.
For example, in FIFA 2000, the screen is blacked out, but if you move the cursor, the original screen is displayed along the cursor. Also, in Tomb Raider 1, in-game textures do not display and menu text is displayed incorrectly to the point of being unreadable.

USB mouse and keyboard does not work with Windows 2000 guest

Mouse cursor is not moving and console window is flooded with messages
[USBHID] DATA IN EP1: Packet Toggle indicator doesn't match Device Toggle indicator. 0 != 1
It was working fine in release version (2.7).

I can provide additional information if needed.
(And also now I can make binaries myself [with MSYS2])

Ping @fysnet.

Versions: 571a961, 2a4dd19 (same effect)

CommDlgExtendedError: invalid filename

When I try to select different VGA BIOS image (click on "Browse..." button), error appears:
image

Most likely, it happens because of incorrect slash / used in path:

sprintf(name, "%s/VGABIOS-lgpl-latest", get_builtin_variable("BXSHARE"));

My OS is Windows 7 SP1 x64

Stack overflow with --enable-all-optimizations

I decided to check how fast Bochs will work with --enable-all-optimizations option.
I made tests previously without it.

But what I found is that very often it just crashes:
bochs_opt_crash
This is stack overflow exception.

In this case, it happened with TinyCore-current.iso.

This is how my options looks like now:
./configure --enable-static --enable-all-optimizations --enable-x86-64 --enable-vmx=2 --enable-avx --enable-clgd54xx --enable-voodoo --enable-ne2000 --enable-e1000 --enable-sb16 --enable-es1370 --enable-usb --enable-usb-ohci --enable-usb-ehci --enable-usb-xhci --enable-busmouse
(--enable-static is my hack)

I use clang version 15.0.7 compiler with MSYS2.
Bochs version: 2928315

Restore Configuration interface on Restore

The current source does not restore the Configuration Interface on a restore.

The bx_real_sim_c::restore_config() reads in the saved bochrc file, parsing the "config_interface:" line.

Then in config.cc,

if (!SIM->get_param_enum(BXPN_SEL_CONFIG_INTERFACE)->set_by_name(params[1]))
      PARSE_ERR(("%s: config_interface '%s' not available", context, params[1]));

Tries to set the configuration interface.

However, since the get_param_enum(BXPN_SEL_CONFIG_INTERFACE) is not enabled, it doesn't set it to the found interface.

get_param_enum(BXPN_SEL_CONFIG_INTERFACE)->get_enabled() returns 0.

paramtree.cc:

void bx_param_num_c::set(Bit64s newval)
    {
      if (!enabled) return;

returns instead of setting the restored interface.

Therefore, the restore reverts to the textconfig interface instead of the found interface ("win32config" in my case).

The (BXPN_SEL_CONFIG_INTERFACE) gets disabled in main.cc, line 334 before we read in the bochrc file (when restoring a sim),
and after reading the bochrc file when starting a new sim.

build failures for v2.7 under Leopard/PPC Macports

These seem generic enough to warrant an upstream issue.

First, there's a c++11 style const member initializer at cpu/icache.h:31. Compiling on Leopard/PPC fails with the error "ISO C++ forbids initialization of member ‘PHY_MEM_PAGES’". Patch follows.

--- cpu/icache.h.orig   2023-07-27 10:22:33.000000000 -0700
+++ cpu/icache.h        2023-07-27 10:25:55.000000000 -0700
@@ -28,11 +28,11 @@

 class bxPageWriteStampTable
 {
-  const Bit32u PHY_MEM_PAGES = 1024*1024;
+  const Bit32u PHY_MEM_PAGES;
   Bit32u *fineGranularityMapping;

 public:
-  bxPageWriteStampTable() {
+  bxPageWriteStampTable() : PHY_MEM_PAGES(1024*1024) {
     fineGranularityMapping = new Bit32u[PHY_MEM_PAGES];
     resetWriteStamps();
   }

Second, there's an #if directive at iodev/display/voodoo_func.h:1630 that causes compilation to fail with "#if with no expression". Should this instead be #ifdefine?

SDL_OpenAudio() failed

After booting Windows 95, Skyroads was executed using MS-DOS mode, but Bochs terminated with SDL_OpenAudio() Failed displayed.

Does not build with `.conf.win64-vcpp` and Visual Studio

The steps to build x64 Bochs executable on Windows is running the those commands

$ sh .conf.win64-vcpp
$ make win32_snap

followed by opening vs2019\bochs.sln on VS and building the solution.

This does not work with this error, due to _M_X64 not being defined.

config.h(94,1): fatal error C1189: #error:  Bochs not configured for MSVC WIN32

The issue is that the VS projects are not configured for AMD64.

A quick fix is to add an x64 build configuration, based on x86 build configuration on VS GUI.
image
x64_config.patch.txt
I confirmed this let us build x64 bochs.exe, and it worked fine.

The diff is mess, as it duplicating the settings. We might want to delete all Condition= attribute and unity the settings.

If we are okay to PR as the patch does (duplicating settings), I could do fairly soon (then we could clean up projects as a separate PR as I find time).

Build failure without --enable-evex

When I build Bochs without --enable-evex, errors appear.
Such configuration worked correctly several days ago.

g++ -c -I.. -I./.. -I../instrument/stubs -I./../instrument/stubs -DWIN32 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -O3 -Wall -Wno-format -mno-ms-bitfields -DWIN32 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES  load.cc -o load.o
g++ -c  -DWIN32 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -I.. -I./.. -I../iodev -I./../iodev -I../instrument/stubs -I./../instrument/stubs -O3 -Wall -Wno-format -mno-ms-bitfields -DWIN32 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES    win32.cc -o win32.o
g++ -c -I.. -I./.. -I../instrument/stubs -I./../instrument/stubs -DWIN32 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -O3 -Wall -Wno-format -mno-ms-bitfields -DWIN32 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES  data_xfer8.cc -o data_xfer8.o
load.cc:206:23: error: no member named 'opmask' in 'bxInstruction_c'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_32BIT_OPMASK(i->opmask()) : 0xffffffff;
                   ~  ^
load.cc:206:40: error: no member named 'opmask' in 'BX_CPU_C'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_32BIT_OPMASK(i->opmask()) : 0xffffffff;
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./cpu.h:214:54: note: expanded from macro 'BX_READ_32BIT_OPMASK'
#define BX_READ_32BIT_OPMASK(index) (BX_CPU_THIS_PTR opmask[index].dword.erx)
                                     ~~~~~~~~~~~~~~~ ^
load.cc:206:64: error: no member named 'opmask' in 'bxInstruction_c'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_32BIT_OPMASK(i->opmask()) : 0xffffffff;
                                                            ~  ^
./cpu.h:214:61: note: expanded from macro 'BX_READ_32BIT_OPMASK'
#define BX_READ_32BIT_OPMASK(index) (BX_CPU_THIS_PTR opmask[index].dword.erx)
                                                            ^~~~~
load.cc:223:23: error: no member named 'opmask' in 'bxInstruction_c'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_16BIT_OPMASK(i->opmask()) : 0xffff;
                   ~  ^
load.cc:223:40: error: no member named 'opmask' in 'BX_CPU_C'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_16BIT_OPMASK(i->opmask()) : 0xffff;
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./cpu.h:213:54: note: expanded from macro 'BX_READ_16BIT_OPMASK'
#define BX_READ_16BIT_OPMASK(index) (BX_CPU_THIS_PTR opmask[index].word.rx)
                                     ~~~~~~~~~~~~~~~ ^
load.cc:223:64: error: no member named 'opmask' in 'bxInstruction_c'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_16BIT_OPMASK(i->opmask()) : 0xffff;
                                                            ~  ^
./cpu.h:213:61: note: expanded from macro 'BX_READ_16BIT_OPMASK'
#define BX_READ_16BIT_OPMASK(index) (BX_CPU_THIS_PTR opmask[index].word.rx)
                                                            ^~~~~
load.cc:240:23: error: no member named 'opmask' in 'bxInstruction_c'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_8BIT_OPMASK(i->opmask()) : 0xff;
                   ~  ^
load.cc:240:40: error: no member named 'opmask' in 'BX_CPU_C'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_8BIT_OPMASK(i->opmask()) : 0xff;
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./cpu.h:212:54: note: expanded from macro 'BX_READ_8BIT_OPMASK'
#define BX_READ_8BIT_OPMASK(index)  (BX_CPU_THIS_PTR opmask[index].word.byte.rl)
                                     ~~~~~~~~~~~~~~~ ^
load.cc:240:63: error: no member named 'opmask' in 'bxInstruction_c'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_8BIT_OPMASK(i->opmask()) : 0xff;
                                                           ~  ^
./cpu.h:212:61: note: expanded from macro 'BX_READ_8BIT_OPMASK'
#define BX_READ_8BIT_OPMASK(index)  (BX_CPU_THIS_PTR opmask[index].word.byte.rl)
                                                            ^~~~~
load.cc:282:23: error: no member named 'opmask' in 'bxInstruction_c'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_16BIT_OPMASK(i->opmask()) : 0xffff;
                   ~  ^
load.cc:282:40: error: no member named 'opmask' in 'BX_CPU_C'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_16BIT_OPMASK(i->opmask()) : 0xffff;
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./cpu.h:213:54: note: expanded from macro 'BX_READ_16BIT_OPMASK'
#define BX_READ_16BIT_OPMASK(index) (BX_CPU_THIS_PTR opmask[index].word.rx)
                                     ~~~~~~~~~~~~~~~ ^
load.cc:282:64: error: no member named 'opmask' in 'bxInstruction_c'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_16BIT_OPMASK(i->opmask()) : 0xffff;
                                                            ~  ^
./cpu.h:213:61: note: expanded from macro 'BX_READ_16BIT_OPMASK'
#define BX_READ_16BIT_OPMASK(index) (BX_CPU_THIS_PTR opmask[index].word.rx)
                                                            ^~~~~
load.cc:299:23: error: no member named 'opmask' in 'bxInstruction_c'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_8BIT_OPMASK(i->opmask()) : 0xff;
                   ~  ^
load.cc:299:40: error: no member named 'opmask' in 'BX_CPU_C'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_8BIT_OPMASK(i->opmask()) : 0xff;
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./cpu.h:212:54: note: expanded from macro 'BX_READ_8BIT_OPMASK'
#define BX_READ_8BIT_OPMASK(index)  (BX_CPU_THIS_PTR opmask[index].word.byte.rl)
                                     ~~~~~~~~~~~~~~~ ^
load.cc:299:63: error: no member named 'opmask' in 'bxInstruction_c'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_8BIT_OPMASK(i->opmask()) : 0xff;
                                                           ~  ^
./cpu.h:212:61: note: expanded from macro 'BX_READ_8BIT_OPMASK'
#define BX_READ_8BIT_OPMASK(index)  (BX_CPU_THIS_PTR opmask[index].word.byte.rl)
                                                            ^~~~~
load.cc:342:23: error: no member named 'opmask' in 'bxInstruction_c'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_8BIT_OPMASK(i->opmask()) : 0xff;
                   ~  ^
load.cc:342:40: error: no member named 'opmask' in 'BX_CPU_C'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_8BIT_OPMASK(i->opmask()) : 0xff;
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./cpu.h:212:54: note: expanded from macro 'BX_READ_8BIT_OPMASK'
#define BX_READ_8BIT_OPMASK(index)  (BX_CPU_THIS_PTR opmask[index].word.byte.rl)
                                     ~~~~~~~~~~~~~~~ ^
load.cc:342:63: error: no member named 'opmask' in 'bxInstruction_c'
  Bit32u opmask = (i->opmask() != 0) ? BX_READ_8BIT_OPMASK(i->opmask()) : 0xff;
                                                           ~  ^
./cpu.h:212:61: note: expanded from macro 'BX_READ_8BIT_OPMASK'
#define BX_READ_8BIT_OPMASK(index)  (BX_CPU_THIS_PTR opmask[index].word.byte.rl)
                                                            ^~~~~
18 errors generated.
make[1]: *** [Makefile:152: load.o] Error 1

Version: f455fa8.

Lack of header files on iSH

imageimageimageimageimageimageimageimageimage

The environment of iSH lacks many header files, and as I downloaded them from the Linux kernel on GitHub, it reported those errors. Is it that there are problems with the header files downloaded?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.