Summary of the whole thing:
- Each architecture is assigned an ABI so that things are compatible at a binary level (this can be ignored if you plan to compile every driver yourself, however).
- All drivers SHOULD be an ELF file that is relocatable and is not dynamically linked.
- The entry function should look like
Code: Select all
USG_RET entryfunc(struct ops_table* ops_tbl);- Each OS SHOULD (you don't HAVE to, but its gonna save RAM anyways, and design time) have a single table, and assume that drivers do not attempt to modify it, if you really want to be safe you can write it, then remap it into read only memory so you can kill drivers which try to access it.
- The whole thing follows semver, the ops table and any major spec things will be fully backwards compatible unless on a higher major version.
- There is a function so you can get specific versions of the ops_table (say the kernel provides 1.15 but the driver needs 1.16, the driver can attempt to request 1.16 and see if the kernel hands it over).
This system is MEANT to load things into kernel space however in theory it is entirely possible that someone could write a kernel which loads drivers into userland, YMMV if you decide to do that. Also yes I do understand that this idea is a bit out there and it will be pretty hard to get support. I have not actually named the system yet other than its "spec name" of USG-0002, with USG-0001 defining USG spec language and USG-0003 is a spec for 6502 calling conventions (not really important unless you are writing an OS for a 6502 system, which I think only a few people here have done before).
