Commit Graph

265 Commits

Author SHA1 Message Date
Volker Ruppert
f6d772982e New attempt to fix issue reported in discussion #318.
New style callbacks code now requires standard C++17.
With this setting VS2019 can compile the iodev_network module.
2024-05-13 17:41:35 +02:00
Volker Ruppert
7dcecf5e57 Attempt to fix issue reported in discussion #318.
Added code compatible with C++11.
2024-05-12 21:11:24 +02:00
Volker Ruppert
f612821c97 Enabled new polling callbacks for builtin slirp.
Big slirp update coming soon.
2024-05-12 08:29:07 +02:00
Volker Ruppert
eb477d7bb2 Some work on the builtin slirp core.
- Updated function arp_input() and related code.
- Updated get_dns_addr() functions for 3 different platforms (Apple code untested).
- Started updating IPv6 header file for C++ compatibilty (to be continued).
- Some other small updates.
2024-05-09 11:29:32 +02:00
Volker Ruppert
8a30642092 Continued updating builtin slirp code (no functional changes).
- Some variable type name changes.
- DEBUG code changes (not yet usable).
- Comment additions and tab-to-space changes.
2024-05-07 19:47:57 +02:00
Volker Ruppert
e64ec27113 Compilation fix for libslirp on mingw/msys.
Unlike the official release, the mingw* version of libslirp.h doesn't define slirp_ssize_t.
2024-05-06 17:22:47 +02:00
Volker Ruppert
5489f18ff2 Some work on builtin slirp header files.
- Get rid of slirp_config.h.
- Added ip6_icmp.h (not yet used).
- Updates in some other headers.
- Added c++ static_assert for structure size checking at compile time.
- Updated Makefile dependencies and VS2019 project files.
2024-05-05 20:00:45 +02:00
Volker Ruppert
a684734975 Next set of updates from libslirp.
- Started implementing guest forwarding feature.
- Updated most of socket.h.
- Added if_mtu / if_mru handling.
- Cleaned up MIN / MAX defines.
2024-05-05 12:27:12 +02:00
Volker Ruppert
94f6336d15 Continued updating builtin slirp from libslirp.
- Cleaned up system includes in slirp.h and removed most of the HAVE_* defines.
- Renamed exec_list to guestfwd_list and removed ex_pty member.
- Using type "char *" instead of "caddr_t".
2024-05-03 20:58:46 +02:00
Volker Ruppert
74df052eea Updated slirp polling functions from libslirp. 2024-05-02 23:30:48 +02:00
Volker Ruppert
b0f238af76 Continued updating slirp code from libslirp (no functional changes). 2024-04-29 22:38:10 +02:00
Volker Ruppert
47f9e4bc12 Builtin slirp: Continued updating from libslirp code.
Processed chksum.cc and dnssearch.cc.
Removed obsolete / unused stuff from compat.h and slirp_config.h.
2024-04-28 21:05:41 +02:00
Volker Ruppert
afba2c932e Builtin slirp: Now util.cc replaces compat.cc completely. 2024-04-28 14:22:51 +02:00
Volker Ruppert
58f44900de Builtin slirp: Removed QTAILQ* stuff and some other cleanups. 2024-04-28 10:43:00 +02:00
Volker Ruppert
c6b7961799 Some more work on builtin slirp - no functional changes yet.
Added all of the SlirpCb and SlirpConfig structures from libslirp.
2024-04-26 22:40:12 +02:00
Volker Ruppert
c5fd56558f Builtin slirp: compilation fixes for VS2019 and Cygwin.
- VS2019 needs C++20 standard to be set.
- Some Cygwin related additions in util.cc.
- slirp_ssize_t definition and usage fixed.
- changed include position of compat.h in slirp.h.
2024-04-25 21:10:48 +02:00
Volker Ruppert
8c81464156 Updated builtin slirp TFTP support from libslirp code.
Added most of ip6.h, util.c and util.h files (except glib stuff).
Related changes in several files.
2024-04-24 22:55:03 +02:00
Volker Ruppert
7e3edfe7d9 Continued updating builtin slirp from libslirp code.
- Updated arp_table.cc (except debug code).
- Updated bootp.cc (Bochs extensions still present).
- Related changes in other files.
2024-04-21 20:35:27 +02:00
Volker Ruppert
aa529a42f6 Fixed slirp compilation issues related to inet_aton(). 2024-04-21 13:13:36 +02:00
Volker Ruppert
f1259413fb Continued work on builtin slirp networking support.
- Modified info / error log message handling.
- Renamed insque / remque functions using "slirp_" prefix.
- Removed useless SVN ID from most file headers and add license specifier instead.
2024-04-21 11:27:51 +02:00
Volker Ruppert
fa5c5ebe88 Started updating builtin slirp from libslirp code (callback support).
Added callbacks send_packet() and clock_get_ns().
2024-04-19 22:18:29 +02:00
Volker Ruppert
a290ce33e0 Builtin slirp now also returns "local" as the domain name.
Some other cleanups in bootp_reply().
2024-04-18 18:08:00 +02:00
Volker Ruppert
4c7e3d6f2f Fixed size of TFTP option reply. 2024-04-16 20:23:32 +02:00
Volker Ruppert
0f6287b592 Applied suggested fix for slirp TFTP support to fix issue #305. 2024-04-16 17:54:59 +02:00
Volker Ruppert
5376f129ee Some work on the slirp networking code.
- Added support for optional TFTP server name in builtin slirp and libslirp.
- Added default domain name for libslirp.
2024-04-14 11:04:01 +02:00
Volker Ruppert
55d7488be6 Some work for libslirp networking support on Windows.
Added inet_aton() function (missing on Windows) from builtin slirp code.
TODO: update builtin slirp code based on libslirp 4.70 code.
2024-04-14 01:01:20 +02:00
Volker Ruppert
155fc74d30 Some work on the libslirp networking support.
- Added capability to turn on IPv6 support with slirp.conf option (using default
  QEMU settings for now / non-Windows platforms only).
- Added some basic timer code required by IPv6 based on example code.
2024-04-13 10:18:38 +02:00
Volker Ruppert
0ff2905998 Added support for using external slirp library instead of builtin one.
- Added configure option --enable-using-libslirp to turn on the search for the
  library. In config.h BX_HAVE_LIBSLIRP is set to 1 if found. The network Makefile
  is set up accordingly. If not enabled or not found, the builtin slirp code is used.
- Moved samba server code and host forwarding code to eth_slirp.cc.
- Modified builtin slirp API to reduce differences.
- NOTE: IPv6 support present in libslirp is not yet enabled (needs more testing).
- TODO: Update builtin slirp code based on libslirp 4.7.0 code.
2024-04-07 19:57:25 +02:00
Biswapriyo Nath
e1d67d9ce0
Fix checking Android platform with __ANDROID__ macro (#299)
This change fixes compiler errors in Android as following.
    
../../../iodev/sound/soundoss.cc:43:10: fatal error: 'sys/soundcard.h'
file not found
       43 | #include <sys/soundcard.h>
          |          ^~~~~~~~~~~~~~~~~
../../../iodev/network/slirp/misc.cc:195:12: error: use of undeclared
identifier 'getdtablesize'; did you mean 'getpagesize'?
      195 |                 for (s = getdtablesize() - 1; s >= 3; s--)
          |                          ^~~~~~~~~~~~~
          |                          getpagesize
/data/data/com.termux/files/usr/include/unistd.h:356:5: note:
'getpagesize' declared here
      356 | int getpagesize(void) __INTRODUCED_IN(21);
          |     ^
    
The official documentation also suggests to use __ANDROID__ macro which
is defined by the compiler irrespective of included headers and build
system.
https://android.googlesource.com/platform/bionic/+/HEAD/docs/defines.md
2024-04-06 23:18:01 +02:00
Volker Ruppert
d4d1fff83b NE2000: Don't check PCI slot config in parser, but then in init code.
TODO (for other devices):
The parser code should not expect that a specific config parameter is
already set. Only the device init code should bring all things together.
2024-01-28 17:50:14 +01:00
Volker Ruppert
7641d13614 E1000: Added support for i/o mapped register access to make DOS driver work. 2023-12-11 21:21:34 +01:00
Volker Ruppert
68ff4be0b8 Fixed a memory leak in the slirp code. 2023-11-24 22:35:43 +01:00
Volker Ruppert
eec7a55c46 Fixed another gcc 13.2 warning (overloaded virtual). 2023-11-16 19:47:59 +01:00
Volker Ruppert
83c71dd7a2 Renaming method fixes gcc 11 warning (overloaded virtual). 2023-11-05 11:01:41 +01:00
Volker Ruppert
5ebe6b46d0 Removed useless BX_DEBUG messages in devices init 2022-08-29 18:14:59 +02:00
Stanislav Shwartsman
1e4f1624c8 remove trailing whitespace from source files 2022-08-23 21:46:04 +03:00
Volker Ruppert
52b0000db7 Applied two patches from Debian.
- Apply standard flags from environment everywhere (SF patch #546).
- Allow overriding ld and objcopy for building bios on non-x86 platforms.
2021-09-10 15:33:22 +00:00
Volker Ruppert
a1058990ba Trailing '../\' breaks compilation with MSVC nmake. Regenerated dependencies. 2021-07-27 18:13:26 +00:00
Stanislav Shwartsman
021f3794fa remove cpudb.h from some Makefile dependencies. TODO: it should be only in cpu/init.cc and config.cc 2021-07-25 18:08:54 +00:00
Volker Ruppert
e34d017f60 Some fixes for compiling for WIN64 with MSVC.
- Added check in config.h whether or not Bochs is configured and compiled for
  the same target platform (WIN32 / WIN64).
- Fixed some warnings that occur in the MSVC WIN64 case.
2021-07-12 19:05:25 +00:00
Volker Ruppert
821b42f309 Fixed some MSVC warnings when compiling for WIN64. 2021-06-20 07:30:29 +00:00
Volker Ruppert
e1265b7536 Fixed special rule for the backward compatible device type selection of card #0.
If at least one ne2k device is assigned to a PCI slot, card #0 defaults to PCI
type, unless type is set up in ne2k line.
2021-06-17 21:04:35 +00:00
Volker Ruppert
25e725a23c Makefile dependency updates
- Don't include paramtree.h in siminterface.h to get rid of duplicates
  in a lot of Makefile dependency lines.
- Regenerated Makefile dependencies in iodev and affected subdirectories.
- FIXME #1: including debug.h causes duplicate entries of config.h and osdep.h.
- FIXME #2: cpudb.h appears in most of the iodev* dependencies, but only needed
  by config.cc and the cpu class.
2021-03-13 09:54:06 +00:00
Volker Ruppert
90ac89ea22 After changing network device object pointer to class logfunctions the
networking modules don't need to include iodev.h.
2021-03-12 21:31:51 +00:00
Volker Ruppert
27c120154b Fixed a GCC warning and some MSVC warnings. 2021-02-27 20:53:10 +00:00
Volker Ruppert
4dd5816108 Some changes in the Bochs plugins code.
- Changed variable type of the plugin_t "type" member from enum to Bit16u.
- Added support for returning device flags with the new mode PLUGIN_FLAGS in
  the plugin entry functions. It is currently only used for devices that can
  be connected to a PCI slot.
- Code cleanup in core device plugins: checking type no longer necessary.
- The "non-plugin" mode now also uses the "loadtype" member of plugin_t.

TODO: Change PCI slot options to bx_param_enum_c and build the choices list
using the new capabilities of the plugin API.
2021-02-26 20:37:49 +00:00
Volker Ruppert
07f32da5a7 Some plugin related fixes.
- Fixed loading of all plugins with one type using wildcard.
- Reduced maximum length of line when listing available modules for hdimage,
  network and sound.
2021-02-14 06:25:01 +00:00
Volker Ruppert
744efe9c22 The hdimage, networking and sound code now also use PLUG_get_plugins_counrt()
and PLUG_get_plugin_name() in case plugin support is disabled. Removed
temporary compatibility code from the self-registering stuff.
2021-02-10 07:29:14 +00:00
Volker Ruppert
0d425037df Improved plugin type detection at Bochs startup.
- Added special mode to all plugin entry functions that returns the plugin type.
- The plugins search function now temporarily loads all available plugins and
  reads the plugin type using the new mode PLUGIN_PROBE.
- Added "loadtype" to the plugin structure to store the type used for plugin
  loading (currently only the voodoo plugin provides two types).
2021-02-07 16:16:06 +00:00
Volker Ruppert
cdc505dfce Fixed MSVC warnings in the devices code after bx_bool to bool changes. 2021-02-06 19:56:57 +00:00