>> Constants are i386-pc specific. In particular left and right shift are >> distinguished but not ctrl or alt. We should either distinguish them >> all or none. > > The values I picked for the constants were convenient for i386-pc, but > that's because it's the only architecture that currently needs an > assembly implementation and it seemed to make sense to me to put the > harder work of transforming values around into C code. > > I'm not sure what you mean by "distinguish" here though. I included > constants for control and alt that are currently unused, which may > actually have been a mistake since the original Red Hat patch to GRUB 1 > honoured those too in its hiddenmenu handling. Is that what you mean? I mean that upper layer code knows whether it was left or right shift but it doesn't know whether it was left or right alt. > >> Going to real mode to retrieve keyboard status is absolutely >> unnecessary: same info is available in BDA. Perhaps our console driver >> should switch to BDA altogether but I'm not sure that this will work >> since grub2 disables interrupts (tests needed) but it definitly works >> with keyboard status. > > OK, fair enough. The attached updated patch makes this change. > Why is it still asm? It can be done easily in C. Actually here we have 2 extremes: nice code (C, transform to nice flags (only one shift or 2 conrols and alts)) or small code (asm, crude value). Where we choose the compromise is a question for maintainer, not me. Another possibility is to put this code outside of kernel altogether. It saves bytes but may make approach ugly.
-- Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel