1 /* ----------------------------------------------------------------------- *
3 * Copyright 2009 Intel Corporation; author: H. Peter Anvin
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
8 * Boston MA 02110-1301, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
16 #include <syslinux/loadfile.h>
17 #include <syslinux/keyboard.h>
19 static inline void error(const char *msg
)
24 int main(int argc
, char *argv
[])
26 const struct syslinux_keyboard_map
*const kmap
= syslinux_keyboard_map();
30 openconsole(&dev_null_r
, &dev_stdcon_w
);
33 error("Usage: kbdmap mapfile\n");
37 if (kmap
->version
!= 1) {
38 error("Syslinux core version mismatch\n");
42 if (loadfile(argv
[1], &kbdmap
, &map_size
)) {
43 error("Keyboard map file load error\n");
47 if (map_size
!= kmap
->length
) {
48 error("Keyboard map file format error\n");
52 memcpy(kmap
->map
, kbdmap
, map_size
);