@@ -519,7 +519,7 @@ void bx_init_options()
519519 bx_param_bool_c *enabled, *readonly;
520520 bx_param_enum_c *mode, *type, *toggle, *status;
521521 bx_param_filename_c *path;
522- char name[BX_PATHNAME_LEN], descr[512 ], label[512 ];
522+ char name[BX_PATHNAME_LEN], descr[512 ], label[512 ], bxshare[BX_PATHNAME_LEN] ;
523523
524524 bx_param_c *root_param = SIM->get_param (" ." );
525525
@@ -726,7 +726,7 @@ void bx_init_options()
726726 " host" ,
727727 " Host allocated memory size (megabytes)" ,
728728 " Amount of host allocated memory in megabytes" ,
729- 1 , 2048 ,
729+ 1 , 8192 ,
730730 BX_DEFAULT_MEM_MEGS);
731731 host_ramsize->set_ask_format (" Enter host memory size (MB): [%d] " );
732732 ram->set_options (ram->SERIES_ASK );
@@ -735,8 +735,8 @@ void bx_init_options()
735735 " block_size" ,
736736 " Memory block granularity (kilobytes)" ,
737737 " Granularity of host memory allocation" ,
738- 4 , 8192 ,
739- 128 );
738+ 0 , 8192 ,
739+ 0 );
740740 mem_block_size->set_ask_format (" Enter memory block size (KB): [%d] " );
741741 ram->set_options (ram->SERIES_ASK );
742742
@@ -746,7 +746,8 @@ void bx_init_options()
746746 " Pathname of ROM image to load" ,
747747 " " , BX_PATHNAME_LEN);
748748 path->set_format (" Name of ROM BIOS image: %s" );
749- sprintf (name, " %s" DIRECTORY_SEPARATOR " BIOS-bochs-latest" , (char *)get_builtin_variable (" BXSHARE" ));
749+ get_bxshare_path (bxshare);
750+ sprintf (name, " %s" DIRECTORY_SEPARATOR " BIOS-bochs-latest" , bxshare);
750751 path->set_initial_val (name);
751752 bx_param_num_c *romaddr = new bx_param_num_c (rom,
752753 " address" ,
@@ -775,7 +776,7 @@ void bx_init_options()
775776 " Pathname of VGA ROM image to load" ,
776777 " " , BX_PATHNAME_LEN);
777778 path->set_format (" Name of VGA BIOS image: %s" );
778- sprintf (name, " %s" DIRECTORY_SEPARATOR " VGABIOS-lgpl-latest.bin" , get_builtin_variable ( " BXSHARE " ) );
779+ sprintf (name, " %s" DIRECTORY_SEPARATOR " VGABIOS-lgpl-latest.bin" , bxshare );
779780 path->set_initial_val (name);
780781 vgarom->set_options (vgarom->SERIES_ASK );
781782
@@ -1626,6 +1627,14 @@ void bx_init_options()
16261627 " Debug messages written to i/o port 0xE9 from ring3 will be displayed on console" ,
16271628 0 );
16281629
1630+ // fw_cfg device (UEFI/OVMF support)
1631+ bx_list_c *fw_cfg = new bx_list_c (misc, " fw_cfg" , " QEMU fw_cfg device (UEFI/OVMF support)" );
1632+ new bx_param_bool_c (fw_cfg,
1633+ " enabled" ,
1634+ " Enable fw_cfg device" ,
1635+ " Enables the QEMU-compatible fw_cfg device used by UEFI/OVMF firmware" ,
1636+ 0 );
1637+
16291638#if BX_SUPPORT_IODEBUG
16301639// iodebug all rings
16311640 new bx_param_bool_c (misc,
@@ -3187,6 +3196,12 @@ static int parse_line_formatted(const char *context, int num_params, char *param
31873196 PARSE_ERR ((" %s: port_e9_hack directive malformed." , context));
31883197 }
31893198 }
3199+ } else if (!strcmp (params[0 ], " fw_cfg" )) {
3200+ for (i=1 ; i<num_params; i++) {
3201+ if (bx_parse_param_from_list (context, params[i], (bx_list_c*) SIM->get_param (BXPN_FW_CFG_ROOT)) < 0 ) {
3202+ PARSE_ERR ((" %s: fw_cfg directive malformed." , context));
3203+ }
3204+ }
31903205 } else if (!strcmp (params[0 ], " iodebug" )) {
31913206#if BX_SUPPORT_IODEBUG
31923207 if (num_params != 2 ) {
@@ -3582,6 +3597,7 @@ int bx_write_configuration(const char *rc, int overwrite)
35823597 fprintf (fp, " print_timestamps: enabled=%d\n " , bx_dbg.print_timestamps );
35833598 bx_write_debugger_options (fp);
35843599 bx_write_param_list (fp, (bx_list_c*) SIM->get_param (BXPN_PORT_E9_HACK_ROOT), NULL , 0 );
3600+ bx_write_param_list (fp, (bx_list_c*) SIM->get_param (BXPN_FW_CFG_ROOT), NULL , 0 );
35853601#if BX_SUPPORT_IODEBUG
35863602 fprintf (fp, " iodebug: all_rings=%d\n " , SIM->get_param_bool (BXPN_IODEBUG_ALL_RINGS)->get ());
35873603#endif
0 commit comments