On Mon, Dec 25, 2000 at 10:13:08PM -0500, Eric Laberge wrote:
[cut query idea, then relized later I needed to comment on it]
I like your idea, but relized later what it was lacking:
We need a function to get a plugin by name: 
plugin_t *get_plugin_by_name(char *name), like
fdc = get_plugin_by_name(config.fdcname);
We need another function to get a plugin by flags:
plugin_t *get_plugin_by_flags(long flags, plugin_t *after)
(the after is there so you can enumerate all.  Use NULL to get the first.),
like:
drive = NULL;
while (drive = get_plugin_by_flags(PLUGIN_IS_FLOPPY, drive)
   do somthing;

Then we need functions to do things with the plugin_t*.

> I also suggest the Bochs plugin to be separated into many, as I think it is 
> way too monolithic to easily add, test or update single components, like 
> the GUI or the CD-ROM, or to use many instances of a single plugin, like 
> two floppies. By design, Plex86 should keep modules the more independent 
> possible.
Ay, indeed.  I was going under the assumption that this was a "havn't gotten
there yet" sort of thing.  The bochs "plugin" was wholesale coppied and
minimaly changed from Bochs, and it shows that bochs wasn't (please correct
me if I'm wrong) a plugin-based design.

> Last, I propose an update to the configuration file to a more "object 
> oriented" one, where users can themselves give significant names to their 
> plugins and easily configure them.
Sounds like a very good idea, but I'd suggest a slightly variant form:

[CORE]
memory = 16MB # Units are a happy thing!
db_syntax = at&t # Is this acatualy used at all?
prescan_depth = 3
ring3 = on
plugin_path=./plugins

[fdc0]
PLUGIN = bochs/fdc
port=0x3f0

[fd0]
PLUGIN = bochs/imgfloppy
controler=fdc0
port=0

---
guiding principles: all-caps are defined by core, everything else by plugin.
For PLUGIN= entries the .so is implied, and CORE::plugin_path is checked
like $PATH (unless the entry begins with ./, ../ or /).

Numbers are always written in dec/0oct/0xhex/0bbin format, _with default
decimal_, for consistency.  We should write a parse-string-as-bool func, to
standardize that too.

For things connected to controlers, refer to the controler by name (as given
by the section name).  It's then up to the downstream device to set up
communications with the upstream one.

               -=- James Mastros
-- 
midendian: She never sleeps.
mousetrout: But I do.  I just regret it after I wake up.
AIM: theorbtwo homepage: http://www.rtweb.net/theorb/
ICBM: 40:04:15.100 N, 76:18:53.165 W

Reply via email to