Jump to content

User:ENusbaum/sandbox

From Wikipedia, the free encyclopedia
The MajorBBS Emulation Project
Original author(s)Eric P. Nusbaum
Developer(s)MBBSEmu Contributors[1]
Initial releaseJanuary 2, 2020; 5 years ago (2020-01-02)
Stable release
v1.0-alpha-022121 / February 21, 2021; 4 years ago (2021-02-21)
Repositorygithub.com/mbbsemu/MBBSEmu
Written inC#
Operating systemWindows, macOS, Linux
Platform.NET Core
Available inEnglish
TypeEmulator, Bulletin Board System, Open Source Software
LicenseMIT[2]
Websitewwww.mbbsemu.com

The MajorBBS Emulation Project (MBBSEmu) is an open source, cross-platform Emulator for modules original compiled for The Major BBS and Worldgroup by Galacticomm. MBBSEmu provides both an internal x86 Emulator and a compatibility layer which translates MajorBBS systems calls into internally emulated routines.

Development

[edit]

MBBSEmu started initial development in November 2019 as an expansion of the functionality provided by MBBSDASM[3], a general purpose NE .DLL disassembler with custom support for Major BBS and Worldgroup specific system calls. During initial development of the expanded disassembler, it became apparent that if a system could be put in place similar to DOSBox where an emulated CPU is provided as well as a process for translating and emulating system calls, then a fully featured emulator could be created that could execute Major BBS modules without the need of the host software.

On December 7th, 2019 first public announcement of the project as well as the first publicly released prototype was posted to Reddit[4].

The initial public Alpha release was announced and published on January 2nd, 2020 to Reddit[5]. Development continued throughout 2020 with the support of a Patreon project, which was setup to allow the community to financially support continued development of The MajorBBS Emulation Project. Throughout development, several former Galacticomm ISV's made contributions of resources and source code to the project in order to assist with development of MBBSEmu[6].

On August 11th, 2020 it was announced on Reddit[7] that MBBSEmu was now released as an Open Source project on GitHub under the terms of the MIT License. With the transition to a community managed Open Source project, the Patreon was closed with the Patreon news updates being saved to the MBBSEmu Wiki[8].

Features

[edit]

MBBSEmu is a command-line program, configured either by a set of command line arguments[9] or by editing a JSON configuration file[10].

The MajorBBS Emulation Project aims to be fully compatible with all Major BBS and Worldgroup Modules which are compatible with The Major BBS 6.25 (and earlier) or Worldgroup 2.0 (and earlier). MBBSEmu tries to replicate the experience of using The Major BBS as accurately as possible.

MBBSEmu offers users several methods of running Modules, some of which are exclusive to MBBSEmu:

  • Telnet - Multiple Users are able to connect and play together on a configured port via Telnet
  • rlogin - Users from other Bulletin Board Systems are able to login to MBBSEmu or directly enter a module via Rlogin
  • Console - Local, single player functionality emulating all ANSI and Telnet graphics directly from the command line

Hardware Emulation

[edit]

MBBSEmu is a full x86 system emulator that provides BIOS interrupts and also contains an emulated DOS API. When a Module compiled for The Major BBS or Worldgroup is opened, several things happen to prepare the Module for execution within an Emulated environment:

  1. The Module DLL header is parsed and loaded
  2. A full, dedicated, addressable 16-bit Memory Space is allocated for the Module
  3. CODE & DATA Segments are loaded from the DLL file into Memory
  4. Relocation Records are read from the DLL relocation table and patched into the CODE & DATA Segments
  5. References in the Imported Name Table are redirected to reference the internal Compatibility Layer
  6. Initial Entry Point is identified

Code is executed by identifying a DLL entry point and executing the disassembled x86 Assembly starting at the specified address through the emulated x86 Processor. The Module code is executed exactly as it was compiled, with no modification to the logic or execution path at runtime within MBBSEmu.

MajorBBS / Worldgroup Emulation

[edit]

Modules are compiled and linked using the Galacticomm SDK as DLLs. Inside these DLLs are references in the Imported Name Table for functions available at runtime through the hosted environment. References to these functions are saved in the Relocation Records and are patched at runtime by MBBSEmu.

The x86 Assembler CALL FAR Opcodes that reference these Imported Functions are remapped to custom memory addresses which inform the emulator that it is accessing an emulated call. When executed, these functions turn control over to the Emulator for execution of the emulated Imported Function before passing control back to the emulated x86 Processor for continued execution.

While the Galacticomm SDK lists over 1,300 Functions available for Import[11], only a minority of these Functions are used by Modules.

Btrieve Emulation

[edit]

MBBSEmu supports full emulation of the Novell Btrieve API exposed by the Galacticomm SDK as well as the Btrieve .DAT files used by The Major BBS and Worldgroup.

Emulation for Btrieve was implemented by first Reverse Engineering the Btrieve File Format[12] which allowed the data contained within Btrieve .DAT files to be read without the requirement of the Btrieve Driver to be loaded. With access to the data, MBBSEmu then converts all data contained within the Btrieve files into a new SQLite Format, utilizing the database capabilities of SQLite to emulate Btrieve's capabilities.[13].

Cross Platform

[edit]

Cross Platform functionality is provided through .NET Core, which allows MBBSEmu to execute on x86-32, x86-64, and ARM based platforms.

Modules written for The Major BBS and Worldgroup were only ever intended to be run within a DOS environment. This means strings that contain File Paths and Names are all assuming the host software is running on a DOS compatible system. Because of this, MBBSEmu has a built in compatibility layer to handle File operations across multiple platforms which requires no modifications to the original Modules.

Modernized Scheduler

[edit]

The Major BBS and Worldgroup were initially able to support up to 255 lines simultaneously. The method in which Galacticomm accomplished this was to use an event loop which continually ran, polling ports for information as fast as the host CPU was able to. While a novel, albeit highly inefficient, solution at the time, this results now in a single core of a host CPU being spiked at 100% utilization as the event polling is essentially an Infinite loop[14]. This design persists in the latest version of Worldgroup 3.3.

MBBSEmu has overcome this issue by not only implementing a multi-threaded socket model but also an event based scheduler. The event based scheduler runs at set intervals or whenever a Module, or User Action would trigger an event within the system. This results in MBBSEmu being able to host modules with very little CPU utilization on modern hardware[15].

See also

[edit]

References

[edit]
  1. ^ "MBBSEmu Contributors". www.github.com.
  2. ^ "LICENSE". GitHub - MBBSEmu.
  3. ^ "GitHub - MBBSDASM". GitHub - MBBSDASM.
  4. ^ "So -- I'm working on a MajorBBS/Worldgroup Emulator and would love some feedback". reddit.com - /r/bbs/.
  5. ^ "MajorBBS/Worldgroup Emulator - Progress & Early, early Alpha Build". reddit.com - /r/bbs/.
  6. ^ "The MajorBBS Emulation Project - Public Alpha 6". reddit.com - /r/bbs/.
  7. ^ "The MajorBBS Emulation Project - Open Source!". reddit.com - /r/bbs/.
  8. ^ "MBBSEmu Wiki - Patreon Archive". wiki.mbbsemu.com.
  9. ^ "MBBSEmu Wiki - Command Line Arguments". wiki.mbbsemu.com.
  10. ^ "MBBSEmu Wiki - appsettings.json Config File". wiki.mbbsemu.com.
  11. ^ "GitHub - MBBSDASM - MAJORBBS API Reference". www.github.com.
  12. ^ "MBBSEmu Wiki - Btrieve File Format". wiki.mbbsemu.com.
  13. ^ "MBBSEmu Wiki - SQKute Database Specifications". wiki.mbbsemu.com.
  14. ^ "The Major BBS Forums - Mbbs 6.25 uses 95% cpu cycles in win xp". www.themajorbbs.com.
  15. ^ "MBBSEmu News - January 4th, 2021". www.mbbsemu.com.