From: Miro K. <mir...@gm...> - 2024-09-15 11:25:22
|
Hi, I guess I'll post it here for better visibility. Basically I'm trying to solve a bag if issues: - https://github.com/freemint/freemint/issues/143 (N.AES not working with /dev/console) - https://github.com/freemint/freemint/issues/173 (AES 4.1 stuck keyboard, mouse freeze and non-working double-click) - https://github.com/freemint/freemint/issues/378 (basically #173) All of those are caused by removal of O_GLOBAL handling in https://github.com/freemint/freemint/commit/9668d6797eaed45ffd9ee8e32770fb04e453f11a. Helmut realised the same thing and even provided a fix for it: https://mikro.naprvyraz.sk/mint/201511/msg00014.html so I have just implemented it in my PR here: https://github.com/freemint/freemint/pull/379. However, as it turns out, this fix solves most of the issues but not all of them. Most notably the double-click issue and to some extent also the stuck key issue (occasionally AES 4.1 still "overflows" with some stray keyboard characters). I can see the implementation of O_GLOBAL but I'm not 100% confident of its purpose. To me it looks like a way to ensure that whatever file is opened (even created in the past), it should be always handled as a file belonging to the root process ("MiNT") and not others (AESSYS, NEWDESK, SCREEN etc). That seems to have some unique properties like ensuring that no key is lost due to task switching (or so, happy to be corrected here). The way it was implemented was quite weird, basically any process handle >= 100 was considered global, essentially limiting the number of open (non-global) file handles to 99. As this has been deprecated, I'm wondering: couldn't we just make one flag in console.c (or dosfile.c) which would tell "this file handle is global because it belongs to /dev/console" and treat it always as root process handle? Thorsten perhaps implied something similar here: https://github.com/freemint/freemint/pull/379#issuecomment-2351411469 but I want to double check. To me it seems like the best of both worlds, /dev/console is always global and we don't need any kludges limiting the number of open file descriptors. -- http://mikro.atari.org |