diff options
author | Matt Wilson <msw@redhat.com> | 1999-09-29 18:50:55 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 1999-09-29 18:50:55 +0000 |
commit | cf79998dde75b4fba80c2739984803390340fec6 (patch) | |
tree | 6d11370f567943b1dc5d310e017899e044e6c564 /utils | |
parent | 8faccd9bf7d915a9e2c5dda466e688b1fbbc8cfc (diff) | |
download | anaconda-cf79998dde75b4fba80c2739984803390340fec6.tar.gz anaconda-cf79998dde75b4fba80c2739984803390340fec6.tar.xz anaconda-cf79998dde75b4fba80c2739984803390340fec6.zip |
added snarffont
Diffstat (limited to 'utils')
-rw-r--r-- | utils/Makefile | 5 | ||||
-rw-r--r-- | utils/snarffont.c | 38 |
2 files changed, 42 insertions, 1 deletions
diff --git a/utils/Makefile b/utils/Makefile index 3ff15262d..d55be8b0e 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -2,7 +2,7 @@ LOADLIBES = -lpopt -L../isys -lisys CFLAGS = -Wall -g LDFLAGS = -g -all: modlist moddeps genhdlist +all: modlist moddeps genhdlist snarffont moddeps: moddeps.o $(CC) $(LDFLAGS) -o moddeps moddeps.o ../loader/modules.o \ @@ -14,6 +14,9 @@ moddeps: moddeps.o genhdlist: genhdlist.c $(CC) -I/usr/include/rpm $(LDFLAGS) -o genhdlist genhdlist.c -lrpm -lbz2 +snarffont: snarffont.c + $(CC) -o snarffont snarffont.c + install: @echo "nothing to do" diff --git a/utils/snarffont.c b/utils/snarffont.c new file mode 100644 index 000000000..cf869eac1 --- /dev/null +++ b/utils/snarffont.c @@ -0,0 +1,38 @@ +#include <fcntl.h> +#include <stdio.h> +#include <sys/ioctl.h> +#include <sys/kd.h> +#include <unistd.h> + +void die(char * mess) { + perror(mess); + exit(1); +} + +int main(void) { + char font[8192]; + unsigned short map[E_TABSZ]; + struct unipair descs[2048]; + struct unimapdesc d; + int fd; + + if ((fd = open("/dev/tty1", O_RDONLY)) < 0) + die("open"); + + if (ioctl(fd, GIO_FONT, font)) + die("GIO_FONT"); + + if (ioctl(fd, GIO_UNISCRNMAP, map)) + die("GIO_UNISCRNMAP"); + + d.entry_ct = 2048; + d.entries = descs; + if (ioctl(fd, GIO_UNIMAP, &d)) + die("GIO_UNIMAP"); + + write(1, font, sizeof(font)); + write(1, map, sizeof(map)); + write(1, &d.entry_ct, sizeof(d.entry_ct)); + write(1, descs, d.entry_ct * sizeof(descs[0])); + return 0; +} |