From fnaumann@mail.cs.uni-magdeburg.de Thu Dec 11 17:16:11 2003 To: mint@fishpool.com Subject: [MiNT] XDD addon proposal Date: 10 Dec 2003 16:49:26 From: "Adam Klobukowski" MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 X-Priority: Normal X-Mailer: Marijuana Mail 0.1.67n [pl] (Atari Falcon 030; TOS 4.04 & MiNT / NVDI 5.01) Message-Id: <20031211160016.8B7013544F@komp7.euh-e.edu.pl> Delivered-To: mint@fishpool.com Delivered-To: mint@lists.fishpool.fi X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: atari@gabo.pl Precedence: bulk List-help: List-unsubscribe: List-ID: X-List-ID: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by prinz.cs.uni-magdeburg.de id hBBGG8001022 Hm, maybe this will a good starting point I propose two new calls avialible only for XDD (and inside kernel): long RegisterAPI(long API_ID, *void P, long N) *api_ret CallAPI(long API_ID, long N) First a little explanation: kernel would store speciall tables for each API we would define, those tables would contain pointers to lists of such structures: struct { long FLAGS; *void P } API_LIST_MEMBER FLAGS is a bitfield that describes that member, it could be: READ_ONLY (this API member can only be read), NO_MULTIPLE (only one XDD can register this function), ... This would be lists to lists becouse we would allow few (depending on such API description) XDD to register the same function. Kernel would call those functions one by one and stop if one handles the call. RegisterAPI description: long API_ID - id of an API where we want to register our function (APM_API, LIBKERN_API, ...) *void P - pointer to a function that is registered, that function must return pointer to a structure that is discussed here later with CallAPI description long N - number of function in API that we want to register. Return value: E_OK, E_TAKEN, E_ERROR, E_UNKNOWN_API, E_UNKNOWN_API_FNUMBER, ... CallAPI description: long API_ID - if of an API we call long N - number of function in that API Return value: pointer to such structure: struct { long state; long retval; } api_ret; state - HANDLED or UNHANDLED retval - returning value (valid only if state==HANDLED) Ok, now description how it works: Situation Shutdown() is called with POWEROFF parameter. Shutdown code does everything it should do (kill processes, ...) Then Shutdown checks if POWEROFF function is registered and id it is it calls it (or calls directly as it should not return and if it does, it can print "System Halted"). Uff.... On last thing: We can implement this as system calls avialible only for XDD, or as a new parts of kerinfo interface (that is already passed to XDDs) and that solution seems better for me. Comments highly welcome. -- Semper Fidelis Adam Klobukowski atari@gabo.pl