Hi Aitor (and thanks a lot for KEYB.EXE/SYS, which I am relying on in the FreeDOS version of Rufus, and which support a whole lot more layouts than the MS-DOS equivalent),
On 2011.12.31 13:32, Aitor Santamaría wrote: > A little addition to Rugxulo's post, that's quite good imho, I suggest > avoiding MODE CON CP SEL, and now that you load COUNTRY, replace it > with CHCP at the very bottom. > > Should work as well (or better). Thanks for the pointer, but I have now completed the keyboard locale setting, and decided not to use country.sys and chcp for the time being. The main reason for that is that I need to set the keyboard using a method that will work for both FreeDOS and WinMe DOS and, in order to keep the non FreeDOS version of Rufus as small as possible, ensure that no extra files need to be embedded in the case of WinME DOS (i.e. only the ones provided by the WinMe DOS bootable floppy image from diskcopy.dll are used). Thus, I am using mode con cp prep and mode con cp sel in both cases, since it allows to factorize much of the KB layout and codepage selection code. I think most of the people using Rufus will be interested in running simple apps, such as BIOS flash utilities, and therefore may not have that much of a requirement for extra such as country.sys setup. What they will most likely want is a keyboard layout that matches the one they used on their Windows machine and that's about it. Of course, I'm waiting on feedback on Rufus to see if there are requests for additional locale settings. If anybody is interested, the keyboard layout and codpage selection is all done in [1]. Basically, we read the keyboard layout code and system locale from Windows, find out if we have a match in the .sys and .cpi/.cpx files we extracted, and create the relevant CONFIG.SYS/AUTOEXEC.BAT, with a human readable description of the locale selection and with a possible fallback to us/437. The end result for FreeDOS then is as follows (when running Rufus with a version of Windows that detected a UK or Ireland locale): CONFIG.SYS: ----------- MENU MENU FreeDOS Language Selection Menu MENU ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ MENU MENUDEFAULT=1,5 MENU 1) Use UK-English keyboard with Western-European (Euro) codepage [858] MENU 2) Use US-English keyboard with US-English codepage [437] MENU 12? AUTOEXEC.BAT: ------------- @echo off set PATH=.;C:\;C:\LOCALE display con=(ega,,1) GOTO %CONFIG% :1 mode con codepage prepare=((858) C:\locale\ega.cpx) > NUL mode con codepage select=858 > NUL keyb uk,,C:\locale\keyboard.sys :2 This way, the AUTOEXEC.BAT is the same for WinME DOS and the only changes in CONFIG.SYS (after sorting out the much more limited locale support in the case of WinMe) have to do with the menu command. I believe this should be good enough for the time being. Since you're here however, I would have one question: Are Korean and Farsi (Persian) keyboard layouts supported in FreeDOS? Windows seems to require specific layouts for those, but I couldn't find mention of "ko" or "fa" as supported by KEYB.EXE, so I commented these out. Did I miss something? Regards, /Pete [1] https://github.com/pbatard/rufus/blob/master/src/dos_locale.c ------------------------------------------------------------------------------ Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev _______________________________________________ Freedos-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freedos-devel
