Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bochs fails to load freshly generated configuration file #95

Closed
Vort opened this issue Oct 16, 2023 · 9 comments
Closed

Bochs fails to load freshly generated configuration file #95

Vort opened this issue Oct 16, 2023 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@Vort
Copy link
Contributor

Vort commented Oct 16, 2023

When I create config file with GUI and then open it - it fails to load:
directive 'port_e9_hack_all_rings' not understood error appears.

Problem looks easily reproducible, but if not, I will provide additional information.

Version: 221cac7

@stlintel
Copy link
Contributor

Can you attach the resulted config file and how it looks like ?

@stlintel
Copy link
Contributor

  new bx_param_bool_c(misc,
      "port_e9_hack_all_rings",
      "Enable port 0xE9 hack for all rings",
      "Debug messages written to i/o port 0xE9 from ring3 will be displayed on console",
      0);

This creates config option with name port_e9_hack_all_rings which is not parseable.
If you make port_e9_hack a list of options - it better to be parsed through list parser 'bx_parse_param_from_list'
Thus I would create port_e9 as a list, then enabled inside as 1st param and all_rings as 2nd param.

@stlintel stlintel added the bug Something isn't working label Oct 16, 2023
@Vort
Copy link
Contributor Author

Vort commented Oct 17, 2023

Can you attach the resulted config file and how it looks like ?

This is how it looks like:

# configuration file generated by Bochs
plugin_ctrl: voodoo=false, unmapped=true, biosdev=true, speaker=true, extfpuirq=true, parallel=true, serial=true, busmouse=false, e1000=false, es1370=false, gameport=true, ne2k=false, sb16=false, usb_uhci=false, usb_ohci=false, usb_ehci=false, usb_xhci=false
config_interface: win32config
display_library: win32
memory: host=256, guest=512
romimage: file="d:\Bochs-2.7/BIOS-bochs-latest", address=0x00000000, options="fastboot"
vgaromimage: file="d:\Bochs-2.7/VGABIOS-lgpl-latest"
boot: disk
floppy_bootsig_check: disabled=0
floppya: type=1_44, 1_44="/dev/fd0", status=inserted, write_protected=0
# no floppyb
ata0: enabled=true, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, path="30M.sample", mode=flat, cylinders=0, heads=16, spt=63, sect_size=512, model="Generic 1234", biosdetect=auto, translation=auto
ata0-slave: type=none
ata1: enabled=true, ioaddr1=0x170, ioaddr2=0x370, irq=15
ata1-master: type=none
ata1-slave: type=none
ata2: enabled=false
ata3: enabled=false
optromimage1: file=none
optromimage2: file=none
optromimage3: file=none
optromimage4: file=none
optramimage1: file=none
optramimage2: file=none
optramimage3: file=none
optramimage4: file=none
pci: enabled=1, chipset=i440fx, slot1=none, slot2=none, slot3=none, slot4=none, slot5=none
vga: extension=vbe, update_freq=5, realtime=1, ddc=builtin
cpu: count=1, ips=50000000, model=core2_penryn_t9600, reset_on_triple_fault=1, cpuid_limit_winnt=0, ignore_bad_msrs=1, mwait_is_nop=0, msrs="msrs.def"
print_timestamps: enabled=0
port_e9_hack: enabled=0
port_e9_hack_all_rings: enabled=0
private_colormap: enabled=0
clock: sync=none, time0=local, rtc_sync=0
# no cmosimage
log: bochsout.txt
logprefix: %t%e%d
debug: action=ignore, pci=report
info: action=report
error: action=report
panic: action=ask
keyboard: type=mf, serial_delay=250, paste_delay=100000, user_shortcut=none
mouse: type=ps2, enabled=false, toggle=ctrl+mbutton
sound: waveoutdrv=win, waveout="/dev/dsp.wavein=", waveindrv=win, wavein=none, midioutdrv=win, midiout=none
speaker: enabled=true, mode=sound, volume=15
parport1: enabled=true, file="parport.out"
parport2: enabled=false
com1: enabled=true, mode=null
com2: enabled=false
com3: enabled=false
com4: enabled=false

stlintel pushed a commit that referenced this issue Oct 17, 2023
refactoring of port_e9_hack configuration options
do not allow port e9 access for all rings if port_e9_hack is not enabled
@stlintel
Copy link
Contributor

Hi I submitted PR which fixes the issue + small refactoring.
Can you test it please ?

Thanks

stlintel pushed a commit that referenced this issue Oct 17, 2023
refactoring of port_e9_hack configuration options
do not allow port e9 access for all rings if port_e9_hack is not enabled
@Vort
Copy link
Contributor Author

Vort commented Oct 17, 2023

Can you test it please ?

With a9b5125 Bochs just crashes after config save is requested.
Maybe I did something wrong, I don't know.

@Vort
Copy link
Contributor Author

Vort commented Oct 17, 2023

More info:
Crash happens here:

if (param->get_enabled() && ((param->get_options() & param->CI_ONLY) == 0)) {

Because param is null.

bx_write_param_list is called from here:

bx_write_param_list(fp, (bx_list_c*) SIM->get_param(BXPN_PORT_E9_HACK), NULL, 0);

stlintel pushed a commit that referenced this issue Oct 17, 2023
refactoring of port_e9_hack configuration options
do not allow port e9 access for all rings if port_e9_hack is not enabled
@stlintel
Copy link
Contributor

Forgot to commit part of change

this:

bx_write_param_list(fp, (bx_list_c*) SIM->get_param(BXPN_PORT_E9_HACK), NULL, 0);

should be:

bx_write_param_list(fp, (bx_list_c*) SIM->get_param(BXPN_PORT_E9_HACK_ROOT), NULL, 0);

@stlintel
Copy link
Contributor

could you try again ?

@Vort
Copy link
Contributor Author

Vort commented Oct 18, 2023

With 727b325 configuration is correctly saved and correctly loaded. Thank you. Should this issue be closed?

stlintel added a commit that referenced this issue Oct 18, 2023
refactoring of port_e9_hack configuration options
do not allow port e9 access for all rings if port_e9_hack is not enabled

Co-authored-by: Stanislav Shwartsman <sshwarts@users.sourceforge.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants