diff options
Diffstat (limited to 'loader')
147 files changed, 0 insertions, 28819 deletions
diff --git a/loader/.cvsignore b/loader/.cvsignore deleted file mode 100644 index dd31f2ee4..000000000 --- a/loader/.cvsignore +++ /dev/null @@ -1,12 +0,0 @@ -init -loader -debug.log -loader-pcmcia -loader-network -loader-local -loader.po -loader.tr -.depend -urltest -mkctype -ctype.c diff --git a/loader/Makefile b/loader/Makefile deleted file mode 100644 index 801265462..000000000 --- a/loader/Makefile +++ /dev/null @@ -1,254 +0,0 @@ -include ../Makefile.inc - -DESTDIR = ../../trees/initrd - -OBJS = log.o windows.o modules.o devices.o cdrom.o kickstart.o lang.o \ - misc.o ftp.o md5.o mediacheck.o moduledeps.o - -SLANGLIB = ../minislang/libslang.a -NEWTLIB = ../mininewt/libnewt.a -ifneq (ia64, $(ARCH)) -ifneq (i386, $(ARCH)) -ifneq (x86_64, $(ARCH)) -ifneq (ppc, $(ARCH)) -OBJS += fnmatch-stub.o printf-stub.o pwd-stub.o dl-stub.o -endif -endif -endif -endif - -LOADEROBJS = loader.o loader-pcmcia.o popen.o -SOURCES = $(subst .o,.c,$(OBJS)) loader.c -BINS = init -DIRS = -NETOBJS = net.o urls.o telnet.o telnetd.o -PCMCIAOBJS = pcmcia.o $(NETOBJS) -OPTS = -Os -DEBUG = -g - -MODULELINKAGE :=-lmodutils -lmodutilutil -lmodutilobj - -COPTS = $(DEBUG) -Wall -DVERSION='"$(VERSION)"' - -CFLAGS = $(COPTS) $(OPTS) -Os -function-sections -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 -I/usr/include/kudzu -I/usr/include/rpm -I.. -I../isys -DHAVE_LIBIO_H -DPRODUCTNAME='$(PRODUCTNAME)' - -# XXX diet is i386 only at the moment -ifeq (i386, $(ARCH)) -CFLAGS += -DGZLIB=1 -endif -ifeq (ppc, $(ARCH)) -CFLAGS += -DGZLIB=1 -endif - -ALLOBJS = $(OBJS) $(PCMCIAOBJS) - -ISYS = ../isys/libisys.a -GUNZIP = -lz -LOADERLIBS = -lpci - -# XXX Japanese is i386 only at the moment -ifeq (i386, $(ARCH)) -BINS += loader-local loader-network loader-pcmcia - ifeq (1, $(JAPANESE)) - KONOBJS = ./kon2/src/libkon.a ./kon2/src/display.a ./kon2/lib/libgon.a - CFLAGS += -DINCLUDE_KON - DIRS += kon2 - endif -OBJS += dietstubs.o ctype.o -endif - -ifeq (x86_64, $(ARCH)) -BINS += loader - ifeq (1, $(JAPANESE)) - KONOBJS = ./kon2/src/libkon.a ./kon2/src/display.a ./kon2/lib/libgon.a - CFLAGS += -DINCLUDE_KON - DIRS += kon2 - endif -endif - -ifeq (ia64, $(ARCH)) -BINS += loader -endif - -ifeq (alpha, $(ARCH)) -BINS += loader -OBJS += stubs.o -endif - -ifeq (s390, $(ARCH)) -BINS += loader -OBJS += stubs.o -S390FILES = load_anaconda -endif - -ifeq (s390x, $(ARCH)) -BINS += loader -OBJS += stubs.o -S390FILES = load_anaconda -endif - -ifeq (sparc, $(ARCH)) -BINS += loader loader-local -OBJS += stubs.o -endif - -ifeq (ppc, $(ARCH)) -BINS += loader loader-local loader-network -OBJS += dietstubs.o ctype.o -endif - -ifeq (.depend,$(wildcard .depend)) -TARGET=$(PROGS) -else -TARGET=depend $(PROGS) -endif - -STATIC = -static - -ifeq (i386, $(ARCH)) -MINILIBC=minilibc.o -COPTS+=-DUSE_MINILIBC=1 -DUSE_LOGDEV -LDFLAGS = -nostdlib /usr/lib/crt1.o -LOADERLIBS += -lrpc -ISYS = ../isys/libisys-diet.a -SLANGLIB = ../minislang/libslang-diet.a -NEWTLIB = ../mininewt/libnewt-diet.a -GUNZIP = ../isys/gzlib/libgunzip-diet.a -DIET=diet -REALCC=gcc -CC=$(DIET) $(REALCC) -STATIC=-static -else -REALCC=$(CC) -ifeq (sparc, $(ARCH)) -MINILIBC=minilibc.o /usr/lib/libc.a -CFLAGS+=-DUSE_MINILIBC=1 -DUSE_LOGDEV -LDFLAGS = -nostdlib /usr/lib/crt1.o -LOADERLIBS += -lresolv -STATIC=-static -else -ifeq (ppc, $(ARCH)) -MINILIBC=minilibc.o -COPTS+=-DUSE_MINILIBC=1 -DUSE_LOGDEV -LDFLAGS = -nostdlib /usr/lib/crt1.o -LOADERLIBS += -lrpc -ISYS = ../isys/libisys-diet.a -SLANGLIB = ../minislang/libslang-diet.a -NEWTLIB = ../mininewt/libnewt-diet.a -GUNZIP = ../isys/gzlib/libgunzip-diet.a -DIET=diet -REALCC=gcc -CC=$(DIET) $(REALCC) -STATIC=-static -else -CFLAGS+=-DUSE_MINILIBC=0 -STATIC=-static -LOADERLIBS += -lresolv -endif -endif -endif - -LANGS = $(shell awk '{ print $$2 }' ../lang-table | egrep -v '(^en$$)') - -TR = $(patsubst %,tr/%.tr,$(LANGS)) -TRFILES = $(patsubst %,%.tr,$(LANGS)) - -all: dirs $(BINS) loader.tr - -loader.tr: $(TR) ../lang-table - (cd tr; ls $(TRFILES) | cpio --quiet -Hcrc -o | gzip -9) > $@ - -loader.po: *.c - xgettext --default-domain=loader --add-comments \ - --keyword=_ --keyword=N_ *.c - -tr/%.tr: ../po/%.po loader.po - msgmerge $< loader.po | ./simplemot > $@ - -dirs: - for n in . $(DIRS); do \ - [ "$$n" = "." ] || make "DIET=$(DIET)" -C $$n ;\ - done - -install: all - mkdir -p $(DESTDIR)/$(RUNTIMEDIR)/loader - for n in $(BINS); do \ - install -m 755 $$n $(DESTDIR)/$(RUNTIMEDIR)/loader; \ - strip $(DESTDIR)/$(RUNTIMEDIR)/loader/$$n; \ - done - install -m 644 loader.tr $(DESTDIR)/$(RUNTIMEDIR)/loader - install -m 644 module-info $(DESTDIR)/$(RUNTIMEDIR)/loader - install -m 644 kon.cfg $(DESTDIR)/$(RUNTIMEDIR)/loader - install -m 644 minikon.fnt $(DESTDIR)/$(RUNTIMEDIR)/loader - -urltest: urltest.o ftp.o urls.o lang.o log.o windows.o - $(CC) -g -o urltest urltest.o -lnewt ftp.o urls.o lang.o log.o windows.o -lz $(ISYS) -lresolv - -loader: loader.o $(OBJS) $(NETOBJS) - $(CC) -g $(STATIC) -o $@ $^ -lpopt \ - -lkudzu_loader $(ISYS) ../balkan/libbalkan.a \ - $(MODULELINKAGE) $(GUNZIP) \ - -lpump $(NEWTLIB) $(SLANGLIB) $(LOADERLIBS) $(KONOBJS) - -loader-local: loader-local.o $(OBJS) - $(CC) -g $(STATIC) -o $@ $^ -lpopt \ - -lkudzu_loader $(ISYS) ../balkan/libbalkan.a \ - $(MODULELINKAGE) $(GUNZIP) \ - -L ../stubs $(NEWTLIB) $(SLANGLIB) $(LOADERLIBS) $(KONOBJS) - -loader-network: loader-net.o $(OBJS) $(NETOBJS) - $(CC) -g $(STATIC) -o $@ $^ -lpopt \ - -lkudzu_loader $(ISYS) ../balkan/libbalkan.a \ - $(MODULELINKAGE) $(GUNZIP) \ - -lpump -L ../stubs $(NEWTLIB) $(SLANGLIB) $(LOADERLIBS) $(KONOBJS) - -loader-pcmcia: loader-pcmcia.o pcmcia.o popen.o $(OBJS) $(PCMCIAOBJS) - $(CC) -g $(STATIC) -o $@ loader-pcmcia.o $(OBJS) \ - $(PCMCIAOBJS) -lcardmgr_loader -lprobe_loader popen.o \ - -lpopt \ - -lkudzu_loader $(ISYS) ../balkan/libbalkan.a \ - $(MODULELINKAGE) $(GUNZIP) \ - -lpump -lresolv $(NEWTLIB) $(SLANGLIB) $(LOADERLIBS) $(KONOBJS) - -loader.o: loader.c - $(CC) -DINCLUDE_LOCAL -DINCLUDE_NETWORK $(CFLAGS) -o $@ -c $< - -loader-local.o: loader.c - $(CC) -DINCLUDE_LOCAL $(CFLAGS) -o $@ -c $< - -loader-net.o: loader.c - $(CC) -DINCLUDE_NETWORK $(CFLAGS) -o $@ -c $< - -loader-pcmcia.o: loader.c - $(CC) -DINCLUDE_PCMCIA -DINCLUDE_LOCAL -DINCLUDE_NETWORK \ - $(CFLAGS) -o $@ -c $< - -init: init.o $(MINILIBC) - $(REALCC) $(STATIC) $(COPTS) $(LDFLAGS) -o $@ init.o $(MINILIBC) - -init.o: init.c - $(REALCC) -O2 $(COPTS) -c -o init.o init.c - -minilibc.o: minilibc.c - $(REALCC) -O2 $(COPTS) -c -o minilibc.o minilibc.c - -mkctype: mkctype.c - $(REALCC) $(COPTS) -o mkctype mkctype.c - -ctype.c: mkctype - ./mkctype > ctype.c - -clean: - rm -f *.o .depend *~ loader-local loader-network loader.old \ - loader-pcmcia probe modprobe loader.po loader.tr tr/*.tr \ - loader init ctype.c mkctype - for n in $(DIRS); do \ - (cd $$n; make clean) \ - done - -depend: - $(CPP) $(CFLAGS) -DHAVE_CONFIG_H -M $(SOURCES) > .depend - -ifeq (.depend,$(wildcard .depend)) -include .depend -endif diff --git a/loader/cdrom.c b/loader/cdrom.c deleted file mode 100644 index 6a742fe5e..000000000 --- a/loader/cdrom.c +++ /dev/null @@ -1,94 +0,0 @@ -#include <stdlib.h> -#include <unistd.h> - -#include <newt.h> - -#include "cdrom.h" -#include "devices.h" -#include "lang.h" -#include "loader.h" -#include "windows.h" - -#define CD_SCSI 2 -#define CD_OTHER 3 - -static struct { char * modname, * devname; } transTable[] = { - { "cm206", "cm206cd" }, - { "sonycd535", "cdu535" }, - { NULL, NULL } -} ; - -static int setupCDdevicePanel(int * type) { - char * menuItems[2]; - int cdromType = 0, rc; - - menuItems[0] = "SCSI"; - menuItems[1] = NULL; - - if (*type == CD_OTHER) - cdromType = 1; - - rc = newtWinMenu(_("CDROM type"), _("What type of CDROM do you have?"), - 30, 5, 5, 7, menuItems, - &cdromType, _("OK"), _("Back"), NULL); - - if (rc == 2) return LOADER_BACK; - - if (cdromType == 0) - *type = CD_SCSI; - else - *type = CD_OTHER; - - return 0; -} - -int setupCDdevice(struct knownDevices * kd, moduleInfoSet modInfo, - moduleList modLoaded, moduleDeps * modDepsPtr, - char * floppyDevice, int flags) { - int type = 0, rc = 0; - int i; - int done = 0; - char * devName; - - while (!done) { - rc = setupCDdevicePanel(&type); - if (rc) return rc; - - switch (type) { - case CD_SCSI: - rc = devDeviceMenu(DRIVER_SCSI, modInfo, modLoaded, modDepsPtr, - floppyDevice, flags, NULL); - if (!rc) { - kdFindScsiList(kd, 0); - /* we'll get called again if the scsi bus doesn't have a CDROM - drive on it */ - done = 1; - } - break; - - case CD_OTHER: - rc = devDeviceMenu(DRIVER_CDROM, modInfo, modLoaded, modDepsPtr, - floppyDevice, flags, &devName); - if (!rc) { - for (i = 0; transTable[i].modname; i++) { - if (!strcmp(devName, transTable[i].devname)) { - devName = transTable[i].devname; - break; - } - } - - kdAddDevice(kd, CLASS_CDROM, devName, NULL); - - done = 1; - } - break; - } - } - - winStatus(35, 3, "CDROM", _("Initializing CDROM...")); - sleep(2); /* some drivers need time to initialize */ - newtPopWindow(); - - return 0; -} - diff --git a/loader/cdrom.h b/loader/cdrom.h deleted file mode 100644 index 3d7ce343b..000000000 --- a/loader/cdrom.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef H_LOADER_CDROM -#define H_LOADER_CDROM - -#include "isys/isys.h" -#include "isys/probe.h" - -#include "modules.h" - -int setupCDdevice(struct knownDevices * kd, moduleInfoSet modInfo, - moduleList modLoaded, moduleDeps * modDepsPtr, - char * floppyDevice, int flags); - -#endif diff --git a/loader/devices.c b/loader/devices.c deleted file mode 100644 index c79ccbd34..000000000 --- a/loader/devices.c +++ /dev/null @@ -1,492 +0,0 @@ -#include <alloca.h> -#include <ctype.h> -#include <errno.h> -#include <fcntl.h> -#include <newt.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <sys/ioctl.h> -#include <sys/stat.h> -#include <sys/utsname.h> -#include <linux/fd.h> - -#include "devices.h" -#include "isys/imount.h" -#include "../isys/isys.h" -#include "lang.h" -#include "loader.h" -#include "log.h" -#include "misc.h" -#include "modules.h" -#include "windows.h" -#include "kudzu/kudzu.h" -#include "isys/cpio.h" - - -/* pulled in from loader.c */ -char *getCurrentFloppyDevice(void); - -void eject(char * deviceName) { - int fd; - -#if !defined(__sparc__) - if (!strncmp(deviceName, "fd", 2)) return; -#endif - - logMessage("ejecting floppy"); - - devMakeInode(deviceName, "/tmp/ejectDevice"); - - fd = open("/tmp/ejectDevice", O_RDONLY); - ioctl(fd, FDEJECT, 1); - close(fd); - - unlink("/tmp/ejectDevice"); -} - - -static int getModuleArgs(struct moduleInfo * mod, char *** argPtr) { - struct newtWinEntry * entries; - int i; - int numArgs; - char ** values; - char * chptr, * end; - int misc = -1; - char ** args; - int argc; - int rc; - char * text; - - entries = alloca(sizeof(*entries) * (mod->numArgs + 2)); - values = alloca(sizeof(*values) * (mod->numArgs + 2)); - - for (i = 0; i < mod->numArgs; i++) { - entries[i].text = mod->args[i].description; - if (mod->args[i].arg) { - int io = !strcmp (mod->args[i].arg, "io"); - values[i] = malloc(strlen(mod->args[i].arg) + (io ? 4 : 2)); - strcpy(values[i], mod->args[i].arg); - strcat(values[i], (io ? "=0x" : "=")); - } else { - values[i] = NULL; - } - entries[i].value = values + i; - entries[i].flags = NEWT_FLAG_SCROLL; - } - - numArgs = i; - - if (!(mod->flags & MI_FLAG_NOMISCARGS)) { - values[i] = NULL; - entries[i].text = _("Miscellaneous"); - entries[i].value = values + i; - entries[i].flags = NEWT_FLAG_SCROLL; - misc = i; - i++; - } - - entries[i].text = (void *) entries[i].value = NULL; - - text = _("This module can take parameters which affects its " - "operation. If you don't know what parameters to supply, " - "just skip this screen by pressing the \"OK\" button " - "now."); - - rc = newtWinEntries(_("Module Parameters"), text, - 40, 5, 15, 20, entries, _("OK"), - _("Back"), NULL); - - if (rc == 2) { - for (i = 0; i < numArgs; i++) - if (values[i]) free(values[i]); - return LOADER_BACK; - } - - /* we keep args big enough for the args we know about, plus a NULL */ - - args = malloc(sizeof(*args) * (numArgs + 1)); - argc = 0; - - for (i = 0; i < numArgs; i++) { - if (values[i] && *values[i]) { - chptr = values[i] + strlen(values[i]) - 1; - while (isspace(*chptr)) chptr--; - if (*chptr != '=') - args[argc++] = values[i]; - } - } - - if (misc >= 0 && values[misc]) { - chptr = values[misc]; - i = 1; - while (*chptr) { - if (isspace(*chptr)) i++; - chptr++; - } - - args = realloc(args, sizeof(*args) * (argc + i + 1)); - chptr = values[misc]; - while (*chptr) { - while (*chptr && isspace(*chptr)) chptr++; - if (!*chptr) break; - - end = chptr; - while (!isspace(*end) && *end) end++; - args[argc] = malloc(end - chptr + 1); - memcpy(args[argc], chptr, end - chptr); - args[argc][end - chptr] = '\0'; - argc++; - chptr = end; - } - - free(values[misc]); - } - - args[argc] = NULL; - *argPtr = args; - - return 0; -} - -int devInitDriverDisk(moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps *modDepsPtr, int flags, char * mntPoint, - struct driverDiskInfo * ddi) { - int badDisk = 0; - char from[200], to[200]; - struct stat sb; - static int ddNum = 0; - char * diskName; - FILE * f; - int fd; - char * fileCheck[] = { "rhdd-6.1", "modinfo", "modules.dep", "pcitable", - NULL }; - char ** fnPtr; - - for (fnPtr = fileCheck; *fnPtr; fnPtr++) { - sprintf(from, "%s/%s", mntPoint, *fnPtr); - if (access(from, R_OK)) { - logMessage("cannot find %s; bad driver disk", from); - badDisk = 1; - } - } - - sprintf(from, "%s/rhdd-6.1", mntPoint); - stat(from, &sb); - if (!sb.st_size) - badDisk = 1; - - if (badDisk) return 1; - - diskName = malloc(sb.st_size + 1); - fd = open(from, O_RDONLY); - read(fd, diskName, sb.st_size); - if (diskName[sb.st_size - 1] == '\n') - sb.st_size--; - diskName[sb.st_size] = '\0'; - close(fd); - - ddi->title = strdup(diskName); - - sprintf(from, "%s/modinfo", mntPoint); - - fd = isysReadModuleInfo(from, modInfo, ddi); - - sprintf(from, "%s/modules.dep", mntPoint); - mlLoadDeps(modDepsPtr, from); - sprintf(from, "%s/pcitable", mntPoint); - pciReadDrivers(from); - - /* save this modinfo file for later -- we may need it again in - ddReadDriverDiskModInfo() */ - sprintf(to, "/tmp/DD-%d", ddNum); - mkdirChain(to); - - sprintf(from, "%s/modinfo", mntPoint); - sprintf(to, "/tmp/DD-%d/modinfo", ddNum); - - if (copyFile(from, to)) - return 0; - - sprintf(to, "/tmp/DD-%d/diskInfo", ddNum); - f = fopen(to, "w"); - fprintf(f, "%s\n", ddi->title); - fprintf(f, "%s\n", ddi->mntDevice); - fprintf(f, "%s\n", ddi->fs); - fprintf(f, "%s\n", ddi->device ? ddi->device : "(NONE)"); - fclose(f); - - ddNum++; - - return 0; -} - -int devLoadDriverDisk(moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps *modDepsPtr, int flags, int cancelNotBack, - int askForExistence, char * device) { - int rc; - int done = 0; - char *origdev, *usedev; - struct driverDiskInfo * ddi; - - ddi = calloc(sizeof(*ddi), 1); - - do { - if (askForExistence) { - rc = newtWinChoice(_("Devices"), _("Yes"), - _("No"), - _("Do you have a driver disk?")); - if (rc == 2) return LOADER_BACK; - } - - eject(device); - rc = newtWinChoice(_("Devices"), _("OK"), - cancelNotBack ? _("Cancel") : _("Back"), - _("Insert your driver disk and press \"OK\" to continue.")); - - if (rc == 2) return LOADER_BACK; - - /* re-probe for floppy device. If the system has no legacy floppy - device or IDE CD-ROM (i.e. it is only USB), they may have - unplugged their CD-ROM at this point to plug in a USB floppy - device. */ - - /* XXXX this is making the big assumption we are only pulling a - driver disk from the floppy device. setFloppyDevice() will - set the extern char *floppyDevice to the proper device */ - - /* If floppyDevice changed after calling setFloppyDevice(), use - the new value. Otherwise use the value we were passed. */ - origdev = strdup(getCurrentFloppyDevice()); - setFloppyDevice(flags); - if (strcmp(origdev, getCurrentFloppyDevice())) - usedev = getCurrentFloppyDevice(); - else - usedev = device; - free(origdev); - - ddi->device = strdup(usedev); - ddi->mntDevice = malloc(strlen(usedev) + 10); - sprintf(ddi->mntDevice, "/tmp/%s", usedev); - - devMakeInode(ddi->device, ddi->mntDevice); - - ddi->fs = "vfat"; - logMessage("trying to mount device %s", ddi->mntDevice); - if (doPwMount(ddi->mntDevice, "/tmp/drivers", ddi->fs, 1, 0, NULL, - NULL)) { - ddi->fs = "ext2"; - if (doPwMount(ddi->mntDevice, "/tmp/drivers", ddi->fs, 1, 0, NULL, - NULL)) - newtWinMessage(_("Error"), _("OK"), - _("Failed to mount driver disk.")); - } - - - if (devInitDriverDisk(modInfo, modLoaded, modDepsPtr, flags, - "/tmp/drivers", ddi)) - newtWinMessage(_("Error"), _("OK"), - _("The floppy disk you inserted is not a valid driver disk " - "for this release of %s."), PRODUCTNAME); - else - done = 1; - - umount("/tmp/drivers"); - } while (!done); - - return 0; -} - -struct sortModuleList { - int index; - moduleInfoSet modInfo; -}; - -static int sortDrivers(const void * a, const void * b) { - const struct sortModuleList * one = a; - const struct sortModuleList * two = b; - - return strcmp(one->modInfo->moduleList[one->index].description, - one->modInfo->moduleList[two->index].description); -} - -static int pickModule(moduleInfoSet modInfo, enum driverMajor type, - moduleList modLoaded, moduleDeps * modDepsPtr, - struct moduleInfo * suggestion, - struct moduleInfo ** modp, int * specifyParams, - char * ddDevice, int flags) { - int i; - newtComponent form, text, listbox, checkbox, ok, back; - newtGrid buttons, grid, subgrid; - char specifyParameters = *specifyParams ? '*' : ' '; - struct newtExitStruct es; - struct sortModuleList * sortedOrder; - int numSorted; - - do { - sortedOrder = malloc(sizeof(*sortedOrder) * modInfo->numModules); - numSorted = 0; - - for (i = 0; i < modInfo->numModules; i++) { - if (modInfo->moduleList[i].major == type && - !mlModuleInList(modInfo->moduleList[i].moduleName, modLoaded)) { - sortedOrder[numSorted].index = i; - sortedOrder[numSorted++].modInfo = modInfo; - } - } - - if (!numSorted) { - /* If nothing appears in this list, force them to insert - a driver disk. */ - i = devLoadDriverDisk(modInfo, modLoaded, modDepsPtr, flags, 0, - 1, ddDevice); - if (i) return i; - continue; - } - - qsort(sortedOrder, numSorted, sizeof(*sortedOrder), sortDrivers); - - text = newtTextboxReflowed(-1, -1, _("Which driver should I try?. " - "If the driver you need does not appear in this list, and " - "you have a separate driver disk, please press F2."), - 30, 0, 10, 0); - - listbox = newtListbox(-1, -1, 6, - NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT); - - buttons = newtButtonBar(_("OK"), &ok, _("Back"), &back, NULL); - checkbox = newtCheckbox(-1, -1, _("Specify module parameters"), - specifyParameters, NULL, &specifyParameters); - - form = newtForm(NULL, NULL, 0); - newtFormAddHotKey(form, NEWT_KEY_F2); - - for (i = 0; i < numSorted; i++) { - char buf[1024]; - int num = sortedOrder[i].index; - - snprintf (buf, sizeof(buf), "%s (%s)", - modInfo->moduleList[num].description, - modInfo->moduleList[num].moduleName); - newtListboxAppendEntry(listbox, buf, (void *) num); - if (modp && (modInfo->moduleList + num) == *modp) - newtListboxSetCurrentByKey(listbox, (void *) num); - } - - subgrid = newtGridVStacked(NEWT_GRID_COMPONENT, listbox, - NEWT_GRID_COMPONENT, checkbox, NULL); - grid = newtGridBasicWindow(text, subgrid, buttons); - newtGridAddComponentsToForm(grid, form, 1); - newtGridWrappedWindow(grid, _("Devices")); - - newtFormRun(form, &es); - - i = (int) newtListboxGetCurrent(listbox); - - newtGridFree(grid, 1); - newtFormDestroy(form); - newtPopWindow(); - - free(sortedOrder); - - if (es.reason == NEWT_EXIT_COMPONENT && es.u.co == back) { - return LOADER_BACK; - } else if (es.reason == NEWT_EXIT_HOTKEY && es.u.key == NEWT_KEY_F2) { - devLoadDriverDisk(modInfo, modLoaded, modDepsPtr, flags, 0, 0, - ddDevice); - continue; - } else { - break; - } - } while (1); - - *specifyParams = (specifyParameters != ' '); - *modp = modInfo->moduleList + i; - - return 0; -} - -int devDeviceMenu(enum driverMajor type, moduleInfoSet modInfo, - moduleList modLoaded, moduleDeps * modDepsPtr, - char * ddDevice, int flags, char ** moduleName) { - struct moduleInfo * mod = NULL; - enum { S_MODULE, S_ARGS, S_DONE } stage = S_MODULE; - int rc; - char ** args = NULL, ** arg; - int specifyArgs = 0; - - while (stage != S_DONE) { - switch (stage) { - case S_MODULE: - if ((rc = pickModule(modInfo, type, modLoaded, modDepsPtr, mod, - &mod, &specifyArgs, ddDevice, flags))) - return LOADER_BACK; - stage = S_ARGS; - break; - - case S_ARGS: - if (specifyArgs) { - rc = getModuleArgs(mod, &args); - if (rc) { - stage = S_MODULE; - break; - } - } - stage = S_DONE; - break; - - case S_DONE: - } - } - - rc = mlLoadModule(mod->moduleName, modLoaded, - *modDepsPtr, args, modInfo, flags); - - if (args) { - for (arg = args; *arg; arg++) - free(*arg); - free(args); - } - - if (rc) - newtWinMessage(_("Error"), _("OK"), _("Failed to insert %s module."), - mod->moduleName); - - if (!rc && moduleName) - *moduleName = mod->moduleName; - - return rc; -} - -void ddReadDriverDiskModInfo(moduleInfoSet modInfo) { - int num = 0; - char fileName[1024]; - struct stat sb; - FILE * f; - struct driverDiskInfo * ddi; - - sprintf(fileName, "/tmp/DD-%d/diskInfo", num); - while (!access(fileName, R_OK)) { - stat(fileName, &sb); - - f = fopen(fileName, "r"); - ddi = malloc(sizeof(*ddi)); - ddi->title = readLine(f); - ddi->mntDevice = readLine(f); - ddi->fs = readLine(f); - ddi->device = readLine(f); - if (!strcmp("(NONE)", ddi->device)) { - free(ddi->device); - ddi->device = NULL; - } - fclose(f); - - sprintf(fileName, "/tmp/DD-%d/modinfo", num); - isysReadModuleInfo(fileName, modInfo, ddi); - - sprintf(fileName, "/tmp/DD-%d/diskName", ++num); - } -} - - diff --git a/loader/devices.h b/loader/devices.h deleted file mode 100644 index a4305c61a..000000000 --- a/loader/devices.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef H_DEVICES -#define H_DEVICES - -#include "../isys/isys.h" -#include "modules.h" - -struct driverDiskInfo { - char * device; /* may be null */ - char * mntDevice; - char * fs; - char * title; -}; - -int devDeviceMenu(enum driverMajor type, moduleInfoSet modInfo, - moduleList modLoaded, moduleDeps * modDepsPtr, - char * ddDevice, int flags, char ** moduleName); -int devLoadDriverDisk(moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps *modDepsPtr, int flags, int cancelNotBack, - int askForExistence, char * device); -int devInitDriverDisk(moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps *modDepsPtr, int flags, char * mntPoint, - struct driverDiskInfo * ddi); -void ddReadDriverDiskModInfo(moduleInfoSet modInfo); -void ejectFloppy(void); -void eject(char * deviceName); - -#endif diff --git a/loader/dietstubs.c b/loader/dietstubs.c deleted file mode 100644 index dab88965f..000000000 --- a/loader/dietstubs.c +++ /dev/null @@ -1,166 +0,0 @@ -#include <errno.h> -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <setjmp.h> -#include <ctype.h> -#include <stdarg.h> - -struct glibc_stat { - long long st_dev; - unsigned short int __pad1; - long st_ino; - int st_mode; - int st_nlink; - int st_uid; - int st_gid; - long long st_rdev; - unsigned short int __pad2; - long st_size; - long st_blksize; - long st_blocks; - long st_atime; - unsigned long int __unused1; - long st_mtime; - unsigned long int __unused2; - long st_ctime; - unsigned long int __unused3; - unsigned long int __unused4; - unsigned long int __unused5; -}; - -static void stat_copy(struct stat * from, struct glibc_stat * to) { - to->st_dev = from->st_dev; - to->st_ino = from->st_ino; - to->st_mode = from->st_mode; - to->st_nlink = from->st_nlink; - to->st_uid = from->st_uid; - to->st_gid = from->st_gid; - to->st_rdev = from->st_rdev; - to->st_size = from->st_size; - to->st_blksize = from->st_blksize; - to->st_blocks = from->st_blocks; - to->st_atime = from->st_atime; - to->st_mtime = from->st_mtime; - to->st_ctime = from->st_ctime; -} - -int __xstat (int __ver, __const char *__filename, struct glibc_stat * sb) { - struct stat s; - int rc = stat(__filename, &s); - - if (!rc) stat_copy(&s, sb); - - return rc; -} - -int __lxstat (int __ver, __const char *__filename, struct glibc_stat * sb) { - struct stat s; - int rc = lstat(__filename, &s); - - if (!rc) stat_copy(&s, sb); - - return rc; -} - -int __fxstat (int __ver, int fd, struct glibc_stat * sb) { - struct stat s; - int rc = fstat(fd, &s); - - if (!rc) stat_copy(&s, sb); - - return rc; -} - -extern double strtod (__const char * __nptr, char ** __endptr); - -double __strtod_internal (__const char *__restrict __nptr, - char **__restrict __endptr, int __group) { - return strtod(__nptr, __endptr); -} - - -long int __strtol_internal(const char * nptr, char ** endptr, - int base, int group) { - return strtol(nptr, endptr, base); -} - -unsigned long int __strtoul_internal (__const char *__restrict __nptr, - char **__restrict __endptr, - int __base, int __group) __THROW { - return strtoul(__nptr, __endptr, __base); -} - -char * __strdup(const char * s) { - return strdup(s); -} - -void __assert_fail (__const char *__assertion, __const char *__file, - unsigned int __line, __const char *__function) { - fprintf(stderr, "%s:%d assertion failed in %s()\n", - __file, __line, __function); - abort(); -} - -int _setjmp(jmp_buf buf) { - return setjmp(buf); -} - -char * strcasestr(char * haystack1, char * needle1) { - char * haystack = strdup(haystack1); - char * needle = strdup(needle1); - char * chptr; - - for (chptr = haystack; *chptr; chptr++) *chptr = toupper(*chptr); - for (chptr = needle; *chptr; chptr++) *chptr = toupper(*chptr); - - chptr = strstr(needle, haystack); - if (!chptr) return NULL; - - return (chptr - haystack) + haystack1; -} - -int _IO_putc(char c, void * f) { - return putc(c, f); -} - -int _IO_getc(void * f) { - return getc(f); -} - -int __xmknod (int __ver, const char * path, unsigned int mode, - long long * dev) { - return mknod(path, mode, *dev); -} - - -/* this should print the name of the app, but how? probably in a global - somewhere (like env is) */ -void warn(char * format, ...) { - va_list args; - int err = errno; - - va_start(args, format); - - fprintf(stderr, "warning: "); - vfprintf(stderr, format, args); - fprintf(stderr, ": %s\n", strerror(err)); - - va_end(args); - - errno = err; -} - -int pwrite(int fd, const void *buf, size_t count, off_t offset) { - return __pwrite(fd, buf, count, offset); -} - -void * __rawmemchr (void* s, int c) { - while (*(char *)s != c) - s++; - return s; -} - -char * dcgettext (const char *domainname, const char *msgid, int category) { - return msgid; -} diff --git a/loader/dl-stub.c b/loader/dl-stub.c deleted file mode 100644 index 71a5acb0e..000000000 --- a/loader/dl-stub.c +++ /dev/null @@ -1,14 +0,0 @@ -void _dl_mcount_wrapper (void *selfpc) -{ -} - -void _dl_mcount_wrapper_check (void *selfpc) -{ -} - -int _dl_osversion; -int __libc_multiple_libcs; -int __libc_enable_secure; - -void __libc_check_standard_fds (void) { } - diff --git a/loader/fnmatch-stub.c b/loader/fnmatch-stub.c deleted file mode 100644 index 936201a3a..000000000 --- a/loader/fnmatch-stub.c +++ /dev/null @@ -1,29 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <fnmatch.h> - -/* A very simplified fnmatch which just supports one - * in the string and no [, ? or { */ -int fnmatch(const char *pattern, const char *string, int flags) -{ - const char *p, *q, *r; - - if (!(flags & ~(FNM_PATHNAME | FNM_PERIOD)) - && strpbrk (pattern, "[?{") == NULL - && (p = strchr (pattern, '*')) != NULL - && strchr (p + 1, '*') == NULL) - { - if (strncmp (string, pattern, p - pattern)) - return FNM_NOMATCH; - q = strstr (string + (p - pattern), p + 1); - r = strchr (string + (p - pattern), '/'); - if (q == NULL || strlen (q) != strlen (p + 1)) - return FNM_NOMATCH; - - if ((flags & FNM_PATHNAME) && (r != NULL && r < q)) - return FNM_NOMATCH; - return 0; - } - fprintf (stderr, "fnmatch stub does not support '%s' patterns\n", pattern); - abort (); -} diff --git a/loader/ftp.c b/loader/ftp.c deleted file mode 100644 index 0654bc26f..000000000 --- a/loader/ftp.c +++ /dev/null @@ -1,506 +0,0 @@ -#define HAVE_ALLOCA_H 1 -#define HAVE_NETINET_IN_SYSTM_H 1 -#define HAVE_SYS_SOCKET_H 1 -#define USE_ALT_DNS 1 - -#if HAVE_ALLOCA_H -# include <alloca.h> -#endif - -#if HAVE_SYS_SOCKET_H -# include <sys/socket.h> -#endif - -#if HAVE_NETINET_IN_SYSTM_H -# include <sys/types.h> -# include <netinet/in_systm.h> -#endif - -#if ! HAVE_HERRNO -extern int h_errno; -#endif - -#include <ctype.h> -#include <errno.h> -#include <fcntl.h> -#include <netdb.h> -#include <pwd.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/socket.h> -#include <sys/time.h> -#include <sys/types.h> -#include <unistd.h> - -#include <netinet/in.h> -#include <netinet/ip.h> -#include <arpa/inet.h> - -#define TIMEOUT_SECS 60 -#define BUFFER_SIZE 4096 - -#ifndef IPPORT_FTP -# define IPPORT_FTP 21 -#endif - -#if defined(USE_ALT_DNS) && USE_ALT_DNS -#include "isys/dns.h" -#endif - -#include "ftp.h" - -static int ftpCheckResponse(int sock, char ** str); -static int ftpCommand(int sock, char * command, ...); -static int getHostAddress(const char * host, struct in_addr * address); - -static int ftpCheckResponse(int sock, char ** str) { - static char buf[BUFFER_SIZE + 1]; - int bufLength = 0; - fd_set emptySet, readSet; - char * chptr, * start; - struct timeval timeout; - int bytesRead, rc = 0; - int doesContinue = 1; - char errorCode[4]; - - errorCode[0] = '\0'; - - do { - FD_ZERO(&emptySet); - FD_ZERO(&readSet); - FD_SET(sock, &readSet); - - timeout.tv_sec = TIMEOUT_SECS; - timeout.tv_usec = 0; - - rc = select(sock + 1, &readSet, &emptySet, &emptySet, &timeout); - if (rc < 1) { - if (rc==0) - return FTPERR_BAD_SERVER_RESPONSE; - else - rc = FTPERR_UNKNOWN; - } else - rc = 0; - - bytesRead = read(sock, buf + bufLength, sizeof(buf) - bufLength - 1); - - bufLength += bytesRead; - - buf[bufLength] = '\0'; - - /* divide the response into lines, checking each one to see if - we are finished or need to continue */ - - start = chptr = buf; - - do { - while (*chptr != '\n' && *chptr) chptr++; - - if (*chptr == '\n') { - *chptr = '\0'; - if (*(chptr - 1) == '\r') *(chptr - 1) = '\0'; - if (str) *str = start; - - if (errorCode[0]) { - if (!strncmp(start, errorCode, 3) && start[3] == ' ') - doesContinue = 0; - } else { - strncpy(errorCode, start, 3); - errorCode[3] = '\0'; - if (start[3] != '-') { - doesContinue = 0; - } - } - - start = chptr + 1; - chptr++; - } else { - chptr++; - } - } while (*chptr); - - if (doesContinue && chptr > start) { - memcpy(buf, start, chptr - start - 1); - bufLength = chptr - start - 1; - } else { - bufLength = 0; - } - } while (doesContinue && !rc); - - if (*errorCode == '4' || *errorCode == '5') { - if (!strncmp(errorCode, "550", 3)) { - return FTPERR_FILE_NOT_FOUND; - } - - return FTPERR_BAD_SERVER_RESPONSE; - } - - if (rc) return rc; - - return 0; -} - -int ftpCommand(int sock, char * command, ...) { - va_list ap; - int len; - char * s; - char * buf; - int rc; - - va_start(ap, command); - len = strlen(command) + 2; - s = va_arg(ap, char *); - while (s) { - len += strlen(s) + 1; - s = va_arg(ap, char *); - } - va_end(ap); - - buf = alloca(len + 1); - - va_start(ap, command); - strcpy(buf, command); - strcat(buf, " "); - s = va_arg(ap, char *); - while (s) { - strcat(buf, s); - strcat(buf, " "); - s = va_arg(ap, char *); - } - va_end(ap); - - buf[len - 2] = '\r'; - buf[len - 1] = '\n'; - buf[len] = '\0'; - - if (write(sock, buf, len) != len) { - return FTPERR_SERVER_IO_ERROR; - } - - if ((rc = ftpCheckResponse(sock, NULL))) - return rc; - - return 0; -} - - -static int getHostAddress(const char * host, struct in_addr * address) { - if (isdigit(host[0])) { - if (!inet_aton(host, address)) { - return FTPERR_BAD_HOST_ADDR; - } - } else { - if (mygethostbyname((char *) host, address)) { - errno = h_errno; - return FTPERR_BAD_HOSTNAME; - } - } - - return 0; -} - -int ftpOpen(char * host, char * name, char * password, char * proxy, - int port) { - static int sock; - /*static char * lastHost = NULL;*/ - struct in_addr serverAddress; - struct sockaddr_in destPort; - struct passwd * pw; - char * buf; - int rc; - - if (port < 0) port = IPPORT_FTP; - - if (!name) - name = "anonymous"; - - if (!password) { - password = "root@"; - if (getuid()) { - pw = getpwuid(getuid()); - if (pw) { - password = alloca(strlen(pw->pw_name) + 2); - strcpy(password, pw->pw_name); - strcat(password, "@"); - } - } - } - - if (proxy) { - buf = alloca(strlen(name) + strlen(host) + 5); - sprintf(buf, "%s@%s", name, host); - name = buf; - host = proxy; - } - - if ((rc = getHostAddress(host, &serverAddress))) return rc; - - sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); - if (sock < 0) { - return FTPERR_FAILED_CONNECT; - } - - destPort.sin_family = AF_INET; - destPort.sin_port = htons(port); - destPort.sin_addr = serverAddress; - - if (connect(sock, (struct sockaddr *) &destPort, sizeof(destPort))) { - close(sock); - return FTPERR_FAILED_CONNECT; - } - - /* ftpCheckResponse() assumes the socket is nonblocking */ - if (fcntl(sock, F_SETFL, O_NONBLOCK)) { - close(sock); - return FTPERR_FAILED_CONNECT; - } - - if ((rc = ftpCheckResponse(sock, NULL))) { - return rc; - } - - if ((rc = ftpCommand(sock, "USER", name, NULL))) { - close(sock); - return rc; - } - - if ((rc = ftpCommand(sock, "PASS", password, NULL))) { - close(sock); - return rc; - } - - if ((rc = ftpCommand(sock, "TYPE", "I", NULL))) { - close(sock); - return rc; - } - - return sock; -} - -int ftpGetFileDesc(int sock, char * remotename) { - int dataSocket; - struct sockaddr_in dataAddress; - int i, j; - char * passReply; - char * chptr; - char * retrCommand; - int rc; - - if (write(sock, "PASV\r\n", 6) != 6) { - return FTPERR_SERVER_IO_ERROR; - } - if ((rc = ftpCheckResponse(sock, &passReply))) - return FTPERR_PASSIVE_ERROR; - - chptr = passReply; - while (*chptr && *chptr != '(') chptr++; - if (*chptr != '(') return FTPERR_PASSIVE_ERROR; - chptr++; - passReply = chptr; - while (*chptr && *chptr != ')') chptr++; - if (*chptr != ')') return FTPERR_PASSIVE_ERROR; - *chptr-- = '\0'; - - while (*chptr && *chptr != ',') chptr--; - if (*chptr != ',') return FTPERR_PASSIVE_ERROR; - chptr--; - while (*chptr && *chptr != ',') chptr--; - if (*chptr != ',') return FTPERR_PASSIVE_ERROR; - *chptr++ = '\0'; - - /* now passReply points to the IP portion, and chptr points to the - port number portion */ - - dataAddress.sin_family = AF_INET; - if (sscanf(chptr, "%d,%d", &i, &j) != 2) { - return FTPERR_PASSIVE_ERROR; - } - dataAddress.sin_port = htons((i << 8) + j); - - chptr = passReply; - while (*chptr++) { - if (*chptr == ',') *chptr = '.'; - } - - if (!inet_aton(passReply, &dataAddress.sin_addr)) - return FTPERR_PASSIVE_ERROR; - - dataSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); - if (dataSocket < 0) { - return FTPERR_FAILED_CONNECT; - } - - retrCommand = alloca(strlen(remotename) + 20); - sprintf(retrCommand, "RETR %s\r\n", remotename); - i = strlen(retrCommand); - - if (write(sock, retrCommand, i) != i) { - return FTPERR_SERVER_IO_ERROR; - } - - if (connect(dataSocket, (struct sockaddr *) &dataAddress, - sizeof(dataAddress))) { - close(dataSocket); - return FTPERR_FAILED_DATA_CONNECT; - } - - if ((rc = ftpCheckResponse(sock, NULL))) { - close(dataSocket); - return rc; - } - - return dataSocket; -} - -int ftpGetFileDone(int sock) { - if (ftpCheckResponse(sock, NULL)) { - return FTPERR_BAD_SERVER_RESPONSE; - } - - return 0; -} - -const char *ftpStrerror(int errorNumber) { - switch (errorNumber) { - case FTPERR_BAD_SERVER_RESPONSE: - return ("Bad FTP server response"); - - case FTPERR_SERVER_IO_ERROR: - return("FTP IO error"); - - case FTPERR_SERVER_TIMEOUT: - return("FTP server timeout"); - - case FTPERR_BAD_HOST_ADDR: - return("Unable to lookup FTP server host address"); - - case FTPERR_BAD_HOSTNAME: - return("Unable to lookup FTP server host name"); - - case FTPERR_FAILED_CONNECT: - return("Failed to connect to FTP server"); - - case FTPERR_FAILED_DATA_CONNECT: - return("Failed to establish data connection to FTP server"); - - case FTPERR_FILE_IO_ERROR: - return("IO error to local file"); - - case FTPERR_PASSIVE_ERROR: - return("Error setting remote server to passive mode"); - - case FTPERR_FILE_NOT_FOUND: - return("File not found on server"); - - case FTPERR_UNKNOWN: - default: - return("FTP Unknown or unexpected error"); - } -} - -int httpGetFileDesc(char * hostname, int port, char * remotename) { - char * buf; - struct timeval timeout; - char headers[4096]; - char * nextChar = headers; - int checkedCode; - struct in_addr serverAddress; - int sock; - int rc; - struct sockaddr_in destPort; - fd_set readSet; - - if (port < 0) port = 80; - - if ((rc = getHostAddress(hostname, &serverAddress))) return rc; - - sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); - if (sock < 0) { - return FTPERR_FAILED_CONNECT; - } - - destPort.sin_family = AF_INET; - destPort.sin_port = htons(port); - destPort.sin_addr = serverAddress; - - if (connect(sock, (struct sockaddr *) &destPort, sizeof(destPort))) { - close(sock); - return FTPERR_FAILED_CONNECT; - } - - buf = alloca(strlen(remotename) + strlen(hostname) + 25); - sprintf(buf, "GET %s HTTP/1.0\t\nHost: %s\r\n\r\n", remotename, hostname); - write(sock, buf, strlen(buf)); - - /* This is fun; read the response a character at a time until we: - - 1) Get our first \r\n; which lets us check the return code - 2) Get a \r\n\r\n, which means we're done */ - - *nextChar = '\0'; - checkedCode = 0; - while (!strstr(headers, "\r\n\r\n")) { - FD_ZERO(&readSet); - FD_SET(sock, &readSet); - - timeout.tv_sec = TIMEOUT_SECS; - timeout.tv_usec = 0; - - rc = select(sock + 1, &readSet, NULL, NULL, &timeout); - if (rc == 0) { - close(sock); - return FTPERR_SERVER_TIMEOUT; - } else if (rc < 0) { - close(sock); - return FTPERR_SERVER_IO_ERROR; - } - - if (read(sock, nextChar, 1) != 1) { - close(sock); - return FTPERR_SERVER_IO_ERROR; - } - - nextChar++; - *nextChar = '\0'; - - if (nextChar - headers == sizeof(headers)) { - close(sock); - return FTPERR_SERVER_IO_ERROR; - } - - if (!checkedCode && strstr(headers, "\r\n")) { - char * start, * end; - - checkedCode = 1; - start = headers; - while (!isspace(*start) && *start) start++; - if (!*start) { - close(sock); - return FTPERR_SERVER_IO_ERROR; - } - start++; - - end = start; - while (!isspace(*end) && *end) end++; - if (!*end) { - close(sock); - return FTPERR_SERVER_IO_ERROR; - } - - *end = '\0'; - if (!strcmp(start, "404")) { - close(sock); - return FTPERR_FILE_NOT_FOUND; - } else if (strcmp(start, "200")) { - close(sock); - return FTPERR_BAD_SERVER_RESPONSE; - } - - *end = ' '; - } - } - - return sock; -} diff --git a/loader/ftp.h b/loader/ftp.h deleted file mode 100644 index 2c7052312..000000000 --- a/loader/ftp.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef H_FTP -#define H_FTP - -const char * ftpStrerror(int ftpErrno); - -#define FTPERR_BAD_SERVER_RESPONSE -1 -#define FTPERR_SERVER_IO_ERROR -2 -#define FTPERR_SERVER_TIMEOUT -3 -#define FTPERR_BAD_HOST_ADDR -4 -#define FTPERR_BAD_HOSTNAME -5 -#define FTPERR_FAILED_CONNECT -6 -#define FTPERR_FILE_IO_ERROR -7 -#define FTPERR_PASSIVE_ERROR -8 -#define FTPERR_FAILED_DATA_CONNECT -9 -#define FTPERR_FILE_NOT_FOUND -10 -#define FTPERR_UNKNOWN -100 - -int ftpOpen(char * host, char * name, char * password, char * proxy, int port); -int ftpGetFile(int sock, char * remotename, int dest); -int ftpGetFileDesc(int sock, char * remotename); -int ftpGetFileDone(int sock); - -int httpGetFileDesc(char * hostname, int port, char * remotename); - -#endif diff --git a/loader/init.c b/loader/init.c deleted file mode 100644 index 8eaed3af2..000000000 --- a/loader/init.c +++ /dev/null @@ -1,832 +0,0 @@ -/* - * init.c - * - * This is the install type init - * - * Erik Troan (ewt@redhat.com) - * - * Copyright 1996 - 2002 Red Hat Software - * - * This software may be freely redistributed under the terms of the GNU - * public license. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#if USE_MINILIBC -#include "minilibc.h" -#ifndef SOCK_STREAM -# define SOCK_STREAM 1 -#endif -#else -#include <ctype.h> -#include <errno.h> -#include <fcntl.h> -#include <net/if.h> -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/ioctl.h> -#include <sys/klog.h> -#include <sys/mount.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/time.h> -#include <sys/types.h> -#include <sys/un.h> -#include <sys/wait.h> -#include <unistd.h> -#include <sys/ioctl.h> -#include <sys/reboot.h> -#include <termios.h> - -/* Need to tell loop.h what the actual dev_t type is. */ -#undef dev_t -#if defined(__alpha) || (defined(__sparc__) && defined(__arch64__)) -#define dev_t unsigned int -#else -#define dev_t unsigned short -#endif -#include <linux/loop.h> -#undef dev_t -#define dev_t dev_t - -#define syslog klogctl -#endif - -struct unmountInfo { - char * name; - int mounted; - int loopDevice; - enum { FS, LOOP } what; -} ; - -#include <linux/cdrom.h> - -#define KICK_FLOPPY 1 -#define KICK_BOOTP 2 - -#define MS_REMOUNT 32 - -#define ENV_PATH 0 -#define ENV_LD_LIBRARY_PATH 1 -#define ENV_HOME 2 -#define ENV_TERM 3 -#define ENV_DEBUG 4 - -char * env[] = { - "PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:" - "/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin", - /* we set a nicer ld library path specifically for bash -- a full - one makes anaconda unhappy */ - "LD_LIBRARY_PATH=/lib:/usr/lib:/usr/X11R6/lib", - "HOME=/", - "TERM=linux", - "DEBUG=", - "TERMINFO=/etc/linux-terminfo", - "PYTHONPATH=/tmp/updates", - NULL -}; - - -/* - * this needs to handle the following cases: - * - * 1) run from a CD root filesystem - * 2) run from a read only nfs rooted filesystem - * 3) run from a floppy - * 4) run from a floppy that's been loaded into a ramdisk - * - */ - -int testing=0; - -void printstr(char * string) { - write(1, string, strlen(string)); -} - -void fatal_error(int usePerror) { -/* FIXME */ -#if 0 - if (usePerror) - perror("failed:"); - else -#endif - printf("failed.\n"); - - printf("\nI can't recover from this.\n"); - if (testing) exit(0); -#if !defined(__s390__) && !defined(__s390x__) - while (1) ; -#endif -} - -int doMke2fs(char * device, char * size) { - char * args[] = { "/usr/sbin/mke2fs", NULL, NULL, NULL }; - int pid, status; - - args[1] = device; - args[2] = size; - - if (!(pid = fork())) { - /* child */ - execve("/usr/sbin/mke2fs", args, env); - fatal_error(1); - } - - wait4(-1, &status, 0, NULL); - - return 0; -} - -int hasNetConfiged(void) { - int rc; - int s; - struct ifconf configs; - struct ifreq devs[10]; - - #ifdef __i386__ - return 0; - #endif - - s = socket(AF_INET, SOCK_STREAM, 0); - if (s < 0) { - /* FIXME was perror*/ - printf("error creating socket: %d\n", errno); - return 0; - } else { - /* this is just good enough to tell us if we have anything - configured */ - configs.ifc_len = sizeof(devs); - configs.ifc_buf = (void *) devs; - - rc = ioctl(s, SIOCGIFCONF, &configs); - if (rc < 0) { - /* FIXME was perror*/ - printstr("SIOCGIFCONF"); - return 0; - } - if (configs.ifc_len == 0) { - return 0; - } - - return 1; - } - - return 0; -} - -void doklog(char * fn) { - fd_set readset, unixs; - int in, out, i; - int log; - int s; - int sock = -1; - struct sockaddr_un sockaddr; - char buf[1024]; - int readfd; - - in = open("/proc/kmsg", O_RDONLY,0); - if (in < 0) { - /* FIXME: was perror */ - printstr("open /proc/kmsg"); - return; - } - - out = open(fn, O_WRONLY, 0); - if (out < 0) - printf("couldn't open %s for syslog -- still using /tmp/syslog\n", fn); - - log = open("/tmp/syslog", O_WRONLY | O_CREAT, 0644); - if (log < 0) { - /* FIXME: was perror */ - printstr("error opening /tmp/syslog"); - sleep(5); - - close(in); - return; - } - - /* if we get this far, we should be in good shape */ - - if (fork()) { - /* parent */ - close(in); - close(out); - close(log); - return; - } - close(0); - close(1); - close(2); - - dup2(1, log); - -#if defined(USE_LOGDEV) - /* now open the syslog socket */ - sockaddr.sun_family = AF_UNIX; - strcpy(sockaddr.sun_path, "/dev/log"); - sock = socket(AF_UNIX, SOCK_STREAM, 0); - if (sock < 0) { - printf("error creating socket: %d\n", errno); - sleep(5); - } - printstr("got socket\n"); - if (bind(sock, (struct sockaddr *) &sockaddr, sizeof(sockaddr.sun_family) + - strlen(sockaddr.sun_path))) { - printf("bind error: %d\n", errno); - sleep(5); - } - printstr("bound socket\n"); - chmod("/dev/log", 0666); - if (listen(sock, 5)) { - printf("listen error: %d\n", errno); - sleep(5); - } -#endif - - syslog(8, NULL, 1); - - FD_ZERO(&unixs); - while (1) { - memcpy(&readset, &unixs, sizeof(unixs)); - - if (sock >= 0) FD_SET(sock, &readset); - FD_SET(in, &readset); - - i = select(20, &readset, NULL, NULL, NULL); - if (i <= 0) continue; - - if (FD_ISSET(in, &readset)) { - i = read(in, buf, sizeof(buf)); - if (i > 0) { - if (out >= 0) write(out, buf, i); - write(log, buf, i); - } - } - - for (readfd = 0; readfd < 20; ++readfd) { - if (FD_ISSET(readfd, &readset) && FD_ISSET(readfd, &unixs)) { - i = read(readfd, buf, sizeof(buf)); - if (i > 0) { - if (out >= 0) { - write(out, buf, i); - write(out, "\n", 1); - } - - write(log, buf, i); - write(log, "\n", 1); - } else if (i == 0) { - /* socket closed */ - close(readfd); - FD_CLR(readfd, &unixs); - } - } - } - - if (sock >= 0 && FD_ISSET(sock, &readset)) { - s = sizeof(sockaddr); - readfd = accept(sock, (struct sockaddr *) &sockaddr, &s); - if (readfd < 0) { - if (out >= 0) write(out, "error in accept\n", 16); - write(log, "error in accept\n", 16); - close(sock); - sock = -1; - } else { - FD_SET(readfd, &unixs); - } - } - } -} - -int setupTerminal(int fd) { - struct winsize winsize; - - if (ioctl(fd, TIOCGWINSZ, &winsize)) { - printf("failed to get winsize"); - fatal_error(1); - } - - winsize.ws_row = 24; - winsize.ws_col = 80; - - if (ioctl(fd, TIOCSWINSZ, &winsize)) { - printf("failed to set winsize"); - fatal_error(1); - } - - env[ENV_TERM] = "TERM=vt100"; - - return 0; -} - -void undoLoop(struct unmountInfo * fs, int numFs, int this); - -void undoMount(struct unmountInfo * fs, int numFs, int this) { - int len = strlen(fs[this].name); - int i; - - if (!fs[this].mounted) return; - fs[this].mounted = 0; - - /* unmount everything underneath this */ - for (i = 0; i < numFs; i++) { - if (fs[i].name[len] == '/' && - !strncmp(fs[this].name, fs[i].name, len)) { - if (fs[i].what == LOOP) - undoLoop(fs, numFs, i); - else - undoMount(fs, numFs, i); - } - } - - printf("\t%s", fs[this].name); - /* don't need to unmount /tmp. it is busy anyway. */ - if (!testing) { - if (umount2(fs[this].name, 0) < 0) { - printf(" umount failed (%d)", errno); - } else { - printf(" done"); - } - } - printf("\n"); -} - -void undoLoop(struct unmountInfo * fs, int numFs, int this) { - int i; - int fd; - - if (!fs[this].mounted) return; - fs[this].mounted = 0; - - /* find the device mount */ - for (i = 0; i < numFs; i++) { - if (fs[i].what == FS && (fs[i].loopDevice == fs[this].loopDevice)) - break; - } - - if (i < numFs) { - /* the device is mounted, unmount it (and recursively, anything - * underneath) */ - undoMount(fs, numFs, i); - } - - unlink("/tmp/loop"); - mknod("/tmp/loop", 0600 | S_IFBLK, (7 << 8) | fs[this].loopDevice); - printf("\tdisabling /dev/loop%d", fs[this].loopDevice); - if ((fd = open("/tmp/loop", O_RDONLY, 0)) < 0) { - printf(" failed to open device: %d", errno); - } else { - if (!testing && ioctl(fd, LOOP_CLR_FD, 0)) - printf(" LOOP_CLR_FD failed: %d", errno); - close(fd); - } - - printf("\n"); -} - -void unmountFilesystems(void) { - int fd, size; - char buf[65535]; /* this should be big enough */ - char * chptr, * start; - struct unmountInfo filesystems[500]; - int numFilesystems = 0; - int i; - struct loop_info li; - char * device; - struct stat sb; - - fd = open("/proc/mounts", O_RDONLY, 0); - if (fd < 1) { - /* FIXME: was perror */ - printstr("failed to open /proc/mounts"); - sleep(2); - return; - } - - size = read(fd, buf, sizeof(buf) - 1); - buf[size] = '\0'; - - close(fd); - - chptr = buf; - while (*chptr) { - device = chptr; - while (*chptr != ' ') chptr++; - *chptr++ = '\0'; - start = chptr; - while (*chptr != ' ') chptr++; - *chptr++ = '\0'; - - if (strcmp(start, "/") && strcmp(start, "/tmp")) { - filesystems[numFilesystems].name = alloca(strlen(start) + 1); - strcpy(filesystems[numFilesystems].name, start); - filesystems[numFilesystems].what = FS; - filesystems[numFilesystems].mounted = 1; - - stat(start, &sb); - if ((sb.st_dev >> 8) == 7) { - filesystems[numFilesystems].loopDevice = sb.st_dev & 0xf; - } else { - filesystems[numFilesystems].loopDevice = -1; - } - - numFilesystems++; - } - - while (*chptr != '\n') chptr++; - chptr++; - } - - for (i = 0; i < 7; i++) { - unlink("/tmp/loop"); - mknod("/tmp/loop", 0600 | S_IFBLK, (7 << 8) | i); - if ((fd = open("/tmp/loop", O_RDONLY, 0)) >= 0) { - if (!ioctl(fd, LOOP_GET_STATUS, &li) && li.lo_name[0]) { - filesystems[numFilesystems].name = alloca(strlen(li.lo_name) - + 1); - strcpy(filesystems[numFilesystems].name, li.lo_name); - filesystems[numFilesystems].what = LOOP; - filesystems[numFilesystems].mounted = 1; - filesystems[numFilesystems].loopDevice = i; - numFilesystems++; - } - - close(fd); - } - } - - for (i = 0; i < numFilesystems; i++) { - if (filesystems[i].what == LOOP) { - undoLoop(filesystems, numFilesystems, i); - } - } - - for (i = 0; i < numFilesystems; i++) { - if (filesystems[i].mounted) { - undoMount(filesystems, numFilesystems, i); - } - } -} - -void disableSwap(void) { - int fd; - char buf[4096]; - int i; - char * start; - char * chptr; - - if ((fd = open("/proc/swaps", O_RDONLY, 0)) < 0) return; - - i = read(fd, buf, sizeof(buf) - 1); - close(fd); - if (i < 0) return; - buf[i] = '\0'; - - start = buf; - while (*start) { - while (*start != '\n' && *start) start++; - if (!*start) return; - - start++; - if (*start != '/') return; - chptr = start; - while (*chptr && *chptr != ' ') chptr++; - if (!(*chptr)) return; - *chptr = '\0'; - printf("\t%s", start); - if (swapoff(start)) - printf(" failed (%d)", errno); - printf("\n"); - - start = chptr + 1; - } -} - -void ejectCdrom(void) { - int ejectfd; - struct stat sb; - - stat("/tmp/cdrom", &sb); - - if ((sb.st_mode & S_IFBLK) == S_IFBLK) { - printf("ejecting /tmp/cdrom..."); - if ((ejectfd = open("/tmp/cdrom", O_RDONLY | O_NONBLOCK, 0)) >= 0) { - if (ioctl(ejectfd, CDROMEJECT, 0)) - printf("eject failed %d ", errno); - close(ejectfd); - } else { - printf("eject failed %d ", errno); - } - printf("\n"); - } -} - -int mystrstr(char *str1, char *str2) { - char *p; - int rc=0; - - for (p=str1; *p; p++) { - if (*p == *str2) { - char *s, *t; - - rc = 1; - for (s=p, t=str2; *s && *t; s++, t++) - if (*s != *t) { - rc = 0; - p++; - } - - if (rc) - return rc; - } - } - return rc; -} - - - -int main(int argc, char **argv) { - pid_t installpid, childpid; - int waitStatus; - int fd; - int nfsRoot = 0; - int roRoot = 0; - int cdRoot = 0; - int doReboot = 0; - int doShutdown =0; - int isSerial = 0; - int noKill = 0; -#ifdef __alpha__ - char * kernel; -#endif - char * argvc[15]; - char ** argvp = argvc; - char twelve = 12; - int i; - char buf[500]; - int len; - - -#if !defined(__s390__) && !defined(__s390x__) - testing = (getppid() != 0) && (getppid() != 1); -#endif - - if (!testing) { - /* turn off screen blanking */ - printstr("\033[9;0]"); - printstr("\033[8]"); - } else { - printstr("(running in test mode).\n"); - } - -#if 0 - printf("unmounting filesystems...\n"); - unmountFilesystems(); - exit(0); -#endif - - umask(022); - - printstr("Greetings.\n"); - - printf("Red Hat install init version %s starting\n", VERSION); - - printf("mounting /proc filesystem... "); - if (!testing) { - if (mount("/proc", "/proc", "proc", 0, NULL)) - fatal_error(1); - } - printf("done\n"); - - printf("mounting /dev/pts (unix98 pty) filesystem... "); - if (!testing) { - if (mount("/dev/pts", "/dev/pts", "devpts", 0, NULL)) - fatal_error(1); - } - printf("done\n"); - - signal(SIGINT, SIG_IGN); - signal(SIGTSTP, SIG_IGN); - - /* these args are only for testing from commandline */ - for (i = 1; i < argc; i++) - if (!strcmp (argv[i], "serial")) { - isSerial = 1; - break; - } - - /* look through /proc/cmdline for special options */ - if ((fd = open("/proc/cmdline", O_RDONLY,0)) > 0) { - len = read(fd, buf, sizeof(buf) - 1); - close(fd); - if (len > 0 && mystrstr(buf, "nokill")) - noKill = 1; - } - -#if !defined(__s390__) && !defined(__s390x__) - if (ioctl (0, TIOCLINUX, &twelve) < 0) - isSerial = 2; - - if (isSerial) { - char *device = "/dev/ttyS0"; - - printf("Red Hat install init version %s using a serial console\n", - VERSION); - - printf("remember, cereal is an important part of a nutritionally " - "balanced breakfast.\n\n"); - - if (isSerial == 2) - device = "/dev/console"; - fd = open(device, O_RDWR, 0); - if (fd < 0) - device = "/dev/tts/0"; - - if (fd < 0) { - printf("failed to open %s\n", device); - fatal_error(1); - } - - setupTerminal(fd); - } else { - fd = open("/dev/tty1", O_RDWR, 0); - if (fd < 0) - fd = open("/dev/vc/1", O_RDWR, 0); - - if (fd < 0) { - printf("failed to open /dev/tty1 and /dev/vc/1"); - fatal_error(1); - } - } - - if (testing) - exit(0); - - dup2(fd, 0); - dup2(fd, 1); - dup2(fd, 2); - close(fd); -#endif - - setsid(); - if (ioctl(0, TIOCSCTTY, NULL)) { - printf("could not set new controlling tty\n"); - } - - if (!testing) { - sethostname("localhost.localdomain", 21); - /* the default domainname (as of 2.0.35) is "(none)", which confuses - glibc */ - setdomainname("", 0); - } - - printf("checking for NFS root filesystem..."); - if (hasNetConfiged()) { - printf("yes\n"); - roRoot = nfsRoot = 1; - } else { - printf("no\n"); - } - - if (!nfsRoot) { - printf("trying to remount root filesystem read write... "); - if (mount("/", "/", "ext2", MS_REMOUNT | MS_MGC_VAL, NULL)) { - printf("failed (but that's okay)\n"); - - roRoot = 1; - } else { - printf("done\n"); - - /* 2.0.18 (at least) lets us remount a CD r/w!! */ - printf("checking for writeable /tmp... "); - fd = open("/tmp/tmp", O_WRONLY | O_CREAT, 0644); - if (fd < 0) { - printf("no (probably a CD rooted install)\n"); - roRoot = 1; - } else { - close(fd); - unlink("/tmp/tmp"); - printf("yes\n"); - } - } - } - -#if !defined(__s390__) && !defined(__s390x__) -#define RAMDISK_DEVICE "/dev/ram" -#else -#define RAMDISK_DEVICE "/dev/ram2" -#endif - - if (!testing && roRoot) { - printf("creating 300k of ramdisk space... "); - if (doMke2fs(RAMDISK_DEVICE, "300")) - fatal_error(0); - - printf("done\n"); - - printf("mounting /tmp from ramdisk... "); - if (mount(RAMDISK_DEVICE, "/tmp", "ext2", 0, NULL)) - fatal_error(1); - - printf("done\n"); - - if (!nfsRoot) cdRoot = 1; - } - - /* Now we have some /tmp space set up, and /etc and /dev point to - it. We should be in pretty good shape. */ - - if (!testing) - doklog("/dev/tty4"); - - /* Go into normal init mode - keep going, and then do a orderly shutdown - when: - - 1) /bin/install exits - 2) we receive a SIGHUP - */ - - printf("running install...\n"); - - setsid(); - - if (!(installpid = fork())) { - /* child */ - *argvp++ = "/sbin/loader"; - *argvp++ = NULL; - - printf("running %s\n", argvc[0]); - execve(argvc[0], argvc, env); - - exit(0); - } - - while (!doShutdown) { - childpid = wait4(-1, &waitStatus, 0, NULL); - - if (childpid == installpid) - doShutdown = 1; - } - - if (!WIFEXITED(waitStatus) || WEXITSTATUS(waitStatus)) { - printf("install exited abnormally "); - if (WIFSIGNALED(waitStatus)) { - printf("-- received signal %d", WTERMSIG(waitStatus)); - } - printf("\n"); - } else { - doReboot = 1; - } - - if (testing) - exit(0); - - sync(); sync(); - - if (!testing && !noKill) { - printf("sending termination signals..."); - kill(-1, 15); - sleep(2); - printf("done\n"); - - printf("sending kill signals..."); - kill(-1, 9); - sleep(2); - printf("done\n"); - } - - printf("disabling swap...\n"); - disableSwap(); - - printf("unmounting filesystems...\n"); - unmountFilesystems(); - - ejectCdrom(); - - if (doReboot) { - printf("rebooting system\n"); - sleep(2); - -#if USE_MINILIBC - reboot(0xfee1dead, 672274793, 0x1234567); -#else -# ifdef __alpha__ - reboot(RB_HALT_SYSTEM); -# else - reboot(RB_AUTOBOOT); -# endif -#endif - } else { - printf("you may safely reboot your system\n"); - while (1); - } - - exit(0); - - return 0; -} diff --git a/loader/kickstart.c b/loader/kickstart.c deleted file mode 100644 index 3db8c40e3..000000000 --- a/loader/kickstart.c +++ /dev/null @@ -1,171 +0,0 @@ -#include <alloca.h> -#include <ctype.h> -#include <errno.h> -#include <fcntl.h> -#include <sys/stat.h> -#include <sys/wait.h> -#include <stdlib.h> -#include <string.h> -#include <newt.h> -#include <popt.h> -#include <unistd.h> - -#include "lang.h" -#include "loader.h" -#include "kickstart.h" - -struct ksCommandNames { - int code; - char * name; -} ; - -struct ksCommand { - int code, argc; - char ** argv; -}; - -struct ksCommandNames ksTable[] = { - { KS_CMD_NFS, "nfs" }, - { KS_CMD_CDROM, "cdrom" }, - { KS_CMD_HD, "harddrive" }, - { KS_CMD_TEXT, "text" }, - { KS_CMD_URL, "url" }, - { KS_CMD_NETWORK, "network" }, - { KS_CMD_DEVICE, "device" }, - { KS_CMD_XDISPLAY, "xdisplay" }, - { KS_CMD_DRIVERDISK, "driverdisk" }, - { KS_CMD_DEVICEPROBE, "deviceprobe" }, - { KS_CMD_KEYBOARD, "keyboard" }, - { KS_CMD_NONE, NULL } -}; - -struct ksCommand * commands = NULL; -int numCommands = 0; - -int ksReadCommands(char * cmdFile) { - int fd; - char * buf; - struct stat sb; - char * start, * end, * chptr; - char oldch; - int line = 0; - char ** argv; - int argc; - int inPackages = 0; - struct ksCommandNames * cmd; - int commandsAlloced = 5; - - if ((fd = open(cmdFile, O_RDONLY)) < 0) { - newtWinMessage(_("Kickstart Error"), _("OK"), - _("Error opening: kickstart file %s: %s"), cmdFile, - strerror(errno)); - return LOADER_ERROR; - } - - fstat(fd, &sb); - - buf = alloca(sb.st_size + 1); - if (read(fd, buf, sb.st_size) != sb.st_size) { - newtWinMessage(_("Kickstart Error"), _("OK"), - _("Error reading contents of kickstart file %s: %s"), - cmdFile, strerror(errno)); - close(fd); - return LOADER_ERROR; - } - - close(fd); - - buf[sb.st_size] = '\0'; - - commands = malloc(sizeof(*commands) * commandsAlloced); - - start = buf; - while (*start && !inPackages) { - line++; - - if (!(end = strchr(start, '\n'))) - end = start + strlen(start); - - oldch = *end; - *end = '\0'; - - while (*start && isspace(*start)) start++; - - chptr = end - 1; - while (chptr > start && isspace(*chptr)) chptr--; - - if (isspace(*chptr)) - *chptr = '\0'; - else - *(chptr + 1) = '\0'; - - if (!*start || *start == '#') { - /* no nothing */ - } else if (!strcmp(start, "%packages")) { - inPackages = 1; - } else { - if (poptParseArgvString(start, &argc, (const char ***) &argv) || !argc) { - newtWinMessage(_("Kickstart Error"), _("OK"), - _("Error in %s on line %d of kickstart file %s."), - argv[0], line, cmdFile); - } else { - for (cmd = ksTable; cmd->name; cmd++) - if (!strcmp(cmd->name, argv[0])) break; - - if (cmd->name) { - if (numCommands == commandsAlloced) { - commandsAlloced += 5; - commands = realloc(commands, - sizeof(*commands) * commandsAlloced); - } - - commands[numCommands].code = cmd->code; - commands[numCommands].argc = argc; - commands[numCommands].argv = argv; - numCommands++; - } - } - } - - if (oldch) - start = end + 1; - else - start = end; - } - - return 0; -} - -int ksHasCommand(int cmd) { - int i = 0; - - while (i < numCommands) { - if (commands[i].code == cmd) return 1; - i++; - } - - return 0; -} - -int ksGetCommand(int cmd, char ** last, int * argc, char *** argv) { - int i = 0; - - if (last) { - for (i = 0; i < numCommands; i++) { - if (commands[i].argv == last) break; - } - - i++; - } - - while (i < numCommands) { - if (commands[i].code == cmd) { - if (argv) *argv = commands[i].argv; - if (argc) *argc = commands[i].argc; - return 0; - } - i++; - } - - return 1; -} diff --git a/loader/kickstart.h b/loader/kickstart.h deleted file mode 100644 index 856160fc1..000000000 --- a/loader/kickstart.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef H_KICKSTART - -#define KS_CMD_NONE 0 -#define KS_CMD_NFS 1 -#define KS_CMD_CDROM 2 -#define KS_CMD_HD 3 -#define KS_CMD_URL 4 -#define KS_CMD_NETWORK 5 -#define KS_CMD_DEVICE 6 -#define KS_CMD_XDISPLAY 7 -#define KS_CMD_TEXT 8 -#define KS_CMD_DRIVERDISK 9 -#define KS_CMD_DEVICEPROBE 10 -#define KS_CMD_KEYBOARD 11 - -int ksReadCommands(char * cmdFile); -int ksGetCommand(int cmd, char ** last, int * argc, char *** argv); -int ksHasCommand(int cmd); - -#endif diff --git a/loader/kon.cfg b/loader/kon.cfg deleted file mode 100644 index 136c13a9c..000000000 --- a/loader/kon.cfg +++ /dev/null @@ -1,216 +0,0 @@ -################################################## -# -# Configuration file for KON -# -################################################## - -################################################## -# REQUIRED ENTRIES -# -# 1) Normal and Startup entries must be present. -# 2) For VGA and VGAFM type displays, Pels entry -# must be defined *after* Normal entry. -# -################################################## - -# Display definition -# Entry named `Normal' is used as default. -J3100SX:J31:J3100 - J3100SX -Stealth: - VGA - 800 864 1016 1064 600 606 608 632 - 2 - 99 36 -PCI805: - VGA - 800 864 1016 1064 600 606 608 632 - 2 - 99 36 -VGA11: - VGAFM - 3777 - 640 680 768 800 480 491 493 525 - 1 - 79 42 -VGA12: - VGAFM - 3BF7 - 640 680 768 800 480 491 493 525 - 1 - 79 39 -VGA13: - VGAFM - 3FF7 - 640 680 768 800 480 491 493 525 - 1 - 79 35 -VGA14: - VGAFM - 7FF7 - 640 680 768 800 480 491 493 525 - 1 - 79 33 -VGA:Normal - VGA - 640 680 768 800 480 491 493 525 - 1 - 79 29 - -# Pels: Pallette value definition for VGA, VGAFM drivers - -REVPEL: # Values for reverse color - 63 63 63 - 63 63 21 - 63 21 63 - 63 21 21 - 21 63 63 - 21 63 21 - 21 21 63 - 21 21 21 - 42 42 42 - 42 21 0 - 42 0 42 - 42 0 0 - 0 42 42 - 0 42 0 - 0 0 42 - 0 0 0 - -STDPEL: # Standard color - 0 0 0 - 0 0 42 - 0 42 0 - 0 42 42 - 42 0 0 - 42 0 42 - 42 21 0 - 42 42 42 - 21 21 21 - 21 21 63 - 21 63 21 - 21 63 63 - 63 21 21 - 63 21 63 - 63 63 21 - 63 63 63 - -HIPEL: Pels # Hi color - 0 0 0 - 0 0 52 - 0 52 0 - 0 52 52 - 52 0 0 - 52 0 52 - 52 31 0 - 52 52 52 - 31 31 31 - 31 31 63 - 31 63 31 - 31 63 63 - 63 31 31 - 63 31 63 - 63 63 31 - 63 63 63 - -# Startup command definition (usually font loading commands are specified) -minix: - /usr/bin/fld.minix -n /usr/share/fonts/publicfont.ank - /usr/bin/fld.minix -n /usr/share/fonts/publicfont.k14 -fontx: - /usr/bin/fld.fontx -n /dos/lib/font/new/jpnhn16x.fnt - /usr/bin/fld.fontx -n /dos/lib/font/new/jpnzn16x.fnt -minix-zcat: - zcat /usr/share/fonts/publicfont.a.Z | /usr/bin/fld.minix -n - zcat /usr/share/fonts/publicfont.k.Z | /usr/bin/fld.minix -n -fontx-zcat: - zcat /dos/lib/font/jpnhn16x.Z | /usr/bin/fld.fontx -n - zcat /dos/lib/font/jpnzn16x.Z | /usr/bin/fld.fontx -n -minix-gzip:Startup - gzip -d < /usr/share/fonts/pubfont.k.gz | /usr/bin/fld -t minix -n - gzip -d < /usr/share/fonts/pubfont.a.gz | /usr/bin/fld -t minix -n -# /usr/bin/fld -t fontx -n /usr/share/fonts/vga.fnt -# gzip -d < /usr/share/fonts/vga.fnt.gz | /usr/bin/fld.fontx -n - -fontx-gzip: - gzip -d < /dos/lib/font/jpnhn16x.z | /usr/bin/fld.fontx -n - gzip -d < /dos/lib/font/jpnzn16x.z | /usr/bin/fld.fontx -n - -################################# -# OPTIONAL SETUP ENTRIES -################################# - -# Mouse type definition. Choose one of: Microsoft, -# MouseSystems, BusMouse, MMSeries, Logitech, or None. -Mouse: - None -# Mouse baud rate -MouseBaud: - 1200 -# Mouse device file name -MouseDev: - /dev/mouse - -# Use hard scroll -HardScroll: - On - -# Length of beep sound (1/100 sec). -BeepCounter: - 5 - -# Cursor blink interval (1/10 sec). -CursorInterval: - 4 - -# Screen blank time (minutes). -SaveTime: - 600 - -# Use double width cursor on kanji character -KanjiCursor: - On - -# Cursor top raster line (0..15) -CursorTop: - 14 - -# Cursor bottom raster line (CursorTop..15) -CursorBottom: - 15 - -# Vga Font Offset -VgaFontOffset: - 0 - -# Save font data in plane 3 (required for Trident TVGA series) -SavePlane3: - Off - -Mouse3Buttons: - On - -# Coding -# SingleByte DoubleByte 8bitCode -# ISO8895-[123456789], JISX0201.1976-0 -# BIG5.HKU-0, GB2312.1980-1, JISX0208.1983-0, KSC5601.1987-0 -# EUC, SJIS - -ja_JP.ujis:Coding - JISX0201.1976-0 JISX0208.1983-0 EUC - -ja_JP.sjis: - JISX0201.1976-0 JISX0208.1983-0 SJIS - -zh_TW.big5: - ISO8859-1 BIG5.HKU-0 - -zh_CN.ugb: - ISO8859-1 GB2312.1980-0 - -ko_KR.euc: - ISO8859-1 KSC5601.1987-0 - -# Show `No warranty' message -StartupMessage: - On diff --git a/loader/kon2/.config b/loader/kon2/.config deleted file mode 100644 index e9e116669..000000000 --- a/loader/kon2/.config +++ /dev/null @@ -1,20 +0,0 @@ -TOPDIR = -BINDIR = $(TOPDIR)/usr/bin -LIBDIR = $(TOPDIR)/etc -MANDIR = $(TOPDIR)/usr/man/ja_JP.ujis/man1 -CONFIG_NAME = kon.cfg -OPTS = -DCONFIG_NAME=\"$(LIBDIR)/$(CONFIG_NAME)\" -I$(INCDIR) -g -CFLAGS = -O2 -Wall $(OPTS) -LD = gcc $(CFLAGS) -RM = rm -f -INSTALL = install -c -s - -MINI_KON = MINI_KON -HAS_VGA = HAS_VGA -HAS_J31SX = HAS_J31SX -HAS_MOUSE = HAS_MOUSE -FLD_MINIX = FLD_MINIX -FLD_BDF = FLD_BDF -FLD_FONTX2 = FLD_FONTX2 -FLD_J31ROM = FLD_J31ROM -USE_ROMFONT = USE_ROMFONT diff --git a/loader/kon2/Makefile b/loader/kon2/Makefile deleted file mode 100644 index 7a44b408f..000000000 --- a/loader/kon2/Makefile +++ /dev/null @@ -1,67 +0,0 @@ -VERSION = 0.3 - -ifeq (.config,$(wildcard .config)) -include .config -endif - -INCDIR = $(shell pwd)/include -LIB = $(shell pwd)/lib/libgon.a - -MFLAGS = INCDIR=$(INCDIR) LIB=$(LIB) - -CC = $(DIET) gcc -MAKE := $(MAKE) "CC=$(CC)" - -ifdef MINI_KON -SUBDIRS = lib src -else -SUBDIRS = lib src font tools -endif - -all: subdirs - -version: - @expr `cat .VERSION` + 1 > .VERSION - @echo \#define VERSION \"ver.$(VERSION).`cat .VERSION` \(`date +%m/%d`\)\" > include/version.h - -config: - @sh tools/Configure.linux < config.in.linux - -for i in $(SUBDIRS) src/display; do \ - (cd $$i && test -f Makefile.linux && cp Makefile.linux Makefile) ; \ - done - cp Makefile.linux Makefile - -subdirs: - echo $(MFLAGS) - @for i in $(SUBDIRS);\ - do (cd $$i && echo making all in $$i && $(MAKE) $(MFLAGS)) || exit;\ - done - -depend: - @for i in $(SUBDIRS);\ - do (cd $$i && echo building dependencies in $$i && $(MAKE) depend) || exit;\ - done - -clean: - $(RM) -f *~ include/*~ doc/*~ .depend config.out - @for i in $(SUBDIRS);\ - do (cd $$i && echo cleaning all in $$i && $(MAKE) clean);\ - done - -install: makedir instbin - @if [ -f $(LIBDIR)/$(CONFIG_NAME) ]; then\ - mv $(LIBDIR)/$(CONFIG_NAME) $(LIBDIR)/$(CONFIG_NAME)'.org';\ - echo $(LIBDIR)/$(CONFIG_NAME)': file exists ... renamed !!';\ - fi - @install -c $(CONFIG_NAME).linux $(LIBDIR)/${CONFIG_NAME} - install -c doc/kon.1 $(MANDIR) - -makedir: - @sh tools/makedir $(BINDIR) - @sh tools/makedir $(LIBDIR) - @sh tools/makedir $(MANDIR) - -instbin: - @for i in $(SUBDIRS);\ - do (cd $$i && echo installing all in $$i && $(MAKE) install);\ - done diff --git a/loader/kon2/Makefile.FreeBSD b/loader/kon2/Makefile.FreeBSD deleted file mode 100644 index 01dfdb885..000000000 --- a/loader/kon2/Makefile.FreeBSD +++ /dev/null @@ -1,30 +0,0 @@ -# project makefile for kon for FreeBSD -# Tatsumi Hosokawa <hosokawa@jp.FreeBSD.org> - -VERSION= 0.3 - -SUBDIR= lib src/display src font - -.if exists(${.CURDIR}/.config) -.include "${.CURDIR}/.config" -.endif - -CLEANFILES= Makefile config.out .config .VERSION - -version: - @expr `cat .VERSION` + 1 > .VERSION - @echo \#define VERSION \"ver.$(VERSION).`cat .VERSION` \(`date +%m/%d`\)\" > include/version.h - -config: - @sh tools/Configure.FreeBSD < config.in.FreeBSD - -for i in $(SUBDIR); do \ - (cd ${.CURDIR}/$$i && test -f Makefile.FreeBSD && cp Makefile.FreeBSD Makefile) ; \ - done - cp Makefile.FreeBSD Makefile - -install: - (cd ${.CURDIR}/src ; make install) - (cd ${.CURDIR}/font ; make install) - install -g wheel -o root -m 0644 -c kon.cfg.FreeBSD /usr/local/etc/kon.cfg - -.include <bsd.prog.mk> diff --git a/loader/kon2/Makefile.linux b/loader/kon2/Makefile.linux deleted file mode 100644 index 77eb0aa4f..000000000 --- a/loader/kon2/Makefile.linux +++ /dev/null @@ -1,58 +0,0 @@ -VERSION = 0.3 - -ifeq (.config,$(wildcard .config)) -include .config -endif - -ifdef MINI_KON -SUBDIRS = lib src -else -SUBDIRS = lib src font tools -endif - -all: subdirs - -version: - @expr `cat .VERSION` + 1 > .VERSION - @echo \#define VERSION \"ver.$(VERSION).`cat .VERSION` \(`date +%m/%d`\)\" > include/version.h - -config: - @sh tools/Configure.linux < config.in.linux - -for i in $(SUBDIRS) src/display; do \ - (cd $$i && test -f Makefile.linux && cp Makefile.linux Makefile) ; \ - done - cp Makefile.linux Makefile - -subdirs: - @for i in $(SUBDIRS);\ - do (cd $$i && echo making all in $$i && $(MAKE)) || exit;\ - done - -depend: - @for i in $(SUBDIRS);\ - do (cd $$i && echo building dependencies in $$i && $(MAKE) depend) || exit;\ - done - -clean: - $(RM) -f *~ include/*~ doc/*~ .depend .config include/config.h config.out - @for i in $(SUBDIRS);\ - do (cd $$i && echo cleaning all in $$i && $(MAKE) clean);\ - done - -install: makedir instbin - @if [ -f $(LIBDIR)/$(CONFIG_NAME) ]; then\ - mv $(LIBDIR)/$(CONFIG_NAME) $(LIBDIR)/$(CONFIG_NAME)'.org';\ - echo $(LIBDIR)/$(CONFIG_NAME)': file exists ... renamed !!';\ - fi - @install -c $(CONFIG_NAME).linux $(LIBDIR)/${CONFIG_NAME} - install -c doc/kon.1 $(MANDIR) - -makedir: - @sh tools/makedir $(BINDIR) - @sh tools/makedir $(LIBDIR) - @sh tools/makedir $(MANDIR) - -instbin: - @for i in $(SUBDIRS);\ - do (cd $$i && echo installing all in $$i && $(MAKE) install);\ - done diff --git a/loader/kon2/config.in.FreeBSD b/loader/kon2/config.in.FreeBSD deleted file mode 100644 index 9fdcdbbcc..000000000 --- a/loader/kon2/config.in.FreeBSD +++ /dev/null @@ -1,8 +0,0 @@ -Support VGA driver -HAS_VGA y -Install Minix/V font loader -FLD_MINIX y -Install .bdf font loader -FLD_BDF y -Support MOUSE driver -HAS_MOUSE y diff --git a/loader/kon2/config.in.linux b/loader/kon2/config.in.linux deleted file mode 100644 index 830cde46b..000000000 --- a/loader/kon2/config.in.linux +++ /dev/null @@ -1,18 +0,0 @@ -build MINI KON -MINI_KON y -Support VGA driver -HAS_VGA y -Support J31SX driver -HAS_J31SX y -Support MOUSE driver -HAS_MOUSE y -Install Minix/V font loader -FLD_MINIX y -Install $fontx2 font loader -FLD_BDF y -Install .bdf font loader -FLD_FONTX2 y -Install J3100ROM font loader -FLD_J31ROM y -Use ROM font -USE_ROMFONT y diff --git a/loader/kon2/doc/AUTHOR b/loader/kon2/doc/AUTHOR deleted file mode 100644 index ce5bef66d..000000000 --- a/loader/kon2/doc/AUTHOR +++ /dev/null @@ -1,27 +0,0 @@ -frandsen@diku.dk (Tommy Frandsen) - VGA ¥°¥é¥Õ¥£¥Ã¥¯¥é¥¤¥Ö¥é¥ê (vgalib) -nemossan@uitec.ac.jp == nemossan@mix -takamiti@mix - MINIX-V ¥Õ¥©¥ó¥È¤ª¤è¤Ó¤½¤Î¥í¡¼¥À -maebashi@mcs.meitetsu.co.jp -yamamoto@sws.cpd.mei.co.jp - MINIX-V ¥Õ¥©¥ó¥È¥í¡¼¥À -kensyu@rabbit.is.s.u-tokyo.ac.jp - FONTX version 2 ¤Î¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¥í¡¼¥À (fontx2.c) -komeda@ics.es.osaka-u.ac.jp - ¥ª¡¼¥È¥é¥Ã¥×Åù¤Ë´Ø¤¹¤ë¥Ñ¥Ã¥Á -mad@nak.math.keio.ac.jp - ¥Ð¡¼¥Á¥ã¥ë¥³¥ó¥½¡¼¥ëÂбþ (vc.c ¤Î EnterVC,LeavVC,InitVC) - ¥«¡¼¥Í¥ë¥á¥Ã¥»¡¼¥¸¤Îɽ¼¨ (syslogk.c) -obuk@MIX - J3100sx Âбþ -kazu@jl1keo.tama.prug.or.jp - J3100 BOLD Âбþ ROM ¥Õ¥©¥ó¥È¥í¡¼¥À -miura@is.aist-nara.ac.jp(»°±º¶ÖÌé) - PS/2 ¥Þ¥¦¥¹Âбþ -hibara@psrc.isac.co.jp - MONO ¥â¡¼¥ÉÂбþ ------------------------------------------------------------ ·É¾Îά¡¦ºîÀ®»þ´ü½ç -mad@nak.math.keio.ac.jp -manabe@papilio.tutics.tut.ac.jp - ¤½¤Î¾¤Î¥×¥í¥°¥é¥à¡¢Á´ÂΤμè¤ê¤Þ¤È¤á diff --git a/loader/kon2/doc/CHANGES b/loader/kon2/doc/CHANGES deleted file mode 100644 index 012d10abe..000000000 --- a/loader/kon2/doc/CHANGES +++ /dev/null @@ -1,158 +0,0 @@ -92/10/13 0.90 - Âè1²ó¥Æ¥¹¥È¸ø³« -92/10/14 0.90.1 - ¥¹¥¯¥í¡¼¥ë¥¿¥¤¥ß¥ó¥°¤ÎÄ´À°¡Ý¡ä¼ºÇÔ -92/10/15 0.90.2 - NEmacs ¤ËÂбþ¤¹¤ë¤¿¤á¤Ë ESC ¥·¡¼¥±¥ó¥¹¤ò³ÈÄ¥ -92/10/16 0.91 - ¥³¥ó¥½¡¼¥ë°Ê³°¤«¤é¤Îµ¯Æ°¤ò¶Ø»ß - ɸ½à¿§¤È¤·¤ÆÄãµ±Å٤ȹ⵱ÅÙ¤ò¥³¥ó¥Ñ¥¤¥ë¥ª¥×¥·¥ç¥ó¤ÇÁªÂò²Äǽ - ɽ¼¨¤µ¤ì¤Ê¤¤¤â¤Î¤ò½ÐÎϤ·¤Ê¤¤¤è¤¦¤Ë¤·¤Æ1³ä°Ê¾å¹â®²½ - ½ªÎ»¥á¥Ã¥»¡¼¥¸¤òɽ¼¨ - ¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤ò¥½¥±¥Ã¥È¤ò»È¤Ã¤ÆÆɤ߹þ¤àÊý¼°¤ËÊѹ¹ -92/10/18 0.92 - KI ¥³¡¼¥É¤È¤·¤Æ¡¢^[$@ ¤Ë²Ã¤¨¤Æ ^[$B ¤¬»È¤¨¤ë¤è¤¦¤ËÊѹ¹ - uum ¤ËÂбþ¤¹¤ë¤¿¤á¤Ë ESC ¥·¡¼¥±¥ó¥¹¤ò³ÈÄ¥ -0.92.10.24 - ¥Ð¡¼¥¸¥ç¥ó¤Î¤Ä¤±¤«¤¿¤òÊѹ¹(version.h) -0.92.11.01 - ʸ»ú¤ÎÁÞÆþ¡¦ºï½ü¤Ç¤ÎÉÔ¶ñ¹ç¤ò½¤Àµ -0.92.11.06 - ¼Â¸ú¥°¥ë¡¼¥× ID ¤ÎÊѹ¹ -0.93.11.08 - linux/types.h ¤òľÀÜ include ¤¹¤ë¤Î¤ò»ß¤á¤¿ - ¹ÔËö¤Ë²þ¹Ô¥³¡¼¥É¤¬Í褿¾ì¹ç¤Ë¾¡¼ê¤Ë¼¡¤Î¹Ô¤Ë°Ü¤é¤Ê¤¤ -0.95.11.20 - fontx ¤Î 16 ¥É¥Ã¥È¥Õ¥©¥ó¥È¤Î¥í¡¼¥À¤òÄɲà -0.96.11.21 - ÄÌ¿®Êý¼°¤ÎÀ°Íý - ¥½¡¼¥¹¥×¥í¥°¥é¥à¤ÎÀ°Íý - Makefile ¤Ç¥ª¥×¥·¥ç¥ó¤ò»ØÄê (config.h ¤Îºï½ü) - make install ¤Ç¥¤¥ó¥¹¥È¡¼¥ë²Äǽ -0.97.11.23 - Stealth ÈÇ Wide Text ¥â¡¼¥É¥µ¥Ý¡¼¥È(¾¤Î¥Ü¡¼¥É¤ÎÂбþ¤Ï̤³Îǧ) - kon.pal ¤«¤é kon.cfg ¤ËÊѹ¹¡¢¥Ñ¥ì¥Ã¥È¾ðÊó¤Î¾¤Ë VGA ¤Î - CRT À©¸æ¥ì¥¸¥¹¥¿¡¢misc ¥ì¥¸¥¹¥¿¤ª¤è¤Óɽ¼¨¥µ¥¤¥º¤Î¾ðÊó¤ò - ¤³¤³¤«¤éÆÀ¤ë - con80x30 ¤Î¥¨¥ó¥È¥ê¤ò»È¤ï¤º¤Ë¡¢´Ä¶ÊÑ¿ô TERMCAP ¤Ë¥µ¥¤¥º - ¤òÀßÄꤹ¤ë -0.97.11.27 - kensyu@rabbit.is.s.u-tokyo.ac.jp ¤µ¤ó¤Ë¤è¤ê fontx - version 2.X ¤Î¥Õ¥©¥ó¥È¤ËÂбþ - ET4000 ¤Î¥Ü¡¼¥É¤Ç¤â¥Ï¡¼¥É¥¦¥§¥¢¥¹¥¯¥í¡¼¥ë¤¬Àµ¾ï¤ËÆ°ºî¤¹¤ë - ¤³¤È¤¬È½ÌÀ - Linux-0.98PL5 ¤Ç¤Ï bzero(memset) ¤¬Àµ¾ï¤ËÆ°ºî¤·¤Ê¤¤¤Î¤Ç¡¢ - ¥ª¥ê¥¸¥Ê¥ë¤Î bzero2 ¤ò»ÈÍÑ -0.97.11.29 - ¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎÀ°Íý - mem.c ¤ò¥é¥¤¥Ö¥é¥ê¤Ë°ÜÆ° -0.97.12.05 - komeda@ics.osaka-u.ac.jp ¤µ¤ó¥Ñ¥Ã¥Á¤Ë¤è¤ë½¤ÀµÈÇ - ¡¦¥ª¡¼¥È¥é¥Ã¥×¤Î´°Á´²½ - ¡¦ESC[M ESC[L ¤ËÂФ¹¤ë½¤Àµ - ¡¦JIS ¥·¥Õ¥È¥¢¥¦¥È¤È¤·¤Æ ESC(B ¤âǧ¼± - ¡Ýinstall »þ¤Ë set-gid ¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿ - kensyu@rabbit.is.s.u-tokyo.ac.jp ¤µ¤ó¤«¤é ProDesignerIIs - Íѥ쥸¥¹¥¿ÀßÄêÃͤò¤¤¤¿¤À¤¤¤¿ -0.97.4 (12/09) ¸ø³« - ¥Ð¡¼¥¸¥ç¥ó¤ÎÉÕ¤±Êý¤ò¹¹¤ËÊѹ¹ - ¥Õ¥©¥ó¥È¥í¡¼¥À¡¢¥Õ¥©¥ó¥È¤Î»ØÄê¤ò kon.cfg ¤«¤é¤Ç¤¤ë¤è¤¦¤ËÊѹ¹ - ¥«¡¼¥½¥ë¥µ¥¤¥º¤ò¥³¥ó¥Ñ¥¤¥ë»þ¤Ë»ØÄê -0.98.0 (12/27) - mad@nak.math.keio.ac.jp ¤µ¤ó¥Ñ¥Ã¥Á¤Ë¤è¤ê VC ¤ËÂбþ - KON Ëè¤Ë¥½¥±¥Ã¥È¤òºîÀ® - ¥³¥ó¥Õ¥£¥°¥¹¥¯¥ê¥×¥È¤Ë¤è¤ë´Ä¶ÀßÄê -0.98.1 (01/02) - ²¾Áۥƥ¥¹¥È VRAM ¤òÍѤ¤¤ë¤³¤È¤Ë¤è¤ê VC Âбþ¤ò´°Á´²½ - ¿§¿ô¤ò 8 ¿§¤ËÀ©¸Â -0.98.2 (01/04) - Á´³Ñ¥«¡¼¥½¥ë¤ËÂбþ - ¥³¥ó¥Õ¥£¥°¥¹¥¯¥ê¥×¥È¤ÎÊѹ¹ -0.98.3 (01/07) - ¥Þ¥¦¥¹¤Ë¤è¤ë¥«¥Ã¥È¡õ¥Ú¡¼¥¹¥È¤ò¥µ¥Ý¡¼¥È - mad@math.keio.ac.jp ¤µ¤ó¤Î¥Î¡¼¥Ö¥é¥ó¥É ET4000 ¥«¡¼¥ÉÍѥ쥸¥¹¥¿ÀßÄê -0.98.4 (01/11) ¸ø³« - ¥¹¥¯¥ê¡¼¥ó¥»¥¤¥Ð¡¼ - ɬÍפʻþ°Ê³°¤Ï¥Þ¥¦¥¹¥«¡¼¥½¥ë¤òɽ¼¨¤·¤Ê¤¤ - EUC/S-JIS ¤¬ÍøÍѲÄǽ -0.98.5 (01/22) - ¥Ï¡¼¥É¥¦¥§¥¢¥¹¥¯¥í¡¼¥ë¤·¤Æ¤¤¤Æ¤â¥«¥Ã¥È¤Ç¤¤ë¤è¤¦¤Ë½¤Àµ - ²¼Àþ¤¬°ú¤±¤ë¤è¤¦¤Ë½¤Àµ - ¥°¥é¥Õ¥£¥Ã¥¯¥É¥é¥¤¥Ð¤òÆþ¤ìÂؤ¨¤ì¤ë¤è¤¦¤Ë disp.c -> vga.c - font ¤ÎºÆ¥í¡¼¥É»þ¤Ë¤Ï¥á¥â¥ê¤ò realloc ¤¹¤ë - komeda@ics.osaka-u.ac.jp ¤µ¤ó¥Ñ¥Ã¥Á£² - ¡¦ÅÀÌǤ·¤Ê¤¤¥«¡¼¥½¥ë - ¡¦¥ê¥Ð¡¼¥¹¥â¡¼¥É - ¡Ýump ¤Î¹¹¿· - kon.cfg ¤Ç¤Î¥Ñ¥ì¥Ã¥È»ØÄê¤ÎÉü³è - ¥¹¥¿¡¼¥È¥¢¥Ã¥×½èÍý¤ò»ØÄꤷ¡¢¥Õ¥©¥ó¥È¥í¡¼¥É¤â¤½¤³¤Ç¹Ô¤¦ -0.98+ (03/02) - select ¤Ç¤Î signal Âкö - J3100sx Âбþ(obuk@MIX ¤µ¤ó) - syslogd + syslogk ¤Ë¤è¤ê¥«¡¼¥Í¥ë¤«¤é¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨ - °µ½Ì¥Õ¥©¥ó¥ÈÂбþ -0.99 alpha (?????) - Á°ÅÄ¡÷·Ä±þ¤µ¤ó¤Ë¤è¤ë¥½¡¼¥¹¤Î½ñ¤´¹¤¨¤Ê¤É¡¢¤È¤Ë¤«¤¯Âç²þ¤ -0.99.1 alpha (8/18) - ¥·¥§¥¢¡¼¥É¥Õ¥©¥ó¥È¤ÎºÎÍÑ -0.99.1.beta (8/29) - ²¾Áۥƥ¥¹¥È¤Î´Á»ú°Í¸¤òÇÓ½ü - ¤¤¤ï¤æ¤ëȾ³Ñ¥«¥¿¥«¥Ê¤â¥µ¥Ý¡¼¥È - ¥·¥§¥¢¡¼¥É¥Õ¥©¥ó¥È¤ÎºÆ¥í¡¼¥É¤¬²Äǽ -0.99.2 (1/24) - kon.cfg ¤Ç¤Î¥Ó¥Ç¥ª¥â¡¼¥É¤ÎÀßÄê¤ò Xconfig ¥é¥¤¥¯¤Ë - VT ¥¨¥ß¥å¥ì¡¼¥¿¤Î case ʸ¤ò´Ø¿ô¤ËÃÖ¤´¹¤¨ -0.99.3 (1/30) - KON ¤«¤éµ¯Æ°¤·¤¿ KON ¤ò VC ¾å¤ÇÆ°¤«¤¹ -0.99.4a (94/5/9) - ¿¸À¸ìÂбþÈÇ -0.99.4b (94/5/12) - Mule ¤Î "ESC $(0" (Big5) ¤ËÂбþ -0.99.4c (94/5/15) - ??? -0.99.4d (94/7/4) - MONO ¥â¡¼¥É¤Ø¤ÎÂбþ -0.99.4f (95/11/28) - Á¾º¬¤µ¤ó¤Ë¤è¤ë resize Åù¤Î¥Ñ¥Ã¥Á - wrap ¤Þ¤ï¤ê -0.99.4g (96/04/17) - Æ£»Þ(fujieda@jaist.ac.jp)¤µ¤ó¤Î¥Ñ¥Ã¥Á - MAP_FIXED ½¤Àµ -KON2 0.2(96/11/09) - µÈ»³¤µ¤ó¤Ë¤è¤ë¡¢¥ì¥¸¥¹¥¿¤Î¥Ð¥°¥Õ¥£¥Ã¥¯¥¹ -KON2 0.3(97/1/25) hosokawa@jp.FreeBSD.org - ÂÔ˾¤Î FreeBSD ÈǤȤÎÅý¹ç¡ª¡ª -KON2 0.3(97/1/27) manabe@dsl.ics.tut.ac.jp - FreeBSD ÈǤǤâ¥Þ¥¦¥¹Âбþ -KON2 0.3(97/1/28) hosokawa@jp.FreeBSD.org - FreeBSD ¤Ç¤Î kon.cfg, kon ¤Î¥¤¥ó¥¹¥È¡¼¥ë»þ¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó½¤Àµ -KON2 0.3(97/2/06) manabe@dsl.ics.tut.ac.jp - FreeBSD ÈÇ kon.cfg ¤Ç¤Î VGA ¥ì¥¸¥¹¥¿Ãͤò Linux ¤Ç¤âÍøÍÑ -KON2 0.3.1(97/4/7) t93141tk@sfc.keio.ac.jp - VgaFm ¥É¥é¥¤¥Ð¤Ç SegV µ¯¤³¤¹¥Ð¥°¤Î½¤Àµ -KON2 0.3.2(97/6/15) - 1. ¥³¥ó¥Ñ¥¤¥ë¥ª¥×¥·¥ç¥óUSE_ROMFONT¤ÎÄɲà - 2. ´Á»ú¥ß¥Ë¥Õ¥©¥ó¥È¤òºîÀ®¤¹¤ëµ¡Ç½¤ÎÄɲÃ(mkminifont) - 3. ¥³¥ó¥Ñ¥¤¥ë¥ª¥×¥·¥ç¥óMINI_KON¤ÎÄɲáÁfld¤ò»È¤ï¤º¤Ë¥Õ¥©¥ó¥È¤ò¥í¡¼¥É - - USE_ROMFONT¤ò¶¯À©ÀßÄê - - ´Á»ú¥ß¥Ë¥Õ¥©¥ó¥È - 4. 8¥Ó¥Ã¥È¥³¡¼¥É¤Î·ÓÀþ¤¬»È¤¨¤ë¤è¤¦¤Ë½¤Àµ - 5. Mule¾å¤Ç¤ÎÁÞÆþ/ºï½ü¤Ë¤È¤â¤Ê¤¦»ú²½¤±¤Î½¤Àµ -KON2 0.3.3(97/6/16) - 1. MINI_KON¤Ç¤Ï¥½¥±¥Ã¥È¤âSysV IPC¤âÍøÍѤ·¤Ê¤¤ - 2. ¥¹¥Æ¡¼¥¿¥¹¥é¥¤¥ó¤Î¼ÂÁõ(regionÀßÄê¤Ë¤è¤ë»ÃÄê¼ÂÁõ) - 3. TERM=kon¤Ë¤Ê¤ë:termcap/terminfo¥Õ¥¡¥¤¥ë¤òÍÑ°Õ(LinuxÍÑ) -KON2 0.3.4(97/6/19) yosshy@jedi.seg.kobe-u.ac.jp - ¥³¥ó¥Ñ¥¤¥ë»þ¤ÎwarningÍÞÀ© -KON2 0.3.5(97/6/25) akira@isq.rim.or.jp - ¥«¡¼¥½¥ë¤Î¥´¥ß¤¬»Ä¤ë¥Ð¥° -KON2 0.3.6(97/8/7) - 1. MINI_KON¤Ç¤Ïutmp¤òºï½ü(thank you yosshy@jedi.seg.kobe-u.ac.jp) - 2. MINI_KON¤Ç¤ÏTERM=linux¤Ë - 3. termio->termios ¤Ø¤ÎÊѹ¹ -KON2 0.3.7(97/8/18) - 1. ESC[10m¤ÇCS_LEFT¤Ë°Ü¤ë¤Î¤ÏCS_GRAPH¤Î»þ¤À¤± - (thank you kikutani@jdc.ericsson.se) -KON2 0.3.8(98/3/9) - 1. single user mode¤Ç¤âÀµ¾ï¤ËÆ°ºî¤¹¤ë¤è¤¦¤Ë - diff --git a/loader/kon2/doc/INSTALL.ENG b/loader/kon2/doc/INSTALL.ENG deleted file mode 100644 index 282d4148d..000000000 --- a/loader/kon2/doc/INSTALL.ENG +++ /dev/null @@ -1,315 +0,0 @@ -1. Setting your environment by "make config" -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -"make config" is necessary to let the Makefile know your environment. -Type in "make config" at a prompt and you will be asked as follows: - - $ make config - KON Kanji ON Linux console - Binary Directory [/usr/local/bin]? - -The characters between the brackets are the default settings. If you -hit ENTER key without typing in anything, you are accepting the -setting. When you execute "make config" for the first time or after -"make clean", authors' specifications will be shown between the -brackets. Otherwise, you will see the settings you specified last -time. - -The followings are the questions asked in the "make config" routine. -If you do not like the default settings, you must input your -specifications. - - Binary Directory - Specify a directory for installing "kon" and other tools. - - Library Directory - Specify a directory for installing "kon.cfg" file. - - Support VGA driver - Use VGA screen mode to display Japanese characters. - - Support J31SX driver - Use J3100SX (DCGA?) screen to display Japanese characters. - - Support MOUSE driver - Link the mouse driver with the "kon" program and use mouse under - Japanese screen mode. - - Support Minix/V font loader - Install the Minix/V font loader (fld.minix) to "Binary Directory" - you specified in the second question. - - Install $fontx1 font loader - Install the $fontx1 font loader (fld.fontx) to "Binary Directory" - you specified in the second question. You can not answer "y" here - if you want to install $fontx2 font loader. - - Install $fontx2 font loader - Install the $fontx2 font loader (fld.fontx) to "Binary Directory" - you specified in the second question. You can not answer "y" here - if you want to install $fontx1 font loader. - - Install J3100ROM font loader - Install the font loader for J3100SX ROM fonts (fld.j31rom). - - Install new "syslogk" - Install "syslogk" into /etc directory. - - -2. Running "make" to compile kon for your system -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -After finishing the "make config" procedure, you can start compiling -the program by running "make". If the program is generated without -any trouble, try to install the program by running "make install" with -the root privilege. - -In the "make install" procedure, the install program tries to copy the -"kon.cfg" file to the directory you designated in the "make config" -questions. If your old "kon.cfg" is already in the directory, the -install program renames the old one into "kon.cfg.org" and copies the -new "kon.cfg" file to the directory. - -"make instbin" installs binary files only and does not install the -"kon.cfg" file. Please make sure to install the new "kon.cfg" file by -running "make install" because the content of the "kon.cfg" file has -been changed since the last version. - - -3. Configuring the "kon.cfg" file -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -"KON" reads the "kon.cfg" file at the time of execution. -The rule of writing entries in the "kon.cfg" file is: - - entry:[alias 1:alias 2:...] - the items for the entry - -KON is not case-sensitive about the entry names. Each line that -contains the items must begin with a TAB character. If a line begins -with a '#' sign, the line is considered as a comment and KON ignores it. - -You can specify the following types of items under a entry: - - boolean - on/off - choice - choose one from the lists - numeric - write decimal values - string - type in characters in special formats - -** ATTENTION ** -You must write the first two items (i.e., NORMAL and STARTUP) in your -"kon.cfg" file. - -============================================================================== -NORMAL (string type) - -Choose one of the video drivers (such as Stealth, ProIIs, VGA9), whose -first items are as follows: - - VGA - VGA, SVGA, EGA video driver - VGAFM - VGA, SVGA, EGA video driver with the font modification - feature (see below) - J3100SX - TOSHIBA J3100SX video driver - -Then write "Normal" as the alias of the name of your video driver. - -Numbers that follow the first item are the value of VGA registers, the -screen size (dots), the number of columns, and the number of lines. -You can modify the number of characters displayed on screen by -changing these values. However, except the standard VGA resolution -(640x480), the relations between the values of VGA registers and the -number of characters displayed on screen vary depending on each video -card. The standard VGA entry is defined as NORMAL in the original -"kon.cfg". - -If you are fortunate enough, your video card's configuration is -already in the "kon.cfg" file; just type in "NORMAL" following the -entry and you may be able to use high-resolution Japanese screen. In -that case, don't forget to delete "NORMAL" from "VGA" entry. - -When you create entries, whose type is either "VGA" or "VGAFM", for your -video card, you must also write: - - the values of VGA registers - the numbers of horizontal and vertical dots - the numbers of columns and lines - -The values of VGA registers can be retrieved from your video card by -using "vacuum.exe" in the "tools" directory; the program is for DOS. -See "tools/README" for details. - -============================================================================== -STARTUP (string type) - -The commands you want to run in the startup process are specified -here. The number of commands written in this section is arbitrary. - -It is necessary to write a command that loads ZENKAKU fonts. Loading -HANKAKU fonts is optional. Examples follow: - -to use fontx's fonts: - /usr/local/bin/fld.fontx /dos/lib/font/jpnhn16x.fnt - /usr/local/bin/fld.fontx /dos/lib/font/jpnzn16x.fnt - -to use MINIX's fonts: - /usr/local/bin/fld.minix /usr/lib/fonts/publicfont.ank - /usr/local/bin/fld.minix /usr/lib/fonts/publicfont.k14 - - -to use compressed font files: - zcat /dos/lib/font/jpnhn16x.fnt.Z | /usr/local/bin/fld.fontx - zcat /dos/lib/font/jpnzn16x.fnt.Z | /usr/local/bin/fld.fontx - -or - zcat /usr/lib/fonts/publicfont.ank.Z | /usr/local/bin/fld.minix - zcat /usr/lib/fonts/publicfont.k14.Z | /usr/local/bin/fld.minix - -============================================================================== -PELS (string type) - -"PELS" defines color palettes. This entry is necessary when you -choose one of VGA or VGAFM video drivers. There must be 16 lines -under this entry, and each line contains 3 decimal values for Red, -Green, and Blue. - -There are "STDPEL" and "REVPEL" entries in the standard "kon.cfg" -file. STDPEL stands for standard palette, and REVPEL stands for -reverse palette. Define PELS as an alias for either STDPEL or -REVPEL. -============================================================================== -MOUSE (choice type) - -Select one of the mouse drivers from the following: - - Microsoft, MouseSystems, BusMouse, - MMSeries, Logitech, None - -If the Logitech driver does not work with your Logitech mouse, please -try Microsoft. -============================================================================== -MouseBaud (choice type) - -Specify the baud rate for your serial mouse. Choose one of the following: - - 1200, 2400, 4800, 9600 - -1200 is the default setting. This is effective when your mouse driver is -one of the following: - - Microsoft, MouseSystems, MMSeries, Logitech - -============================================================================== -MouseDev (string type) - -Specify the device name of your mouse. This entry is effective when -you choose an item other than NONE for the MOUSE entry. -============================================================================== -HardScroll (boolean type) - -Specify whethter to use hardware scroll. The default is ON. -This is effective on VGA, VGAFM, and J31SX. -============================================================================== -VgaFontOffset (numeric type) - -Specify the offset address when loading VGA fonts. If '1' is given here -the fonts will appear one dot higher than usual. The default is 0. -============================================================================== -BeepCounter (numeric type) - -Specify the length of beep by 1/100 seconds. The default is 5. -============================================================================== -CursorInterval (numeric type) - -Specify the interval time of cursor blinking by 1/10 second. -the default is 5. If you do not want the cursor to blink, -choose 0 (zero). -============================================================================== -SaveTime (numeric type) - -Specify the length of time before the screen saver start working. -The default is 4. - -** ATTENTION ** -The screen saver does not work if you choose not to blink the cursor, -because KON times the length by counting the number of blinking. -============================================================================== -KanjiCursor (boolean type) - -When KanjiCursor is ON, the width of the cursor becomes ZENKAKU size. -The default is ON. -============================================================================== -CursorTop, CursorBottom -(numeric type : for VGA and VGAFM drivers.) - -Specify the size of the cursor. - - 0 +--------+ - | | - |--------| <-- CursorTop - |********| - |********| - |********| - |********| - |********| - 15 +--------+ <-- CursorBottom - -============================================================================== -BoxCursor (boolean type : for the J3100SX driver) - -When BoxCursor is ON, the cursor's shape is a box. -============================================================================== -SavePlane3 (boolean type : for VGA and VGAFM drivers) - -When SavePlane3 is ON, KON saves the font data that are in -the third page of VGA. The default is OFF. This item is -not necessary if you do not use Trident video cards. -============================================================================== -SjisKanji (boolean type) - -When SjisKanji is on, KON uses Shift-JIS code instead of EUC for its -second kanji code. The default is OFF (using EUC for the second kanji -code.) -============================================================================== -StartupMessage (boolean type) - -When StartupMessage is ON, KON displays the greeting messages -in the startup procedure. The default is ON. -============================================================================== - - -4. The Font Modification Function -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The hight of KON's fonts are 16 dots by default, but the VGAFM driver -can make the fonts smaller by reducing the hight of a character to -less than 16 dots. (The original idea is credited to Mr. Matsui Takao -: mat@tansei.cc.u-tokyo.ac.jp) - -The VGAFM driver calculates the hight (lines) of a character from the -number of dots in the NORMAL entry and the number of lines. Then the -driver displays characters by reducing the hight of a character if -necessary. - -By using MINIX's public fonts, the VGAFM driver can create fonts that -are fairly readable. In this case, the number of lines on a screen -increases by 30 percent. 480-dot screen can have 40 lines, and -600-dot screen can have 50 lines. This function may be particularly -useful for notebook computers. - - -5. Other information about the "kon.cfg" file -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If there are several entries that have the same name, the first -entry will be effective. - -If an entry has an illegal name, the entry will be ignored. - -The maximum number of characters in a line is 255. - -An entry can have a maximum of 1023 bytes of characters. -_____________________ - -If there are any questions regarding this translation, please send -messages to: - - NBB02702 (NIFTY-Serve) - 72111,2702 (CompuServe) - -or respective Internet addresses. - Nakagome Tomoyuki diff --git a/loader/kon2/doc/MODULE b/loader/kon2/doc/MODULE deleted file mode 100644 index 973c0c64d..000000000 --- a/loader/kon2/doc/MODULE +++ /dev/null @@ -1,39 +0,0 @@ -³Æ¥â¥¸¥å¡¼¥ë¤Î´Ø·¸ - -¤¿¤À¤·¡¢´°Á´¤Ë³¬ÁؤËʬ¤«¤ì¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¯¡¢³¬ÁؤòÈô¤Ð¤·¤Æ¸Æ¤Ó½Ð¤¹¤³ -¤È¤â¤¢¤ê¤Þ¤¹¡£ - -main - ¥á¥¤¥ó - term - ¥Þ¥ë¥Á¥×¥ì¥¯¥µ - utmp - utmp ÀßÄê - sock - socket ÄÌ¿® - fnld - ¥Õ¥©¥ó¥È¥í¡¼¥À - child - ¥¹¥¿¡¼¥È¥¢¥Ã¥×¥³¥Þ¥ó¥É¼Â¹Ô¡¢¥·¥§¥ëµ¯Æ° - mouse - ¥Þ¥¦¥¹¥É¥é¥¤¥Ð - vt - vt ¥¨¥ß¥å¥ì¡¼¥¿ - vc - ¥³¥ó¥½¡¼¥ë¥É¥é¥¤¥Ð - vga - cga - j31sx - errors - ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸É½¼¨¥æ¡¼¥Æ¥£¥ê¥Æ¥£ - - -½é´ü²½¤Î¥¹¥Æ¥Ã¥×¤Ë¤Ä¤¤¤Æ¡£ - -³Æ¥â¥¸¥å¡¼¥ë¤Î½é´ü²½¤Ï°ìÈ̤˼¡¤Î3¤Ä¤Î¥¹¥Æ¥Ã¥×¤Ç¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£ - -1. Init ÀßÄê¥Õ¥¡¥¤¥ë¤òÆɤà½àÈ÷ - kon.cfg ¤Î¥¨¥ó¥È¥ê¤ò²òÀϤ¹¤ë call back ´Ø¿ô¤òÀßÄꤷ¤Þ¤¹¡£ - -2. Config ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß - kon.cfg ¤òÆɤ߹þ¤ßÃæ¤Ë¡¢1 ¤ÇÀßÄꤷ¤¿ call back ´Ø¿ô¤¬¸Æ¤Ó½Ð¤µ¤ì¤Þ¤¹¡£ - kon.cfg ¤ÎÆâÍƤˤè¤Ã¤ÆÊÑ¿ô¤ÎÀßÄê¤ò¹Ô¤Ê¤¤¡¢É¬Íפʤé¤ÐÄɲäΠcall - back ´Ø¿ô¤òÀßÄꤷ¤Þ¤¹¡£ - -3. Start ½é´ü²½ - ÀßÄꤷ½ª¤Ã¤¿ÊÑ¿ô¤ÎÃͤ˱þ¤¸¤Æ½é´ü²½¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£ - -4. Cleanup ²òÊü - ºÆ½é´ü²½¤ÎÁ°¤Ë¡¢Cleanup ¥ë¡¼¥Á¥ó¤¬¸Æ¤Ð¤ì¤Þ¤¹¡£ ¤³¤³¤Ç¤Ï¡¢³ÎÊݤ·¤¿»ñ - ¸» (¥á¥â¥ê, ¥Õ¥¡¥¤¥ë, IO permission, capability ɽ¤Î¥¨¥ó¥È¥ê) ¤ò²ò - Êü¤·¤Þ¤¹¡£ diff --git a/loader/kon2/doc/QINSTALL.ENG b/loader/kon2/doc/QINSTALL.ENG deleted file mode 100644 index 9442cb8e3..000000000 --- a/loader/kon2/doc/QINSTALL.ENG +++ /dev/null @@ -1,26 +0,0 @@ -For those of you who do not have patience to read through the -instructions in the "install.eng" file, here is the brief installing -procedure. - -1. "make clean" - deletes backup files. This is not necessary for the first install. - -2. "make config" - determines your environment and prepares for compiling KON. - -3. "make depend" - creates the dependency files for compiling KON. - -4. "make" - creates KON. - -5. "make install" - installs several files including the KON program. - Do this with the root privilege. - -6. "kon" - runs the program. - -And you should be able to display Japanese characters on screen. I -recommend that, at first, you use standard VGA screen (640x480 dots) -to run KON. Good luck! diff --git a/loader/kon2/doc/README b/loader/kon2/doc/README deleted file mode 100644 index bf846838c..000000000 --- a/loader/kon2/doc/README +++ /dev/null @@ -1,65 +0,0 @@ - £Ë£Ï£Î ----- Kanji ON Linux console ----- - - - KON ¤Ï Linux ¤Î¥³¥ó¥½¡¼¥ë²èÌ̾å¤Ç´Á»ú¤òɽ¼¨¤¹¤ë¤¿¤á¤Î¥×¥í¥°¥é¥à¤Ç¤¹¡£ -ɽ¼¨Êý¼°¤Ï DOS/V, minix-V, 386BSD KanjiHand ¤È(¶²¤é¤¯)Ʊ¤¸¤Ç¤¹¤¬¡¢ -minix-V ¤ä KanjiHand ¤È°Û¤Ê¤ëÅÀ¤¬°ì¤Ä¤¢¤ê¤Þ¤¹¡£KON ¤Ç¤Ïµ¿»÷üËö¤ò»È¤Ã -¤Æ¥³¥ó¥½¡¼¥ë½ÐÎϤò¥Õ¥Ã¥¯¤·¡¢VGA ¤ËŸ³«¤·¤Æ¤¤¤Þ¤¹¡£¤·¤¿¤¬¤Ã¤Æ¥«¡¼¥Í¥ë -¥½¡¼¥¹¤Ë¥Ñ¥Ã¥Á¤òÅö¤Æ¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¤¬¡¢minix-V ¤ä KanjiHand ¤Î¤è¤¦ -¤Ê³ÈÄ¥µ¡Ç½¤Ï´üÂԤǤ¤Þ¤»¤ó¡£ - -¡ü µ¡Ç½¤ÈÀ©¸Â - -¡¦ ¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤È¤·¤Æ minix-V ¤Î publicfont ¤ª¤è¤Ó fontx1 ¤Î 16 ¥É - ¥Ã¥È¥Õ¥©¥ó¥È¤ò»È¤ï¤»¤Æ¤¤¤¿¤À¤¤¤Æ¤Þ¤¹¡£publicfont ¤Ï X11R5 ¤Ç»È¤ï¤ì - ¤Æ¤¤¤ë k14.bdf ¤Ê¤É¤ò minix-V ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤·¤¿¤â¤Î¤Ç¤¹¤Î¤Ç - minix-V ¤Î¥Õ¥©¥ó¥È¥Ñ¥Ã¥±¡¼¥¸¤«¤éÆþ¼ê¤·¤Æ²¼¤µ¤¤¡£fontx1 ¥Õ¥©¥ó¥È¤Î¾ì - ¹ç¤âÆâÉôŪ¤Ë¤Ï¡¢minix-V ¤Î¥Õ¥©¥ó¥È¹½Â¤¤Ç°·¤Ã¤Æ¤¤¤Þ¤¹¡£ - -¡¦ fontx1 ¤Ë³¤¤¤Æ¡¢fontx2 ¤Î¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤Ë¤âÂбþ¤·¤Þ¤·¤¿¡£ - kensyu@rabbit.is.s.u-tokyo.ac.jp ¤µ¤óºî¤Ç¤¹¡£ - -¡¦ pty ¤ò»È¤Ã¤Æ½ÐÎϤò¥Õ¥Ã¥¯¤·¡¢VGA ¤Ç¥Æ¥¥¹¥È²èÌ̤ò¥¨¥ß¥å¥ì¡¼¥È¤·¤Æ - ¤¤¤Þ¤¹¡£ - -¡¦ obuk@MIX ¤µ¤ó¤Ë¤è¤ê¡¢J3100sx ¤Ç¤âÍøÍѤǤ¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£ - -¡¦ JIS/{EUC|SJIS} ¤ËÂбþ¤·¤Æ¤ª¤ê¤Þ¤¹¡£ - -¡¦ ¥Õ¥©¥¢¥°¥é¥ó¥É¡¢¥Ð¥Ã¥¯¥°¥é¥ó¥É¤½¤ì¤¾¤ì£¸¿§¥«¥é¡¼¤Çȿž¡¢²¼Àþ¤Î°À - ɽ¼¨¤¬¤Ç¤¤Þ¤¹¡£ - -¡¦ ¥½¥±¥Ã¥È¤òÄ̤·¤Æ¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤ÈÄÌ¿®¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ - (¸½¾õ¤Ç¤Ï¥Õ¥©¥ó¥È¥í¡¼¥É¤Î¤ß¥µ¥Ý¡¼¥È) - -¡¦ ¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó 0.99PL1 °Ê¹ß¤ÇÍøÍѤ¹¤ë¤³¤È¤Ë¤è¤ê¡¢¥Ð¡¼¥Á¥ã¥ë¥³¥ó - ¥½¡¼¥ë¤ËÂбþ¤·¤Þ¤¹¡£ - -¡¦ ¥Þ¥¦¥¹¤Ë¤è¤ë¥«¥Ã¥È¡õ¥Ú¡¼¥¹¥Èµ¡Ç½¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤·¤¿¡£¥Þ¥¦¥¹¥«¡¼¥½¥ë¤Ï - ¥Þ¥¦¥¹¤òÆ°¤«¤¹¤Èɽ¼¨¤µ¤ì¤Þ¤¹¡£°ìöɽ¼¨¤µ¤ì¤Æ¥«¡¼¥½¥ë¤¬£±£°²óÅÀÌǤ¹¤ë¤È - ¾Ã¤¨¤Þ¤¹¡£ - -¡¦ ¥«¡¼¥Í¥ë¤«¤é¥³¥ó¥½¡¼¥ë¤Ø¤Î¥á¥Ã¥»¡¼¥¸¤ò KON ¤Çɽ¼¨¤Ç¤¤ë¤è¤¦¤Ë - ¤Ê¤ê¤Þ¤·¤¿¡£ - -¡Ý more ¤Ê¤É¤Î¥Ä¡¼¥ë¤Ï£¸¥Ó¥Ã¥È¥¯¥ê¡¼¥ó¤ÊÀ߷פˤʤäƤޤ¹¤¬¡¢JIS ¤Î¥¨¥¹ - ¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤òÍý²ò¤¹¤ë¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£¤·¤¿¤¬¤Ã¤Æ¡¢JIS ¥³¡¼¥É¤Î - ¥Æ¥¥¹¥È¤ò more ¤·¤¿¤ê¤¹¤ë¤È»ú¤¬²½¤±¤Þ¤¹¡£ - -¡ü ¥×¥í¥°¥é¥à¡¢¥Ð¥°¤Ë¤Ä¤¤¤Æ - - KON ¤Î¥½¡¼¥¹¥×¥í¥°¥é¥à¤Ë´Ø¤·¤Æ»ä¸Ä¿Í¤È¤·¤Æ¤Ï¤¤¤«¤Ê¤ëÉôʬ¤Ë¤â¤É¤ó¤Ê¸¢Íø¤â -¼çÄ¥¤¹¤ë¤Ä¤â¤ê¤Ï¤¢¤ê¤Þ¤»¤ó(Êü´þ¤¹¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¤½¤¦¤Ç¤¹¤¬)¡£¤·¤¿¤¬¤Ã¤Æ¡¢ -Êѹ¹¡¦ÇÛÉۤϼ«Í³¤Ë¹Ô¤Ã¤Æ¤¤¤¿¤À¤¤¤Æ·ë¹½¤Ç¤¹¡£¤¿¤À¡¢¥Ð¥°¥Õ¥£¥Ã¥¯¥¹Åù¤Î²þÁ±¤Ï -¼è¤ê¤Þ¤È¤á¤¿¤¤¤Î¤Çºî¼Ô¤Þ¤ÇÁ÷¤Ã¤Æ¤¤¤¿¤À¤±¤ì¤Ð¹¬¤¤¤Ç¤¹¡£ - ¤Þ¤¿¡¢KON ¤ò»È¤Ã¤Æ¥Ï¡¼¥É¥¦¥§¥¢¤ä¾¤Î¥½¥Õ¥È¥¦¥§¥¢¤ËÌäÂ꤬ȯÀ¸¤·¤Æ¤âÀÕǤ¤ò -¤È¤ë¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£ - ¥Ð¥°¤ä°Õ¸«¤Ê¤É¤¬¤¢¤ê¤Þ¤·¤¿¤é°Ê²¼¤Î¥¢¥É¥ì¥¹¤Ë¥á¥¤¥ë¤ò²¼¤µ¤¤¡£ - - E-Mail: manabe@papilio.tutics.tut.ac.jp. - PC-VAN: FFE91293 - - ¸½ºß¤ï¤«¤Ã¤Æ¤¤¤ë¥Ð¥°¤Ï¡¢ -¡¦ £Ø¤òÍøÍѤǤ¤Ê¤¤¡£ -¡¦ KON ½ªÎ»»þ¤Ë¥Æ¥¥¹¥È¤¬Ìá¤é¤Ê¤¤»þ¤¬¤¢¤ë¡£ -¤Ç¤¹¡£ diff --git a/loader/kon2/doc/README.FreeBSD b/loader/kon2/doc/README.FreeBSD deleted file mode 100644 index 2cbbcecb5..000000000 --- a/loader/kon2/doc/README.FreeBSD +++ /dev/null @@ -1,89 +0,0 @@ -KON2 for Linux/FreeBSD ¤Ï¡¢¤Û¤½¤«¤ï¤¿¤Ä¤ß <hosokawa@jp.FreeBSD.org> ¤¬ -FreeBSD Âбþºî¶È¤ò¹Ô¤Ê¤¤¤Þ¤·¤¿¡£ºî¶È¤Ï¼ç¤Ë¡¢½¾Íè¤Î kon-0.99.4e (²¼¤Î¥É -¥¥å¥á¥ó¥È¤ò»²¾È) ¤Î¥Ñ¥Ã¥Á¤Î¼è¤ê¹þ¤ß¡¢GNU make ¤«¤é FreeBSD make ¤Ø¤Î -Makefile ¤Î½¤Àµ¡¢FreeBSD ÍѥѥåÁ¤òÅö¤Æ¤¿¸å¤Ç Linux ¤Ç¥³¥ó¥Ñ¥¤¥ë¤¬¤¦¤Þ -¤¯¤¤¤«¤Ê¤¤Éôʬ¤Î½¤Àµ¤Ê¤É¤ò¹Ô¤Ê¤¤¤Þ¤·¤¿¡£ - -make ¤¹¤ë¤Ë¤Ï¡¢ - -# tar xvfz kon2-0.1.tar.gz -# cd kon2-0.1 -# make -f Makefile.FreeBSD - (¼ÁÌä¤Ë¤Ï¤¹¤Ù¤Æ [Enter] ¤ÇÂç¾æÉפǤ¹) -# make -# make install - -¤Î¼ê½ç¤Ç¹Ô¤Ê¤Ã¤Æ²¼¤µ¤¤¡£ - -¤Û¤½¤«¤ï ¤¿¤Ä¤ß <hosokawa@jp.FreeBSD.org> - - - -kon-0.99.4 ¤ËÂФ¹¤ë FreeBSD ÍÑ°Ü¿¢¤Ë¤Ä¤¤¤Æ¤Ï°Ê²¼¤Îʸ¾Ï¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£ - ----------------------------------------------------------------------------- - - KON for FreeBSD ver 0.1 - - 1995-06-04 - ¾®ÁÒ µ® - <ogura@st.rim.or.jp> - - ¤Ï¤¸¤á¤Ë kon for FreeBSD ¤Ï¡¢linux ¤ÎÆüËܸ쥳¥ó¥½¡¼¥ë¤Ç¤¢¤ë kon-0.99.4e -¤È kon for NetBSD(NetBSD-0.9 ¤¬¥ê¥ê¡¼¥¹¤µ¤ì¤¿Åö»þ¤Ë°Ü¿¢¤µ¤ì¤¿¤â¤Î)¤ò¥Ù¡¼¥¹ -¤Ë°Ü¿¢¤·¤¿¤â¤Î¤Ç¤¹¡£ - - ÆÃħ¤È¤·¤Æ¡¢¥·¥§¥¢¡¼¥É¥á¥â¥ê¤Ë¥Õ¥©¥ó¥È¤Î¾ðÊó¤òÃÖ¤¯¤Î¤Ç¿¤¯¤Î²¾ÁÛ¥³¥ó¥½¡¼ -¥ë¾å¤Ç kon ¤òµ¯Æ°¤·¤Æ¤â¥á¥â¥ê¤ò¿¤¯»ÈÍѤ·¤Ê¤¤¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤Þ¤¿¡¢ºî¼Ô¤Î -¼êÈ´¤¡¢µ»½ÑÎϤÎÄ㤵¤«¤é¥ª¥ê¥¸¥Ê¥ë¤Î kon-0.99.4e ¤è¤ê¿¤¯¤Îµ¡Ç½¤¬ºï½ü¤µ¤ì -¤Æ¤¤¤Þ¤¹¡£Âбþ¤·¤Æ¤¤¤Ê¤¤µ¡Ç½¤Ë¤Ä¤¤¤Æ¤ÏÁªÂò¤Ç¤¤Ê¤¤ÍѤˤ·¤Æ¤¤¤Þ¤¹¡£ - - -¥¤¥ó¥¹¥È¡¼¥ë¤Î»ÅÊý - - 1.1 ¥«¡¼¥Í¥ë¤Ë¥·¥§¥¢¡¼¥É¥á¥â¥ê¤òÀßÄꤹ¤ë¡£/usr/src/sys/i386/conf/GENERIC - ¥Õ¥¡¥¤¥ë¤Ë"options SYSVSHM"¤Î¹Ô¤òÄɲø塢 - config GENERIC;cd ../../compile/GENERIC - make depend;make all;cp kernel / - ¤Ê¤É¤ò¼Â¹Ô¤·¤Æ¥ê¥Ö¡¼¥È¤·¤Æ¤¯¤À¤µ¤¤¡£ - - 1.2 ¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç make config ¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£VGA ¤Ïɬ¤º[y]¤Ë - ¤·¤Æ¤¯¤À¤µ¤¤¡£¥Õ¥©¥ó¥È¤ÎÁªÂò¤Ï¤É¤ì¤«°ì¤Ä¤Ïɬ¤º[y]¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£ - - 1.3 .config ¥Õ¥¡¥¤¥ë¤ò¼Â¹Ô¥â¥¸¥å¡¼¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ä¡¢ - kon.cfg / man ¥Õ¥¡¥¤¥ë¤Î³ÊǼÀè¤Ê¤É¤òÊѹ¹¤·¤Æ¤¯¤À¤µ¤¤¡£¥Ç¥Õ¥©¥ë¥È¤Ç - ¤Ï°Ê²¼¤ÎÍѤˤʤäƤ¤¤Þ¤¹¡£ - /usr/local/bin ¼Â¹Ô¥â¥¸¥å¡¼¥ë³ÊǼÀè - /usr/local/etc kon.cfg ¥Õ¥¡¥¤¥ë³ÊǼÀè - /usr/local/man/ja_JP.EUC/man1 man ¥Õ¥¡¥¤¥ë³ÊǼÀè - - 1.4 kon.cfg ¥Õ¥¡¥¤¥ë¤ò¥Õ¥©¥ó¥È¤Ë¤¢¤ï¤»¤ÆÊѹ¹¤·¤Æ¤¯¤À¤µ¤¤¡£µ½ÒÊýË¡¤Ê - ¤É¤Ï doc °Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ò»²¹Í¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£»ÈÍѤ¹¤ë¥Õ¥©¥ó¥È¤Ï - ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï linux ¤ÎÆüËܸì¥Ñ¥Ã¥±¡¼¥¸¤Ç¤¢¤ë JE ¤Î publicfont - ¤Î k14 ¤È ank ¥Õ¥©¥ó¥È¤ò gzip ·Á¼°¤Ç /usr/share/fonts °Ê²¼¤Ë³ÊǼ - ¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ - - 1.5 make;make install ¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£ - - -¥È¥é¥Ö¥ë¥·¥å¡¼¥Æ¥£¥ó¥° - - kon ¤¬¤¦¤Þ¤¯µ¯Æ°¤·¤Ê¤¤»þ¤Ë¤Ï¡¢¥·¥§¥¢¡¼¥É¥á¥â¥ê¤¬ÍøÍѤǤ¤ë¤«³Î - ǧ¤·¤Æ¤¯¤À¤µ¤¤¡£ ¤Þ¤¿¡¢²èÌ̤¬¿¿¤Ã°Å¤Ç¤â¤Û¤È¤ó¤É¤Î¾ì¹ç¥Ï¥ó¥°¤Ï¤· - ¤Æ¤¤¤Þ¤»¤ó¤«¤é"exit" ¤ä "CTRL+D"¡¢"CTRL+C" ¤Ê¤É¤Ç kon ¤ò½ªÎ»¤µ¤» - "vidcontrol VGA_80x30"¤ò¼Â¹Ô¤·¤Æ¸«¤Æ¤¯¤À¤µ¤¤¡£¤Þ¤¿¡¢XFree86-3.1 - ¤È¤Û¤ÜƱ¤¸ÊýË¡¤Ç¥³¥ó¥½¡¼¥ë¾å¤Ëʸ»ú¤òɽ¼¨¤·¤Æ¤¤¤ë¤Î¤Ç£Ø¤¬ÍøÍѤǤ - ¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£ - - - ËÜ¥½¥Õ¥È¥¦¥§¥¢(kon for FreeBSD)¤Ï¥Õ¥ê¡¼¥½¥Õ¥È¥¦¥§¥¢¤Ç¤¢¤ê¡¢Êѹ¹¡¦ÇÛÉÛ¤Ï -¼«Í³¤Ë¹Ô¤Ã¤Æ¤¤¤¿¤À¤¤¤Æ·ë¹½¤Ç¤¹¡£¤¿¤À¡¢¥Ð¥°¤ä´¶Áۤʤɤò»ä°¸¤Ë¥á¡¼¥ë¤Ç¤â¤· -¤Æ¤¤¤¿¤À¤±¤ì¤Ð¹¬¤¤¤Ç¤¹¡£ - ¤Þ¤¿¡¢kon for FreeBSD ¤ò»È¤Ã¤Æ¥Ï¡¼¥É¥¦¥§¥¢¤ä¾¤Î¥½¥Õ¥È¥¦¥§¥¢¤ËÌäÂ꤬ȯÀ¸ -¤·¤Æ¤âÀÕǤ¤ò¤È¤ë¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£ - - ºÇ¸å¤Ë¡¢kon ¤Îºî¼Ô¤Ç¤¢¤ë¿¿Æ餵¤ó<manabe@papilio.tutics.tut.ac.jp>¤È -kon for NetBSD ¤Îºî¼Ô¤Ç¤¢¤ë±»ô¤µ¤ó<ukai@hplj.hpl.hp.com>¡¢¥Æ¥¹¥È¤Ë¶¨ÎϤ· -¤Æ¤¯¤À¤µ¤Ã¤¿³§ÍÍ¡¢¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£ - - ¾®ÁÒ µ®<ogura@st.rim.or.jp> diff --git a/loader/kon2/doc/THANKS b/loader/kon2/doc/THANKS deleted file mode 100644 index 6cda91a9f..000000000 --- a/loader/kon2/doc/THANKS +++ /dev/null @@ -1,29 +0,0 @@ - KON ¤Ï¾¤Î¥×¥í¥°¥é¥à¤Î¥³¡¼¥É¤ò¤«¤Ê¤ê´Þ¤ó¤Ç¤¤¤Þ¤¹¡£¤³¤Î»ö¤Ë´Ø¤·¤Æ²¿Ì¾¤« -¤ÎÊý¤Ë¤ªÀ¤Ïäˤʤê¤Þ¤·¤¿¡£ - minix-V ¤Îºî¼Ô¤Ç¤¢¤ë - nemossan@uitec.ac.jp == nemossan@mix ¤µ¤ó - takamiti@mix ¤µ¤ó - ¤½¤·¤Æ KanjiHand ¤Îºî¼Ô¤Ç¤¢¤ë - maebashi@mcs.meitetsu.co.jp ¤µ¤ó - yamamoto@sws.cpd.mei.co.jp ¤µ¤ó -¥Õ¥©¥ó¥È¤ª¤è¤Ó¤½¤Î¥í¡¼¥ÀÉôʬ¤ÎžÍѤò²÷Âú¤·¤Æ¤¤¤¿¤À¤¤¤Æ¿¿¤Ë¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤ -¤Þ¤·¤¿¡£¥Õ¥©¥ó¥È¤À¤±¤Ç¤Ê¤¯ VGA ´Ø·¸¤â¤«¤Ê¤ê»²¹Í¤Ë¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤·¤¿¡£ - KON ¤Î¥Æ¥¹¥È¸ø³«¤Ë´Ø¤·¤Æ¤Ï Azuma Okamoto <lfo@ecei.tohoku.ac.jp> ¤µ¤ó¤Î -¿×®¤ÊÂбþ¤Ë´¶¼Õ¤·¤Æ¤¤¤Þ¤¹¡£ - ¥Æ¥¹¥È¤Ë¶¨ÎϤ·¤Æ¤¯¤À¤µ¤Ã¤¿ - Takahiro.Noguchi@Japan.Sun.COM ¤µ¤ó -¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£ - NEmacs + SKK ¤¬´û¤Ë¤¢¤ë¤³¤È¤ò¶µ¤¨¤Æ¤¯¤À¤µ¤Ã¤¿ - nakamura@arl.mech.tohoku.ac.jp ¤µ¤ó -¤ª¤«¤²¤µ¤Þ¤Ç¡¢´Ä¶¤¬¿ïʬ²þÁ±¤µ¤ì¤Þ¤·¤¿¡£ - »ä¤¬ Linux ¤ò»Ï¤á¤¿º¢¤Ë¤¤¤í¤¤¤í¤È¶µ¤¨¤Æ¤¯¤À¤µ¤Ã¤¿ - kawamoto@chuo-computer.co.jp ¤µ¤ó - nick@nsis.cl.nec.co.jp ¤µ¤ó -¤Ï»ä¤Ë¤È¤Ã¤ÆÂçÊÑ¿´¶¯¤¤Â¸ºß¤Ç¤¹¡£ - KON ¤Î³«È¯¤Ë¤¢¤¿¤Ã¤Æ¤Ï¡¢screen, pty, kterm ¤Ê¤ÉÍÍ¡¹¤Ê¸ø³«¥½¥Õ¥È¤ò»²¹Í¤Ë -¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤·¤¿¡£publicfont ¤Î´ð¤È¤Ê¤Ã¤Æ¤¤¤ë X11R5 ¤Î¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë -¤â´Þ¤á¤Æ¡¢¤³¤Î¤è¤¦¤Êµ®½Å¤«¤ÄËÄÂç¤Ê¾ðÊó¤ò¼ê¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¤³¤ÎÀ¤³¦¤Ë´¶¼Õ -¤·¡¢¤Ç¤¤ë¤³¤È¤Ê¤é¤Ð¹×¸¥¤·¤Æ¤¤¤¤¿¤¤¤È»×¤¤¤Þ¤¹¡£ - ºÇ¸å¤Ë¡¢Linux ¤ò³«È¯¤·¸ø³«¤µ¤ì¤¿ - torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds) »á -¤½¤·¤Æ¤³¤Î Linux ¤ò°é¤Æ¤Æ¤¤¿Â¿¤¯¤ÎÊý¡¹¤Ë¿¼¤¯´¶¼Õ¤·¤Þ¤¹¡£ diff --git a/loader/kon2/doc/TODO b/loader/kon2/doc/TODO deleted file mode 100644 index b21544371..000000000 --- a/loader/kon2/doc/TODO +++ /dev/null @@ -1,3 +0,0 @@ -$B!&6&M-%a%b%jHs;HMQHG(B -$B!&(BISO-2022 $BBP1~(B -$B!&4J0W%0%i%U%#%C%/5!G=$NAuHw(B diff --git a/loader/kon2/doc/conf.doc b/loader/kon2/doc/conf.doc deleted file mode 100644 index 71aa63fae..000000000 --- a/loader/kon2/doc/conf.doc +++ /dev/null @@ -1,70 +0,0 @@ -A. kon.cfg ¤Î½èÍý - -¢£void ReadConfig(void) - -kon.cfg ¤ÎÆâÍƤϴؿô ReadConfig() ¤Ë¤è¤Ã¤Æ½èÍý¤µ¤ì¤Þ¤¹¡£ ReadConfig() -¤Ï¥¨¥ó¥È¥ê̾¤È½é´ü²½´Ø¿ô¤ÎÂбþɽ¤ò¥µ¡¼¥Á¤·¤Æ¡¢Æɤ߹þ¤ó¤À¥¨¥ó¥È¥ê£±¤Ä£± -¤Ä¤Ë¤Ä¤¤¤ÆÂбþ¤¹¤ë½é´ü²½´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤Þ¤¹¡£ Âбþɽ¤Ï°Ê²¼¤Î¹½Â¤ÂΤòÊ -¤Ù¤¿¤â¤Î¤Ç¤¹¡£ - - static struct capability { - const char *name; ¥¨¥ó¥È¥ê̾ - void (*func)(const char*); ½é´ü²½´Ø¿ô - int initialized; ½é´ü²½¤¬½ª¤ì¤Ð 1 - const char *def_value; ¥Ç¥Õ¥©¥ë¥ÈÃÍ¡£ NULL¤Ê¤éɬ¿Ü¥¨¥ó¥È¥ê - }; - -½èÍý´Ø¿ô¤Ï¥¨¥ó¥È¥êÃͤÎʸ»úÎó¤ò¼õ¤±¤È¤ê½é´ü²½½èÍý¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£ - -kon.cfg ¤òÆɤ߽ª¤ë¤È¡¢½é´ü²½´Ø¿ô¤ò¸Æ¤Ó½Ð¤µ¤Ê¤«¤Ã¤¿¥¨¥ó¥È¥ê¤Ë¤Ä¤¤¤Æ¥Ç¥Õ¥© -¥ë¥ÈÃͤ¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«Ä´¤Ù¡¢ÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð¤½¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ç -½é´ü²½´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤Þ¤¹¡£ ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡£ - - -¢£void DefineCap(const char *name, initializer *func, const char *def_value) - -¿·¤¿¤Ê¥¨¥ó¥È¥ê¤ò½é´ü²½¥Æ¡¼¥Ö¥ë¤Ë²Ã¤¨¤Þ¤¹¡£ VGA ¥É¥é¥¤¥Ð¤À¤±¤Ï PELS ¥¨ -¥ó¥È¥ê¤òɬÍפȤ¹¤ë¤Î¤Ç¡¢¤³¤Î´Ø¿ô¤ò»È¤Ã¤Æɬ¿Ü¥¨¥ó¥È¥ê¤òÄɲ䷤Ƥ¤¤Þ¤¹¡£ - -¢£void DelCap(const char* name) - -Âбþɽ¤ÎÃæ¤Î¥¨¥ó¥È¥ê̾ name ¤Î½é´ü²½´Ø¿ô¤òºï½ü¤·¤Þ¤¹¡£ ºÆ½é´ü²½¤ÎºÝ¤Ë -»È¤Ã¤Æ¤¤¤Þ¤¹¡£ - - -B. ¥Ó¥Ç¥ª¥É¥é¥¤¥Ð¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹ - -¡ü¹½Â¤ÂÎ vInfo - -¥Ó¥Ç¥ª¥É¥é¥¤¥Ð¤ËÂФ¹¤ëÁàºî¤Ï¤¹¤Ù¤Æ¹½Â¤ÂÎ vInfo ¤òÄ̤·¤Æ¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£ - -struct videoInfo { - bool has_hard_scroll; ¥Ï¡¼¥É¥¹¥¯¥í¡¼¥ë¤¬»È¤¨¤ë¤«¤É¤¦¤« - void (*init)(void), ½é´ü²½ - (*text_mode)(void), ¥Æ¥¥¹¥È¥â¡¼¥É¤ËÀÚÂؤ¨ - (*graph_mode)(void), ¥°¥é¥Õ¥£¥Ã¥¯¥â¡¼¥É¤ËÀÚÂؤ¨ - (*wput)(u_char *code, u_char fc, u_char bc), - ´Á»ú½ÐÎÏ - (*sput)(u_char *code, u_char fc, u_char bc), - ANK½ÐÎÏ - (*set_cursor_address)(struct cursorInfo *c, u_int x, u_int y), - ¥«¡¼¥½¥ë c ¤Î¥¢¥É¥ì¥¹¤ò (x, y) ¤ËÀßÄê - (*set_address)(u_int i),¼¡¤Ë½ñ¤¯Ê¸»ú¤Î¥¢¥É¥ì¥¹¤ò i ʸ»úÌܤËÀßÄê - (*cursor)(bool), ¥«¡¼¥½¥ëon/off - (*clear_all)(void), ²èÌÌ¥¯¥ê¥¢ - (*screen_saver)(bool), ¥¹¥¯¥ê¡¼¥ó¥»¡¼¥Ð(TRUE¤Ç¥»¡¼¥Ö¡¢FALSE¤ÇÉüµ¢) - - /* ¥Ï¡¼¥É¥¹¥¯¥í¡¼¥ë¤¬»È¤¨¤Ê¤±¤ì¤Ð°Ê²¼¤ÏNULL */ - (*set_start_address)(), ɽ¼¨³«»Ï¥¢¥É¥ì¥¹ÀßÄê - (*hard_scroll_up)(int lines), ¥Ï¡¼¥É¥¹¥¯¥í¡¼¥ë¥¢¥Ã¥× - (*hard_scroll_down)(int lines); ¥Ï¡¼¥É¥¹¥¯¥í¡¼¥ë¥À¥¦¥ó -} vInfo; - - -¢£void ConfigDisplay(const char *config) - -¥Ó¥Ç¥ª¥É¥é¥¤¥Ð¥¨¥ó¥È¥ê¤Î½é´ü²½´Ø¿ô ConfigDisplay() ¤Ï¡¢¥¨¥ó¥È¥êÃÍʸ»ú -Îó config ¤ÎºÇ½é¤Î¹Ô¤ò¥¡¼¤È¤·¤Æ¥Ó¥Ç¥ª¥É¥é¥¤¥ÐÀßÄê´Ø¿ô¤òÁªÂò¤·¤Þ¤¹¡£ -¥Ó¥Ç¥ª¥É¥é¥¤¥ÐÀßÄê´Ø¿ô¤Ï dInfo ¤È vInfo ¤Ë¤½¤Î¥É¥é¥¤¥Ð¤ò»È¤¦¤¿¤á¤ÎÃͤò -ÀßÄꤷ¤Þ¤¹¡£¤Þ¤¿¡¢VGA, VGAFM ¥É¥é¥¤¥Ð¤Î¾ì¹ç¤Ï¥ì¥¸¥¹¥¿Ãͤò config ʸ»ú -Îó¤è¤êÆÀ¤Æ¥É¥é¥¤¥ÐÆâÉô¤ÎÊÑ¿ô¤Ëµ²±¤·¤Þ¤¹¡£ diff --git a/loader/kon2/doc/fld.j3100.doc b/loader/kon2/doc/fld.j3100.doc deleted file mode 100644 index c3d06b87f..000000000 --- a/loader/kon2/doc/fld.j3100.doc +++ /dev/null @@ -1,33 +0,0 @@ -J-3100 $B4A;z(B ROM $B@lMQ%U%)%s%H%m!<%@!<(B - - $B8B$i$l$?(B disk $B;q8;$rM-8z$K;H$&$?$a!"$^$?!"(Bk14 $B$J$I$h$j$O!"8+$J$l$?%U%)%s%H(B -$B$G!"(BKON $B$r;H$&$?$a$K!"(BJ-3100 $B$NFbB"4A;z(B ROM $B$rMxMQ$7$?!"%U%)%s%H%m!<%@!<$G$9!#(B - -$B#1!%%$%s%9%H!<%k(B - * make [install|instbin] $B$G!"(B/usr/local/bin $B$K%$%s%9%H!<%k$5$l$^$9!#(B - * /usr/local/lib/kon.cfg $B$N:G8e$K!"(B - /usr/local/bin/fld.j3100 ank standard - /usr/local/bin/fld.j3100 kanji standard - $B$H!";XDj$7$^$9!#$^$?!"%\!<%k%I%U%)%s%H$K$7$?$$>l9g$O!"(B - /usr/local/bin/fld.j3100 ank bold - /usr/local/bin/fld.j3100 kanji bold - $B$NMM$K!";XDj$7$^$9!#$5$i$K!"H>3Q%U%)%s%H$O%G%U%)%k%H$G4A;z(B ROM $B$+$i(B - $BFI$_9~$_$^$9$,!"0J2<$N$h$&$K;XDj$9$l$P!"(BBIOS ROM $B$+$iFI$_9~$`$3$H$,(B - $B$G$-$^$9!#(B - /usr/local/bin/fld.j3100 ank [standard|bold] bios - $B>e5-;XDj$G!"@5$7$/I=<($5$l$J$$>l9g$O!"0J2<$N$h$&$K;XDj$7$F2<$5$$!#(B - /usr/local/bin/fld.j3100 ank [standard|bold] bios2 - $B!v4A;z(B ROM $B$r;XDj$9$k$H!"H>3Q$N(B'$B!o(B'$B$,I=<($5$l!"(BBIOS ROM $B$r;XDj$9$k(B - $B$H!"H>3Q$N(B'$B!@(B'$B$,I=<($5$l$^$9!#(BBIOS ROM $B$O!"5!<o$K$h$j%U%)%s%H$N(B - $B%"%I%l%9$,0[$J$k$N$G!"(B[bios|bios1] $B$H(B bios2 $B$r;n$7$F!"@5$7$/I=<((B - $B$5$l$kJ}$r8fMxMQ2<$5$$!#(B - -$B#2!%F0:n3NG'(B - * J-3100SX001 + 80Mhdd + 8Mram - SLS1.03(93/08/18) - linux-0.99.12+ - KON-0.99.1 - -$B#3!%O"Mm@h(B - * kazu@jl1keo.tama.prug.or.jp - diff --git a/loader/kon2/doc/kon.1 b/loader/kon2/doc/kon.1 deleted file mode 100644 index 55183284d..000000000 --- a/loader/kon2/doc/kon.1 +++ /dev/null @@ -1,292 +0,0 @@ -.TH KON 1 "Sep 5, 1996" -.UC 4 -.SH ¡Ú̾Á°¡Û -KON \- ´Á»ú¥³¥ó¥½¡¼¥ë¥¨¥ß¥å¥ì¡¼¥¿ -.SH ¡Ú½ñ¼°¡Û -.B kon -[ -.B video -] -[ -.B -capability -value ... -] -.SH ¡Ú³µÍ×¡Û -\fIKON\fP ¤Ï \fILinux\fP, \fIFreeBSD\fP ¤Î¥³¥ó¥½¡¼¥ë²èÌ̾å¤Ç´Á»ú¤òɽ¼¨ -¤¹¤ë¤¿¤á¤Î¥×¥í¥°¥é¥à¤Ç¤¹¡£\fIKON\fP ¤Ç¤Ï¡¢ -.B pty(4) -¤ò»È¤Ã¤Æ¥³¥ó¥½¡¼¥ëÆþ½ÐÎϤò¥Õ¥Ã¥¯¤·¡¢\fIVGA\fP ¤¢¤ë¤¤¤Ï \fIDCGA\fP -¤ËŸ³«¤¹¤ë»ö¤Ë¤è¤Ã¤Æ´Á»úɽ¼¨¤ò¼Â¸½¤·¤Æ¤¤¤Þ¤¹¡£¤Þ¤¿¡¢\fIKON\fP ¤¬Æ°ºî -¤·¤Æ¤¤¤ë¥³¥ó¥½¡¼¥ë¤«¤éµ¯Æ°¤µ¤ì¤¿ \fIKON\fP ¤Ï¿·¤·¤¤²¾ÁÛ¥³¥ó¥½¡¼¥ë¾å¤Ç -Æ°ºî¤·¤Þ¤¹¡£ -.SH ¡Ú¥ª¥×¥·¥ç¥ó¡Û -.PP -\fIKON\fP ¤Ï¥ª¥×¥·¥ç¥ó¤Ç¥Ó¥Ç¥ª¥É¥é¥¤¥Ð¤ä¤¤¤¯¤Ä¤«¤Î´Ä¶¤ò»ØÄꤹ¤ë¤³¤È¤¬ -¤Ç¤¤Þ¤¹¡£ -.B video -¤Ë¤Ï \fIkon.cfg\fP ¤Ëµ½Ò¤µ¤ì¤Æ¤¤¤ë¥Ó¥Ç¥ª¥É¥é¥¤¥Ð¥¨¥ó¥È¥ê -¤Î°ì¤Ä¤ò»ØÄꤷ¤Þ¤¹¡£²¿¤â»ØÄꤷ¤Ê¤±¤ì¤Ð¡¢¥Ó¥Ç¥ª¥É¥é¥¤¥Ð¤È¤·¤Æ \fINORMAL\fP -¤¬»ØÄꤵ¤ì¤¿¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£ \fICursorInterval\fP ¤Ê¤É¤ÎÀßÄê¤Ï¥ª¥×¥·¥ç¥ó -.B -capability -¤Ç¥ª¡¼¥Ð¥é¥¤¥È¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£Î㤨¤Ð¡¢ - -.br - % kon -CursorInterval 10 -.br - -¤È¤¹¤ì¤Ð \fICursorInterval\fP ¤ÎÃͤò 10 ¤Ë¤·¤Æµ¯Æ°¤·¤Þ¤¹¡£ - -.PP -.SH ¡Ú´Ä¶ÀßÄê¡Û -ɽ¼¨¤¹¤ë¥Ó¥Ç¥ª¥É¥é¥¤¥Ð¤ä¥Ñ¥ì¥Ã¥È¤Ê¤É¤Î´Ä¶¤Ï \fIkon.cfg\fP ¥Õ¥¡¥¤¥ë¤ÇÀßÄꤹ¤ë -¤³¤È¤¬¤Ç¤¤Þ¤¹¡£¤³¤Î¥Õ¥¡¥¤¥ë¤Îʸˡ¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹: -.TP 8 - \fI¥¨¥ó¥È¥ê̾\fP:[\fIÊÌ̾1\fP:\fIÊÌ̾2\fP:...] - \fI¥¨¥ó¥È¥ê¤ÎÃÍ\fP -.PP -\fI¥¨¥ó¥È¥ê̾\fP¤ÎÂçʸ»ú/¾®Ê¸»ú¤Ï¶èÊ̤·¤Þ¤»¤ó¡£¤¢¤ë\fI¥¨¥ó¥È¥ê¤ÎÃÍ\fP¤ò -»Ø¼¨¤¹¤ë¹Ô¤Ïɬ¤º \fITAB\fP ¥¥ã¥é¥¯¥¿¤Ç»Ï¤á¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤Þ¤¿¡¢ -\fI#\fP ¤«¤é¹ÔËö¤Þ¤Ç¤Ï¥³¥á¥ó¥È¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹¡£ -.PP -\fI¥¨¥ó¥È¥ê¤ÎÃÍ\fP¤Î¼ïÎà¤Ë¤Ï¼¡¤Î¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ê¤Þ¤¹: -.TP 10 -\fIboolean\fP -On ¤Þ¤¿¤Ï Off ¤ò»ØÄê(Âçʸ»ú/¾®Ê¸»ú¤Î¶èÊ̤ʤ·) -.TP 10 -\fIchoice\fP -¤¤¤¯¤Ä¤«¤ÎÁªÂò»è¤«¤é°ì¤Ä¤ò»ØÄê(Âçʸ»ú/¾®Ê¸»ú¤Î¶èÊ̤ʤ·) -.TP 10 -\fInumeric\fP -10¿Ê¿ôÃͤò»ØÄê -.TP 10 -\fIstring\fP -¤½¤Î¥¨¥ó¥È¥êÆÃͤΥե©¡¼¥Þ¥Ã¥È¤ÇÃͤò»ØÄê -.PP -¤Þ¤¿¡¢°Ê²¼¤Î2¤Ä¤Î¥¨¥ó¥È¥ê¤Ïɬ¿Ü¤Ç¤¹: -.TP 4 -\fINORMAL\fP(string) -¥Ó¥Ç¥ª¥É¥é¥¤¥Ð¤òÁªÂò¤·¤Þ¤¹¡£ÃͤΰÕÌ£¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹: - -.nf -\fIVGA\fP VGA, SVGA, EGAÍѥɥ饤¥Ð -\fIVGAFM\fP VGA, SVGA, EGAÍѥɥ饤¥Ð(¥Õ¥©¥ó¥ÈÊÑ·Áµ¡Ç½¤Ä¤) -\fIJ3100SX\fP Åì¼Ç J3100SX Íѥɥ饤¥Ð(DCGA ¥É¥é¥¤¥Ð) -.fi - -\fIVGA\fP, \fIVGAFM\fP ¤Î¾ì¹ç¤Ï¤µ¤é¤Ë\fIVGA¥ì¥¸¥¹¥¿ÃÍ\fP¤È²èÌÌ¥µ¥¤¥º -(¥É¥Ã¥È¿ô)¡¢¹ÔÉý(ʸ»ú¿ô)¡¢¹Ô¿ô¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤Î¥¨¥ó¥È¥ê¤Ë¤è¤Ã¤Æ -ɽ¼¨Ê¸»ú¿ô¤òÊѤ¨¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¤¬¡¢ VGA ¤Î²òÁüÅÙ(640x480)¤ò½ü¤¤¤Æ -\fIVGA¥ì¥¸¥¹¥¿ÃÍ\fP¤Èɽ¼¨Ê¸»ú¿ô¤Î´Ø·¸¤Ï¥Ó¥Ç¥ª¥«¡¼¥É¤Ë°Í¸¤·¤Þ¤¹¡£ -ÉÕ°¤Î \fIkon.cfg\fP ¤Ç¤Ï¡¢ \fINORMAL\fP ¤¬É¸½à VGA ¤ÎÊÌ̾¤È¤Ê¤Ã¤Æ¤ª¤ê¡¢ -¤½¤Î¾¤Ë¤¤¤¯¤Ä¤«¤Î¥¨¥ó¥È¥ê¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤Þ¤º¤³¤Î¾õ¶·¤Ç»î¤·¤Æ¡¢ -¤½¤Î¸å¤ª»È¤¤¤Î¥Ó¥Ç¥ª¥«¡¼¥É¤Ë¤¢¤Ã¤¿¤â¤Î¤òÁª¤ó¤Ç²¼¤µ¤¤¡£ - -.\" ¤ª»È¤¤¤Î¥Ó¥Ç¥ª¥«¡¼¥ÉÍѤ˿·¤¿¤Ê¥¨¥ó¥È¥ê¤ò½ñ¤²Ã¤¨¤ë¤Ë¤Ï¡¢tools -.\" ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë \fIvacuum.exe\fP ¤òÍѤ¤¤Æ DOS ¾å¤Ç\fIVGA¥ì¥¸¥¹¥¿ÃÍ\fP -.\" ¤òÄ´¤Ù¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ - -\fIKON\fP ¤Ï 16 ¥É¥Ã¥È¥Õ¥©¥ó¥È¤Î¤ß¤ò°·¤¤¤Þ¤¹¤¬¡¢ \fIVGAFM\fP ¥É¥é¥¤¥Ð¤Ï¡¢ -¥é¥¤¥ó¤ò´Ö°ú¤¤¤Æ 16 ¥é¥¤¥ó¤è¤ê¾¯¤Ê¤¤Éý¤Ç 1 ¹Ô¤ò»ØÄꤹ¤ëµ¡Ç½¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹ -(¸¶°Æ¤Ï¾¾°æ¹§Íº¤µ¤ó mat@tanasei.cc.u-tokyo.ac.jp¤Ë¤è¤ë)¡£ \fIVGAFM\fP -¥É¥é¥¤¥Ð¤Ï¡¢ \fINORMAL\fP ¥¨¥ó¥È¥ê¤Î½Ä¥É¥Ã¥È¿ô¤È¹Ô¿ô¤«¤é 1 ¹Ô¤Î¥é¥¤¥ó¿ô¤òµá¤á¡¢ -ɬÍפʤé¤Ð¥é¥¤¥ó¤ò´Ö°ú¤¤¤ÆÄ̾ï¤è¤ê¿¤¯¤Î¹Ô¤òɽ¼¨¤Ç¤¤Þ¤¹¡£¥Õ¥©¥ó¥È¤È -¥é¥¤¥ó¿ô¤ÎÁȹ礻¤Ë¤è¤êÆɤߤ䤹¤µ¤Ï°Û¤Ê¤ê¤Þ¤¹¤¬¡¢ MINIX ¤Î¥Ñ¥Ö¥ê¥Ã¥¯¥Õ¥©¥ó¥È -¤òÍѤ¤¤¿¾ì¹ç¡¢ 12 ¥É¥Ã¥È¤Ç¤â·ë¹½Æɤá¤ëɽ¼¨¤¬¤Ç¤¤Þ¤¹¡£¤½¤Î¾ì¹ç¡¢¹Ô¿ô -¤¬3³ä°Ê¾åÁý¤¨¤ë¤Î¤Ç(480¥é¥¤¥ó¤Ç 40 ¹Ô¡¢ 600 ¥é¥¤¥ó¤Ç 50 ¹Ô)¡¢Æä˥Ρ¼¥È¥Ñ¥½¥³¥ó -¤Ê¤É¤Ç¤ÏÊØÍø¤Ê»þ¤¬¤¢¤ë¤Ç¤·¤ç¤¦¡£ -.TP 4 -\fISTARTUP\fP(string) -¥¹¥¿¡¼¥È¥¢¥Ã¥×»þ¤Ëµ¯Æ°¤¹¤ë¥³¥Þ¥ó¥Éʸ»úÎó¤ò»ØÄꤷ¤Þ¤¹¡£ 1 ¹Ô 1 ¥³¥Þ¥ó -¥É¤Ç²¿¹Ô¤Ç¤âµ½Ò¤Ç¤¤Þ¤¹¡£¥Õ¥©¥ó¥È¤ò¥í¡¼¥É¤¹¤ë¥³¥Þ¥ó¥É¤ò¤³¤³¤Ç»ØÄê -¤·¤Æ¤ä¤é¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤Þ¤¿¡¢VGA ¤Ë¤ª¤¤¤ÆȾ³Ñ¥Õ¥©¥ó¥È¤ò¥í¡¼¥É -¤·¤Ê¤«¤Ã¤¿»þ¤Ï \fIVGA¥Õ¥©¥ó¥È\fP¤¬»È¤ï¤ì¤Þ¤¹¡£ - -.nf -.I È󰵽̥ե©¥ó¥È - <¥Õ¥©¥ó¥È¥í¡¼¥À> <Ⱦ³Ñ¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë> - <¥Õ¥©¥ó¥È¥í¡¼¥À> <Á´³Ñ¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë> -.I °µ½Ì¥Õ¥©¥ó¥È - zcat <Ⱦ³Ñ¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë> | <¥Õ¥©¥ó¥È¥í¡¼¥À> - zcat <Á´³Ñ¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë> | <¥Õ¥©¥ó¥È¥í¡¼¥À> -.fi -.PP -¼¡¤Î¥¨¥ó¥È¥ê¤Ï¥Ó¥Ç¥ª¥É¥é¥¤¥Ð¤Ë VGA, VGAFM ¤ò»ØÄꤷ¤¿»þ¤ËɬÍפˤʤê¤Þ¤¹: -.TP -\fIPELS\fP(string) -¥Ñ¥ì¥Ã¥È¤Î»ØÄê¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢R,G,B ¤Î¥Ñ¥ì¥Ã¥ÈÃÍ(10 -¿Ê)¤ò 1 ¹Ô¤Ë½ñ¤¡¢¤½¤ì¤ò 16 ¹Ôʤ٤¿¤â¤Î¤Ç¤¹¡£ -¥Ñ¥Ã¥±¡¼¥¸ÉÕ°¤Î \fIkon.cfg\fP ¤Ç¤Ï¡¢ \fISTDPEL\fP ¤È \fIREVPEL\fP ¤Î -¥¨¥ó¥È¥ê¤¬¤¢¤ê¤Þ¤¹¡£ \fISTDPEL\fP ¤Ïɸ½à¥Ñ¥ì¥Ã¥È¤Ç¡¢ \fIREVPEL\fP -¤Ï¥ê¥Ð¡¼¥¹¤Ç¤¹¡£´õ˾¤¹¤ë¥¨¥ó¥È¥ê¤ÎÊÌ̾¤È¤·¤Æ \fIPELS\fP ¤ò»ØÄꤷ¤Æ²¼¤µ¤¤¡£ -.PP -¤½¤Î¾¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ê¥¨¥ó¥È¥ê¤¬¤¢¤ê¤Þ¤¹: -.TP 4 -\fIMOUSE\fP(choice) -Microsoft, MouseSystems, BusMouse, MMSeries, Logitech, None -¤è¤ê 1 ¤ÄÁªÂò¡£¥Ç¥Õ¥©¥ë¥È¤Ï None¡£ -¥Þ¥¦¥¹¥É¥é¥¤¥Ð¤Î¼ïÎà¤òÁªÂò¤·¤Þ¤¹¡£Logitech Mouse Man ¥·¥ê¡¼¥º¤¬Æ°ºî -¤·¤Ê¤¤¾ì¹ç¤Ï Microsoft ¤ò»ØÄꤷ¤Æ¤ß¤Æ²¼¤µ¤¤¡£ -.TP 4 -\fIMouseBaud\fP(choice) -1200, 2400, 4800, 9600¤è¤êÁªÂò¡£¥Ç¥Õ¥©¥ë¥È¤Ï 1200¡£ -¥·¥ê¥¢¥ë¥Þ¥¦¥¹¤Î¥Ü¡¼¥ì¡¼¥È¤òÁªÂò¤·¤Þ¤¹¡£ MOUSE ¤Ë None, BusMouse °Ê -³°¤ÎÃͤò»ØÄꤷ¤¿»þ¤Ë͸ú¤È¤Ê¤ê¤Þ¤¹¡£ -.TP 4 -\fIMouseDev\fP(string) -¥Þ¥¦¥¹¤Î¥Ç¥Ð¥¤¥¹Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ï /dev/mouse ¤Ç¤¹¡£ -\fIMOUSE\fP ¤Ë None °Ê³°¤Î¥¨¥ó¥È¥ê¤òÍ¿¤¨¤¿»þ¤Ë͸ú¤Ç¤¹¡£ -.TP 4 -\fIMouse3Buttons\fP(boolean) -3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¾ì¹ç¤Ë¥Ú¡¼¥¹¥È¥Ü¥¿¥ó¤òÃæ±û¤ËÀßÄꤷ¤Þ¤¹¡£ -¥Ç¥Õ¥©¥ë¥È¤Ï Off ¤Ç¤¹¡£ -.TP 4 -\fIHardScroll\fP(boolean) -¥Ï¡¼¥É¥¦¥¨¥¢¥¹¥¯¥í¡¼¥ë¤ò»È¤¦¤«¤É¤¦¤«¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï -On ¤Ç¤¹¡£ VGA, VGAFM, J31SX ¥É¥é¥¤¥Ð¤Ç͸ú¤Ç¤¹¡£ -.TP 4 -\fIBeepCounter\fP(numeric) -¥Ó¡¼¥×²»¤ÎŤµ¤ò 1/100 ÉÃñ°Ì¤Ç»ØÄꤷ¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ï 5 ¤Ç¤¹¡£ -.TP 4 -\fICursorInterval\fP(numeric) -¥«¡¼¥½¥ëÅÀÌÇ´Ö³Ö¤ò 1/10 ÉÃñ°Ì¤Ç»ØÄꤷ¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ï 4 ¤Ç¤¹¡£ -¥«¡¼¥½¥ë¤ÎÅÀÌǤò»ß¤á¤ë¤Ë¤Ï 0 ¤ò»ØÄꤷ¤Þ¤¹¡£ -.TP 4 -\fISaveTime\fP(numeric) -¥¹¥¯¥ê¡¼¥ó¥»¥¤¥Ð¤¬Æ¯¤¯¤Þ¤Ç¤Î»þ´Ö¤òʬñ°Ì¤Ç»ØÄꤷ¤Þ¤¹¡£ -¥Ç¥Õ¥©¥ë¥È¤Ï 4 ¤Ç¤¹¡£ -.TP 4 -\fIKanjiCursor\fP(boolean) -´Á»ú¤Î¾å¤Ë¥«¡¼¥½¥ë¤¬¤¢¤ë»þ¡¢¥«¡¼¥½¥ë¤òÁ´³ÑÉý¤Ë¤¹¤ë¤«¤É¤¦¤«¤ò -»ØÄꤷ¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ï On ¤Ç¤¹¡£ -.TP 4 -\fICursorTop\fP(numeric),\fICursorBottom\fP(numeric) -¤³¤Î 2 ¤Ä¤Ç¥«¡¼¥½¥ë¥Ü¥Ã¥¯¥¹¤Î¥µ¥¤¥º¤ò»ØÄꤷ¤Þ¤¹¡£ -.nf - 0 +--------+ - | | - |--------| <-- CursorTop - |********| - |********| - |********| - |********| - |********| - 15 +--------+ <-- CursorBottom -.fi -VGA, VGAFM, CGA ¥É¥é¥¤¥Ð¤Ç͸ú¤Ç¤¹¡£ -.TP 4 -\fIBoxCursor\fP(boolean) -¥«¡¼¥½¥ë¤Î·Á¾õ¤ò²¼Àþ¤Î¤ß¤Ç¤Ê¤¯È¢·¿¤Ë¤¹¤ë¤«¤É¤¦¤«¤ò»ØÄꤷ¤Þ¤¹¡£ -¥Ç¥Õ¥©¥ë¥È¤Ï Off ¤Ç¤¹¡£ J3100SX ¥É¥é¥¤¥Ð¤Ç͸ú¤Ç¤¹¡£ -.TP 4 -\fISavePlane3\fP(boolean) -VGA ¥á¥â¥êÂè 3 ¥Ú¡¼¥¸¤Î¥Õ¥©¥ó¥È¥Ç¡¼¥¿¤òÊݸ¤·¤Þ¤¹¡£Trident ·Ï°Ê³°¤Ç -¤ÏÉÔÍפǤ¹¡£¥Ç¥Õ¥©¥ë¥È¤Ï Off ¤Ç¤¹¡£ VGA, VGAFM ¥É¥é¥¤¥Ð¤Ç͸ú¤Ç¤¹¡£ -.TP 4 -\fIVgaFontOffset\fP(numeric) -\fIVGA¥Õ¥©¥ó¥È\fP¤Î¥ª¥Õ¥»¥Ã¥ÈÃͤò»ØÄꤷ¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ï 0 ¤Ç¤¹¡£ -\fIVGA¥Õ¥©¥ó¥È\fP¤òȾ³Ñ¥Õ¥©¥ó¥È¤È¤·¤ÆÍøÍѤ¹¤ë¾ì¹ç¡¢¥á¡¼¥«¤Ë¤è¤Ã¤Æ¤Ïʸ»ú¤Î -²¼Éô¤¬·ç¤±¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤½¤Î¤è¤¦¤Ê»þ¤Ë¤³¤ÎÃͤò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤Æ -ʸ»ú¤Î°ÌÃÖ¤òÄ´À°¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -.TP 4 -\fICoding\fP(string) -¥Ç¥Õ¥©¥ë¥È¤ÇÍøÍѤ¹¤ë¥Õ¥©¥ó¥È¤ª¤è¤Ó 16bit ¤Ç¤Î¥³¡¼¥Ç¥£¥ó¥°¤ò»ØÄꤷ¤Þ¤¹¡£ -µ½ÒÊýË¡¤Ï¡¢ - -.br - <SB font> <DB font> [EUC|SJIS] - -¤È¤Ê¤ê¡¢¤½¤ì¤¾¤ì°Ê²¼¤Î¤è¤¦¤Ê»ØÄê¤ò¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -.PP -.TP 4 - SB font: Single Byte ¥Õ¥©¥ó¥È - ISO8859-1,ISO8859-2,ISO8859-3,ISO8859-4,ISO8859-5, - ISO8859-6,ISO8859-7,ISO8859-8,ISO8859-9, - JISX0201.1976-0 -.PP -.TP 4 - DB font: Double Byte ¥Õ¥©¥ó¥È - GB2312.1980-1,JISX0208.1983-0,KSC5601,BIG5 -.PP -.TP 4 -\fIStartupMessage\fP(boolean) -µ¯Æ°»þ¤Î greeting ¥á¥Ã¥»¡¼¥¸¤ò½Ð¤¹¤«¤É¤¦¤«¤ò»ØÄꤷ¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È -¤Ï On ¤Ç¤¹¡£ -.PP -.SH ¡Ú¹â²òÁüÅ٥⡼¥É¤ÎÀßÄê¡Û -\fIkon\fP ¤Ç¤Ï¡¢¥Ó¥Ç¥ª¥É¥é¥¤¥Ð¤È¤·¤Æ VGA, VGAFM ¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë -\fIkon.cfg\fP ¤ÎÀßÄê¤Ë¤è¤ê¥Æ¥¥¹¥È¤Î¹¤µ¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -.TP 4 -\fI¥¨¥ó¥È¥ê̾\fP: -.br - <\fIVGA\fP ¤¢¤ë¤¤¤Ï \fIVGAFM\fP> -.br - [\fIVGAFM\fP ¤Î¾ì¹ç¤Î´Ö°ú¤·¸¿ô] -.br - <HR> <HS> <HE> <HFL> <VR> <VS> <VE> <VFL> -.br - <\fI¥¯¥í¥Ã¥¯ÈÖ¹æ\fP> -.br - <\fI¹ÔÉý - 1\fP> <\fI¹Ô¿ô - 1\fP> -.PP -3 ¹ÔÌÜ(VGA¥É¥é¥¤¥Ð¤Ç¤Ï 2 ¹ÔÌÜ)¤Î²èÌÌÀ©¸æ¥Ñ¥é¥á¡¼¥¿¤Ï -8 ¸Ä¤Î 10 ¿Ê¿ô¤Î¿ôÃͤ«¤é¤Ê¤ê¤Þ¤¹¡£¤³¤ì¤Ï¡¢Xconfig(4/5) -¤Ë¤ª¤±¤ë¥Ó¥Ç¥ª¥â¡¼¥É¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¤Û¤ÜƱ¤¸ÆâÍƤǤ¹¡£ -¤¿¤À¤·¡¢\fIKON\fP ¤Ç¤Ï 800x600 ¤Þ¤Ç¤Î²òÁüÅ٤ǥƥ¥¹¥È¤ò -¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ -.TP 4 -²èÌÌÀ©¸æ¥Ñ¥é¥á¡¼¥¿ -.br -.B HR -¿åÊ¿¥É¥Ã¥È¿ô -.br -.B HS -¿åʿƱ´ü»ÏÅÀ -.br -.B HE -¿åʿƱ´ü½ªÅÀ -.br -.B HFL -¿åÊ¿Áí¥Õ¥ì¡¼¥à¿ô -.br -.B VR -¿âľ¥é¥¤¥ó¿ô -.br -.B VS -¿âľƱ´ü»ÏÅÀ -.br -.B VE -¿âľƱ´ü½ªÅÀ -.br -.B VFL -¿âľÁí¥Õ¥ì¡¼¥à¿ô -.PP -\fI¥¯¥í¥Ã¥¯ÈÖ¹æ\fP ¤Ë¤Ï¤½¤Î¥¨¥ó¥È¥ê¤Î²èÌ̥⡼¥É¤¬²¿ÈÖÌܤΥ¯¥í¥Ã¥¯¤ò -»ÈÍѤ¹¤ë¤«¤ò»ØÄꤷ¤Þ¤¹¡£¼Â¼Á͸ú¤Ê¤Î¤ÏÃͤβ¼°Ì 2 ¥Ó¥Ã¥È¤Ç¤¹¡£ -¤·¤¿¤¬¤Ã¤Æ¡¢0 ¡Á 3 ¤ÎÃͤΤ¤¤º¤ì¤«¤Ç¤¹¡£ -ºÇ¸å¤Î¹Ô¤Ï¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë¥Æ¥¥¹¥È²èÌ̤餵¤Î»ØÄê¤Ç¤¹¡£ -.SH ¡Ú¥Õ¥¡¥¤¥ë¡Û -.if n .ta 2.5i -.if t .ta 1.8i -/usr/local/lib/kon.cfg ´Ä¶ÀßÄê¥Õ¥¡¥¤¥ë -.br -/usr/lib/font/* ¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë -.SH ¡Ú´ØÏ¢¹àÌÜ¡Û -swkon(1), fld(1) -.SH ¡ÚÃí°Õ»ö¹à¡Û -- ¥Æ¥¥¹¥È¤ò¹â²òÁüÅ٥⡼¥É¤Ë¤·¤Æ \fILinux\fP ¤òµ¯Æ°¤¹¤ë¤È \fIVGA¥Õ¥©¥ó¥È\fP -¤Î¥µ¥¤¥º¤¬°Û¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¢Àµ¾ï¤Ëɽ¼¨¤µ¤ì¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£ -.br -- \fIkon.cfg\fP ¤Ë¤ª¤¤¤ÆƱ¤¸¥¨¥ó¥È¥ê̾¤¬Ê£¿ô¤¢¤ë¾ì¹ç¡¢ºÇ½é¤Î¤â¤Î¤¬Í¸ú -¤È¤Ê¤ê¤Þ¤¹¡£¤Þ¤¿¡¢1 ¹Ô¤ÎŤµ¤ÎºÇÂçÃÍ¤Ï 255 ¥Ð¥¤¥È¤Ç¤¹¡£ -.br -- \fIX Window System\fP ¤È¤ÎÁêÀ¤¬Îɤ¯¤Ê¤¤¾ì¹ç¤Ï \fIswkon(1)\fP ¤Ç -¥Æ¥¥¹¥È¥â¡¼¥É¤Ë°Ü¤ê¡¢¥Þ¥¦¥¹¤òÀÚ¤êÎ¥¤·¤Æ \fIX Window System\fP ¤ò¤´ÍøÍÑ -²¼¤µ¤¤¡£ -.SH ¡Úºî¼Ô¡Û -.nf -MANABE Takashi <manabe@papilio.tutics.tut.ac.jp> -MAEDA Atusi <mad@nak.math.keio.ac.jp> -KOMEDA Shinji <komeda@ics.es.osaka-u.ac.jp> -YOSHIDA Kensyu <kensyu@rabbit.is.s.u-tokyo.ac.jp> -obuk@MIX -.fi diff --git a/loader/kon2/doc/kon.doc b/loader/kon2/doc/kon.doc deleted file mode 100644 index 0ae60c93f..000000000 --- a/loader/kon2/doc/kon.doc +++ /dev/null @@ -1,393 +0,0 @@ - £Ë£Ï£Î ----- Kanji ON Linux console ----- - - ¤³¤Î¥Õ¥¡¥¤¥ë¤Ï KON ¤ÎÆâÉô¹½Â¤¤ò¥É¥¥å¥á¥ó¥È²½¤·¤¿¤â¤Î¤Ç¤¹¡£¤Þ¤À̤´°À®¤Ç¤¹¤¬¡¢ -¥Ð¥°¼è¤ê¤ä²þ¤¤ÎºÝ¤Î»²¹Í¤Ë¤·¤Æ²¼¤µ¤¤¡£ - -£±¡¥Ê¸»ú½ÐÎϤÎή¤ì - - KON ¤Ç¤Ï²¾Áۥƥ¥¹¥È VRAM ¤òÄ̤·¤Æ²èÌ̽ÐÎϤò¹Ô¤Ã¤Æ¤¤¤Þ¤¹¡£PTY ¤«¤é¤Î½ÐÎÏ¤Ï -BUFSIZ ñ°Ì¤Ç¥Õ¥é¥°¥á¥ó¥È²½¤µ¤ì¤Æ VT ¥¨¥ß¥å¥ì¡¼¥¿¤Ë°ú¤ÅϤµ¤ì¤Þ¤¹¡£VT ¥¨¥ß¥å -¥ì¡¼¥¿¤Ï£±Ê¸»ú¤º¤Ä²òÀϤ·¤Æ²¾Áۥƥ¥¹¥È¤Ë½ÐÎϤ·¤Þ¤¹¡££±¤Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤¬½èÍý¤µ -¤ì¤¿»þÅÀ¤Ç¥³¥ó¥½¡¼¥ë¤¬¥¢¥¯¥Æ¥£¥Ö¤Ê¤é¤Ð²¾Áۥƥ¥¹¥È¤ÎÆâÍƤò¤½¤Î¤Þ¤Þ VGA ²èÌ̤˽ñ -¤¹þ¤ß¤Þ¤¹¡£ - -£±.£±¡¥µ¿»÷üËö - -£±.£²¡¥VT ¥¨¥ß¥å¥ì¡¼¥¿ - -¡ü¹½Â¤ÂÎ con - - VT ¥¨¥ß¥å¥ì¡¼¥¿¤Ë±÷¤±¤ë¥Æ¥¥¹¥È¾õÂÖ¾ðÊó¤Ï con ¹½Â¤ÂΤ˵²±¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ -VT ¥¨¥ß¥å¥ì¡¼¥¿¤Ç¤Ï¥Æ¥¥¹¥ÈºÂɸ·Ï¤Ïº¸Ã¼¤ò¸¶ÅÀ[0, 0]¤È¤·¤Æ·×»»¤·¤Æ¤¤¤Þ¤¹¡£ - -struct _con_info { - char x, ¸½ºß¤Î X ºÂɸ - y, ¸½ºß¤Î Y ºÂɸ - xmax, X ºÂɸºÇÂçÃÍ - ymin, Y ºÂɸºÇ¾®ÃÍ - ymax, Y ºÂɸºÇÂçÃÍ - tab; TAB ¸Ä¿ô - u_char fcol, ¥Õ¥©¥¢¥°¥é¥ó¥É¥«¥é¡¼ - bcol, ¥Ð¥Ã¥¯¥°¥é¥ó¥É¥«¥é¡¼ - attr, ʸ»ú°À¥Õ¥é¥° - sfonth, Ⱦ³Ñ¥Õ¥©¥ó¥È¤Î¹â¤µ - wfonth, Á´³Ñ¥Õ¥©¥ó¥È¤Î¹â¤µ - knj1; ´Á»ú¥³¡¼¥ÉÂ裱¥Ð¥¤¥È - enum { - ESC_NEUTRAL, ESC ³° - ESC_START, '\x1B' ¼õ¿® - ESC_BRA, '[' ¼õ¿® - ESC_SI, '$' ¼õ¿® - ESC_SO, '(' ¼õ¿® - ESC_QUESTION, '?' ¼õ¿® - } esc; ¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤Î¾õÂÖÊÑ¿ô - bool knj, JIS ´Á»ú¥â¡¼¥É¥Õ¥é¥° - soft, ¥½¥Õ¥È¥¦¥§¥¢¥¹¥¯¥í¡¼¥ë¥Õ¥é¥° - ins, ÁÞÆþ¥â¡¼¥É¥Õ¥é¥° - active, ¥¢¥¯¥Æ¥£¥Ö¥³¥ó¥½¡¼¥ë¥Õ¥é¥° - saved, ¾Æ¤ÉÕ¤±Ëɻ߾õÂÖ - wrap; wrap ¾õÂ֥ե饰 -}; - -¡üÊÑ¿ô scrollLine - - con.y ¤¬¥ê¡¼¥¸¥ç¥ó(con.ymin¡Ácon.ymax ¤ÎÈÏ°Ï)³°¤Ë¤Ê¤ì¤Ð¥¹¥¯¥í¡¼¥ë¤¹¤ëɬÍפ¬ -ͤê¤Þ¤¹¡£¤·¤«¤·¡¢uum ¤Ê¤É¤Î FEP ¤Ç¤Ï¥·¥¹¥Æ¥à¥é¥¤¥ó¤Ëʸ»ú½ÐÎϤ¹¤ëºÝ¤Ëɬ¤º¥ê¡¼ -¥¸¥ç¥ó³°¤Ë¤Ê¤ê¤Þ¤¹¡£¤½¤³¤Ç¡¢\Ey:xH ¤Ë¤è¤ë¥«¡¼¥½¥ë°ÜÆ°¤ËÂФ·¤Æ¤Ï¥¹¥¯¥í¡¼¥ë¤·¤Ê¤¤ -¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£¤³¤ì°Ê³°¤ÎÊýË¡¤Ç con.y ¤¬¥ê¡¼¥¸¥ç¥ó³°¤Ë½Ð¤¿¾ì¹ç¤Ï¡¢ÊÑ¿ô -scrollLine ¤ËŬÅö¤Ê¥¹¥¯¥í¡¼¥ë¹Ô¿ô¤¬²Ã»»¤µ¤ì¤Þ¤¹¡£con.ymin ¤è¤ê¾®¤µ¤¤¾ì¹ç¤ÏÉé -¿ô¡¢con.ymax ¤è¤êÂ礤¤¾ì¹ç¤ÏÀµ¿ô¤¬¤½¤ì¤¾¤ì²Ã»»¤µ¤ì¤Þ¤¹¡£À©¸æ¥³¡¼¥É(ɽ¼¨ÉÔ²Äǽ -ʸ»ú)¤¬ÆþÎϤµ¤ì¤¿»þÅÀ¤ÇÊÑ¿ô scrollLine ¤ò¼ÂºÝ¤Î¥¹¥¯¥í¡¼¥ë¤ËÈ¿±Ç¤·¤Þ¤¹¡£ - -£±.£³¡¥²¾Áۥƥ¥¹¥È - - ²¾Áۥƥ¥¹¥È¤Ï£³¤Ä¤Î¥Ð¥Ã¥Õ¥¡¤«¤é¤Ê¤ê¤Þ¤¹¡£ - -¡ü¥Æ¥¥¹¥È¥Ð¥Ã¥Õ¥¡ - - ¥Æ¥¥¹¥È¤Î¥¥ã¥é¥¯¥¿¥³¡¼¥É¤¬³ÊǼ¤µ¤ì¤Þ¤¹¡£È¾³Ñʸ»ú¤Ï¤½¤Î ASCII ¥³¡¼¥É¤¬¤½¤Î¤Þ -¤Þ³ÊǼ¤µ¤ì¤Þ¤¹¡£´Á»ú¤Î¾ì¹ç¤Ï EUC/SJIS ¤È¤â¤Ë JIS ¥³¡¼¥É¤ËÊÑ´¹¤µ¤ì¤Æ³ÊǼ¤µ¤ì¤Þ¤¹¡£ -¤Þ¤¿¡¢BIG5 ¤Ç¤Ï Mule ³ÈÄ¥¤Î "ESC$(0" ¤¬Íè¤ì¤Ð BIG5 ¤Î 16bit ¥³¡¼¥É¤ËÊÑ´¹¤µ¤ì¤Æ -³ÊǼ¤µ¤ì¤Þ¤¹¡£¤Þ¤¿¡¢EUC ¤Î¾ì¹ç¤Ï¤É¤Î¸À¸ì¤Ç¤â´Á»úƱÍÍ¤Ë 8bit ¤¬Í¤ì¤Æ³ÊǼ¤µ¤ì -¤Þ¤¹¤Î¤Ç¡¢BIG5 ¤Ç EUC ¤Ë¤¹¤ë¤È¾ðÊó¤¬Íî¤Á¤Þ¤¹¡£ - -¡ü¿§¡¦Â°À¥Ð¥Ã¥Õ¥¡ - - ¿§¤È°À¤Î¾ðÊ󤬳ÊǼ¤µ¤ì¤Þ¤¹¡£¤¿¤À¤·¡¢Á´³Ñʸ»ú¤Î¾ì¹ç¤Ï¼ã¤¤¥¢¥É¥ì¥¹¤Ë¤·¤«³ÊǼ -¤µ¤ì¤Þ¤»¤ó¡£³Æ¥Ó¥Ã¥È¤Î°ÕÌ£¤Ï°Ê²¼¤ÎÍͤʤâ¤Î¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ - - MSB LSB - |b7|b6|b5|b4|b3|b2|b1|b0| - - b2¡Áb0: ¥Õ¥©¥¢¥°¥é¥ó¥É¿§ - b3: ̤»ÈÍÑ - b6¡Áb4: ¥Ð¥Ã¥¯¥°¥é¥ó¥É¿§ - b7: ²¼Àþ°À - -¡ü¥Õ¥é¥°¥Ð¥Ã¥Õ¥¡ - - ¥Õ¥é¥°¥Ð¥Ã¥Õ¥¡¤Ï³ºÅö¥Æ¥¥¹¥È¤ÎÊѹ¹¾ðÊó¤È¸À¸ì¾ðÊó¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£MSB¤ÏÊѹ¹¾ð -Êó¤Ç¡¢¥Æ¥¥¹¥È¤Ø¤Î½ñ¤¹þ¤ß¤¬µ¯¤³¤ë¤È 0 ¤Ë¤Ê¤ê¡¢¤½¤ì¤¬¼Â²èÌ̤ØÈ¿±Ç¤µ¤ì¤ë¤È 1 ¤È -¤Ê¤ê¤Þ¤¹¡£¼¡¤Î 2bit ¤Ï Double Byte ¥³¡¼¥É¤ò°ÕÌ£¤·¤Æ¤ª¤ê¡¢Âè 1 ¥Ð¥¤¥È¤Ê¤é¤Ð b5 -¤¬¡¢Âè 2 ¥Ð¥¤¥È¤Ê¤é b6 ¤¬ 1 ¤È¤Ê¤ê¤Þ¤¹¡£Âè 1 ¥Ð¥¤¥È¤Î b3-b0 ¤Ë¤Ï¸À¸ì¾ðÊó¤¬Æþ¤ê -¤Þ¤¹¡£º£¸å¡¢Âбþ¸À¸ì¤¬Áý¤¨¤ì¤Ð b4 ¤¢¤ë¤¤¤Ï Âè 2 ¥Ð¥¤¥È¤Î¶õ¤¥Ó¥Ã¥È¤ò¸À¸ì¾ðÊó¤Ë -³ä¤êÅö¤Æ¤ëͽÄê¤Ç¤¢¤ë¡£¸À¸ì¾ðÊó¤Ï¡¢ - - enum { - DF_GB2312, - DF_JISX0208, - DF_KSC5601, - DF_JISX0212, - DF_BIG5_0, - DF_BIG5_1 - }; - -¤ÈÄêµÁ¤·¤Æ¤¤¤Þ¤¹¡£ - - MSB LSB - | b7| b6| b5|b4||b3|b2|b1|b0| - |CLEAN_S|LATCH_2|LATCH_1| ||<--------->| - |0=latch| byte2| byte1| || LANG| - - 80x30 ¤Î ɸ½à VGA ²èÌ̤ǥƥ¥¹¥ÈºÂɸ[5, 3](º¸¶ù¤Ï[0, 0])¤Ë¡Ö1¤¢¡×¤òÇò¿§ÇØ·Ê¿§ -̵¤·¤Çɽ¼¨¤¹¤ë¤È¡¢ - - ÁêÂÐ¥¢¥É¥ì¥¹: 80 x 3 + 5 = 245 - ¡Ö1¡×¤Î ASCII ¥³¡¼¥É: 0x31 - ¡Ö¤¢¡×¤Î JIS ¥³¡¼¥É: 0x2422 - Çò¿§ÇØ·Ê¿§¤Ê¤·: 00000111(B) = 0x07 - - textBuff[245] = 0x31 - attrBuff[245] = 0x07 - flagBuff[245] = 0x00 - - textBuff[246] = 0xA2 - textBuff[247] = 0x24 - attrBuff[246] = 0x07 - attrBuff[247] = 0x07 - flagBuff[246] = 0x22 - flagBuff[247] = 0x40 - -¤È¤Ê¤ê¤Þ¤¹¡£ - -£²¡¥VGA - - ²¾Áۥƥ¥¹¥È¤òºÎÍѤ¹¤ë¤³¤È¤Ë¤è¤ê VGA ÁàºîÉôʬ¤ò¾®¤µ¤¯¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤·¤¿¡£ -EGA ¤Ê¤É¤Ø¤Î°Ü¿¢¤â³Ú¤Ë¤Ê¤Ã¤¿¤È»×¤¤¤Þ¤¹¡£ - -£².£±¡¥¥ì¥¸¥¹¥¿ - -£².£²¡¥´ðËÜÁàºî - -¡ü¹½Â¤ÂÎ dInfo - - ɽ¼¨Ç½ÎϤò¼¨¤¹¾ðÊó¤òÊݸ¤·¤Æ¤¤¤Þ¤¹¡£³ÆÃÍ¤Ï kon.cfg ¤«¤éÆɤ߹þ¤Þ¤ì¤¿¤â¤Î¡¢ -¤¢¤ë¤¤¤Ï¤½¤ì¤é¤Ë¤è¤ê»»½Ð¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£ - -struct dispInfo { - int gsize; ¥°¥é¥Õ¥£¥Ã¥¯¥á¥â¥ê¥µ¥¤¥º - = glineByte * gydim - short gxdim, ¥°¥é¥Õ¥£¥Ã¥¯ X ¥É¥Ã¥È¿ô - glineChar ¤ÎÀ°¿ôÇܤˤʤë¤è¤¦¤ËÀµµ¬²½¤µ¤ì¤¿ÃÍ - gydim, ¥°¥é¥Õ¥£¥Ã¥¯ Y ¥é¥¤¥ó¿ô - txmax, ¥Æ¥¥¹¥È X ºÇÂçÃÍ(con.xmax ¤Î½é´üÃÍ) - tymax, ¥Æ¥¥¹¥È Y ºÇÂçÃÍ(con.ymax ¤Î½é´üÃÍ) - glineChar, ¥Æ¥¥¹¥È£±¹Ôʬ¤Î¥°¥é¥Õ¥£¥Ã¥¯¥é¥¤¥ó¿ô - = gydim / (tymax + 1) - glineByte, ¥°¥é¥Õ¥£¥Ã¥¯£±¹Ôʬ¤Î¥Ð¥¤¥È¿ô - = gxdim / 8 - tlineByte; ¥Æ¥¥¹¥È£±¹Ôʬ¤Î¥°¥é¥Õ¥£¥Ã¥¯¥Ð¥¤¥È¿ô - = glineChar * glineByte -}; - -¡ü¹½Â¤ÂÎ cInfo - - ¥«¡¼¥½¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤Ç¤¹¡£ÅÀÌDzó¿ô¤Ï¶ö¿ô¤Ê¤éɽ¼¨Ãæ¤ò°ÕÌ£¤·¤Æ¤ª¤ê¡¢¥¹¥¯¥ê¡¼¥ó -¥»¥¤¥Ð¡¼¤Î¥«¥¦¥ó¥¿¡¼¤Ë¤â»È¤ï¤ì¤Æ¤¤¤Þ¤¹¡£addr ¤Ï VgaSetCursorAddress ¤Ë¤è¤Ã¤Æ -·×»»¤µ¤ì¤Þ¤¹¡£kanji ¤Ï¥«¡¼¥½¥ë°ÌÃÖ¤¬Á´³Ñ¤Ê¤éÈó£°ÃͤȤʤê¤Þ¤¹¡£É½¼¨¥¹¥¤¥Ã¥Á¤Ï -ESC ¥·¡¼¥±¥ó¥¹¤Ë¤è¤Ã¤ÆÁàºî¤µ¤ì¤Þ¤¹¡£ - -struct cursorInfo { - short kanji; ´Á»ú¤Î¾å¤Ë¤¢¤ì¤Ð TRUE - u_int addr; VRAM ¥¢¥É¥ì¥¹ - bool sw; FALSE ¤Ê¤éɽ¼¨¶Ø»ß - int interval; ÅÀÌÇ´Ö³Ö - int count; ÅÀÌÇÍÑ¥«¥¦¥ó¥È - bool shown; ɽ¼¨Ãæ¥Õ¥é¥° -}; - -£².£³¡¥WideText - - KON ¤Ç¤Ï VGA ¤ò¹â²òÁüÅ٥⡼¥É¤Ë°Ü¹Ô¤¹¤ë¤¿¤á¤Ë VGA ¤Î CRT À©¸æ¥ì¥¸¥¹¥¿¤È MISC -¥ì¥¸¥¹¥¿¤ò kon.cfg ¥Õ¥¡¥¤¥ë¤Ç»ØÄê¤Ç¤¤ëÍͤˤ·¤Æ¤¤¤Þ¤¹¡£VGA ËÜÍè¤Îµ¬³Ê¤«¤é¤¹¤ì¤Ð -800x600 ¤Þ¤Ç¤Î²òÁüÅ٤Ǥ¢¤ì¤Ð CRT À©¸æ¥ì¥¸¥¹¥¿¤È MISC ¥ì¥¸¥¹¥¿¤Î¤ß¤Ë¤è¤Ã¤Æ VGA -¤Î²òÁüÅÙ¤òÊѹ¹¤Ç¤¤ë¤è¤¦¤Ë»×¤¨¤ë¤Î¤Ç¤¹¤¬¡¢SVGA ¥«¡¼¥É¤¬»ý¤ÄÊ£¿ô¤Î¥â¡¼¥É¤ÎËؤó¤É -¤Ï¾¤Î¥ì¥¸¥¹¥¿¤Ë°Í¸¤·¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£ - -¡ü¹½Â¤ÂÎ regText, regGraph - - VGA ¤Î¥ì¥¸¥¹¥¿¾ðÊó¤Ç¤¹¡£regGraph ¤Î¾ì¹ç¤Ï CRT À©¸æ¥ì¥¸¥¹¥¿¡¢misc ¥ì¥¸¥¹¥¿¤Ï -kon.cfg ¤«¤éÆɤ߹þ¤Þ¤ì¤Þ¤¹¡£CRT À©¸æ¥ì¥¸¥¹¥¿¤Ï¹¹¤Ë·×»»¤¬»Ü¤µ¤ì¤Þ¤¹¡£dInfo.gydim -¤Ï kon.cfg ¤«¤éÆɤ߹þ¤Þ¤ì¤ë»þ¤Ëɽ¼¨Í¸ú¤ÊÃͤËÊÑ´¹¤µ¤ì¤Þ¤¹¡£¤³¤ÎÃͤò´ð¤Ë VGA ¦ -¤Îɽ¼¨¥é¥¤¥ó¿ô¤òÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£É½¼¨¥é¥¤¥ó¿ô¤Ï CRT À©¸æ¥ì¥¸¥¹¥¿¤Ë¤¢¤ê¡¢ - 0x12 ¤ÎÁ´¥Ó¥Ã¥È : ²¼°Ì16¥Ó¥Ã¥È - 0x07 ¤ÎÂ裲¥Ó¥Ã¥È: Â裹¥Ó¥Ã¥È - 0x07 ¤ÎÂ裷¥Ó¥Ã¥È: Âè10¥Ó¥Ã¥È -¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢ - regGraph.crt[0x12] = (dInfo.gydim - 1) & 0xFF; - regGraph.crt[7] &= 0xBD; - regGraph.crt[7] |= ((dInfo.gydim - 1) & 0x100) >> 7; - regGraph.crt[7] |= ((dInfo.gydim - 1) & 0x200) >> 3; -¤È¤¤¤¦Áàºî¤ò»Ü¤·¤Æ¤¤¤Þ¤¹¡£ - -struct vgaRegs { - u_char crt[VGACRT_CNT], CRT À©¸æ¥ì¥¸¥¹¥¿ - att[VGAATTR_CNT], °À¥ì¥¸¥¹¥¿ - gra[VGAGRP_CNT], ¥°¥é¥Õ¥£¥Ã¥¯¥¹À©¸æ¥ì¥¸¥¹¥¿ - seq[VGASEQ_CNT], ¥·¡¼¥±¥ó¥µ - mis; misc ¥ì¥¸¥¹¥¿ -}; - -¡üÊÑ¿ô LineComp8, LineComp9 - - ¥é¥¤¥óÈæ³Ó¥ì¥¸¥¹¥¿¤Ï 0x18 ¤Ë¤¢¤ê¤Þ¤¹¤¬¡¢¤½¤ÎÂ裹¥Ó¥Ã¥È¤ÈÂè10¥Ó¥Ã¥È¤Ï¤½¤ì¤¾¤ì -0x07 ¤ª¤è¤Ó 0x09 ¤Ë¤¢¤ê¤Þ¤¹¡£¤³¤ì¤é¤Î¥Ó¥Ã¥È°Ê³°¤ÎÃͤȥ쥸¥¹¥¿ÈÖ¹æ¤ò¤Þ¤È¤á¤¿Êª¤¬ -LineComp8 ¤È LineComp9 ¤Ç¤¹¡£ - -£³¡¥¥½¥±¥Ã¥È¤Ë¤è¤ëÄÌ¿® - - ÍÍ¡¹¤Ê³ÈÄ¥À¤ò¹Í¤¨¤Æ¥½¥±¥Ã¥È¤òÍÑ°Õ¤·¤¿¤Î¤Ç¤¹¤¬¡¢¤Þ¤À¥Õ¥©¥ó¥È¥í¡¼¥É¤Ë¤·¤«»È¤ï -¤ì¤Æ¤¤¤Þ¤»¤ó¡£¤Þ¤È¤â¤Ê¥×¥í¥È¥³¥ë¤òºîÀ®¡¦¼ÂÁõ¤¹¤ëÃ챤â»þ´Ö¤â¤Ê¤¤¤Î¤ÇÄÌ¿®Êý¼°¤¬ -¤¤¤¤²Ã¸º¤Ê¤â¤Î¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ - -£³.£±¡¥¥½¥±¥Ã¥È̾ - - KON ¤Î¥½¥±¥Ã¥È¤Ï /tmp ¤ËºîÀ®¤µ¤ì¤Þ¤¹¡£¤½¤Î̾Á°¤Ï .kon ¤Î¸å¤Ë¿ôʸ»ú£±Ê¸»ú¤ò¤È -¤â¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£¤³¤Î¿ô»ú¤Ï KON ¤¬ÍøÍѤ·¤Æ¤¤¤ëµ¿»÷üËö̾¤ÎËöÈø¤Î¿ôʸ»ú¤ÈÅù¤·¤¯¤Ê -¤ê¤Þ¤¹¡£¤Þ¤¿¡¢GON ¥é¥¤¥Ö¥é¥ê¤Î SocketClientOpen ´Ø¿ô¤òÍøÍѤ¹¤ì¤Ð¼«Æ°Åª¤ËŬÅö¤Ê -¥½¥±¥Ã¥È̾¤ò»È¤¦¤Î¤Ç¡¢Ì¾Á°¤ò°Õ¼±¤¹¤ë¤³¤È̵¤¯¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ -¤¹¡£ - -£³.£²¡¥´ðËÜŪ¤ÊÄÌ¿®Êý¼° - - ÄÌ¿®¤Ï messageHeader ¹½Â¤ÂΤòÍѤ¤¤Æ¹Ô¤ï¤ì¤Þ¤¹¡£ - - struct messageHeader { - u_char cno, ¥¯¥é¥¤¥¢¥ó¥ÈÈÖ¹æ(̤»ÈÍÑ) - cmd; µ¡Ç½¥³¡¼¥É - }; - - ¥¯¥é¥¤¥¢¥ó¥È¤¬µ¡Ç½¥³¡¼¥É¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤ÆÄÌ¿®¤¬³«»Ï¤µ¤ì¤Þ¤¹¡£µ¡Ç½¥³¡¼¥É -¤ÏȾ³Ñʸ»ú£±Ê¸»ú¤Ç¤¹¡£ - - S: Ⱦ³Ñʸ»ú¥Õ¥©¥ó¥È¥í¡¼¥É - W: Á´³Ñʸ»ú¥Õ¥©¥ó¥È¥í¡¼¥É - -µ¡Ç½¥³¡¼¥É¤òǧ¼±¤·¤¿ KON ¤Ï ACK ¤òµ¡Ç½¥³¡¼¥É¤È¤·¤¤¤ÆÁ÷¤êÊÖ¤·¤Þ¤¹¡£Ç§¼±¤Ç¤ -¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï NAK ¤òÊÖ¤·¤Þ¤¹¡£°Ê¸å¡¢¥Ç¡¼¥¿¤ò¼õ¿®¤¹¤ë¤´¤È¤Ë KON ¤Ï ACK ¤¢¤ë¤¤ -¤Ï NAK ¤òÁ÷¿®¤·¤Þ¤¹¡£¥¯¥é¥¤¥¢¥ó¥È¦¤Ï NAK ¤ò¼õ¤±¼è¤ì¤Ðľ¤Á¤ËÁ÷¿®¤òÃæ»ß¤Ê¤±¤ì -¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ - -£³.£³¡¥¥Õ¥©¥ó¥È¥í¡¼¥É¤ÎÊý¼° - - ¥Õ¥©¥ó¥È¥í¡¼¥À¤¬ KON ¤Ë¥Õ¥©¥ó¥È¥Ç¡¼¥¿¤òÁ÷¿®¤¹¤ëºÝ¤Î¼ê½ç¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹¡£ - - ¥Õ¥©¥ó¥È¥í¡¼¥À (fld.*) <-- /usr/tmp/.kon? --> KON - - Function: S|W --------------------> - S = Ⱦ³Ñ¥Õ¥©¥ó¥È - W = ´Á»ú¥Õ¥©¥ó¥È - <-------------------- ¹ÎÄê±þÅú (ACK) - fontInfo ¹½Â¤ÂÎ --------------------> - <-------------------- ¹ÎÄê±þÅú (ACK) - ¥Õ¥©¥ó¥È¥Ç¡¼¥¿¤ò BUFSIZ ¤Ç¥Õ¥é¥°¥á¥ó¥È²½¤·¤Æ°Ê²¼¤ò·«¤êÊÖ¤¹: - ¥Ç¡¼¥¿¥°¥é¥à --------------------> - <-------------------- ¹ÎÄê±þÅú (ACK) - -£´¡¥¥Þ¥¦¥¹¥É¥é¥¤¥Ð - - ¥Þ¥¦¥¹¥É¥é¥¤¥Ð¤Ï selection-1.4 ¤ò»²¹Í¤Ë½ñ¤¤Þ¤·¤¿¡£¤·¤¿¤¬¤Ã¤Æ£µµ¡¼ïÂбþ¤È¤Ê¤Ã -¤Æ¤¤¤Þ¤¹¤¬¡¢¤³¤Á¤é¤Ç¥Æ¥¹¥È¤·¤Æ¤¤¤ë¤Î¤Ï MircoSoft ¤È Mouse Systems ¤Î¤ß¤Ç¤¹¡£ - -¡ü¹½Â¤ÂÎ mInfo - - ¥Þ¥¦¥¹¤Ë´Ø¤¹¤ë¾ðÊó¤ò´ÉÍý¤·¤Æ¤¤¤Þ¤¹¡£ºÂɸ¾ðÊó¤ÏÁ´¤Æ¥Æ¥¥¹¥ÈºÂɸ·Ï¤Çɽ¸½¤µ¤ì¤Æ -¤¤¤Þ¤¹¡£¥«¡¼¥½¥ëɽ¼¨¼÷Ì¿¤Ï¥«¡¼¥½¥ë¤¬ÅÀÌǤ¹¤ë¤´¤È¤Ë¥Ç¥¯¥ê¥á¥ó¥È¤µ¤ì¡¢£°¤Ë¤Ê¤Ã¤¿ -»þÅÀ¤Ç¥Þ¥¦¥¹¥«¡¼¥½¥ë¤¬É½¼¨¤µ¤ì¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£¥Þ¥¦¥¹¤Î¾õÂÖ¤¬ÊѲ½¤·¤¿»þ¤Ï¾ï¤Ë¤³¤Î -Ãͤò MOUSE_LIFETIME(¥Ç¥Õ¥©¥ë¥È 22) ¤Ç½é´ü²½¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ - -struct mouseInfo { - char x, y, ¥Þ¥¦¥¹¥«¡¼¥½¥ë°ÌÃÖ - dx, dy, ¥Þ¥¦¥¹¥«¡¼¥½¥ë°ÜÆ°ÃÍ - sx, sy, º¸¥Ü¥¿¥ó¥¯¥ê¥Ã¥¯°ÌÃÖ - sw, ¥«¡¼¥½¥ëɽ¼¨¼÷Ì¿ - stat; ¥Ü¥¿¥ó¾õÂÖ -}; - -¡üÊÑ¿ô dx, dy - - ´Ø¿ô MouseAnalyzePacket ¤Ç»È¤ï¤ì¤Æ¤¤¤ë static ÊÑ¿ô dx, dy ¤Ï¥°¥é¥Õ¥£¥Ã¥¯¥¹ -ºÂɸ·Ï¤Î¥Þ¥¦¥¹°ÜÆ°ÃͤǤ¹¡£¥Þ¥¦¥¹¤ò¤æ¤Ã¤¯¤ê¤ÈÆ°¤«¤·¤¿¾ì¹ç¤Ç¤â¤Á¤ã¤ó¤ÈÈ¿±Ç¤µ¤ì¤ë -Íͤˤ¹¤ë¤¿¤á¤ËÍÑ°Õ¤·¤Þ¤·¤¿¡£ - -¡üÊÑ¿ô oldstat - - ´Ø¿ô MouseAnalyzePacket ¤Ç»È¤ï¤ì¤Æ¤¤¤ë static ÊÑ¿ô oldstat ¤Ï mInfo.stat ¤Î -Á°²ó¤Î¾õÂ֤Ǥ¹¡£ - -¡ü¥Õ¥¡¥¤¥ë /tmp/.kontmp - - ¥Þ¥¦¥¹¤Ç¥«¥Ã¥È¤·¤¿¥Ð¥Ã¥Õ¥¡¤ò³ÊǼ¤¹¤ë¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ - -£µ¡¥Â¿¸À¸ì¤Ë´Ø¤¹¤ë°·¤¤ - - ¥Õ¥©¥ó¥È¤Ï lib/coding.c ¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤¬ÍøÍѤǤ¤Þ¤¹¡£¿·¤¿¤Ê¥Õ¥©¥ó¥È -¤ÎÅÐÏ¿¤Ï Single Byte ¤Î¾ì¹ç¤Ï coding.c:fSRegs, coding.c:fldSRegs ¤Ë¡¢ -Double Byte ¤Î¾ì¹ç¤Ï coding.c:fDRegs, coding.c:fldDRegs, ¤½¤·¤Æ vt.h ¤Î -DF_?????? ¤Ëµ½Ò¤·¤Æ²¼¤µ¤¤¡£¤½¤ì¤¾¤ì¤Î¾ðÊó¤Ï 1 ÂÐ 1 ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢ -½ç½ø¤ò¼é¤Ã¤Æ²¼¤µ¤¤¡£ - -£¶¡¥GON ¥é¥¤¥Ö¥é¥ê - - KON ¤È¤ÎÄÌ¿®¤òÍưפ˹Ԥ¦¤¿¤á¤ËÍÑ°Õ¤·¤¿¥é¥¤¥Ö¥é¥ê¤Ç¤¹¡£ - -£¶.£±¡¥¥á¥â¥êÁàºî´Ø¿ô - -¢£void PortOutw(u_short value, u_short port) - - I/O ¥Ý¡¼¥È¤Ø£²¥Ð¥¤¥Èñ°Ì¤Î½ÐÎϤò¹Ô¤¤¤Þ¤¹¡£ - -¢£void PortOutb(char value, u_short port) - - I/O ¥Ý¡¼¥È¤Ø£±¥Ð¥¤¥Èñ°Ì¤Î½ÐÎϤò¹Ô¤¤¤Þ¤¹¡£ - -¢£u_char PortInb(unsigned short port) - - I/O ¥Ý¡¼¥È¤«¤é£±¥Ð¥¤¥Èñ°Ì¤ÎÆþÎϤò¹Ô¤¤¤Þ¤¹¡£ - -¢£void bzero2(void *buff, int n) - - stosb ¤ò»È¤Ã¤¿¹â®¤Ê¥¼¥íËä¤á´Ø¿ô¤Ç¤¹¡£·ë²Ì¤Ï bzero ¤ÈƱ¤¸¤Ç¤¹¡£ - -¢£void wzero(void *buff, int n) - - stosw ¤ò»È¤Ã¤¿¹â®¤Ê¥¼¥íËä¤á´Ø¿ô¤Ç¤¹¡£n ¥Ð¥¤¥È¤ò¥¼¥íËä¤á¤¹¤ë¤³¤È¤ËÃí°Õ¤·¤Æ -²¼¤µ¤¤¡£ - -¢£void lzero(void *buff, int n) - - stosl ¤ò»È¤Ã¤¿¹â®¤Ê¥¼¥íËä¤á´Ø¿ô¤Ç¤¹¡£n ¥Ð¥¤¥È¤ò¥¼¥íËä¤á¤¹¤ë¤³¤È¤ËÃí°Õ¤·¤Æ -²¼¤µ¤¤¡£ - -¢£void bmove(void *dst, void *src, int n) - - movsb ¤ò»È¤Ã¤¿¹â®¤Ê¥Ð¥Ã¥Õ¥¡Å¾Á÷´Ø¿ô¤Ç¤¹¡£ - -¢£void brmove(void *dst, void *src, int n) - - movsb ¤ò»È¤Ã¤¿¹â®¤ÊµÕÊý¸þ¥Ð¥Ã¥Õ¥¡Å¾Á÷´Ø¿ô¤Ç¤¹¡£src, dst ¤«¤éµÕÊý¸þ¤Ë n -¥Ð¥¤¥È¤ÎžÁ÷¤ò¹Ô¤¤¤Þ¤¹¡£ - -¢£void wmove(void *dst, void *src, int n) - - movsw ¤ò»È¤Ã¤¿¹â®¤Ê¥Ð¥Ã¥Õ¥¡Å¾Á÷´Ø¿ô¤Ç¤¹¡£n ¥Ð¥¤¥ÈžÁ÷¤¹¤ë¤³¤È¤ËÃí°Õ¤·¤Æ²¼ -¤µ¤¤¡£ - -¢£void lmove(void *dst, void *src, int n) - - movsl ¤ò»È¤Ã¤¿¹â®¤Ê¥Ð¥Ã¥Õ¥¡Å¾Á÷´Ø¿ô¤Ç¤¹¡£n ¥Ð¥¤¥ÈžÁ÷¤¹¤ë¤³¤È¤ËÃí°Õ¤·¤Æ²¼ -¤µ¤¤¡£ - -£¶.£²¡¥¥½¥±¥Ã¥ÈÁàºî´Ø¿ô - -¢£void SocketKill(int fd) - - ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥×¥ê¥¿¤Ç»ØÄꤵ¤ì¤¿¥½¥±¥Ã¥È¤ò¥¯¥í¡¼¥º¤·¡¢KON ¤Î¥½¥±¥Ã¥È¤ò -ºï½ü¤¹¤ë¡£ - -¢£int SocketRecCommand(int fd, struct messageHeader *mh) - - ¥½¥±¥Ã¥È¤«¤é¡¢messageHeader ¹½Â¤ÂΤòÆɤ߹þ¤à - -¢£int SocketSendCommand(int fd, char *cmd) - - ¥¯¥é¥¤¥¢¥ó¥È¤«¤é¡¢KON ¤Ëµ¡Ç½¥³¡¼¥É¤òÁ÷¤ê¤Þ¤¹¡£ - -¢£int SocketClientOpen() - - KON ¤Î¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£ - -¢£int SocketSendData(u_char *buff, int size, int fd) - - ¥Ç¡¼¥¿¥Ð¥Ã¥Õ¥¡¤ò BUFSIZ ¤Ç¥Õ¥é¥°¥á¥ó¥È²½¤·¤Ê¤¬¤é¥½¥±¥Ã¥È¤ØÁ÷¤ê½Ð¤·¤Þ¤¹¡£ - -¢£char socketName[MAX_SOCKET_NAME+1] - - ´Ø¿ô SocketClientOpen ¤ÇºîÀ®¤µ¤ì¤¿¥½¥±¥Ã¥È̾¤¬µ²±¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ç¤¹¡£ - -£¶.£³¡¥¤½¤Î¾ - -¢£FILE *CapSearchLabel(char *label) - - kon.cfg ¤«¤é»ØÄꤵ¤ì¤¿¥é¥Ù¥ë¤ò¸¡º÷¤¹¤ë´Ø¿ô¡£¥é¥Ù¥ë¤ÎÊÌ̾¤âÄ´¤Ù¤ë¡£°ìÃפ¹¤ë -¥é¥Ù¥ë¤ò¸«¤Ä¤±¤¿¾ì¹ç¤Ï FILE ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£ diff --git a/loader/kon2/font/Makefile b/loader/kon2/font/Makefile deleted file mode 100644 index be3a81541..000000000 --- a/loader/kon2/font/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -OBJ = fld.o minix.o fontx2.o bdf.o j3100.o - -ifeq (../.config,$(wildcard ../.config)) -include ../.config -endif - -#CC = cc -g -#LD = cc -g - -LOADLIBES = $(LIB) - -all: fld - -fld: $(OBJ) $(LIB) - $(LD) -o fld $(OBJ) $(LIB) - -bdfcat: bdf.c $(LIB) - $(CC) $(CFLAGS) -DBDFCAT -o bdfcat bdf.c $(LIB) - -depend .depend: - $(CC) $(CFLAGS) -M *.c > .depend - -clean: - $(RM) *.o fld fontx.c *~ .depend - -install: fld - $(INSTALL) -m 4755 fld $(BINDIR) - -ifeq (.depend,$(wildcard .depend)) -include .depend -endif diff --git a/loader/kon2/font/Makefile.FreeBSD b/loader/kon2/font/Makefile.FreeBSD deleted file mode 100644 index 84a2317fd..000000000 --- a/loader/kon2/font/Makefile.FreeBSD +++ /dev/null @@ -1,23 +0,0 @@ -# Tatsumi Hosokawa <hosokawa@jp.FreeBSD.org> - -SRCS= fld.c minix.c fontx2.c bdf.c # j3100.c -CFLAGS+= -I${.CURDIR}/../include -CLEANFILES= Makefile - -NOMAN= YES - -.if exists(${.CURDIR}/../.config) -.include "${.CURDIR}/../.config" -.endif - -PROG= fld - -.if exists(${.OBJDIR}/../lib) -LIBOBJ= -L${.OBJDIR}/../lib -.else -LIBOBJ= -L${.CURDIR}/../lib -.endif - -LDADD= ${LIBOBJ} -lgon - -.include <bsd.prog.mk> diff --git a/loader/kon2/font/Makefile.linux b/loader/kon2/font/Makefile.linux deleted file mode 100644 index be3a81541..000000000 --- a/loader/kon2/font/Makefile.linux +++ /dev/null @@ -1,31 +0,0 @@ -OBJ = fld.o minix.o fontx2.o bdf.o j3100.o - -ifeq (../.config,$(wildcard ../.config)) -include ../.config -endif - -#CC = cc -g -#LD = cc -g - -LOADLIBES = $(LIB) - -all: fld - -fld: $(OBJ) $(LIB) - $(LD) -o fld $(OBJ) $(LIB) - -bdfcat: bdf.c $(LIB) - $(CC) $(CFLAGS) -DBDFCAT -o bdfcat bdf.c $(LIB) - -depend .depend: - $(CC) $(CFLAGS) -M *.c > .depend - -clean: - $(RM) *.o fld fontx.c *~ .depend - -install: fld - $(INSTALL) -m 4755 fld $(BINDIR) - -ifeq (.depend,$(wildcard .depend)) -include .depend -endif diff --git a/loader/kon2/font/bdf.c b/loader/kon2/font/bdf.c deleted file mode 100644 index 05225958a..000000000 --- a/loader/kon2/font/bdf.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include <stdio.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/ioctl.h> -#include <sys/file.h> -#include <string.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <errno.h> - -#include <interface.h> -#include <fnld.h> - -extern struct fontInfo fi; -extern forceLoad; - -u_char *FontLoadBdf(fp) -FILE *fp; -{ - char *fdata = NULL, line[256], *p, *w, reg[256]; - u_char ch, ch2; - int num, width, high, i, code, data, k, n; - struct fontRegs *fReg; - struct fontLoaderRegs *fldReg; - - fReg = &fSRegs[0]; - fldReg = &fldSRegs[0]; - fi.type = CodingByRegistry("ISO8859-1"); - num = width = high = 0; - while(fgets(line, 256, fp)) { - if (!width && !high && - !strncmp("FONTBOUNDINGBOX", line, - strlen("FONTBOUNDINGBOX"))) { - p = line + sizeof("FONTBOUNDINGBOX"); - sscanf(p, "%d %d", &width, &high); - } else if (!strncmp("CHARSET_REGISTRY", line, 16)) { - p = line + sizeof("CHARSET_REGISTRY"); - while(*p != '"') p ++; - w = ++p; - while(*p != '"') p ++; - *p = '\0'; - strcpy(reg, w); - } else if (!strncmp("CHARSET_ENCODING", line, 16)) { - p = line + sizeof("CHARSET_ENCODING"); - while(*p != '"') p ++; - w = ++p; - while(*p != '"') p ++; - *p = '\0'; - strcat(reg, "-"); - strcat(reg, w); - fi.type = CodingByRegistry(reg); - } else if (!num && !strncmp("CHARS ", line, 6)) { - p = line + sizeof("CHARS"); - sscanf(p, "%d", &num); - break; - } - } - fi.width = width; - fi.high = high; - if (fi.type & CHR_DBC) { - fldReg = &fldDRegs[fi.type&~CHR_DFLD]; - fReg = &fDRegs[fi.type&~CHR_DFLD]; - if (fldReg->max) - fi.size = fldReg->addr(fldReg->max >> 8, fldReg->max & 0xFF) - + 16; - else - fi.size = (width / 8 + ((width % 8 > 0) ? 1: 0)) * num * 16; - width = 0; - } else { - fldReg = &fldSRegs[fi.type&~CHR_SFLD]; - fReg = &fSRegs[fi.type&~CHR_SFLD]; - if (fldReg->max) - fi.size = fldReg->max * 16; - else - fi.size = num * 16; - } - if ((fdata = (u_char *)malloc(fi.size)) == NULL) return(NULL); - k = 0; - while(fgets(line, 256, fp)) { - if (!strncmp("ENCODING", line, strlen("ENCODING"))) { - p = line + sizeof("ENCODING"); - code = atoi(p); - } else if (!strncmp("BITMAP", line, strlen("BITMAP"))) { - p = fdata + code * 16; - k ++; -#ifdef BDFCAT - printf("----- %X -----\n", code); -#endif - if (!(fi.type & CHR_DBC)) { - for (i = 0; i < fi.high; i ++, p ++) { - fscanf(fp, "%2X", &data); -#ifdef BDFCAT - for (n = 0; n < 7; n ++) - printf("%c", ((data << n) & 0x80) ? '#':' '); - printf("\n"); -#else - *p = data; -#endif - } - } else { - ch = (code >> 8) & 0xFF; - ch2 = code & 0xFF; - num = fldReg->addr(ch, ch2); - if (num > width) width = num; - p = fdata + num; - for (i = 0; i < fi.high; i ++, p ++) { - fscanf(fp, "%4X", &data); -#ifdef BDFCAT - for (n = 0; n < 15; n ++) - printf("%c", ((data << n) & 0x80) ? '#':' '); - printf("\n"); -#else - *p = (data >> 8) & 0xFF; - p ++; - *p = data & 0xFF; -#endif - } - } - } - } - return(fdata); -} - -#ifdef BDFCAT -struct fontInfo fi; -forceLoad; - -void main(int argc, char *argv[]) -{ - FILE *fp; - - fp = fopen(argv[1], "r"); - FontLoadBdf(fp); -} -#endif diff --git a/loader/kon2/font/fld.c b/loader/kon2/font/fld.c deleted file mode 100644 index d27a7ab35..000000000 --- a/loader/kon2/font/fld.c +++ /dev/null @@ -1,258 +0,0 @@ -/* - KON - Kanji ON Linux Console - - Copyright (C) 1992, 1993 Takashi MANABE (manabe@tut.ac.jp) - - KON is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - KON is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <sys/types.h> -#include <sys/file.h> -#include <string.h> -#include <ctype.h> -#include <sys/ipc.h> -#include <sys/shm.h> -#include <sys/socket.h> -#include <errno.h> - -#include <interface.h> -#include <fnld.h> - -int forceLoad=1; -struct fontInfo fi; - -u_char *FontLoadMinix(); -u_char *FontLoadFontx(); -u_char *FontLoadBdf(); -#if defined(linux) -u_char *FontLoadJ3100(); -#endif - -static struct { - char *type; - u_char* (*loader)(FILE *fp); -} fontLoaders[] = { - {"minix", FontLoadMinix}, - {"fontx", FontLoadFontx}, - {"bdf", FontLoadBdf}, - {"j3100", NULL}, - {NULL, NULL} -}; - -void UnloadShmem(char fnum) -{ - key_t shmkey; - int shmid; - struct shmid_ds shmseg; - -#if defined(linux) - shmkey = ftok(CONFIG_NAME, fnum); -#elif defined(__FreeBSD__) - shmkey = 5000 + (fnum & 0x7F); -#endif - if ((shmid = shmget(shmkey, sizeof(struct fontInfo), 0444)) < 0) - return; - shmctl(shmid, IPC_STAT, &shmseg); - if (shmseg.shm_nattch < 1) { - shmctl(shmid, IPC_RMID, 0); - } -} - -int CheckLoadedFont(char fnum) -{ - key_t shmkey; - extern int forceLoad; - - if (forceLoad) return(EOF); -#if defined(linux) - shmkey = ftok(SHMEM_NAME, fnum); -#elif defined(__FreeBSD__) - shmkey = 5000 + (fnum & 0x7F); -#endif - if (shmget(shmkey, 1, 0444) == EOF) return(EOF); - return(0); -} - -static - void ShmFont(char *prog, u_char *font, struct fontInfo *fi) -{ - key_t shmkey; - int shmid; - u_char *shmbuff; - -#if defined(linux) - shmkey = ftok(SHMEM_NAME, fi->type); -#elif defined(__FreeBSD__) - shmkey = 5000 + (fi->type & 0x0000007F); -#endif - shmid = shmget(shmkey, fi->size+sizeof(struct fontInfo), - IPC_CREAT|0666); - shmbuff = shmat(shmid, 0, 0); - memcpy(shmbuff, fi, sizeof(struct fontInfo)); - memcpy(shmbuff + sizeof(struct fontInfo), font, fi->size); - shmdt(shmbuff); - fprintf(stderr, "%s> load %s in shmem(%d): %d Bytes\n", - prog, - (fi->type & CHR_DBC) ? - fDRegs[fi->type&~CHR_DFLD].registry: - fSRegs[fi->type&~CHR_SFLD].registry, - shmid, fi->size); -} - -int SetFont(char *prog, u_char *font, struct fontInfo *fi) -{ - int s; - - if ((s = SocketClientOpen()) > 0) { - SocketSendCommand(s, CHR_UNLOAD); - close(s); - } - ShmFont(prog, font, fi); - if ((s = SocketClientOpen()) > 0) { - SocketSendCommand(s, CHR_LOAD); - close(s); - } - return(0); -} - -void -ShowShmem(u_char fnum) -{ - key_t shmkey; - int shmid; - struct fontInfo *fi; - -#if defined(linux) - shmkey = ftok(CONFIG_NAME, fnum); -#elif defined(__FreeBSD__) - shmkey = 5000 + (fnum & 0x7F); -#endif - if ((shmid = shmget(shmkey, sizeof(struct fontInfo), 0444)) < 0) - return; - fi = (struct fontInfo*)shmat(shmid, 0, SHM_RDONLY); - if (fi) { - printf("%3X %6d %-15s %2dx%2d %7d\n", - fnum&~CHR_SFLD, - shmid, - (fnum & CHR_DBC) ? - fDRegs[fnum&~CHR_DFLD].registry: - fSRegs[fnum&~CHR_SFLD].registry, - fi->width, - fi->high, - fi->size); - } -} - -void ShowFont() -{ - int i; - - i = 0; - printf(" No. ShmId Font Name Size MemSize\n" - "+---+-----+---------------+-----+-------+\n"); - while (fSRegs[i].registry) { - ShowShmem(i|CHR_SFLD); - i ++; - } - i = 0; - while (fDRegs[i].registry) { - ShowShmem(i|CHR_DFLD); - i ++; - } -} - -void main(argc, argv) -int argc; -char *argv[]; -{ - int i, n; - FILE *fp = stdin; - enum {ST_ARG, ST_UNLOAD, ST_TYPE} st=ST_ARG; - char file[256], *type, *p; - u_char *font; - - if ((p = index(argv[0], '.')) != NULL) type = p + 1; - for (i = 1; i < argc; i ++) { - p = argv[i]; - switch(st) { - case ST_UNLOAD: - if (isxdigit(*p)) { - sscanf(p, "%X", &n); - fprintf(stderr, "%s> unload %X(%s)\n", argv[0], n, - (n & CHR_DBC) ? - fDRegs[n&~CHR_DFLD].registry: - fSRegs[n&~CHR_SFLD].registry); - UnloadShmem(n | CHR_SFLD); - break; - } - st = ST_ARG; - case ST_ARG: - if (*p == '-') { - ++p; - switch(*p) { - case 'n': - forceLoad = 0; - break; - case 'u': - st = ST_UNLOAD; - break; - case 't': - st = ST_TYPE; - break; - case 'i': - ShowFont(); - exit(0); - break; - } - } else { - if(!(fp = fopen(argv[i], "r"))) { - fprintf(stderr, "%s> Can not open font file.\n", argv[0]); - exit(EOF); - } - } - break; - case ST_TYPE: - type = p; - st = ST_ARG; - break; - } - } - if (st == ST_UNLOAD) exit(0); - i = 0; - while (fontLoaders[i].type) { - if (!strcasecmp(fontLoaders[i].type, type)) - break; - i ++; - } - if (!fontLoaders[i].type) { - fprintf(stderr, "%s> type %s is not supported.\n", - argv[0], type); - exit(EOF); - } -#if defined(linux) - if (!fontLoaders[i].loader) - font = FontLoadJ3100(argc, argv); - else -#endif - font = fontLoaders[i].loader(fp); - if (font == NULL) { - fprintf(stderr, "%s> Can not load font.\n", argv[0]); - exit(EOF); - } - if (fp != stdin) fclose(fp); - exit(SetFont(argv[0], font, &fi)); -} diff --git a/loader/kon2/font/fontx2.c b/loader/kon2/font/fontx2.c deleted file mode 100644 index ead054c1b..000000000 --- a/loader/kon2/font/fontx2.c +++ /dev/null @@ -1,213 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992, 1993 - * kensyu@rabbit.is.s.u-tokyo.ac.jp - * nozomi@yucca.cc.tsukuba.ac.jp - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#define FXLD_C -#include <stdio.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/ioctl.h> -#include <sys/file.h> -#include <string.h> -#include <sys/socket.h> - -#include <interface.h> -#include <fnld.h> - -extern struct fontInfo fi; -extern forceLoad; - -struct fontx { - char title[6]; - char name[8]; - unsigned char xsize; - unsigned char ysize; - unsigned char type; - - unsigned char ntable; - struct tn { unsigned short top, tail; } table[1 /* = ntable */]; -}; - -#define FontxhTop 17 -#define MSDOS 1 -#define nSFontx 256 - -static struct fontx* LoadFontxHeader(FILE *fp){ - struct fontx head; - struct fontx* ans; -#if !MSDOS - fread(&head.title, 6, 1, fp); - fread(&head.name, 8, 1, fp); - fread(&head.xsize, 1, 1, fp); - fread(&head.ysize, 1, 1, fp); - fread(&head.type, 1, 1, fp); - fread(&head.ntable, 1, 1, fp); -#else - fread(&head, sizeof(struct fontx) - sizeof(struct tn), 1, fp); -#endif - if(head.type & 1){ - ans = malloc(sizeof(struct fontx) + sizeof(struct tn)*(head.ntable-1)); - *ans = head; -#if !MSDOS - for(i=1;i<head.ntable;i++)fread(ans->table + i,sizeof(struct tn),1,fp); -#else - fread(ans->table, sizeof(struct tn), head.ntable, fp); -#endif - fseek(fp, FontxhTop + 1 + ans->ntable * 4, SEEK_SET); - }else{ - ans = malloc(sizeof(struct fontx)); - *ans = head; - fseek(fp, FontxhTop, SEEK_SET); - }; - return ans; -}; - -u_char *FontLoadSFontx(fp, header) -FILE *fp; -struct fontx *header; -{ - u_char *fontbuff; - - fi.width = header->xsize; - fi.high = header->ysize; - fi.size = ((header->xsize - 1)/8 + 1) * header->ysize * nSFontx; - fontbuff = (u_char *)calloc(fi.size, nSFontx); - fread(fontbuff, fi.size, nSFontx, fp); - return(fontbuff); -} -static unsigned int sjis2num(unsigned int code){ - unsigned int cl, ch; - /* to jis */ - ch = (code >> 8) & 0xFF; - cl = code & 0xFF; - - ch -= (ch > 0x9F) ? 0xC1: 0x81; - if (cl >= 0x9F) { - ch = (ch << 1) + 0x22; - cl -= 0x7E; - } else { - ch = (ch << 1) + 0x21; - cl -= ((cl <= 0x7E) ? 0x1F: 0x20); - } - /* to num */ - if (ch > 0x2A){ - return (cl - 0x41 + (ch - 0x26) * 96); - }else{ - return (cl - 0x21 + (ch - 0x21) * 96); - } -} - -u_char *FontLoadDFontx(fp, header) -FILE *fp; -struct fontx *header; -{ - u_char *fontbuff; - unsigned i, code, nchar; - int char_byte; - - for(i = 0, nchar = 0; i < header->ntable; i++){ - nchar += header->table[i].tail - header->table[i].top + 1; - } - fi.width = header->xsize; - fi.high = header->ysize; - char_byte = ((header->xsize - 1)/8 + 1) * header->ysize; - fi.size = char_byte * (sjis2num(header->table[header->ntable-1].tail) + 1); - - fontbuff = (u_char *)malloc(fi.size); - - for(i = 0; i < header->ntable; i++){ - for(code = header->table[i].top; code <= header->table[i].tail; code ++){ - if ((code & 0xFF) == 0x7F){ /* for buggy font (0x7E == 0x7F) */ - fseek(fp, char_byte, SEEK_CUR); - continue; - } - fread(fontbuff + sjis2num(code) * char_byte, char_byte, 1, fp); - } - } - return(fontbuff); -} - -u_char *FontLoadFontx(FILE *fp) -{ - u_char *font; - struct fontx *header; - - header = LoadFontxHeader(fp); - if (header->type & 1) { - fi.type = CodingByRegistry("JISX0208.1983-0"); - if (forceLoad || CheckLoadedFont(fi.type)) - font = FontLoadDFontx(fp, header); - else exit(0); - } else { - fi.type = CodingByRegistry("JISX0201.1976-0"); - if (CheckLoadedFont(fi.type)) - font = FontLoadSFontx(fp, header); - else exit(0); - } - free(header); - return(font); -} - -#if 0 -void main(argc, argv) -int argc; -char *argv[]; -{ - FILE *fp; - u_char *font; - int i, loaded=0; - char *p; - - for (i = 1; i < argc; i ++) { - p = argv[i]; - if (*p == '-') { - ++p; - switch(*p) { - case 'n': - forceLoad = 0; - break; - } - } else { - if(!(fp = fopen(argv[i], "r"))) { - fprintf(stderr, "%s> Can not open font file.\n", argv[0]); - exit(EOF); - } - loaded = 1; - } - } - if (!loaded) fp = stdin; - if ((font = FontLoadFontx(fp))== NULL) { - fprintf(stderr, "%s> Can not load font file.\n", argv[0]); - exit(EOF); - } - fclose(fp); - - exit(SetFont(argv[0], font, &fi)); -} -#endif diff --git a/loader/kon2/font/j3100.c b/loader/kon2/font/j3100.c deleted file mode 100644 index d19a03baa..000000000 --- a/loader/kon2/font/j3100.c +++ /dev/null @@ -1,297 +0,0 @@ -/* - KON Font Loader for J-3100 (TOSHIBA), Version 0.3(1993/ 9/ 3) - Copyright (C) 1993, Kazumasa KAWAI (kazu@jl1keo.tama.prug.or.jp) - Copyright (C) 1992, 1993 MAEDA Atusi (mad@math.keio.ac.jp) -*/ -/* - * KON2 - Kanji ON Console 2 - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#define FXLD_C -#include <stdio.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/ioctl.h> -#include <sys/file.h> -#include <string.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/mman.h> -/* #include <linux/mm.h> */ -#include <asm/page.h> -#include <mem.h> - -#include <fnld.h> -#include <interface.h> - -#define ANK_BASE 0xFC000 -#define ANK_SIZE 0x4000 -#define SCHAR_SIZE (16*1) /* Size of one hankaku char (bytes) */ -#define HANKAKU_OFFSET 32 /* No font for first 32 chars */ -#define SFONT_SIZE (256*SCHAR_SIZE) /* Font for 32(10)...128(10) */ -#define KANJI_BASE 0xE0000 -#define KANJI_SIZE 0x10000 -#define MINKANJI 0x2121 -#define MAXKANJI 0x7424 - -static char *fontrom; - -extern struct fontInfo fi; - -#define get_kfontoft(k1,k2) (((k1) > 0x29) ? \ - ((((k2) - 0x40) + ((k1) - 0x25) * 96) << 5) : \ - ((((k2) - 0x20) + ((k1) - 0x20) * 96) << 5)) - -#define get_afontoft(c) (c << 4) - -static u_char *FontLoads(boldMode, Source) -int boldMode, Source; -{ - int devMem, i; - u_short word; - u_char *fontbuf, bankNum; - u_int offset; - - if (Source) { /* from BIOS ROM */ - if ((devMem = open("/dev/mem", O_RDWR) ) < 0) { - fprintf(stderr, "Can not open /dev/mem.\n"); - exit(EOF); - } - if ((fontrom = malloc(ANK_SIZE + (PAGE_SIZE-1))) == NULL) { - fprintf(stderr, "Memory allocation error.\n"); - exit (EOF); - } - if ((unsigned long)fontrom % PAGE_SIZE) - fontrom += PAGE_SIZE - ((unsigned long)fontrom % PAGE_SIZE); - fontrom = (unsigned char *)mmap( - (caddr_t)fontrom, - ANK_SIZE, - PROT_READ, - MAP_SHARED|MAP_FIXED, - devMem, - ANK_BASE - ); - if ((long)fontrom < 0) { - fprintf(stderr, "Can not map memory.\n"); - exit(EOF); - } - - if ((fontbuf = (u_char *)malloc(get_afontoft(256))) == NULL) - return(NULL); - fi.size = get_afontoft(128); - if (Source == 1) - offset = 0xA00; - else - offset = 0xC00; - bmove(fontbuf, fontrom + offset, fi.size); - } else { /* from KANJI ROM */ - if ((devMem = open("/dev/mem", O_RDWR) ) < 0) { - fprintf(stderr, "Can not open /dev/mem.\n"); - exit(EOF); - } - if ((fontrom = valloc(KANJI_SIZE)) == NULL || - (fontbuf = calloc(1, SFONT_SIZE)) == NULL) { - fprintf(stderr, "Memory allocation error.\n"); - exit (EOF); - } - fontrom = (u_char *)mmap( - (caddr_t)fontrom, - KANJI_SIZE, - PROT_READ|PROT_WRITE, - MAP_SHARED|MAP_FIXED, - devMem, - KANJI_BASE - ); - bankNum = 0x80; - *fontrom = bankNum; - for (i = HANKAKU_OFFSET*SCHAR_SIZE, offset = 0; i < (SFONT_SIZE/2); i ++) { - word = *(u_short *) (fontrom + offset); - fontbuf[i] = (word & 0xff); - offset += 2; - } - } - /* kana */ -/* - if ((devMem = open("/dev/mem", O_RDWR) ) < 0) { - fprintf(stderr, "Can not open /dev/mem.\n"); - exit(EOF); - } -*/ - if ((fontrom = valloc(KANJI_SIZE)) == NULL) { - fprintf(stderr, "Memory allocation error.\n"); - exit (EOF); - } - fontrom = (u_char *)mmap( - (caddr_t)fontrom, - KANJI_SIZE, - PROT_READ|PROT_WRITE, - MAP_SHARED|MAP_FIXED, - devMem, - KANJI_BASE - ); - bankNum = 0x80; - *fontrom = bankNum; - for (i = 0xa00, offset = get_kfontoft(0x29, 0x20); i < 0xe00; i ++) { - word = *(u_short *) (fontrom + offset); - fontbuf[i] = (word & 0xff); - offset += 2; - } - fi.size = SFONT_SIZE; - if (boldMode) { - for (i = 0; i < fi.size; i++) { - *(fontbuf + i) |= *(fontbuf + i) >> 1; - } - } - return(fontbuf); -} - -static u_char *FontLoadw(boldMode) -int boldMode; -{ - size_t start; - int devMem, i; /* , l; JL1KEO */ - u_char *fontbuf; - - if ((devMem = open("/dev/mem", O_RDWR) ) < 0) { - fprintf(stderr, "Can not open /dev/mem.\n"); - exit(EOF); - } - if ((fontrom = malloc(KANJI_SIZE + (PAGE_SIZE-1))) == NULL) { - fprintf(stderr, "Memory allocation error.\n"); - exit (EOF); - } - if ((unsigned long)fontrom % PAGE_SIZE) - fontrom += PAGE_SIZE - ((unsigned long)fontrom % PAGE_SIZE); - fontrom = (unsigned char *)mmap( - (caddr_t)fontrom, - KANJI_SIZE, - PROT_READ|PROT_WRITE, - MAP_SHARED|MAP_FIXED, - devMem, - KANJI_BASE - ); - if ((long)fontrom < 0) { - fprintf(stderr, "Can not map memory.\n"); - exit(EOF); - } - - fi.size = get_kfontoft((MAXKANJI+1)>>8, (MAXKANJI+1) & 0xFF); - start = get_kfontoft((MINKANJI)>>8, (MINKANJI) & 0xFF); - if ((fontbuf = (u_char *)malloc(fi.size)) == NULL) return(NULL); - - *fontrom = 0x80; bmove(fontbuf , fontrom, 0x10000); - *fontrom = 0x81; bmove(fontbuf + 0x10000, fontrom, 0x10000); - *fontrom = 0x82; bmove(fontbuf + 0x20000, fontrom, 0x10000); - *fontrom = 0x83; bmove(fontbuf + 0x30000, fontrom, 0x0b0a0); - - if (boldMode) { - for (i = 0; i < fi.size; ) { - if(*(fontbuf + i) & 0x01) { - *(fontbuf + i + 1) |= (*(fontbuf + i + 1) >> 1) | 0x80; - } else { - *(fontbuf + i + 1) |= *(fontbuf + i + 1) >> 1; - } - *(fontbuf + i) |= *(fontbuf + i) >> 1; - i += 2; - } - } - - return(fontbuf + start); -} - -u_char *FontLoadJ3100(int argc, char **argv) -{ - int boldMode = 0, Source = 0; - u_char *font = NULL; - - if (argc < 2) exit(EOF); - if (argc > 2) /* Bold mode */ - if (*argv[2] == 'b' || *argv[2] == 'B') - boldMode = 1; - if (argc > 3) /* ASCII source */ - if (*argv[3] == 'b' || *argv[3] == 'B') /* from BIOS ROM */ - if (*(argv[3]+4) == '2') - Source = 2; - else - Source = 1; - if (*argv[1] == 'a' || *argv[1] == 'A') { /* ASCII mode */ - fi.width = 8; - fi.high = 16; - fi.type = CHR_SFONT; /* single byte char */ - if (CheckLoadedFont(CHR_SFONT)) - font = FontLoads(boldMode, Source); - else exit(0); - } else { /* KANJI mode */ - fi.width = 16; - fi.high = 16; - fi.type = CHR_WFONT; /* double byte char */ - if (CheckLoadedFont(CHR_WFONT)) - font = FontLoadw(boldMode); - else exit(0); - } -} - -#if 0 -void main(argc, argv) -int argc; -char *argv[]; -{ - int boldMode = 0, Source = 0; - u_char *font = NULL; - - if (argc < 2) exit(EOF); - if (argc > 2) /* Bold mode */ - if (*argv[2] == 'b' || *argv[2] == 'B') - boldMode = 1; - if (argc > 3) /* ASCII source */ - if (*argv[3] == 'b' || *argv[3] == 'B') /* from BIOS ROM */ - if (*(argv[3]+4) == '2') - Source = 2; - else - Source = 1; - if (*argv[1] == 'a' || *argv[1] == 'A') { /* ASCII mode */ - fi.width = 8; - fi.high = 16; - fi.type = CHR_SFONT; /* single byte char */ - if (CheckLoadedFont(CHR_SFONT)) - font = FontLoads(boldMode, Source); - else exit(0); - } else { /* KANJI mode */ - fi.width = 16; - fi.high = 16; - fi.type = CHR_WFONT; /* double byte char */ - if (CheckLoadedFont(CHR_WFONT)) - font = FontLoadw(boldMode); - else exit(0); - } - if (font == NULL) { - fprintf(stderr, "%s> Can not load font file.\n", argv[0]); - exit(EOF); - } - - exit(SetFont(argv[0], font, &fi)); -} -#endif diff --git a/loader/kon2/font/minix.c b/loader/kon2/font/minix.c deleted file mode 100644 index 85bba8b4f..000000000 --- a/loader/kon2/font/minix.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* - This code is based on KanjiHand. - - Thanks to - nemossan@uitec.ac.jp == nemossan@mix - takamiti@mix - maebashi@mcs.meitetsu.co.jp - yamamoto@sws.cpd.mei.co.jp - */ - -#include <stdio.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/ioctl.h> -#include <sys/file.h> -#include <string.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <errno.h> - -#include <fnld.h> -#include <interface.h> - -#define SFONT_SIZE 256 -#define FH_MEMO_SIZE 508 - -extern struct fontInfo fi; -extern forceLoad; - -struct font_header { - short fnt_size; /* bytes per one character bit patern */ - short fnt_high; /* font height */ - short fnt_width; /* font width */ - unsigned short top_code; - unsigned short end_code; - char _unused[502]; /* empty */ - char memo[FH_MEMO_SIZE]; - long sum; -}; - -#define FONT_HEAD_SIZE sizeof(struct font_header) -#define MINKANJI 0x2121 -#define MAXKANJI 0x7424 - -#define get_kfontoft(k1,k2) (((k1) > 0x29) ? \ - ((((k2) - 0x40) + ((k1) - 0x25) * 96) << 5) : \ - ((((k2) - 0x20) + ((k1) - 0x20) * 96) << 5)) - -#define get_afontoft(c) (c << 4) - -static u_char *FontLoads(fp, fsize) -FILE *fp; -size_t fsize; -{ - int addr, i; - u_char *fontbuf; - - if ((fontbuf = (u_char *)malloc(get_afontoft(SFONT_SIZE))) == NULL) - return(NULL); - fi.size = get_afontoft(SFONT_SIZE); - for (i = 0; i < SFONT_SIZE; i ++) { - addr = get_afontoft(i); - if (fread(fontbuf + addr, fsize, 1, fp) != 1) return(NULL); - } - return(fontbuf); -} - -static u_char *FontLoadw(fp, fsize) -FILE *fp; -size_t fsize; -{ - size_t start; - int addr, k1, k2, i; - u_char *fontbuf; - - fi.size = get_kfontoft((MAXKANJI+1)>>8, (MAXKANJI+1) & 0xFF); - start = get_kfontoft((MINKANJI)>>8, (MINKANJI) & 0xFF); - if ((fontbuf = (u_char *)malloc(fi.size)) == NULL) return(NULL); - for (k1 = 0x21; k1 <= 0x74; k1 ++) { - for (k2 = 0x21; k2 < 0x7f; k2 ++) { - if (k1 > 0x29 && k1 < 0x30) { - for (i = 0; i < fsize; i ++) fgetc(fp); - /* fseek(fp, fsize, SEEK_CUR);*/ - continue; - } - addr = get_kfontoft(k1, k2); - if (fread(fontbuf + addr, fsize, 1, fp) != 1) - return(NULL); - if(k1 == 0x74 && k2 == 0x24) break; - } - } - return(fontbuf + start); -} - -u_char *FontLoadMinix(fp) -FILE *fp; -{ - char *fdata = NULL; - struct font_header hd; - - if(fread(&hd, sizeof(struct font_header), 1, fp) != 1) return(NULL); - if (memcmp("k14;", hd.memo, 4)) { - if (hd.fnt_width > 0 && hd.fnt_width <= 8 - && hd.fnt_high > 8 && hd.fnt_high <= 16 - && hd.fnt_size == 16 ) { - fi.high = hd.fnt_high; - fi.width = hd.fnt_width; - fi.type = CodingByRegistry("JISX0201.1976-0"); - if (CheckLoadedFont(fi.type)) - fdata = FontLoads(fp, hd.fnt_size); - else exit(0); - } - } else { - if(hd.fnt_width > 8 && hd.fnt_width <= 16 - && hd.fnt_high > 8 - && hd.fnt_high <= 16 - && hd.fnt_size > 16 && hd.fnt_size <= 32) { - fi.high = hd.fnt_high; - fi.width = hd.fnt_width; - fi.type = CodingByRegistry("JISX0208.1983-0"); - if (CheckLoadedFont(fi.type)) - fdata = FontLoadw(fp, hd.fnt_size); - else exit(0); - } - } - return(fdata); -} - -#if 0 -void main(argc, argv) -int argc; -char *argv[]; -{ - FILE *fp; - u_char *font; - int loaded=0; - int i; - char *p; - - for (i = 1; i < argc; i ++) { - p = argv[i]; - if (*p == '-') { - ++p; - switch(*p) { - case 'n': - forceLoad = 0; - break; - } - } else { - if(!(fp = fopen(argv[i], "r"))) { - fprintf(stderr, "%s> Can not open font file.\n", argv[0]); - exit(EOF); - } - loaded = 1; - } - } - if (!loaded) fp = stdin; - - if ((font = FontLoadMinix(fp)) == NULL) { - fprintf(stderr, "%s> Can not load font file.\n", argv[0]); - exit(EOF); - } - if (fp != stdin) fclose(fp); - - exit(SetFont(argv[0], font, &fi)); -} -#endif diff --git a/loader/kon2/include/child.h b/loader/kon2/include/child.h deleted file mode 100644 index 7a760c875..000000000 --- a/loader/kon2/include/child.h +++ /dev/null @@ -1,37 +0,0 @@ - /* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* child -- child process (run startup command and execute shell) */ - -#ifndef CHILD_H -#define CHILD_H - -extern void ChildInit(void); -extern void ChildStart(FILE *errfp); -extern void ChildCleanup(void); - -#endif diff --git a/loader/kon2/include/config.h b/loader/kon2/include/config.h deleted file mode 100644 index f6b7962df..000000000 --- a/loader/kon2/include/config.h +++ /dev/null @@ -1,61 +0,0 @@ - -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992, 1993 MAEDA Atusi (mad@math.keio.ac.jp) - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* - NOTE: This is automatically generated config. - >>>>>>>>>>>>>> DO NOT EDIT !! <<<<<<<<<<<<<< -*/ - -#ifndef CONFIG_H -#define CONFIG_H - - -/* build MINI KON */ -#define MINI_KON - -/* Support VGA driver */ -#define HAS_VGA - -/* Support MOUSE driver */ -#undef HAS_MOUSE - -/* Install Minix/V font loader */ -#define FLD_MINIX - -/* Install $fontx2 font loader */ -#define FLD_BDF - -/* Install .bdf font loader */ -#define FLD_FONTX2 - -/* Install J3100ROM font loader */ -#define FLD_J31ROM - -#define USE_STATICFONT -#endif diff --git a/loader/kon2/include/defs.h b/loader/kon2/include/defs.h deleted file mode 100644 index 6cd90187e..000000000 --- a/loader/kon2/include/defs.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* defs.h -- global definition */ - -#ifndef DEFS_H -#define DEFS_H - -#undef FALSE -#undef TRUE -typedef enum {FALSE, TRUE} bool; - -#define FAILURE (-1) -#define SUCCESS (0) - -#endif diff --git a/loader/kon2/include/errors.h b/loader/kon2/include/errors.h deleted file mode 100644 index c4f0c1a08..000000000 --- a/loader/kon2/include/errors.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1993 by MAEDA Atusi (mad@math.keio.ac.jp) - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#ifndef ERRORS_H -#define ERRORS_H - -extern void Perror(const char *message); /* perror(message) */ -extern void PerrorExit(const char *message); /* perror(message) and die */ -extern void fatal(const char *format, ...); /* print error message and die */ -extern void error(const char *format, ...); /* print error message */ -extern void warn(const char *format, ...); /* print warning message */ -extern void message(const char *format, ...); /* print message */ - -#endif diff --git a/loader/kon2/include/fnld.h b/loader/kon2/include/fnld.h deleted file mode 100644 index cdf94181d..000000000 --- a/loader/kon2/include/fnld.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* fnld.h -- font information */ - -#ifndef FNLD_H -#define FNLD_H - -#include <interface.h> -#include <defs.h> - -struct fontRegs { - u_int (*addr)(u_char ch1, u_char ch2); - u_int size; - char *registry, *bitmap; - u_char high, width, sign0, sign1, stat; -}; - -struct langInfo { - u_char - sb, - db, - sc; -}; - -extern struct langInfo lInfo; - -#define FR_ATTACH 1 -#define FR_PROXY 2 - -extern struct fontRegs fSRegs[], fDRegs[]; -extern struct fontRegs *sbFReg, *dbFReg; - -extern u_char *FontLoad(u_char *fbuff, int fd, struct fontInfo *fi); -extern u_char *GetShmem(char type); -extern void DownShmem(char type); -extern void FontAttach(void); -extern void FontDetach(bool); -extern int CodingByRegistry(char *); - -#endif diff --git a/loader/kon2/include/getcap.h b/loader/kon2/include/getcap.h deleted file mode 100644 index 41e380482..000000000 --- a/loader/kon2/include/getcap.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* getcap library - read configuration file and invoke initializer function */ - -#ifndef GETCAP_H -#define GETCAP_H - -#include <defs.h> - -/* Initializer function should return 0 on success, -1 on failure. */ -typedef int (initializer)(const char *); - -/* Define initializer function func for capability name. If def_value is nil, - then the entry of the name must exist in configuration file. An error is - flagged if no entry is found. If def_value is non-nil and no entry is found - in configuration file, then func is invoked with def_value. */ -extern void DefineCap(const char *name, initializer *func, const char *def_value); - -/* Delete all initializer functions. */ -extern void CapInit(void); - -/* Read configuration file named filename and invoke initializer function for each entry. - Return 0 on success, -1 on failure. */ -extern int ReadConfig(const char *filename); - -/* Set value for capability capName. Return 0 on success, -1 if capName not defined. */ -extern int SetCapArg(const char *capName, const char *value); - -#define MAX_COLS 256 /* maximum line length of config file */ - -/* Utility function that return 1 if confstr is "On" and 0 if "OFF". */ -extern bool BoolConf(const char *confstr); - -#endif diff --git a/loader/kon2/include/interface.h b/loader/kon2/include/interface.h deleted file mode 100644 index 46d8aad29..000000000 --- a/loader/kon2/include/interface.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* interface.h -- communication protocol definition */ - -#ifndef INTERFACE_H -#define INTERFACE_H - -#include <sys/types.h> - -/* ÄÌ¿®À©¸æ¥¥ã¥é¥¯¥¿ */ -#define STR_NAK "\x15" -#define CHR_NAK 0x15 -#define STR_ACK "\x06" -#define CHR_ACK 0x06 - -/* ÄÌ¿®ÆâÍƤμ±ÊÌ»Ò */ -#define CHR_SFONT 0x81 -#define CHR_WFONT 0x89 - -#define CHR_SFLD 0x80 -#define CHR_DBC 0x20 -#define CHR_DFLD (CHR_SFLD|CHR_DBC) - -#define CHR_LOAD 'L' -#define CHR_UNLOAD 'U' -#define CHR_STAT 'S' -#define CHR_DISCONNECT 'D' -#define CHR_TEXTMODE 'T' -#define CHR_GRAPHMODE 'G' -#define CHR_RESTART 'R' - -#define MAX_SOCKET_NAME 14 -#define SOCKET_BASENAME "/tmp/.kon" - -#define SHMEM_NAME CONFIG_NAME - -/* À©¸æ¥¥ã¥é¥¯¥¿¤ÎºÇÂçĹ */ -#define MAX_CTRLCHAR 80 - -/* -extern char socketName[MAX_SOCKET_NAME+1]; -*/ - -struct messageHeader { - u_char cno, /* client number */ - cmd; /* command */ -}; - -struct fontInfo { - u_int size; - u_char high, width, type; -}; - -struct fontLoaderRegs { - u_int (*addr)(u_char ch1, u_char ch2); - u_int max; -}; - -extern struct fontLoaderRegs fldSRegs[], fldDRegs[]; - -extern void SocketKill(int); -extern int SocketRecCommand(int, struct messageHeader *); -extern int SocketSendCommand(int, char); -extern int SocketClientOpen(void); -extern int SocketSendData(u_char *buff, int size, int fd); -extern int CheckLoadedFont(char type); -extern int SetFont(char *prog, u_char *font, struct fontInfo *fi); - -#endif diff --git a/loader/kon2/include/mem.h b/loader/kon2/include/mem.h deleted file mode 100644 index 9f5ddb87a..000000000 --- a/loader/kon2/include/mem.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* mem -- memory handling libraries */ - -#ifndef MEM_H -#define MEM_H - -static __inline__ - void PortOutw(u_short value, u_short port) -{ - __asm__ volatile ("outw %0,%1" - ::"a" ((unsigned short) value), "d"((unsigned short) port)); -} - -static __inline__ - void PortOutb(char value, u_short port) -{ - __asm__ volatile ("outb %0,%1" - ::"a" ((unsigned char) value), "d"((unsigned short) port)); -} - -static __inline__ - unsigned char PortInb(unsigned short port) -{ - unsigned char value; - __asm__ volatile ("inb %1,%0" - :"=a" (value) - :"d"((unsigned short) port)); - return value; -} - -extern void wzero(void *, int); -extern void wmove(void *, void *, int); -extern void lmove(void *, void *, int); -extern void SafeFree(void **); - -#endif diff --git a/loader/kon2/include/mouse.h b/loader/kon2/include/mouse.h deleted file mode 100644 index fec8afa85..000000000 --- a/loader/kon2/include/mouse.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* mouse.h -- mouse driver interface */ -#ifndef MOUSE_H -#define MOUSE_H - -#include <defs.h> - -#define MOUSE_LFT 4 -#define MOUSE_MID 2 -#define MOUSE_RGT 1 -#define MOUSE_LIFETIME 55 /* 5.5 seconds */ - -struct mouseInfo { - bool has_mouse; - char x, y, - dx, dy, - sx, sy, - sw, - stat; -}; - -extern struct mouseInfo mInfo; -extern int mouseFd; - -extern void MouseInit(void); -extern int MouseStart(void); -extern void MouseGetPacket(unsigned char *, int); -extern void MouseCleanup(void); -extern void MouseSetRfd(int); -extern void MouseResetRfd(int); - -#endif diff --git a/loader/kon2/include/setutmp.h b/loader/kon2/include/setutmp.h deleted file mode 100644 index 1b1f1eb66..000000000 --- a/loader/kon2/include/setutmp.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* setutmp -- set/reset utmp entry */ - -#ifndef SETUTMP_H -#define SETUTMP_H - -extern void SetUtmp(char *tty); -extern void ResetUtmp(char *tty); - -#endif diff --git a/loader/kon2/include/sock.h b/loader/kon2/include/sock.h deleted file mode 100644 index fe5248e41..000000000 --- a/loader/kon2/include/sock.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* sock -- socket interface module */ - -#ifndef SOCK_H -#define SOCK_H - -extern int SocketInit(char*); -extern void SocketInterface(int); -extern void FontShmGet(u_char); - -#endif diff --git a/loader/kon2/include/term.h b/loader/kon2/include/term.h deleted file mode 100644 index 3890ad8c8..000000000 --- a/loader/kon2/include/term.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* term -- multiplexer main module */ - -#ifndef TERM_H -#define TERM_H - -/* Do initialization before reading config file */ -extern void TermInit(int argc, const char *argv[]); - -extern void TermStart(void); /* start procesing */ -extern void TermRestart(int fd); /* restart kon (args are read from fd) */ -extern int masterPty; /* master pseudo-tty file descriptor */ - -#endif diff --git a/loader/kon2/include/types.h b/loader/kon2/include/types.h deleted file mode 100644 index 69bc800d1..000000000 --- a/loader/kon2/include/types.h +++ /dev/null @@ -1,3 +0,0 @@ -typedef unsigned short u_short; -typedef unsigned char u_char; -typedef unsigned int u_int; diff --git a/loader/kon2/include/vc.h b/loader/kon2/include/vc.h deleted file mode 100644 index 601155307..000000000 --- a/loader/kon2/include/vc.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* vc -- high-level console driver */ - -#ifndef VC_H -#define VC_H - -#define ATTR_ULINE 0x80 /* under line */ -#define ATTR_REVERSE 0x40 /* reverse */ -#define ATTR_HIGH 0x20 /* high */ - -#define LATCH_S 0x0 /* single byte char */ -#define LATCH_1 0x20 /* double byte char 1st byte */ -#define LATCH_2 0x40 /* double byte char 2nd byte */ - -#define CLEAN_S 0x80 -#define CODEIS_1 LATCH_1 -#define CODEIS_2 LATCH_2 -#define LANG_CODE 0x0F -/* -#define LANG_DCODE LANG_CODE|CODEIS_1 -#define LANG_SCODE LANG_CODE -*/ - -extern void ConsoleInit(const char *video_type); -extern void ConsoleStart(void); -extern void ConsoleCleanup(void); -extern void TextClearAll(void); -extern void TextClearEol(u_char); -extern void TextClearEos(u_char); -extern void TextDeleteChar(int); -extern void TextInsertChar(int); -extern void TextMoveDown(int top, int btm, int line); -extern void TextMoveUp(int top, int btm, int line); -extern void TextMode(void); -extern void GraphMode(void); -extern void ScrollUp(int); -extern void ScrollDown(int); -extern void TextWput(u_char ch1, u_char ch2); -extern void TextSput(u_char ch); -extern void TextReverse(int fx, int fy, int tx, int ty); -extern void TextRefresh(void); -extern void TextInvalidate(void); -extern void TextCopy(int fx, int fy, int tx, int ty); -extern void TextPaste(void); -extern void PollCursor(bool wakeup); /* Called to wakeup, or every 0.1 sec when idle */ -extern void Beep(void); - -struct cursorInfo { - short kanji; /* ´Á»ú¤Î¾å¤Ë¤¢¤ì¤Ð TRUE */ - u_int addr; /* VRAM ¥¢¥É¥ì¥¹ */ - bool sw; /* FALSE ¤Ê¤éɽ¼¨¶Ø»ß */ - int interval; /* ÅÀÌÇ´Ö³Ö */ - int count; /* ÅÀÌÇÍÑ¥«¥¦¥ó¥È */ - bool shown; /* ɽ¼¨Ãæ¥Õ¥é¥° */ -}; - -/* video driver interface */ -struct videoInfo { - bool - has_hard_scroll; /* ¥Ï¡¼¥É¥¹¥¯¥í¡¼¥ë¤¬»È¤¨¤ë¤«¤É¤¦¤« */ - void - (*init)(void), /* ½é´ü²½ */ - (*text_mode)(void), /* ¥Æ¥¥¹¥È¥â¡¼¥É¤ËÀÚÂؤ¨ */ - (*graph_mode)(void), /* ¥°¥é¥Õ¥£¥Ã¥¯¥â¡¼¥É¤ËÀÚÂؤ¨ */ - (*wput)(u_char *code, u_char fc, u_char bc), /* ´Á»ú½ÐÎÏ */ - (*sput)(u_char *code, u_char fc, u_char bc), /* ANK½ÐÎÏ */ - (*set_cursor_address)(struct cursorInfo *c, u_int x, u_int y), - /* ¥«¡¼¥½¥ë c ¤Î¥¢¥É¥ì¥¹¤ò (x,y) ¤ËÀßÄê */ - (*set_address)(u_int i), - /* ʸ»ú½ñ¤¹þ¤ß¥¢¥É¥ì¥¹¤ò i ʸ»úÌܤËÀßÄê */ - (*cursor)(struct cursorInfo *), /* ¥«¡¼¥½¥ë¤ò¥È¥°¥ë */ - (*clear_all)(void), /* ²èÌÌ¥¯¥ê¥¢ */ - (*screen_saver)(bool), /* ¥¹¥¯¥ê¡¼¥ó¥Ö¥é¥ó¥¯/¥¢¥ó¥Ö¥é¥ó¥¯ */ - (*detatch)(void), /* ¥É¥é¥¤¥Ð²òÊü */ - /* ¥Ï¡¼¥É¥¹¥¯¥í¡¼¥ë¤¬»È¤¨¤Ê¤±¤ì¤Ð°Ê²¼¤ÏNULL */ - (*set_start_address)(void), /* ɽ¼¨³«»Ï¥¢¥É¥ì¥¹ÀßÄê */ - (*hard_scroll_up)(int lines), /* ¥Ï¡¼¥É¥¹¥¯¥í¡¼¥ë¥¢¥Ã¥× */ - (*hard_scroll_down)(int lines); /* ¥Ï¡¼¥É¥¹¥¯¥í¡¼¥ë¥À¥¦¥ó */ -}; - -struct dispInfo { - int - gsize; - short - gxdim, - gydim, - txmax, - tymax, - glineChar, /* text £±¹Ôʬ¤Î graph ¹Ô¿ô */ - glineByte, /* graph £±¹Ôʬ¤Î¥Ð¥¤¥È¿ô */ - tlineByte; /* text £±¹Ôʬ¤Î¥Ð¥¤¥È¿ô */ -}; - -extern struct dispInfo dInfo; -extern struct cursorInfo cInfo; -extern struct videoInfo vInfo; - -#endif diff --git a/loader/kon2/include/version.h b/loader/kon2/include/version.h deleted file mode 100644 index 165a07108..000000000 --- a/loader/kon2/include/version.h +++ /dev/null @@ -1 +0,0 @@ -#define VERSION "ver.0.3.9 (2000/03/21)" diff --git a/loader/kon2/include/vga.h b/loader/kon2/include/vga.h deleted file mode 100644 index 734c5a700..000000000 --- a/loader/kon2/include/vga.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* vga.h -- definitions used in video drivers */ - -#ifndef VGA_H -#define VGA_H - -/* Sequencer */ -#define VGASEQ_ADDR 0x3C4 -#define VGASEQ_DATA 0x3C5 -#define VGASEQ_CNT 5 - -/* CRT controller */ -/* -#define VGACRT_ADDR 0x3D4 -#define VGACRT_DATA 0x3D5 -*/ -#define CGACRT_ADDR 0x3D4 -#define CGACRT_DATA 0x3D5 -#define VGACRT_CNT 25 -#define CGACRT_CNT 25 - -/* Graphics controller */ -#define VGAGRP_ADDR 0x3CE -#define VGAGRP_DATA 0x3CF -#define VGAGRP_CNT 9 - -/* Attribute controller */ -#define VGAATTR_A_O 0x3C0 -#define VGAATTR_DATA 0x3C1 -#define VGAATTR_CNT 21 -#define EGAATTR_CNT 20 - -#if defined(linux) -#define GRAPH_BASE 0xA0000 -#elif defined(__FreeBSD__) -#define GRAPH_BASE 0x0 -#endif -#define FONT_SIZE 0x2000 - -#define VGA_FONT_SIZE 128 -#define VGA_FONT_HEIGHT 16 - -#define NUM_VIDEOH_INFO 4 -#define NUM_VIDEOV_INFO 4 - -/* DAC Palette */ -#define VGAPAL_OADR 0x3C8 -#define VGAPAL_IADR 0x3C7 -#define VGAPAL_DATA 0x3C9 - -/* Misc */ -#define VGAMISC_IN 0x3CC -#define VGAMISC_OUT 0x3C2 - -/* Input Stat 1 */ -/*#define VGAST1_ADDR 0x3DA*/ - -#define MAX_PELS 16 - -struct vgaRegs { - u_char crt[VGACRT_CNT], - att[VGAATTR_CNT], - gra[VGAGRP_CNT], - seq[VGASEQ_CNT], - mis; -}; - -struct pelRegs { - u_char red[MAX_PELS], - grn[MAX_PELS], - blu[MAX_PELS]; -}; - -union videoTimings { - struct { - int hDot, hStart, hEnd, hTotal; - int vLine, vStart, vEnd, vTotal; - int txmax, tymax, i; - } m; - int v[NUM_VIDEOH_INFO+NUM_VIDEOV_INFO+1]; -}; - -static inline - void VgaOutByte(u_char value) -{ - __asm__ ("movb %%al, %%ah\n\t" - "movb $8, %%al\n\t" - "outw %%ax, %w1" - :/* no outputs */ - :"a" ((u_char) value), - "d" ((u_short)VGAGRP_ADDR)); -} - -extern u_int vgaCrtAddr, vgaCrtData, vgaSt1Addr; - -extern int LineComp9, LineComp8, gramHead; -extern struct vgaRegs regText, regGraph; -extern struct videoInfo SvgaInfo; - -void VgaSetRegisters(struct vgaRegs *regs); -void VgaInit(void); -void VgaTextMode(void); -void VgaGraphMode(void); -void VgaWput(u_char *code, u_char fc, u_char bc); -void VgaSput(u_char *code, u_char fc, u_char bc); -void VgaWputFm(u_char *code, u_char fc, u_char bc); -void VgaSputFm(u_char *code, u_char fc, u_char bc); -void VgaHardScrollUp(int line); -void VgaHardScrollDown(int line); -void VgaSetCursorAddress(struct cursorInfo *ci, u_int x, u_int y); -void VgaSetAddress(u_int p); -void VgaCursor(struct cursorInfo *ci); -void VgaClearAll(void); -void VgaScreenSaver(bool blank); -int VgaReadPels(const char *str); -int VgaReadNewRegs(const char *str, union videoTimings *); -int VgaAttach(void); -void VgaDetach(void); -void VgaDefaultCaps(); -void VgaLoadRomFont(char *); -#endif diff --git a/loader/kon2/include/vgafont.h b/loader/kon2/include/vgafont.h deleted file mode 100644 index 853c460aa..000000000 --- a/loader/kon2/include/vgafont.h +++ /dev/null @@ -1,514 +0,0 @@ -static unsigned char vgaFont[]={ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, - 0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7e, 0xff, 0xdb, 0xff, 0xff, 0xc3, - 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, - 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, - 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0xe7, 0xe7, - 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, - 0x7e, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, - 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xc3, - 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, - 0x42, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, - 0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0x00, 0x1e, 0x0e, 0x1a, 0x32, 0x78, 0xcc, - 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, - 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30, - 0x30, 0x70, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0x63, 0x7f, 0x63, 0x63, 0x63, - 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, - 0x3c, 0xdb, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, - 0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x06, 0x0e, 0x1e, 0x3e, 0xfe, 0x3e, - 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, - 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, - 0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7f, 0xdb, 0xdb, 0xdb, 0x7b, 0x1b, - 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, - 0x6c, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, - 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0xfe, - 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, - 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, - 0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x66, 0xff, - 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, - 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, - 0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, - 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, - 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, - 0x06, 0x86, 0xc6, 0x7c, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, - 0x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x76, 0xdc, - 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, - 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, - 0x3c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, - 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0c, 0x18, - 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x66, 0xc3, 0xc3, 0xdb, 0xdb, - 0xc3, 0xc3, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x0c, 0x18, 0x30, - 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, - 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe, - 0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, 0xfc, 0x06, - 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, - 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18, - 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7c, 0xc6, - 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, - 0x06, 0x06, 0x0c, 0x78, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, - 0x30, 0x18, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, - 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, - 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, - 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xde, 0xde, - 0xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, - 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, - 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, - 0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, - 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, - 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xde, - 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, - 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, - 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, - 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, - 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc3, 0xe7, 0xff, 0xff, 0xdb, 0xc3, - 0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, - 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, - 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x60, - 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, - 0xc6, 0xd6, 0xde, 0x7c, 0x0c, 0x0e, 0x00, 0x00, - 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, - 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, - 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, - 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, - 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, - 0xdb, 0xff, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18, - 0x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18, - 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30, - 0x60, 0xc1, 0xc3, 0xff, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38, - 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, - 0x0c, 0x0c, 0x0c, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, - 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, - 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xe0, 0x60, 0x60, 0x78, 0x6c, 0x66, - 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, - 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, - 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, - 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, - 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, - 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00, - 0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, - 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, - 0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78, - 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0xdb, - 0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, - 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, - 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, - 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, - 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, - 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, - 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3, - 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3, - 0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, - 0x18, 0x3c, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, - 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18, - 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, - 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x0e, 0x18, - 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, - 0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, - 0xc2, 0x66, 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00, - 0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, - 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0c, 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe, - 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x10, 0x38, 0x6c, 0x00, 0x78, 0x0c, 0x7c, - 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c, - 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c, - 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x38, 0x6c, 0x38, 0x00, 0x78, 0x0c, 0x7c, - 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, - 0x66, 0x3c, 0x0c, 0x06, 0x3c, 0x00, 0x00, 0x00, - 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, - 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xfe, - 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xfe, - 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x66, 0x00, 0x00, 0x38, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x18, 0x3c, 0x66, 0x00, 0x38, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x60, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, - 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, - 0x38, 0x6c, 0x38, 0x00, 0x38, 0x6c, 0xc6, 0xc6, - 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x30, 0x60, 0x00, 0xfe, 0x66, 0x60, 0x7c, - 0x60, 0x60, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b, - 0x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3e, 0x6c, 0xcc, 0xcc, 0xfe, 0xcc, - 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, - 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, 0xc6, 0xc6, - 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, 0xc6, 0xc6, - 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x30, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, - 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc, - 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc6, 0x00, 0x00, 0xc6, 0xc6, 0xc6, - 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00, - 0x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, - 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, - 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x18, 0x18, 0x7e, 0xc3, 0xc0, 0xc0, 0xc0, - 0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, - 0x60, 0x60, 0xe6, 0xfc, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18, - 0xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xfc, 0x66, 0x66, 0x7c, 0x62, 0x66, 0x6f, - 0x66, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, - 0x18, 0x18, 0x18, 0x18, 0xd8, 0x70, 0x00, 0x00, - 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c, - 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0c, 0x18, 0x30, 0x00, 0x38, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x18, 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, - 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, 0xcc, 0xcc, - 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x76, 0xdc, 0x00, 0xdc, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, - 0x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, - 0xce, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x7c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, - 0xc0, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, - 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, - 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, - 0x60, 0xce, 0x9b, 0x06, 0x0c, 0x1f, 0x00, 0x00, - 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, - 0x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, - 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, - 0x6c, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36, - 0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, - 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, - 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, - 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, - 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, - 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0xf8, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xf6, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xfe, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xf7, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xf7, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0xff, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, - 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0xd8, - 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, - 0xc6, 0xc6, 0xc6, 0xcc, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0, - 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xfe, 0x6c, 0x6c, 0x6c, - 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, - 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8, - 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, - 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66, - 0x66, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, - 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, - 0x6c, 0x6c, 0x6c, 0xee, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66, - 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xdb, 0xdb, - 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb, - 0xf3, 0x7e, 0x60, 0xc0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, 0x7c, 0x60, - 0x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, - 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, - 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, - 0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x30, 0x18, 0x0c, 0x06, 0x0c, - 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, - 0x18, 0x0c, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, - 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, - 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, - 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xec, - 0x6c, 0x6c, 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xd8, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c, 0x7c, 0x7c, - 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; diff --git a/loader/kon2/include/vt.h b/loader/kon2/include/vt.h deleted file mode 100644 index e019568a3..000000000 --- a/loader/kon2/include/vt.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* vt -- VT emulator */ - -#ifndef VT_H -#define VT_H - -#include <defs.h> -#include <fnld.h> - -struct _con_info { - short - x, - y, - xmax, /* 79 */ - ymin, /* 0:¥¹¥¯¥í¡¼¥ë³«»Ï¹Ô */ - ymax, /* 29 */ - tab; /* 8 */ - u_char - fcol, /* ¥Õ¥©¥¢¥°¥é¥ó¥É */ - bcol, /* ¥Ð¥Ã¥¯¥°¥é¥ó¥É */ - attr, /* ʸ»ú°À */ - sb, /* 1 byte code ¥Õ¥©¥ó¥ÈÈÖ¹æ */ - db, /* 2 byte code ¥Õ¥©¥ó¥ÈÈÖ¹æ */ - knj1; /* ´Á»ú¥¥ã¥é¥¯¥¿Âè 1 byte */ - void (*esc)(u_char); - enum { - CS_LEFT, - CS_RIGHT, - CS_GRAPH, - CS_DBCS} trans, g[2]; - enum { - SL_NONE, - SL_ENTER, - SL_LEAVE} sl; - bool - soft, - ins, - active, - wrap, - text_mode; -}; - -extern struct _con_info con; - -#define CODE_2022 0 /* 2022 ¤Î¤ß¤Ë½¾¤¦*/ -#define CODE_EUC 1 /* EUC ¤Ë¤â½¾¤¦ */ -#define CODE_SJIS 2 /* SJIS ¤Ë¤â½¾¤¦ */ - -#define G0_SET 0 -#define G1_SET 0x80 - -extern void VtInit(void); -extern void VtStart(void); -extern void VtEmu(const char*, int nchars); -extern void VtCleanup(void); - -#define sjistojis(ch, cl)\ -{\ - ch -= (ch > 0x9F) ? 0xB1: 0x71;\ - ch = ch * 2 + 1;\ - if (cl > 0x9E) {\ - cl = cl - 0x7E;\ - ch ++;\ - } else {\ - if (cl > 0x7E) cl --;\ - cl -= 0x1F;\ - }\ -} - -#define jistosjis(ch, cl)\ -{\ - if (ch & 1) cl = cl + (cl > 0x5F ? 0x20:0x1F);\ - else cl += 0x7E;\ - ch = ((ch - 0x21) >> 1) + 0x81;\ - if (ch > 0x9F) ch += 0x40;\ -} - -/* - derived from Mule:codeconv.c to support "ESC $(0" sequence - thanks to K.Handa <handa@etl.go.jp> - */ - -#define muletobig5(type, m1, m2)\ -{\ - unsigned code = (m1 - 0x21) * 94 + (m2 - 0x21);\ -\ - if (type == DF_BIG5_1) code += 0x16F0;\ - m1 = code / 157 + 0xA1;\ - m2 = code % 157;\ - m2 += m2 < 0x3F ? 64 : 98;\ -} - -enum { - DF_GB2312, - DF_JISX0208, - DF_KSC5601, - DF_JISX0212, - DF_BIG5_0, - DF_BIG5_1 - }; - -#endif diff --git a/loader/kon2/kbiff/Makefile b/loader/kon2/kbiff/Makefile deleted file mode 100644 index a319f5dd5..000000000 --- a/loader/kon2/kbiff/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -CFLAGS=-O3 -g -OBJS= kbiff.o - -kbiff: $(OBJS) - $(CC) -o $@ $< -lncurses - -install: - install -cs kbiff /usr/bin - -clean: - rm -f $(OBJS) kbiff diff --git a/loader/kon2/kbiff/kbiff.c b/loader/kon2/kbiff/kbiff.c deleted file mode 100644 index d1c8ea1b7..000000000 --- a/loader/kon2/kbiff/kbiff.c +++ /dev/null @@ -1,68 +0,0 @@ -#include <stdio.h> -#include <unistd.h> -#include <string.h> -#include <stdlib.h> -#include <curses.h> -#include <term.h> -#include <signal.h> -#include <sys/stat.h> -#include <sys/time.h> - -void -cleanup() -{ - putp(from_status_line); - putp(dis_status_line); - exit(0); -} - -void -main(int argc, char *argv[]) -{ - char *term, *mail, *p, *buff; - time_t interval=10000000; - time_t old_mtime=0; - int n, update=1; - struct stat st; - - if ((term = getenv("TERM")) == NULL - || (mail = getenv("MAIL")) == NULL) exit(1); - setupterm(term, 1, &n); - if (n != 1) exit(1); - if (!has_status_line) exit(1); - if ((buff = calloc(columns + 1, 1)) == NULL) exit(1); - putp(tparm(to_status_line, 0, 0)); - putp(from_status_line); - fflush(stdout); - signal(SIGINT, cleanup); - signal(SIGKILL, cleanup); - while (1) { - if (!stat(mail, &st) && st.st_size) { - if (st.st_mtime > old_mtime) { - sprintf(buff, "New mail received %s", - ctime(&st.st_mtime)); - update = 1; - old_mtime = st.st_mtime; - } - } else { - if (st.st_mtime > old_mtime) { - sprintf(buff, "No mail"); - update = 1; - old_mtime = st.st_mtime; - } - } - if (update) { - if ((p = strchr(buff, '\n')) != NULL) *p = 0; - printf("%s%s\n%*s%s%s", - tparm(to_status_line, 0, 0), - enter_standout_mode, - columns, buff, - exit_standout_mode, - from_status_line); - fflush(stdout); - update = 0; - } - usleep(interval); - } - cleanup(); -} diff --git a/loader/kon2/kon.cfg.FreeBSD b/loader/kon2/kon.cfg.FreeBSD deleted file mode 100644 index 764df6f9b..000000000 --- a/loader/kon2/kon.cfg.FreeBSD +++ /dev/null @@ -1,216 +0,0 @@ -################################################## -# -# Configuration file for KON -# -################################################## - -################################################## -# REQUIRED ENTRIES -# -# 1) Normal and Startup entries must be present. -# 2) For VGA and VGAFM type displays, Pels entry -# must be defined *after* Normal entry. -# -################################################## - -# Display definition -# Entry named `Normal' is used as default. -J3100SX:J31:J3100 - J3100SX -Stealth: - VGA - 800 864 1016 1064 600 606 608 632 - 2 - 99 36 -PCI805: - VGA - 800 864 1016 1064 600 606 608 632 - 2 - 99 36 -VGA11: - VGAFM - 3777 - 640 680 776 808 480 491 493 524 - 1 - 79 42 -VGA12: - VGAFM - 3BF7 - 640 680 776 808 480 491 493 524 - 1 - 79 39 -VGA13: - VGAFM - 3FF7 - 640 680 776 808 480 491 493 524 - 1 - 79 35 -VGA14: - VGAFM - 7FF7 - 640 680 776 808 480 491 493 524 - 1 - 79 33 -VGA:Normal - VGA - 640 680 768 800 480 491 493 525 - 1 - 79 23 - -# Pels: Pallette value definition for VGA, VGAFM drivers - -REVPEL: # Values for reverse color - 63 63 63 - 63 63 21 - 63 21 63 - 63 21 21 - 21 63 63 - 21 63 21 - 21 21 63 - 21 21 21 - 42 42 42 - 42 21 0 - 42 0 42 - 42 0 0 - 0 42 42 - 0 42 0 - 0 0 42 - 0 0 0 - -STDPEL: # Standard color - 0 0 0 - 0 0 42 - 0 42 0 - 0 42 42 - 42 0 0 - 42 0 42 - 42 21 0 - 42 42 42 - 21 21 21 - 21 21 63 - 21 63 21 - 21 63 63 - 63 21 21 - 63 21 63 - 63 63 21 - 63 63 63 - -HIPEL: Pels # Hi color - 0 0 0 - 0 0 52 - 0 52 0 - 0 52 52 - 52 0 0 - 52 0 52 - 52 31 0 - 52 52 52 - 31 31 31 - 31 31 63 - 31 63 31 - 31 63 63 - 63 31 31 - 63 31 63 - 63 63 31 - 63 63 63 - -# Startup command definition (usually font loading commands are specified) -bdf-zcat:Startup - gzip -cd /usr/local/lib/fonts/k14.bdf.gz | /usr/local/bin/fld -t bdf -n - gzip -cd /usr/local/lib/fonts/7x14rk.bdf.gz | /usr/local/bin/fld -t bdf -n -minix: - /usr/bin/fld.minix -n /usr/share/fonts/publicfont.ank - /usr/bin/fld.minix -n /usr/share/fonts/publicfont.k14 -fontx: - /usr/bin/fld.fontx -n /dos/lib/font/new/jpnhn16x.fnt - /usr/bin/fld.fontx -n /dos/lib/font/new/jpnzn16x.fnt -minix-zcat: - zcat /usr/share/fonts/publicfont.a.Z | /usr/bin/fld.minix -n - zcat /usr/share/fonts/publicfont.k.Z | /usr/bin/fld.minix -n -fontx-zcat: - zcat /dos/lib/font/jpnhn16x.Z | /usr/bin/fld.fontx -n - zcat /dos/lib/font/jpnzn16x.Z | /usr/bin/fld.fontx -n -minix-gzip: - gzip -cd /usr/share/fonts/publicfont.k14.gz | /usr/local/bin/fld -t minix -n - gzip -cd /usr/share/fonts/publicfont.ank.gz | /usr/local/bin/fld -t minix -n -fontx-gzip: - gzip -d < /dos/lib/font/jpnhn16x.z | /usr/bin/fld.fontx -n - gzip -d < /dos/lib/font/jpnzn16x.z | /usr/bin/fld.fontx -n - -################################# -# OPTIONAL SETUP ENTRIES -################################# - -# Mouse type definition. Choose one of: Microsoft, -# MouseSystems, BusMouse, MMSeries, Logitech, or None. -Mouse: - None -# Mouse baud rate -MouseBaud: - 1200 -# Mouse device file name -MouseDev: - /dev/mouse - -# Use hard scroll -HardScroll: - On - -# Length of beep sound (1/100 sec). -BeepCounter: - 5 - -# Cursor blink interval (1/10 sec). -CursorInterval: - 4 - -# Screen blank time (minutes). -SaveTime: - 5 - -# Use double width cursor on kanji character -KanjiCursor: - On - -# Cursor top raster line (0..15) -CursorTop: - 14 - -# Cursor bottom raster line (CursorTop..15) -CursorBottom: - 15 - -# Vga Font Offset -VgaFontOffset: - 0 - -# Save font data in plane 3 (required for Trident TVGA series) -SavePlane3: - Off - -Mouse3Buttons: - On - -# Coding -# SingleByte DoubleByte 8bitCode -# ISO8895-[123456789], JISX0201.1976-0 -# BIG5.HKU-0, GB2312.1980-1, JISX0208.1983-0, KSC5601.1987-0 -# EUC, SJIS - -ja_JP.ujis:Coding - JISX0201.1976-0 JISX0208.1983-0 EUC - -ja_JP.sjis: - JISX0201.1976-0 JISX0208.1983-0 SJIS - -zh_TW.big5: - ISO8859-1 BIG5.HKU-0 - -zh_CN.ugb: - ISO8859-1 GB2312.1980-0 - -ko_KR.euc: - ISO8859-1 KSC5601.1987-0 - -# Show `No warranty' message -StartupMessage: - On diff --git a/loader/kon2/kon.cfg.linux b/loader/kon2/kon.cfg.linux deleted file mode 100644 index a68583cdb..000000000 --- a/loader/kon2/kon.cfg.linux +++ /dev/null @@ -1,213 +0,0 @@ -################################################## -# -# Configuration file for KON -# -################################################## - -################################################## -# REQUIRED ENTRIES -# -# 1) Normal and Startup entries must be present. -# 2) For VGA and VGAFM type displays, Pels entry -# must be defined *after* Normal entry. -# -################################################## - -# Display definition -# Entry named `Normal' is used as default. -J3100SX:J31:J3100 - J3100SX -Stealth: - VGA - 800 864 1016 1064 600 606 608 632 - 2 - 99 36 -PCI805: - VGA - 800 864 1016 1064 600 606 608 632 - 2 - 99 36 -VGA11: - VGAFM - 3777 - 640 680 768 800 480 491 493 525 - 1 - 79 42 -VGA12: - VGAFM - 3BF7 - 640 680 768 800 480 491 493 525 - 1 - 79 39 -VGA13: - VGAFM - 3FF7 - 640 680 768 800 480 491 493 525 - 1 - 79 35 -VGA14: - VGAFM - 7FF7 - 640 680 768 800 480 491 493 525 - 1 - 79 33 -VGA:Normal - VGA - 640 680 768 800 480 491 493 525 - 1 - 79 29 - -# Pels: Pallette value definition for VGA, VGAFM drivers - -REVPEL: # Values for reverse color - 63 63 63 - 63 63 21 - 63 21 63 - 63 21 21 - 21 63 63 - 21 63 21 - 21 21 63 - 21 21 21 - 42 42 42 - 42 21 0 - 42 0 42 - 42 0 0 - 0 42 42 - 0 42 0 - 0 0 42 - 0 0 0 - -STDPEL: # Standard color - 0 0 0 - 0 0 42 - 0 42 0 - 0 42 42 - 42 0 0 - 42 0 42 - 42 21 0 - 42 42 42 - 21 21 21 - 21 21 63 - 21 63 21 - 21 63 63 - 63 21 21 - 63 21 63 - 63 63 21 - 63 63 63 - -HIPEL: Pels # Hi color - 0 0 0 - 0 0 52 - 0 52 0 - 0 52 52 - 52 0 0 - 52 0 52 - 52 31 0 - 52 52 52 - 31 31 31 - 31 31 63 - 31 63 31 - 31 63 63 - 63 31 31 - 63 31 63 - 63 63 31 - 63 63 63 - -# Startup command definition (usually font loading commands are specified) -minix: - /usr/bin/fld.minix -n /usr/share/fonts/publicfont.ank - /usr/bin/fld.minix -n /usr/share/fonts/publicfont.k14 -fontx: - /usr/bin/fld.fontx -n /dos/lib/font/new/jpnhn16x.fnt - /usr/bin/fld.fontx -n /dos/lib/font/new/jpnzn16x.fnt -minix-zcat: - zcat /usr/share/fonts/publicfont.a.Z | /usr/bin/fld.minix -n - zcat /usr/share/fonts/publicfont.k.Z | /usr/bin/fld.minix -n -fontx-zcat: - zcat /dos/lib/font/jpnhn16x.Z | /usr/bin/fld.fontx -n - zcat /dos/lib/font/jpnzn16x.Z | /usr/bin/fld.fontx -n -minix-gzip:Startup - gzip -d < /usr/share/fonts/pubfont.k.gz | /usr/bin/fld -t minix -n - gzip -d < /usr/share/fonts/pubfont.a.gz | /usr/bin/fld -t minix -n -fontx-gzip: - gzip -d < /dos/lib/font/jpnhn16x.z | /usr/bin/fld.fontx -n - gzip -d < /dos/lib/font/jpnzn16x.z | /usr/bin/fld.fontx -n - -################################# -# OPTIONAL SETUP ENTRIES -################################# - -# Mouse type definition. Choose one of: Microsoft, -# MouseSystems, BusMouse, MMSeries, Logitech, or None. -Mouse: - None -# Mouse baud rate -MouseBaud: - 1200 -# Mouse device file name -MouseDev: - /dev/mouse - -# Use hard scroll -HardScroll: - Off - -# Length of beep sound (1/100 sec). -BeepCounter: - 5 - -# Cursor blink interval (1/10 sec). -CursorInterval: - 4 - -# Screen blank time (minutes). -SaveTime: - 5 - -# Use double width cursor on kanji character -KanjiCursor: - On - -# Cursor top raster line (0..15) -CursorTop: - 14 - -# Cursor bottom raster line (CursorTop..15) -CursorBottom: - 15 - -# Vga Font Offset -VgaFontOffset: - 0 - -# Save font data in plane 3 (required for Trident TVGA series) -SavePlane3: - Off - -Mouse3Buttons: - On - -# Coding -# SingleByte DoubleByte 8bitCode -# ISO8895-[123456789], JISX0201.1976-0 -# BIG5.HKU-0, GB2312.1980-1, JISX0208.1983-0, KSC5601.1987-0 -# EUC, SJIS - -ja_JP.ujis:Coding - JISX0201.1976-0 JISX0208.1983-0 EUC - -ja_JP.sjis: - JISX0201.1976-0 JISX0208.1983-0 SJIS - -zh_TW.big5: - ISO8859-1 BIG5.HKU-0 - -zh_CN.ugb: - ISO8859-1 GB2312.1980-0 - -ko_KR.euc: - ISO8859-1 KSC5601.1987-0 - -# Show `No warranty' message -StartupMessage: - On diff --git a/loader/kon2/lib/Makefile b/loader/kon2/lib/Makefile deleted file mode 100644 index a17a97a0f..000000000 --- a/loader/kon2/lib/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -OBJ = sockface.o getcap.o mem.o font.o coding.o -LIB = libgon.a - -ifeq (../.config,$(wildcard ../.config)) -include ../.config -endif - -all: $(LIB) - -$(LIB): $(OBJ) - $(AR) rcs $(LIB) $(OBJ) - -depend .depend: - $(CC) $(CFLAGS) -M *.c > .depend - -clean: - $(RM) -f $(OBJ) $(LIB) *~ .depend - -install: all - -ifeq (.depend,$(wildcard .depend)) -include .depend -endif diff --git a/loader/kon2/lib/Makefile.FreeBSD b/loader/kon2/lib/Makefile.FreeBSD deleted file mode 100644 index 5764b8a60..000000000 --- a/loader/kon2/lib/Makefile.FreeBSD +++ /dev/null @@ -1,9 +0,0 @@ -# kon libraly makefile for FreeBSD -# Tatsumi Hosokawa <hosokawa@jp.FreeBSD.org> - -SRCS= sockface.c getcap.c mem.c font.c coding.c -CFLAGS= -I${.CURDIR}/../include -CLEANFILES= Makefile -LIB= gon - -.include <bsd.lib.mk> diff --git a/loader/kon2/lib/Makefile.linux b/loader/kon2/lib/Makefile.linux deleted file mode 100644 index a17a97a0f..000000000 --- a/loader/kon2/lib/Makefile.linux +++ /dev/null @@ -1,23 +0,0 @@ -OBJ = sockface.o getcap.o mem.o font.o coding.o -LIB = libgon.a - -ifeq (../.config,$(wildcard ../.config)) -include ../.config -endif - -all: $(LIB) - -$(LIB): $(OBJ) - $(AR) rcs $(LIB) $(OBJ) - -depend .depend: - $(CC) $(CFLAGS) -M *.c > .depend - -clean: - $(RM) -f $(OBJ) $(LIB) *~ .depend - -install: all - -ifeq (.depend,$(wildcard .depend)) -include .depend -endif diff --git a/loader/kon2/lib/coding.c b/loader/kon2/lib/coding.c deleted file mode 100644 index 4e1846d08..000000000 --- a/loader/kon2/lib/coding.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include <config.h> -#include <types.h> - -#include <stdio.h> -#include <errno.h> -#include <string.h> - -#include <interface.h> -#include <fnld.h> - -static u_int JISX0208(u_char ch1, u_char ch2) -{ - if (ch1 > 0x2A) - return((ch2 - 0x41 + (ch1 - 0x26) * 96) << 5); - else - return((ch2 - 0x21 + (ch1 - 0x21) * 96) << 5); -} - -#ifdef MINI_KON - -#define GB2312 NULL -#define BIG5 NULL -#define KSC5601 NULL - -#else - -static u_int GB2312(u_char ch1, u_char ch2) -{ - if (ch1 > 0x29) - return(((ch1 - 0x27) * 94 + ch2 - 0x21) << 5); - else - return(((ch1 - 0x21) * 94 + ch2 - 0x21) << 5); -} - -static u_int BIG5(u_char ch1, u_char ch2) -{ - if (ch2 < 0xA1) - return(((ch1 - 0xA1) * 157 + ch2 - 0x40) << 5); - else - return(((ch1 - 0xA1) * 157 + 63 + ch2 - 0xA1) << 5); -} - -static u_int KSC5601(u_char ch1, u_char ch2) -{ - if (ch1 > 0x2D) - return((ch2 - 0x21 + (ch1 - 0x24) * 96) << 5); - else - return((ch2 - 0x21 + (ch1 - 0x21) * 96) << 5); -} - -#endif - -static u_int FldJISX0208(u_char ch1, u_char ch2) -{ - return(JISX0208(ch1&0x7F, ch2&0x7F)); -} - -#ifdef MINI_KON - -#define FldGB2312 NULL -#define FldKSC5601 NULL - -#else - -static u_int FldKSC5601(u_char ch1, u_char ch2) -{ - return(KSC5601(ch1&0x7F, ch2&0x7F)); -} - -static u_int FldGB2312(u_char ch1, u_char ch2) -{ - return(GB2312(ch1&0x7F, ch2&0x7F)); -} - -#endif - -struct fontRegs fSRegs[] = { - /* latin1(French, Spanish, ...) */ - { NULL, 0, "ISO8859-1", NULL, 0, 0, 'B', 'A', 0}, - /* latin2 */ - { NULL, 0, "ISO8859-2", NULL, 0, 0, 'B', 'B', 0}, - /* latin3 */ - { NULL, 0, "ISO8859-3", NULL, 0, 0, 'B', 'C', 0}, - /* latin4 */ - { NULL, 0, "ISO8859-4", NULL, 0, 0, 'B', 'D', 0}, - /* Russian */ - { NULL, 0, "ISO8859-5", NULL, 0, 0, 'B', 'L', 0}, - /* Arabic */ - { NULL, 0, "ISO8859-6", NULL, 0, 0, 'B', 'G', 0}, - /* Greek */ - { NULL, 0, "ISO8859-7", NULL, 0, 0, 'B', 'F', 0}, - /* Hebrew */ - { NULL, 0, "ISO8859-8", NULL, 0, 0, 'B', 'H', 0}, - /* latin5 */ - { NULL, 0, "ISO8859-9", NULL, 0, 0, 'B', 'M', 0}, - /* Japanese */ - { NULL, 0,"JISX0201.1976-0", NULL, 0, 0, 'J', 'I', 0}, - { NULL, 0, NULL, NULL, 0, 0, 0, 0, 0} -}; - -struct fontLoaderRegs fldSRegs[] = { - { NULL, 0xFF}, - { NULL, 0xFF}, - { NULL, 0xFF}, - { NULL, 0xFF}, - { NULL, 0xFF}, - { NULL, 0xFF}, - { NULL, 0xFF}, - { NULL, 0xFF}, - { NULL, 0xFF}, - { NULL, 0xFF}, - { NULL, 0}, -}; - -struct fontRegs fDRegs[] = { - /* DF_GB2312 */ - { GB2312, 0, "GB2312.1980-0", NULL, 0, 0, 'A', 0, 0}, - /* DF_JISX0208 */ - {JISX0208, 0,"JISX0208.1983-0", NULL, 0, 0, 'B', 0, 0}, - /* DF_KSC5601 */ - { KSC5601, 0, "KSC5601.1987-0", NULL, 0, 0, 'C', 0, 0}, - /* DF_JISX0212 */ - {JISX0208, 0, "JISX0212", NULL, 0, 0, 'D', 0, 0}, - /* DF_BIG5_0 */ - { BIG5, 0, "BIG5.HKU-0", NULL, 0, 0, '0', 0, 0}, - /* DF_BIG5_1 */ - { BIG5, 0, "BIG5.HKU-0", NULL, 0, 0, '1', 0, 0}, - { NULL, 0, NULL, NULL, 0, 0, 0, 0, 0} -}; - -struct fontLoaderRegs fldDRegs[] = { - { FldGB2312, 0}, - {FldJISX0208, 0x7424}, - { FldKSC5601, 0x7D7E}, - {FldJISX0208, 0x7424}, - { BIG5, 0}, - { BIG5, 0}, - { NULL, 0} -}; - -int CodingByRegistry(char *reg) -{ - int i; - - i = 0; - while (fSRegs[i].registry) { - if (!strncasecmp(fSRegs[i].registry, reg, strlen(reg))) - return(i|CHR_SFLD); - i ++; - } - i = 0; - while (fDRegs[i].registry) { - if (!strncasecmp(fDRegs[i].registry, reg, strlen(reg))) - return(i|CHR_DFLD); - i ++; - } - return(-1); -} diff --git a/loader/kon2/lib/font.c b/loader/kon2/lib/font.c deleted file mode 100644 index a424fc1b3..000000000 --- a/loader/kon2/lib/font.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include <config.h> -#include <types.h> - -#include <stdio.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/ipc.h> -#include <sys/shm.h> -#include <sys/socket.h> -#include <errno.h> - -#include <fnld.h> -#include <interface.h> - -#ifndef MINI_KON - -void DownShmem(char fnum) -{ - key_t shmkey; - int shmid; - struct shmid_ds shmseg; - -#if defined(linux) - shmkey = ftok(CONFIG_NAME, fnum); -#elif defined(__FreeBSD__) - shmkey = 5000 + (fnum & 0x7F); -#endif - if ((shmid = shmget(shmkey, sizeof(struct fontInfo), 0444)) < 0) - return; - shmctl(shmid, IPC_STAT, &shmseg); - if (shmseg.shm_nattch < 1) { - shmctl(shmid, IPC_RMID, 0); - } -} - -u_char *GetShmem(fnum) -char fnum; -{ - key_t shmkey; - int shmid; - -#if defined(linux) - shmkey = ftok(CONFIG_NAME, fnum); -#elif defined(__FreeBSD__) - shmkey = 5000 + (fnum & 0x7F); -#endif - if ((shmid = shmget(shmkey, sizeof(struct fontInfo), 0444)) < 0) return(0); - return((u_char*)shmat(shmid, 0, SHM_RDONLY)); -} - -#endif diff --git a/loader/kon2/lib/getcap.c b/loader/kon2/lib/getcap.c deleted file mode 100644 index 017373647..000000000 --- a/loader/kon2/lib/getcap.c +++ /dev/null @@ -1,248 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <stdlib.h> - -#include <getcap.h> - -#define BUF_SIZE 1024 - -#define MAX_CAPS 20 - -static struct capability { - char *name; /* Name of capability label */ - initializer *func; /* Function to perform configuration */ - int initialized; /* 1 if initialized */ - char *arg; /* Command line argument for this capability. */ - char *def_value; /* Default value. NULL means required entry. */ -} cap[MAX_CAPS]; - -static struct capability *FindCap(const char *name) -{ - int i; - struct capability *cp; - - for (i = 0, cp = cap; i < MAX_CAPS; i++, cp++) { - if ((cp->name != NULL) && (strcasecmp(name, cp->name) == 0)) { - return cp; - } - } - return NULL; -} - -/* Define initializer function func for capability name. If def_value is nil, - then the entry of the name must exist in configuration file. An error is - flagged if no entry is found. If def_value is non-nil and no entry is found - in configuration file, then func is invoked with def_value. */ - -void DefineCap(const char *name, initializer *func, const char *def_value) -{ - int i; - struct capability *cp; - - /* Pass 1 -- try to replace same name entry if exists. */ - if ((cp = FindCap(name)) != NULL) { -#ifdef DEBUG - fprintf(stderr, "cap %s redefined (default %s)\r\n", name, - def_value ? def_value : "None"); -#endif - cp->name = strdup(name); - cp->func = func; - if (def_value) - cp->def_value = strdup(def_value); - return; - } - /* Pass 2 -- fine empty slot and insert new entry. */ - for (i = 0, cp = cap; i < MAX_CAPS; i++, cp++) { - if (cp->name == NULL) { -#ifdef DEBUG - fprintf(stderr, "cap %s defined (default %s)\r\n", name, - def_value ? def_value : "None"); -#endif - cp->name = strdup(name); - cp->func = func; - if (def_value) - cp->def_value = strdup(def_value); - return; - } - } - fprintf(stderr, "Fatal: internal error - can't find room for capability `%s'\r\r\n", name); - abort(); -} - -/* Delete all initializer functions. */ - -void CapInit(void) -{ - struct capability *cp; - int i; - - for (i = 0, cp = cap; i < MAX_CAPS; i++, cp++) { -#ifdef DEBUG - if (cp->name) - fprintf(stderr, "cap %s deleted\r\n", cp->name); -#endif - cp->initialized = 0; - if (cp->name) - free(cp->name); - if (cp->arg) - free(cp->arg); - if (cp->def_value) - free(cp->def_value); - cp->name = cp->arg = cp->def_value = NULL; - } -} - -static const char label_delim[] = ":,; \t\n"; - -/* Read configuration file named filename and invoke initializer function for each entry. */ - -int ReadConfig(const char *filename) -{ - FILE *capFp; - char line[MAX_COLS], *p; - char buf[BUF_SIZE]; - struct capability *c; - int i; - int errors = 0; /* number of errors during configuration */ - - if ((capFp = fopen(filename, "r")) == NULL) { - fprintf(stderr, "Error: can't open config file\r\r\n"); - perror(filename); - return FAILURE; - } - - while(fgets(line, MAX_COLS, capFp) != NULL) { - nextLabel: - if ((p = strchr(line, '#')) != NULL) - *p = '\0'; - if (strchr(line, ':') == NULL) continue; /* not a lebel */ - for (p = strtok(line, label_delim); p != NULL; p = strtok(NULL, label_delim)) { - /* Process one label line. */ - if ((c = FindCap(p)) != NULL) { - /* Found matching capability. Get body from file. */ - char *l = buf; - while (fgets(line, MAX_COLS, capFp) != NULL - && line[0] == '\t') { - char *l2 = line; - while (*l2 != '\n' && *l2 != '#') { - *l++ = *l2++; - } - *l++ = '\n'; - } - *l = '\0'; - if (! c->initialized) { - /* do initialize */ - if (c->arg) { -#ifdef DEBUG - fprintf(stderr, "Capability %s set to arg %s\r\n", - c->name, c->arg); -#endif - if (c->func(c->arg) < 0) - errors++; - } else { -#ifdef DEBUG - fprintf(stderr, "Capability %s set to %s", - c->name, buf); -#endif - if (c->func(buf) < 0) - errors++; - } - c->initialized = 1; - } - goto nextLabel; /* next line already read */ - } - } - } - /* Default initialization for unspecified capability. */ - for (i = 0, c = cap; i < MAX_CAPS; i++, c++) { - if ((c->name != NULL) && !c->initialized) { - if (c->arg) { -#ifdef DEBUG - fprintf(stderr, "Capability %s defaults to arg %s\r\n", c->name, c->arg); -#endif - if (c->func(c->arg) < 0) - errors++; - } else if (c->def_value) { -#ifdef DEBUG - fprintf(stderr, "Capability %s defaults to %s\r\n", c->name, c->def_value); -#endif - if (c->func(c->def_value) < 0) - errors++; - } else { - fprintf(stderr, "Error: entry for capability `%s' not found\r\r\n", c->name); - errors++; - } - } - } - fclose(capFp); -#ifdef DEBUG - fprintf(stderr, "Finished reading config file\r\n"); -#endif - if (errors) - return FAILURE; - else - return SUCCESS; -} - -/* Set value for capability capName. */ -int SetCapArg(const char *capName, const char *value) -{ - struct capability *cp; - if ((cp = FindCap(capName)) == NULL) { - return FAILURE; - } - if (cp->def_value == NULL) { - /* Protected capability. */ - return FAILURE; - } - cp->arg = strdup(value); -#ifdef DEBUG - fprintf(stderr, "Setting arg for %s to %s\r\n", capName, value); -#endif - return SUCCESS; -} - -/* Utility function that return 1 if confstr is "On" and 0 if "OFF". */ - -bool BoolConf(const char *confstr) -{ - char name[MAX_COLS]; - sscanf(confstr, "%s", name); - if (strcasecmp(name, "On") == 0 || - strcasecmp(name, "True") == 0) { - return TRUE; - } else if (strcasecmp(name, "Off") != 0 && - strcasecmp(name, "False") != 0) { - fprintf(stderr, "Warning: value `%s' unrecognized as boolean; assuming `Off'\r\r\n", - name); - } - return FALSE; -} diff --git a/loader/kon2/lib/load.c b/loader/kon2/lib/load.c deleted file mode 100644 index 68aca8704..000000000 --- a/loader/kon2/lib/load.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -u_char *LoadFromShm(u_char *fbuff, int fd, struct fontInfo *fi) -{ - int shmid; - u_char *addr; - - read(fd, &shmid, sizeof(shmid)); - read(fd, fi, sizeof(struct fontInfo)); - addr = memalign(fi->size, PAGE_SIZE); - if (addr < 0) { - Perror("memalign"); - return NULL; - } - if ((addr = shmat(shmid, addr, 0)) == (char *) -1) { - Perror("shmat"); - free(addr); - return NULL; - } - if (fbuff) - free(fbuff); - return addr; -} diff --git a/loader/kon2/lib/mem.c b/loader/kon2/lib/mem.c deleted file mode 100644 index d43ea48f0..000000000 --- a/loader/kon2/lib/mem.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include "../include/types.h" -#include <sys/types.h> -#include <mem.h> -#if defined(linux) -#include <malloc.h> -#else -#include <stdlib.h> -#endif - -#if 0 -u_char PortInb(unsigned short port) -{ - u_char _rval; - - __asm__ volatile ("inb %1,%0" - :"=a" (_rval) - :"d" ((u_short) port)); - - return(_rval); -} - -void wzero(void *head, int n) -{ - int dummy_cx; - __asm__ ("cld\n\t" - "rep\n\t" - "stosw" - :"=c" (dummy_cx) - :"a" (0), - "0" (n>>1), - "D" ((long)head) - :"cx","di"); -} - -void wmove(void *dst, void *src, int n) -{ - int dummy_cx; - __asm__ ("cld\n\t" - "rep\n\t" - "movsw\n\t" - :"=c" (dummy_cx) - :"0" (n>>1), - "D" ((long)dst), - "S" ((long)src) - :"cx","di","si"); -} - -void lmove(void *dst, void *src, int n) -{ - int dummy_cx; - __asm__ ("cld\n\t" - "rep\n\t" - "movsl\n\t" - :"=c" (dummy_cx) - :"0" (n>>2), - "D" ((long)dst), - "S" ((long)src) - :"cx","di","si"); -} -#endif - -void SafeFree(void **p) -{ - if (*p) { - free(*p); - *p = NULL; - } -} diff --git a/loader/kon2/lib/sockface.c b/loader/kon2/lib/sockface.c deleted file mode 100644 index bef533713..000000000 --- a/loader/kon2/lib/sockface.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include <config.h> - -#ifndef MINI_KON - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <sys/types.h> -#include <sys/time.h> -#include <sys/file.h> -#include <sys/types.h> -#include <sys/socket.h> -#ifdef linux -#include <sys/vt.h> -#endif -#include <sys/ioctl.h> - -#include <interface.h> - -u_int wfontSize, sfontSize; -u_char *sbFontBuff, *dbFontBuff; - -/* -char socketName[MAX_SOCKET_NAME+1]; -*/ - -static u_char clientNumber; - -void SocketKill(int sfd) -{ - close(sfd); - unlink("/tmp/.kon"); -} - -int SocketRecCommand(int fd, struct messageHeader *mh) -{ - return(read(fd, mh, sizeof(struct messageHeader))); -} - -int SocketSendCommand(int fd, char cmd) -{ - struct messageHeader mh; - - mh.cmd = cmd; - mh.cno = clientNumber; - return(write(fd, &mh, sizeof(struct messageHeader))); -} - -int SocketSearchName(struct sockaddr *sa, int fd) -{ -#ifdef linux - struct vt_stat vs; -#endif - - bzero(sa, sizeof(struct sockaddr)); - sa->sa_family = AF_UNIX; -#if defined(linux) - if (ioctl(fd, VT_GETSTATE, &vs) < 0) { - return EOF; - } - sprintf(sa->sa_data, "%s%d", SOCKET_BASENAME, vs.v_active); -#elif defined(__FreeBSD__) - sprintf(sa->sa_data, "%s", SOCKET_BASENAME); -#endif - return(0); -} - -int SocketClientOpen(void) -{ - int s, len; - struct sockaddr sa; - int fd; - - if ((fd = open("/dev/console", O_WRONLY)) < 0) - fd = open("/dev/console", O_RDONLY); - SocketSearchName(&sa, fd); - s = socket(AF_UNIX, SOCK_STREAM, 0); - -#if defined(linux) - len = sizeof(sa.sa_family) + strlen(sa.sa_data); -#elif defined(__FreeBSD__) - len = sizeof(sa.sa_family) + strlen(sa.sa_data) + 1; -#endif - if (connect(s, &sa, len) == -1) s = EOF; - return(s); -} - -int SocketSendData(u_char *buff, int size, int fd) -{ - int i; - struct messageHeader mh; - - for (i = 0; i < size; i += BUFSIZ) { - if ((size - i) < BUFSIZ) - write(fd, (void *)buff, size - i); - else - write(fd, (void *)buff, BUFSIZ); - SocketRecCommand(fd, &mh); - if (mh.cmd != CHR_ACK) return(EOF); - buff += BUFSIZ; - } - return(0); -} - -#endif diff --git a/loader/kon2/src/Makefile b/loader/kon2/src/Makefile deleted file mode 100644 index 6b6fe006e..000000000 --- a/loader/kon2/src/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -DISP = display.a -OBJS = vt.o sock.o fnld.o vc.o mouse.o term.o main.o utmp.o errors.o child.o -KON = libkon.a($(OBJS)) - -ifeq (../.config,$(wildcard ../.config)) -include ../.config -endif - -#CC := $(CC) -g -#LD := $(CC) -lgmon -SUBDIRS = display - -all: subdirs $(KON) - -#$(KON): $(OBJS) $(DISP) $(LIB) -# $(LD) -o $(KON) $(OBJS) $(DISP) $(LIB) - -depend .depend: - $(CC) $(CFLAGS) -M *.c > .depend - @for i in $(SUBDIRS);\ - do (cd $$i && echo building dependencies in $$i && $(MAKE) depend) || exit;\ - done - -subdirs: - @for i in $(SUBDIRS);\ - do (cd $$i && echo making all in $$i && $(MAKE)) || exit;\ - done - -clean: - $(RM) -f *.o *.a libkon.a $(OBJS) *~ .depend - @for i in $(SUBDIRS);\ - do (cd $$i && echo cleaning all in $$i && $(MAKE) clean) || exit;\ - done - -install: $(KON) - $(INSTALL) -m 4755 $(KON) $(BINDIR) - -ifeq (.depend,$(wildcard .depend)) -include .depend -endif diff --git a/loader/kon2/src/Makefile.FreeBSD b/loader/kon2/src/Makefile.FreeBSD deleted file mode 100644 index d45b8f613..000000000 --- a/loader/kon2/src/Makefile.FreeBSD +++ /dev/null @@ -1,31 +0,0 @@ -# FreeBSD makefile for kon -# Tatsumi Hosokawa <hosokawa@jp.FreeBSD.org> - -PROG= kon -BINOWN= root -BINMODE= 4555 -SRCS= vt.c sock.c fnld.c vc.c mouse.c term.c main.c utmp.c errors.c child.c -LIBS+= -L${.CURDIR}/display -L${.CURDIR}/../lib -ldisplay -lgon -NOMAN= YES -CFLAGS+= -I${.CURDIR}/../include -CLEANFILES= Makefile - -.if exists(${.OBJDIR}/../lib) -LIBOBJ= -L${.OBJDIR}/../lib -.else -LIBOBJ= -L${.CURDIR}/../lib -.endif - -.if exists(${.OBJDIR}/display) -LIBOBJ+= -L${.OBJDIR}/display -.else -LIBOBJ+= -L${.CURDIR}/display -.endif - -LDADD= ${LIBOBJ} -ldisplay -lgon - -.if exists(${.CURDIR}/../.config) -.include "${.CURDIR}/../.config" -.endif - -.include <bsd.prog.mk> diff --git a/loader/kon2/src/Makefile.linux b/loader/kon2/src/Makefile.linux deleted file mode 100644 index a8f046575..000000000 --- a/loader/kon2/src/Makefile.linux +++ /dev/null @@ -1,40 +0,0 @@ -DISP = display.a -OBJS = vt.o sock.o fnld.o vc.o mouse.o term.o main.o utmp.o errors.o child.o -KON = kon - -ifeq (../.config,$(wildcard ../.config)) -include ../.config -endif - -#CC := $(CC) -g -#LD := $(CC) -lgmon -SUBDIRS = display - -all: subdirs $(KON) - -$(KON): $(OBJS) $(DISP) $(LIB) - $(LD) -o $(KON) $(OBJS) $(DISP) $(LIB) - -depend .depend: - $(CC) $(CFLAGS) -M *.c > .depend - @for i in $(SUBDIRS);\ - do (cd $$i && echo building dependencies in $$i && $(MAKE) depend) || exit;\ - done - -subdirs: - @for i in $(SUBDIRS);\ - do (cd $$i && echo making all in $$i && $(MAKE)) || exit;\ - done - -clean: - $(RM) -f *.o $(KON) *~ .depend - @for i in $(SUBDIRS);\ - do (cd $$i && echo cleaning all in $$i && $(MAKE) clean) || exit;\ - done - -install: $(KON) - $(INSTALL) -m 4755 $(KON) $(BINDIR) - -ifeq (.depend,$(wildcard .depend)) -include .depend -endif diff --git a/loader/kon2/src/child.c b/loader/kon2/src/child.c deleted file mode 100644 index d31257ed6..000000000 --- a/loader/kon2/src/child.c +++ /dev/null @@ -1,149 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include <config.h> -#include <types.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <errno.h> - -#include <getcap.h> - -#include <defs.h> -#include <version.h> -#include <vc.h> - -static char *startupStr, *execProg; - -int ConfigExecProg(const char *string) -{ - execProg = strdup(string); - return SUCCESS; -} - -#ifndef MINI_KON - -static int ConfigStartup(const char *string) -{ - startupStr = strdup(string); - return SUCCESS; -} - -static void RunStartupCmd(void) -{ - char *p; - - p = strtok(startupStr, "\n"); - while(p) { - system(p); - p = strtok(NULL, "\n"); - } -} - -static bool startupMessage; - -static int ConfigMessage(const char *confstr) -{ - startupMessage = BoolConf(confstr); - return SUCCESS; -} - -void ChildInit(void) -{ - DefineCap("StartupMessage", ConfigMessage, "On"); - DefineCap("StartUp", ConfigStartup, NULL); -} - -#endif - -void ChildCleanup(void) -{ - free(startupStr); -} - -void ChildStart(FILE *errfp) -{ - char *tail, *tcap; - char buff[256]; - extern char *TermName(); - -#ifndef MINI_KON - char *shell; - setgid(getgid()); - setuid(getuid()); - - RunStartupCmd(); -#endif - -#if defined(linux) -#ifdef MINI_KON - strcpy(buff, "TERM=kon"); -#else - strcpy(buff, "TERM=kon"); -#endif -#elif defined(__FreeBSD__) - sprintf(buff,"TERM=vt100"); -#endif - - tcap = strdup(buff); - putenv(tcap); - -#ifndef MINI_KON - if (startupMessage) - printf("\rKON2 Kanji On Console " VERSION - " using VT number %c\r\n" - "%*s\r\n" - "%*s\r\n", *(TermName()+8), - dInfo.txmax, - "Copyright (C) " - "1993-1996 Takashi MANABE", - dInfo.txmax, - "1993, 1994 MAEDA Atusi "); -#if defined(__FreeBSD__) - printf("\rKON for FreeBSD-2.x ver0.01 Takashi OGURA\r\n"); -#endif - - fflush(stdout); -#endif - - if (execProg) - execlp(execProg, execProg, 0); - else { - if ((execProg = getenv("SHELL")) == NULL) - execProg = "/bin/sh"; - if ((tail = strrchr(execProg, '/')) == NULL) - tail = " sh"; - sprintf(buff, "-%s", tail + 1); - execl(execProg, buff, 0); - } - fprintf(errfp, "KON> couldn't exec shell\r\n"); - fprintf(errfp, "%s: %s\r\n", execProg, strerror(errno)); - exit(EXIT_FAILURE); -} diff --git a/loader/kon2/src/display/Makefile b/loader/kon2/src/display/Makefile deleted file mode 100644 index 57ec7be20..000000000 --- a/loader/kon2/src/display/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -OBJS = -DISP = ../display.a - -ifeq (../../.config,$(wildcard ../../.config)) -include ../../.config -endif - -ifdef HAS_S3 -OBJS := $(OBJS) s3.o -endif -ifdef HAS_J31SX -OBJS := $(OBJS) j31sx.o -endif -OBJS := $(OBJS) svga.o vga.o - -#CC := $(CC) -g -#LD := $(CC) -g - -all: $(DISP) - -$(DISP): $(OBJS) - $(AR) rcs $(DISP) $(OBJS) - -depend .depend: - $(CC) $(CFLAGS) -M *.c > .depend - -clean: - $(RM) -f *.o $(DISP) *~ .depend - -install: all - -ifeq (.depend,$(wildcard .depend)) -include .depend -endif diff --git a/loader/kon2/src/display/Makefile.FreeBSD b/loader/kon2/src/display/Makefile.FreeBSD deleted file mode 100644 index dfcac4433..000000000 --- a/loader/kon2/src/display/Makefile.FreeBSD +++ /dev/null @@ -1,20 +0,0 @@ -# Tatsumi Hosokawa <hosokawa@jp.FreeBSD.org> - -.if exists(${.CURDIR}/../../.config) -.include "${.CURDIR}/../../.config" -.endif - -SRCS= svga.c vga.c - -.ifdef HAS_S3 -SRCS+= s3.c -.endif - -.ifdef HAS_J31SX -SRCS+= j31sx.c -.endif - -CFLAGS+= -I${.CURDIR}/../../include -LIB=display - -.include <bsd.lib.mk> diff --git a/loader/kon2/src/display/Makefile.linux b/loader/kon2/src/display/Makefile.linux deleted file mode 100644 index 57ec7be20..000000000 --- a/loader/kon2/src/display/Makefile.linux +++ /dev/null @@ -1,34 +0,0 @@ -OBJS = -DISP = ../display.a - -ifeq (../../.config,$(wildcard ../../.config)) -include ../../.config -endif - -ifdef HAS_S3 -OBJS := $(OBJS) s3.o -endif -ifdef HAS_J31SX -OBJS := $(OBJS) j31sx.o -endif -OBJS := $(OBJS) svga.o vga.o - -#CC := $(CC) -g -#LD := $(CC) -g - -all: $(DISP) - -$(DISP): $(OBJS) - $(AR) rcs $(DISP) $(OBJS) - -depend .depend: - $(CC) $(CFLAGS) -M *.c > .depend - -clean: - $(RM) -f *.o $(DISP) *~ .depend - -install: all - -ifeq (.depend,$(wildcard .depend)) -include .depend -endif diff --git a/loader/kon2/src/display/j31sx.c b/loader/kon2/src/display/j31sx.c deleted file mode 100644 index f93bdda1b..000000000 --- a/loader/kon2/src/display/j31sx.c +++ /dev/null @@ -1,453 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* - This code is based on vgalib. - - Thanks to frandsen@diku.dk (Tommy Frandsen). -*/ - -/* - This code is modified for DCGA by obuk@MIX. - - Thanks to obuk@MIX. -*/ - -#include <config.h> - -#ifdef HAS_J31SX - -#include <stdio.h> -#include <fcntl.h> -#include <termios.h> -#include <string.h> -#include <unistd.h> -#include <sys/mman.h> -#include <linux/mm.h> -#include <sys/kd.h> -#undef free -#include <stdlib.h> - -#include <mem.h> -#include <getcap.h> -#include <defs.h> -#include <errors.h> -#include <vc.h> - -#define COLUMNS 80 -#define ROWS 25 - -#define GRAPH_BASE 0xB8000 -#define GRAPH_SIZE (LSIZE*NLINES) - -#define LSIZE (0x800*4) -#define NLINES 4 - -#define LINE0 (0*LSIZE) -#define LINE1 (1*LSIZE) -#define LINE2 (2*LSIZE) -#define LINE3 (3*LSIZE) - -#define CGA_DATA 0x3d4 -#define CGA_MODE 0x3d8 -#define CGA_COLOR 0x3d9 -#define CGA_STATUS 0x3da - -struct cgaRegs { - u_char mode; - u_char data[16]; - u_char color; -}; - -static struct cgaRegs - regText = { - 0x2d & ~8, /* mode */ - { - 0x71, 0x50, 0x5a, 0x0a, 0x1f, 0x06, 0x19, 0x1c, /* data */ - 0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, - }, - 0x30, /* color */ - }, - regGraph = { - 0x1e & ~8, /* mode */ - { - 0x38, 0x28, 0x2d, 0x0a, 0x7f, 0x06, 0x64, 0x7d, /* data */ - 0x02, 0x03, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, - }, - 0x3f, /* color */ - }; - - -static char *gram; /* dummy buffer for mmapping grahics memory */ -static int origin = 0; -static int scroll = 0; -static int mode; -static u_int writeAddr; /* address to write next character */ - -static bool boxCursor; -static bool kanjiCursor; - -#define DIM(x) (sizeof(x)/sizeof((x)[0])) -#define min(a,b) ((a)<(b)?(a):(b)) - -static void ClearLines(int top, int bottom); -static void SetOrigin(int pos); -static void DisableVideo(void); -static void EnableVideo(void); -static void SetRegisters(struct cgaRegs *regs); - -static u_char wspace[] = { - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -}; - -static inline -void VgaSetAddress(u_int p) -{ - int row = (p / COLUMNS + scroll) % ROWS; - int column = p % COLUMNS; - writeAddr = row*COLUMNS*4 + column; -} - - -static -void VgaSput(u_char *code, u_char fc, u_char bc) -{ - int pos, i; char x; - int underline; - - underline = fc & ATTR_ULINE; - fc &= 7; bc &= 7; - if (!code || fc == bc) code = wspace; - x = (fc < bc)? 0xff: 0x00; - - pos = origin + writeAddr - COLUMNS; - for (i = 0; i < NLINES; i++) { - pos = (pos+COLUMNS) & (LSIZE-1); - gram[pos+LINE0] = x ^ *code++; - gram[pos+LINE1] = x ^ *code++; - gram[pos+LINE2] = x ^ *code++; - gram[pos+LINE3] = x ^ *code++; - } - if (underline) { - gram[pos+LINE3] = 0xff; - } -} - - -static -void VgaWput(u_char *code, u_char fc, u_char bc) -{ - int pos1, pos2, i; char x; - int underline; - - underline = fc & ATTR_ULINE; - fc &= 7; bc &= 7; - if (!code || fc == bc) code = wspace; - x = (fc < bc)? 0xff: 0x00; - - pos1 = origin + writeAddr - COLUMNS; - for (i = 0; i < NLINES; i++) { - pos1 = (pos1+COLUMNS) & (LSIZE-1); - pos2 = (pos1+1) & (LSIZE-1); - gram[pos1+LINE0] = x ^ *code++; gram[pos2+LINE0] = x ^ *code++; - gram[pos1+LINE1] = x ^ *code++; gram[pos2+LINE1] = x ^ *code++; - gram[pos1+LINE2] = x ^ *code++; gram[pos2+LINE2] = x ^ *code++; - gram[pos1+LINE3] = x ^ *code++; gram[pos2+LINE3] = x ^ *code++; - } - if (underline) { - gram[pos1+LINE3] = 0xff; gram[pos2+LINE3] = 0xff; - } -} - - -static inline -void VgaSetCursorAddress(struct cursorInfo *ci, u_int x, u_int y) -{ - ci->addr = y*COLUMNS*4 + x; -} - -static inline -void VgaCursor(struct cursorInfo *ci) -{ - int pos, i; - - pos = origin + ci->addr; - i = 0; - if (! boxCursor) - pos += COLUMNS*3; i += 3; - - for (; i < NLINES; i++) { - pos &= LSIZE-1; - gram[pos+LINE0] ^= 0xff; - gram[pos+LINE1] ^= 0xff; - gram[pos+LINE2] ^= 0xff; - gram[pos+LINE3] ^= 0xff; - if (kanjiCursor && ci->kanji) { - int pos2 = (pos+1) & (LSIZE-1); - gram[pos2+LINE0] ^= 0xff; - gram[pos2+LINE1] ^= 0xff; - gram[pos2+LINE2] ^= 0xff; - gram[pos2+LINE3] ^= 0xff; - } - pos += COLUMNS; - } -} - - - -static -void VgaSetStartAddress(void) -{ - SetOrigin(origin); -} - -static -void VgaHardScrollUp(int line) -{ - if (line > ROWS-1) { - line %= ROWS; - ClearLines(0, ROWS-1); - } - SetOrigin(origin + line*COLUMNS*4); - ClearLines(ROWS-line, ROWS-1); - scroll = (scroll-line+ROWS) % ROWS; -} - -static -void VgaHardScrollDown(int line) -{ - if (line > ROWS-1) { - line %= ROWS; - ClearLines(0, ROWS-1); - } - SetOrigin(origin - line*COLUMNS*4); - ClearLines(0, line-1); - scroll = (scroll+line+ROWS) % ROWS; -} - - -static void ClearLines(int top, int bottom) -{ - int pos, bytes, n; - if (top > bottom) return; - pos = origin + top*COLUMNS*4; - bytes = (bottom+1-top)*COLUMNS*4; - while (bytes > 0) { - pos &= (LSIZE-1); - n = min(bytes, LSIZE-pos); - bzero2(&gram[pos+LINE0], n); - bzero2(&gram[pos+LINE1], n); - bzero2(&gram[pos+LINE2], n); - bzero2(&gram[pos+LINE3], n); - pos += n; - bytes -= n; - } -} - -static -void VgaClearAll(void) -{ - ClearLines(0, ROWS-1); -} - -static -void VgaScreenSaver(bool blank) -{ - if (blank) { - DisableVideo(); - } else { - EnableVideo(); - } -} - - -static -void VgaTextMode(void) -{ - SetRegisters(®Text); - EnableVideo(); -} - -static -void VgaGraphMode(void) -{ - SetRegisters(®Graph); - EnableVideo(); -} - -static -void VgaInit(void) -{ - SetRegisters(®Graph); /* enter graphics mode */ - lzero(gram, GRAPH_SIZE); - EnableVideo(); -} - - -static void DisableVideo(void) -{ - PortOutb(mode &= ~8, CGA_MODE); -} - - -static void EnableVideo(void) -{ - PortOutb(mode |= 8, CGA_MODE); -} - - -static void SetOrigin(int pos) -{ - int word_address = (origin = pos & (LSIZE-1)) >> 1; - int hi = word_address >> 8; - int lo = word_address & 0x00FF; -#ifdef wordport_magic - PortOutw(12 | (hi << 8), CGA_DATA); - PortOutw(13 | (lo << 8), CGA_DATA); -#else - PortOutb(12, CGA_DATA); - PortOutb(hi, CGA_DATA+1); - PortOutb(13, CGA_DATA); - PortOutb(lo, CGA_DATA+1); -#endif -} - - -static void SetRegisters(struct cgaRegs *regs) -{ - int i; - - PortOutb(0, CGA_MODE); /* disable video */ - for (i = 0; i < DIM(regs->data); ++i) { -#ifdef wordport_magic - PortOutw((regs->data[i] << 8) | i, CGA_DATA); -#else - PortOutb(i, CGA_DATA); - PortOutb(regs->data[i], CGA_DATA+1); -#endif - } - PortOutb(regs->color, CGA_COLOR); - PortOutb(mode = regs->mode, CGA_MODE); -} - -static void VgaDetach(void) -{ - origin = scroll = 0; - ioperm(CGA_MODE, 1, 0); - ioperm(CGA_DATA, 2, 0); - ioperm(CGA_COLOR, 1, 0); - - munmap(gram, GRAPH_SIZE); - - SafeFree((void **)&gram); -} - -static struct videoInfo J31SXInfo = -{ - TRUE, - VgaInit, - VgaTextMode, - VgaGraphMode, - VgaWput, - VgaSput, - VgaSetCursorAddress, - VgaSetAddress, - VgaCursor, - VgaClearAll, - VgaScreenSaver, - VgaDetach, - VgaSetStartAddress, - VgaHardScrollUp, - VgaHardScrollDown -}; - -static int ConfigKanjiCursor(const char *confstr) -{ - kanjiCursor = BoolConf(confstr); - return SUCCESS; -} - -static int ConfigBoxCursor(const char *confstr) -{ - boxCursor = BoolConf(confstr); - return SUCCESS; -} - -int J31SXSetVideoType(struct videoInfo *info, const char *regs) -{ - int devMem; - - /* Calculate display info */ - dInfo.gxdim = 640; - dInfo.gydim = 400; - dInfo.txmax = COLUMNS-1; - dInfo.tymax = ROWS-1; - - dInfo.glineChar = dInfo.gydim / (dInfo.tymax + 1); - dInfo.glineByte = dInfo.gxdim >> 3; - dInfo.gydim = dInfo.glineChar * (dInfo.tymax + 1); - dInfo.gsize = dInfo.glineByte * dInfo.gydim; - dInfo.tlineByte = dInfo.glineChar * dInfo.glineByte; - - /* get I/O permissions for VGA registers */ - ioperm(CGA_MODE, 1, 1); - ioperm(CGA_DATA, 2, 1); - ioperm(CGA_COLOR, 1, 1); - - if ((devMem = open("/dev/mem", O_RDWR) ) < 0) { - Perror("/dev/mem"); - return FAILURE; - } - gram = (unsigned char *)mmap( - (__ptr_t)0, - GRAPH_SIZE, - PROT_READ|PROT_WRITE, -#if 0 - MAP_SHARED|MAP_FIXED, -#else - MAP_SHARED, -#endif - devMem, - GRAPH_BASE - ); - close(devMem); - if ((long)gram < 0) { - Perror("mmap"); - return FAILURE; - } - - *info = J31SXInfo; - DefineCap("KanjiCursor", ConfigKanjiCursor, "On"); - DefineCap("BoxCursor", ConfigBoxCursor, "Off"); - - return SUCCESS; -} - -#endif diff --git a/loader/kon2/src/display/s3.c b/loader/kon2/src/display/s3.c deleted file mode 100644 index e90c7c5f6..000000000 --- a/loader/kon2/src/display/s3.c +++ /dev/null @@ -1,264 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* - This code is based on vgalib. - - Thanks to frandsen@diku.dk (Tommy Frandsen). - */ - -#include <config.h> - -#ifndef MINI_KON - -#ifdef HAS_VGA - -#include <stdio.h> -#include <fcntl.h> -#include <termios.h> -#include <string.h> -#include <unistd.h> -#include <sys/mman.h> -#include <linux/mm.h> -#include <sys/kd.h> -#undef free -#include <stdlib.h> - -#include <mem.h> -#include <getcap.h> -#include <defs.h> -#include <errors.h> -#include <vc.h> -#include <vt.h> -#include <vga.h> -#include <fnld.h> - -#define R5x_MASK 0x7737 - -union s3Regs { - struct { - u_char r3[10];/* Video Atribute (CR30-34, CR38-3C) */ - u_char rx[33];/* Video Atribute (CR40-65) */ - } x; - struct { - u_char - x30, x31, x32, x33, x34, - x38, x39, x3a, x3b, x3c; - u_char - x40, x41, x42, x43, x44, x45, x46, x47, - x48, x49, x4a, x4b, x4c, x4d, x4e, x4f, - x50, x51, x53, x54, x55, x58, x59, x5a, x5c, x5d, x5e, - x60, x61, x62, x63, x64, x65; - } r; -} s3Text, s3Graph; - -static - void S3SetRegisters(union s3Regs *regs) -{ - int i, n; - - PortOutw(0xa539, vgaCrtAddr); /* unlock system control regs */ - for (i = 0; i < 5; i ++) { - PortOutb(0x30 + i, vgaCrtAddr); - PortOutb(regs->x.r3[i], vgaCrtData); - PortOutb(0x38 + i, vgaCrtAddr); - PortOutb(regs->x.r3[5+i], vgaCrtData); - } - for (i = 0; i < 16; i ++) { - PortOutb(0x40 + i, vgaCrtAddr); - PortOutb(regs->x.rx[i], vgaCrtData); - } - for (n = 16, i = 0; i < 16; i ++) { - if ((1 << i) & R5x_MASK) { - PortOutb(0x50 + i, vgaCrtAddr); - PortOutb(regs->x.rx[n], vgaCrtData); - n ++; - } - } - for (i = 0; i < 6; i ++, n ++) { - PortOutb(0x60 + i, vgaCrtAddr); - PortOutb(s3Text.x.rx[n], vgaCrtData); - } -} - -static - void S3SetStartAddress(void) -{ - u_int til; - - PortOutb(0x31, vgaCrtAddr); - PortOutb(((gramHead & 0x030000) >> 12) | s3Graph.r.x31, vgaCrtData); - s3Graph.r.x51 &= ~0x03; - s3Graph.r.x51 |= ((gramHead & 0x040000) >> 18); - PortOutb(0x51, vgaCrtAddr); - /* Don't override current bank selection */ - PortOutb((PortInb(vgaCrtData) & ~0x03) - | ((gramHead & 0x40000) >> 18), vgaCrtData); - - PortOutw((gramHead & 0xFF00) | 0x0c, vgaCrtAddr); - PortOutw(((gramHead & 0x00FF) << 8) | 0x0d, vgaCrtAddr); - - til = dInfo.gydim - 1 - (gramHead / dInfo.glineByte); - PortOutw((til << 8) | 0x18, vgaCrtAddr); - PortOutw(((til & 0x100) << 4) | LineComp8, vgaCrtAddr); - PortOutw(((til & 0x200) << 5) | LineComp9, vgaCrtAddr); - PortOutw(0x8d31, vgaCrtAddr); /* unlock system control regs */ -} - -static - void S3TextMode(void) -{ - VgaTextMode(); - S3SetRegisters(&s3Text); -} - -static - void S3CalcNewRegs(union videoTimings *video) -{ - regGraph.mis |= 0x0D; -/* regGraph.crt[19] = 0xA0;*/ -/* regGraph.crt[20] = 0xA0;*/ - regGraph.crt[23] = 0xE3; -/* regGraph.crt[24] = 0;*/ - s3Graph.r.x5e = (((video->m.vTotal - 2) & 0x400) >> 10) - | (((video->m.vLine - 1) & 0x400) >> 9) - | ((video->m.vStart & 0x400) >> 8) - | ((video->m.vStart & 0x400) >> 6) | 0x40; - s3Graph.r.x5d = ((video->m.hTotal & 0x800) >> 11) - | ((video->m.hDot & 0x800) >> 10) - | ((video->m.hStart & 0x800) >> 9) - | ((video->m.hStart & 0x800) >> 7); -} - -static - void S3GraphMode(void) -{ -/* s3Graph.r.x35 = s3Text.r.x35 & 0xF0;*/ -#if 1 - s3Graph.r.x5c = 0x20; - s3Graph.r.x31 = 0x8D; - s3Graph.r.x32 = 0; - s3Graph.r.x33 = 0x20; - s3Graph.r.x34 = 0x10; -/* s3Graph.r.x35 = 0;*/ -/* s3Graph.r.x3a = 0x95;*/ - s3Graph.r.x3b = (regGraph.crt[0] + regGraph.crt[4] + 1) / 2; - s3Graph.r.x3c = regGraph.crt[0] / 2; - s3Graph.r.x40 = (s3Text.r.x40 & 0xF6) | 1; - s3Graph.r.x43 = s3Text.r.x44 = 0; - s3Graph.r.x45 = s3Text.r.x45 & 1; - - s3Graph.r.x50 = s3Text.r.x50 & ~0xC1; - s3Graph.r.x51 = (s3Text.r.x51 & 0xC0) | ((dInfo.gxdim >> 7) & 0x30); - s3Graph.r.x53 = s3Text.r.x53 & ~0x30; - s3Graph.r.x54 = 0xA0; - s3Graph.r.x55 = (s3Text.r.x55 & 8) | 0x40; - s3Graph.r.x58 = 0; - s3Graph.r.x5d |= s3Graph.r.x5d & ~0x17; - s3Graph.r.x60 = 0x3F; - s3Graph.r.x61 = 0x81; - s3Graph.r.x62 = 0; - if (dInfo.gxdim < 800) { - s3Graph.r.x50 |= 0x40; - s3Graph.r.x42 = 0xb; - } else if (dInfo.gxdim < 1024) { - s3Graph.r.x50 |= 0x80; - s3Graph.r.x42 = 2; - } else { - s3Graph.r.x42 = 0xE; - } - VgaGraphMode(); -#endif - S3SetRegisters(&s3Graph); -} - -static - void S3Init() -{ - int i, n; - - PortOutw(0xa539, vgaCrtAddr); /* unlock system control regs */ -/* PortOutw(0x483b, vgaCrtAddr); /* unlock system control regs */ - for (i = 0; i < 5; i ++) { - PortOutb(0x30 + i, vgaCrtAddr); - s3Text.x.r3[i] = PortInb(vgaCrtData); - PortOutb(0x38 + i, vgaCrtAddr); - s3Text.x.r3[i+5] = PortInb(vgaCrtData); - } - for (i = 0; i < 16; i ++) { - PortOutb(0x40 + i, vgaCrtAddr); - s3Text.x.rx[i] = PortInb(vgaCrtData); - } - for (n = 16, i = 0; i < 16; i ++) { - if ((1 << i) & R5x_MASK) { - PortOutb(0x50 + i, vgaCrtAddr); - s3Text.x.rx[n] = PortInb(vgaCrtData); - n ++; - } - } - for (i = 0; i < 6; i ++, n ++) { - PortOutb(0x60 + i, vgaCrtAddr); - s3Text.x.rx[n] = PortInb(vgaCrtData); - } - s3Graph = s3Text; - s3Graph.r.x39 = 0xA5; - VgaInit(); -} - -static struct videoInfo S3Info = -{ - TRUE, - S3Init, - S3TextMode, - S3GraphMode, - VgaWput, - VgaSput, - VgaSetCursorAddress, - VgaSetAddress, - VgaCursor, - VgaClearAll, - VgaScreenSaver, - VgaDetach, - S3SetStartAddress, - VgaHardScrollUp, - VgaHardScrollDown - }; - -int S3SetVideoType(struct videoInfo *info, const char *regs) -{ - union videoTimings video; - - *info = S3Info; - VgaReadNewRegs(regs, &video); - S3CalcNewRegs(&video); - if (VgaAttach() < 0) return FAILURE; - VgaDefaultCaps(); - return SUCCESS; -} - -#endif -#endif diff --git a/loader/kon2/src/display/svga.c b/loader/kon2/src/display/svga.c deleted file mode 100644 index f1385548e..000000000 --- a/loader/kon2/src/display/svga.c +++ /dev/null @@ -1,111 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* - This code is based on vgalib. - - Thanks to frandsen@diku.dk (Tommy Frandsen). - */ - -#include <config.h> -#include <types.h> - -#ifdef HAS_VGA - -#include <stdio.h> -#include <fcntl.h> -#include <termios.h> -#include <string.h> -#include <unistd.h> -#include <sys/mman.h> -#if defined(linux) -/* #include <linux/mm.h> */ -#include <sys/kd.h> -#endif -#undef free -#include <stdlib.h> - -#include <mem.h> -#include <getcap.h> -#include <defs.h> -#include <errors.h> -#include <vc.h> -#include <vt.h> -#include <vga.h> -#include <fnld.h> - -#ifdef MINI_KON -#define vgaCrtAddr 0x3D4 -#define vgaCrtData 0x3D5 -#define vgaSt1Addr 0x3DA -#endif - -static - void SvgaSetStartAddress(void) -{ - int til; - - til = (dInfo.gydim - 1 - (gramHead / dInfo.glineByte)) << 4; - - PortOutw((gramHead & 0xff00) | 0x0c, vgaCrtAddr); - PortOutw((gramHead << 8) | 0x0d, vgaCrtAddr); - PortOutw((til << 4) | 0x18, vgaCrtAddr); - PortOutw((til & 0x1000) | LineComp8, vgaCrtAddr); - PortOutw(((til & 0x2000) << 1) | LineComp9, vgaCrtAddr); -} - -struct videoInfo SvgaInfo = -{ - TRUE, - VgaInit, - VgaTextMode, - VgaGraphMode, - VgaWput, - VgaSput, - VgaSetCursorAddress, - VgaSetAddress, - VgaCursor, - VgaClearAll, - VgaScreenSaver, - VgaDetach, - SvgaSetStartAddress, - VgaHardScrollUp, - VgaHardScrollDown - }; - -int SvgaSetVideoType(struct videoInfo *info, const char *regs) -{ - union videoTimings video; - - *info = SvgaInfo; - VgaReadNewRegs(regs, &video); - if (VgaAttach() < 0) return FAILURE; - VgaDefaultCaps(); - return SUCCESS; -} - -#endif diff --git a/loader/kon2/src/display/vga.c b/loader/kon2/src/display/vga.c deleted file mode 100644 index 78940b29b..000000000 --- a/loader/kon2/src/display/vga.c +++ /dev/null @@ -1,788 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* - This code is based on vgalib. - - Thanks to frandsen@diku.dk (Tommy Frandsen). - */ - -#include <config.h> -#include <types.h> - -#ifdef HAS_VGA - -#include <stdio.h> -#include <fcntl.h> -#include <termios.h> -#include <string.h> -#include <unistd.h> -#include <sys/mman.h> -#if defined(linux) -/* #include <linux/mm.h> */ -#include <sys/kd.h> -#elif defined(__FreeBSD__) -#include <vm/vm_param.h> -#include <sys/ioctl.h> -#include <machine/console.h> -vm_size_t page_size; -#endif -#undef free -#include <stdlib.h> - -#include <mem.h> -#include <getcap.h> -#include <defs.h> -#include <errors.h> -#include <vc.h> -#include <vt.h> -#include <vga.h> -#include <fnld.h> - -static struct pelRegs grapPels, textPels; - -struct vgaRegs - regText, - regGraph = { - { /* CRT */ - 0x5F,0x4F,0x50,0x82,0x54,0x80,0x0B,0x3E, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xEA,0x0C,0xDF,0x28,0x00,0xE7,0x04,0xE3, - 0xFF - }, { /* ATT */ - 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, - 0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, - 0x01,0x00,0x0F,0x00,0x00 - }, { /* GRA */ - 0x00,0x0F,0x00,0x20,0x03,0x00,0x05,0x00, - 0xFF - }, { /*SEQ */ - 0x03,0x01,0x0F,0x00,0x06 - }, /* MIS */ - 0xE3 - }; - -int LineComp9, LineComp8, gramHead; -#ifdef MINI_KON -#define vgaCrtAddr 0x3D4 -#define vgaCrtData 0x3D5 -#define vgaSt1Addr 0x3DA -#else -u_int vgaCrtAddr = 0x3D4; -u_int vgaCrtData = 0x3D5; -u_int vgaSt1Addr = 0x3DA; -#endif - -static char *gramMem; /* dummy buffer for mmapping grahics memory */ -static char *fontBuff1; /* saved font data - plane 2 */ - -static bool savePlane3; -static char *fontBuff2; /* saved font data - plane 3 */ - -static u_int writeAddr; /* address to write next character */ - -static bool kanjiCursor; -static u_char cursorTop, cursorBtm; - -#ifndef MINI_KON -static u_short fmPattern; /* bit pattern to modify font; skip line if bit clear */ -#endif - -void VgaSetRegisters(struct vgaRegs *regs) -{ - int i; - - /* disable video */ - PortInb(vgaSt1Addr); - PortOutb(0x00, VGAATTR_A_O); - - /* update misc output register */ - PortOutb((regs->mis&~0x1)|(PortInb(VGAMISC_IN)&0x01), VGAMISC_OUT); - - /* synchronous reset on */ - PortOutb(0x00,VGASEQ_ADDR); - PortOutb(0x01,VGASEQ_DATA); - - /* write sequencer registers */ - for (i = 1; i < VGASEQ_CNT; i++) { - PortOutb(i, VGASEQ_ADDR); - PortOutb(regs->seq[i], VGASEQ_DATA); - } - - /* synchronous reset off */ - PortOutb(0x00, VGASEQ_ADDR); - PortOutb(0x03, VGASEQ_DATA); - - /* deprotect CRT registers 0-7 */ - PortOutb(0x11, vgaCrtAddr); - PortOutb(PortInb(vgaCrtData)&0x7F, vgaCrtData); - - /* write CRT registers */ - for (i = 0; i < VGACRT_CNT; i++) { - PortOutb(i, vgaCrtAddr); - PortOutb(regs->crt[i], vgaCrtData); - } - - /* write graphics controller registers */ - for (i = 0; i < VGAGRP_CNT; i++) { - PortOutb(i, VGAGRP_ADDR); - PortOutb(regs->gra[i], VGAGRP_DATA); - } - - /* write attribute controller registers */ - for (i = 0; i < VGAATTR_CNT; i++) { - /* reset flip-flop */ - PortInb(vgaSt1Addr); - PortOutb(i, VGAATTR_A_O); - PortOutb(regs->att[i],VGAATTR_A_O); - } -} - -static -void VgaSetPELS(struct pelRegs *pels) -{ - int i; - - for(i = 0; i < MAX_PELS; i++) { - PortOutb(i, VGAPAL_OADR); - PortOutb(pels->red[i], VGAPAL_DATA); - PortOutb(pels->grn[i], VGAPAL_DATA); - PortOutb(pels->blu[i], VGAPAL_DATA); - } -} - -static -void VgaGetPELS(struct pelRegs *pels) -{ - int i; - - PortOutb(0, VGAPAL_IADR); - for(i = 0; i < MAX_PELS; i++) { - pels->red[i] = PortInb(VGAPAL_DATA); - pels->grn[i] = PortInb(VGAPAL_DATA); - pels->blu[i] = PortInb(VGAPAL_DATA); - } -} - -static inline -void VgaSetColor(u_char col) -{ - static old; - - if (old == col) return; - PortOutw(col << 8, VGAGRP_ADDR); - old = col; -} - -void VgaInit(void) -{ - int i; - - VgaGetPELS(&textPels); - - /* disable video */ - PortInb(vgaSt1Addr); - PortOutb(0x00, VGAATTR_A_O); - /* save text mode VGA registers */ - for (i = 0; i < VGACRT_CNT; i++) { - PortOutb(i, vgaCrtAddr); - regText.crt[i] = PortInb(vgaCrtData); - } - for (i = 0; i < VGAATTR_CNT; i++) { - PortInb(vgaSt1Addr); - PortOutb(i, VGAATTR_A_O); - regText.att[i] = PortInb(VGAATTR_DATA); - } - for (i = 0; i < VGAGRP_CNT; i++) { - PortOutb(i, VGAGRP_ADDR); - regText.gra[i] = PortInb(VGAGRP_DATA); - } - for (i = 0; i < VGASEQ_CNT; i++) { - PortOutb(i, VGASEQ_ADDR); - regText.seq[i] = PortInb(VGASEQ_DATA); - } - regText.mis = PortInb(VGAMISC_IN); - - PortOutb(PortInb(VGAMISC_IN)|0x01, VGAMISC_OUT); - VgaSetRegisters(®Graph); - - /* save font data in plane 2 */ - PortOutw(0x0204, VGAGRP_ADDR); - memcpy(fontBuff1, gramMem, FONT_SIZE); -#ifdef USE_ROMFONT - VgaLoadRomFont(fontBuff1); -#endif -#if defined(MINI_KON) || defined(USE_STATICFONT) - VgaLoadStaticFont(); -#endif - - if (savePlane3 && fontBuff2) { - /* save font data in plane 3 */ - PortOutw(0x0304, VGAGRP_ADDR); - memcpy(fontBuff2, gramMem, FONT_SIZE); - } -} - -void VgaTextMode(void) -{ - /* disable video */ - PortInb(vgaSt1Addr); - PortOutb(0x00, VGAATTR_A_O); - - /* restore font data - first select a 16 color graphics mode */ - VgaSetRegisters(®Graph); - - /* disable Set/Reset Register */ - PortOutb(0x01, VGAGRP_ADDR ); - PortOutb(0x00, VGAGRP_DATA ); - - /* restore font data in plane 2 - necessary for all VGA's */ - PortOutb(0x02, VGASEQ_ADDR ); - PortOutb(0x04, VGASEQ_DATA ); - memcpy(gramMem, fontBuff1, FONT_SIZE); - - if (savePlane3) { - /* restore font data in plane 3 - necessary for Trident VGA's */ - PortOutb(0x02, VGASEQ_ADDR ); - PortOutb(0x08, VGASEQ_DATA ); - memcpy(gramMem, fontBuff2, FONT_SIZE); - } - - /* restore text mode VGA registers */ - VgaSetRegisters(®Text); - - /* set text palette */ - - VgaSetPELS(&textPels); - - /* enable video */ - PortInb(vgaSt1Addr); - PortOutb(0x20, VGAATTR_A_O); -} - -void VgaGraphMode(void) -{ - /* disable video */ - PortInb(vgaSt1Addr); - PortOutb(0x00, VGAATTR_A_O); - - VgaSetRegisters(®Graph); - - /* set default palette */ - - VgaSetPELS(&grapPels); - - /* enable video */ - PortInb(vgaSt1Addr); - PortOutb(0x20, VGAATTR_A_O); -} - -#ifdef MINI_KON -void VgaChangeClock() -{ - static int clock=-1; - - if (clock < 0) clock = (regGraph.mis >> 2) & 3; - clock = (clock + 1) & 3; - regGraph.mis &= ~(3 << 2); - regGraph.mis |= clock << 2; -printf("%d\r\n", clock); - VgaGraphMode(); -} -#endif - -void VgaWput(u_char *code, u_char fc, u_char bc) -{ - volatile char *gram, *vcls; - u_char *til; - u_char x; - - VgaSetColor(bc&7); - vcls = gram = gramMem + writeAddr; - for (x = 0;x < dInfo.glineChar;x ++, vcls += dInfo.glineByte) - *vcls = *(vcls + 1) = 0; - VgaSetColor(fc); - if (bc & 0x8) { - vcls -= dInfo.glineByte; - *vcls = *(vcls + 1) = 0; - } - til = code + (dbFReg->high << 1); - for (;code < til; code ++, gram += dInfo.glineByte) { - if (*code) { - VgaOutByte(*code); - *gram = *gram; - } - code ++; - if (*code) { - VgaOutByte(*code); - *(gram + 1) = *(gram + 1); - } - } - VgaOutByte(0xFF); -} - -void VgaSput(u_char *code, u_char fc, u_char bc) -{ - volatile char *gram, *vcls; - u_char *til; - u_char x; - - vcls = gram = gramMem + writeAddr; - VgaSetColor(bc&7); - for (x = 0;x < dInfo.glineChar;x ++, vcls += dInfo.glineByte) - *vcls = 0; - if (!code) return; - VgaSetColor(fc); - if (bc & 0x8) *(vcls - dInfo.glineByte) = 0; - til = code + sbFReg->high; - for (;code < til;code ++, gram += dInfo.glineByte) { - if (*code) { - VgaOutByte(*code); - *gram = *gram; - } - } - VgaOutByte(0xFF); -} - -#ifndef MINI_KON - -void VgaWputFm(u_char *code, u_char fc, u_char bc) -{ - volatile char *gram, *vcls; - u_char x; - u_short fm = (1 << (dbFReg->high - 1)); - - VgaSetColor(bc&7); - vcls = gram = gramMem + writeAddr; - for (x = 0;x < dInfo.glineChar;x ++, vcls += dInfo.glineByte) - *vcls = *(vcls + 1) = 0; - VgaSetColor(fc); - if (bc & 0x8) { - vcls -= dInfo.glineByte; - *vcls = *(vcls + 1) = 0; - } - for (x = 0;x < dbFReg->high;x ++, code ++, fm >>= 1) { - if (*code) { - VgaOutByte(*code); - *gram = *gram; - } - code ++; - if (*code) { - VgaOutByte(*code); - *(gram + 1) = *(gram + 1); - } - if (fm & fmPattern) - gram += dInfo.glineByte; - } - VgaOutByte(0xFF); -} - -void VgaSputFm(u_char *code, u_char fc, u_char bc) -{ - volatile char *gram, *vcls; - u_char x; - u_short fm = (1 << (sbFReg->high - 1)); - - vcls = gram = gramMem + writeAddr; - VgaSetColor(bc&7); - for (x = 0;x < dInfo.glineChar;x ++, vcls += dInfo.glineByte) - *vcls = 0; -/* if (!code) return;*/ - VgaSetColor(fc); - if (bc & 0x8) *(vcls - dInfo.glineByte) = 0; - if (code) for (x = 0;x < sbFReg->high;x ++, code ++, fm >>= 1) { - if (*code) { - VgaOutByte(*code); - *gram = *gram; - } - if (fm & fmPattern) - gram += dInfo.glineByte; - } - VgaOutByte(0xFF); -} -#endif - -void VgaHardScrollUp(int line) -{ - int oldhead; - - VgaSetColor((con.attr & ATTR_REVERSE ? con.fcol:con.bcol)&7); - - if (line > dInfo.tymax) { - line %= dInfo.tymax + 1; - bzero(gramMem, dInfo.gsize); - } - - oldhead = gramHead; - gramHead += line * dInfo.tlineByte; - if (gramHead >= dInfo.gsize) { - gramHead -= dInfo.gsize; - bzero(gramMem + oldhead, dInfo.gsize - oldhead); -/* if (gramHead) bzero(gramMem, gramHead);*/ - bzero(gramMem, gramHead); - } else bzero(gramMem + oldhead, gramHead - oldhead); - vInfo.set_start_address(); -} - -void VgaHardScrollDown(int line) -{ - int oldhead; - - VgaSetColor((con.attr & ATTR_REVERSE ? con.fcol:con.bcol)&7); - - if (line > dInfo.tymax) { - line %= dInfo.tymax + 1; - bzero(gramMem, dInfo.gsize); - } - - oldhead = gramHead; - gramHead -= line * dInfo.tlineByte; - if (gramHead < 0) { - gramHead += dInfo.gsize; -/* if (oldhead) bzero(gramMem, oldhead);*/ - bzero(gramMem, oldhead); - bzero(gramMem + gramHead, dInfo.gsize - gramHead); - } else bzero(gramMem + gramHead, oldhead - gramHead); - vInfo.set_start_address(); -} - -void VgaSetCursorAddress(struct cursorInfo *ci, u_int x, u_int y) -{ -#if 0 - if (x > dInfo.txmax) { - y ++; - x -= dInfo.txmax + 1; - } -#endif - ci->addr = (y * dInfo.tlineByte + cursorTop - * dInfo.glineByte + x + gramHead) % dInfo.gsize; -} - -void VgaSetAddress(u_int p) -{ - writeAddr = (p%dInfo.glineByte) + (p/dInfo.glineByte) * dInfo.tlineByte; -} - -void VgaCursor(struct cursorInfo *ci) -{ - volatile char *gram; - u_char x; - int bottom = cursorBtm + 1 <= dInfo.glineChar ? - cursorBtm + 1 : dInfo.glineChar; - - VgaSetColor(15); - gram = gramMem + ci->addr; - - PortOutw(0x0F00, VGAGRP_ADDR); /* color white */ - PortOutw(0x1803, VGAGRP_ADDR); /* XOR mode */ - x = cursorTop; - if (kanjiCursor && ci->kanji) { - for (;x < bottom;x ++, gram += dInfo.glineByte) { - *gram = *gram; - *(gram + 1)= *(gram + 1); - } - } else - for (;x < bottom;x ++, gram += dInfo.glineByte) - *gram = *gram; - PortOutw(0x0003, VGAGRP_ADDR); /* unmodify mode */ -} - -void VgaClearAll(void) -{ - VgaSetColor((con.attr & ATTR_REVERSE ? con.fcol:con.bcol)&7); - bzero(gramMem, dInfo.gsize); -} - -void VgaScreenSaver(bool blank) -{ - if (blank) { - PortOutb(0x01, VGASEQ_ADDR); - PortOutb(PortInb(VGASEQ_DATA) | 0x20, VGASEQ_DATA); - } else { - PortOutb(0x01, VGASEQ_ADDR); - PortOutb(PortInb(VGASEQ_DATA) & 0xDF, VGASEQ_DATA); - } -} - -int VgaReadPels(const char *str) -{ - int i, red, grn, blu; - - for (i = 0; i < MAX_PELS; i ++) { - sscanf(str, "%d %d %d", &red, &grn, &blu); - if ((str = strchr(str, '\n')) == NULL) { - error("PELS entry too short\r\n"); - return FAILURE; - } - str++; /* skip '\n' */ - grapPels.red[i] = red; - grapPels.grn[i] = grn; - grapPels.blu[i] = blu; - } - return SUCCESS; -} - -int VgaReadNewRegs(const char *str, union videoTimings *video) -{ - int i, clock, txmax, tymax; - char *line2; - - for (i = 0; i < NUM_VIDEOH_INFO+NUM_VIDEOV_INFO; i ++) { - if (! *str) { - error("%d values required for vga registers, " - "but only supplied %d\r\n", VGACRT_CNT, i); - return FAILURE; - } - video->v[i] = strtoul(str, (char **) &str, 10); - } - line2 = strpbrk(str, "\r\n"); - *line2 = '\0';line2 ++; - if (*str) video->m.i = atoi(str); - if (sscanf(line2, "%x \n %d %d", &clock, &txmax, &tymax) == EOF) { - error("missing arg for vga driver\r\n"); - return FAILURE; - } - dInfo.gxdim = video->m.hDot; - dInfo.gydim = video->m.vLine; - dInfo.txmax = txmax; - dInfo.tymax = tymax; - dInfo.glineChar = dInfo.gydim / (dInfo.tymax + 1); - dInfo.glineByte = dInfo.gxdim >> 3; - dInfo.gydim = dInfo.glineChar * (dInfo.tymax + 1); - dInfo.gsize = dInfo.glineByte * dInfo.gydim; -/*printf("%ld\r\n", dInfo.gsize);*/ - dInfo.tlineByte = dInfo.glineChar * dInfo.glineByte; - - if (video->m.vLine < 480) { - regGraph.crt[23] = 0xE3; - regGraph.mis = 0xE3; - } else { - if (video->m.vLine < 768) regGraph.mis = 0xE3; - else regGraph.mis = 0x23; - regGraph.crt[23] = 0xC3; - } - regGraph.mis |= (clock & 3) << 2; - regGraph.crt[0] = (video->m.hTotal>>3) - 5; - regGraph.crt[1] = (video->m.hDot>>3) - 1; - regGraph.crt[2] = (video->m.hStart>>3) - 1; - regGraph.crt[3] = ((video->m.hEnd>>3) & 0x1F) | 0x80; - regGraph.crt[4] = video->m.hStart>>3; - regGraph.crt[5] = (((video->m.hEnd>>3) & 0x20) << 2) - | ((video->m.hEnd>>3) & 0x1F); - regGraph.crt[6] = (video->m.vTotal - 2) & 0xFF; - regGraph.crt[7] = 0x10; - regGraph.crt[7] |= (((dInfo.gydim - 1) & 0x100) >> 7) - | (((dInfo.gydim - 1) & 0x200) >> 3); - regGraph.crt[7] |= ((video->m.vStart & 0x100) >> 6) - | ((video->m.vStart & 0x100) >> 5); - regGraph.crt[7] |= (((video->m.vTotal - 2) & 0x100) >> 8) - | (((video->m.vTotal - 2) & 0x200) >> 4); - regGraph.crt[7] |= ((video->m.vStart & 0x200) >> 2); - regGraph.crt[9] = ((video->m.vStart & 0x200) >>4) | 0x40; - regGraph.crt[16] = video->m.vStart & 0xFF; - regGraph.crt[17] = (video->m.vEnd & 0x0F) | 0x20; - regGraph.crt[18] = (dInfo.gydim - 1) & 0xFF; - regGraph.crt[19] = video->m.hDot >> 4; - regGraph.crt[21] = video->m.vStart & 0xFF; - regGraph.crt[22] = (video->m.vStart + 1) & 0xFF; - - LineComp8 = ((regGraph.crt[7] & 0xEF) << 8) + 0x07; - LineComp9 = ((regGraph.crt[9] & 0xBF) << 8) + 0x09; - - return SUCCESS; -} - -/* VGA initialize & uninitialize */ - -int VgaAttach(void) -{ - int devMem; - -#if defined(linux) - ioperm(VGAMISC_IN, 1, 1); -#ifndef MINI_KON - if (!(PortInb(VGAMISC_IN)&0x01)) { /* monochrome VGA */ - vgaCrtAddr = 0x3B4; - vgaCrtData = 0x3B5; - vgaSt1Addr = 0x3BA; - } -#endif - - /* get I/O permissions for VGA registers */ - ioperm(vgaCrtAddr, 1, 1); - ioperm(VGAATTR_A_O, 1, 1); - ioperm(VGAGRP_ADDR, 1, 1); - ioperm(VGASEQ_ADDR, 1, 1); - ioperm(VGAPAL_OADR, 1, 1); - ioperm(VGAPAL_IADR, 1, 1); - ioperm(vgaCrtData, 1, 1); - ioperm(VGAATTR_DATA, 1, 1); - ioperm(VGAGRP_DATA, 1, 1); - ioperm(VGASEQ_DATA, 1, 1); - ioperm(VGAMISC_IN, 1, 1); - ioperm(VGAMISC_OUT, 1, 1); - ioperm(vgaSt1Addr, 1, 1); - ioperm(VGAPAL_DATA, 1, 1); - - if ((devMem = open("/dev/mem", O_RDWR) ) < 0) { - Perror("/dev/mem"); - return FAILURE; - } -#elif defined(__FreeBSD__) - if (ioctl(0, KDENABIO,0) < 0) { - Perror("ioctl CONSOLE_IO_ENABLE"); - return FAILURE; - } - if (ioctl(0, KDSETMODE,KD_GRAPHICS) < 0) { - Perror("ioctl CONSOLE_IO_ENABLE"); - return FAILURE; - } - if ((devMem = open("/dev/vga", O_RDWR|O_NDELAY) ) < 0) { - Perror("/dev/mem"); - return FAILURE; - } -#endif - if ((fontBuff1 = malloc(FONT_SIZE)) == NULL - || (savePlane3 && (fontBuff2 = malloc(FONT_SIZE)) == NULL) - ) { - Perror("malloc "); - return FAILURE; - } - gramMem = (unsigned char *)mmap( -#if defined(linux) - (__ptr_t)0, -#else - 0, -#endif - dInfo.gsize, - PROT_READ|PROT_WRITE, -#if 0 - MAP_SHARED|MAP_FIXED, -#else -#if defined(linux) - MAP_SHARED, -#elif defined(__FreeBSD__) - MAP_FILE|MAP_SHARED, -#endif -#endif - devMem, - GRAPH_BASE - ); - close(devMem); - if ((long)gramMem < 0) { - Perror("mmap"); - return FAILURE; - } - - return SUCCESS; -} - -void VgaDetach(void) -{ - gramHead = 0; -#if defined(linux) - ioperm(vgaCrtAddr, 1, 0); - ioperm(VGAATTR_A_O, 1, 0); - ioperm(VGAGRP_ADDR, 1, 0); - ioperm(VGASEQ_ADDR, 1, 0); - ioperm(VGAPAL_OADR, 1, 0); - ioperm(VGAPAL_IADR, 1, 0); - ioperm(vgaCrtData, 1, 0); - ioperm(VGAATTR_DATA, 1, 0); - ioperm(VGAGRP_DATA, 1, 0); - ioperm(VGASEQ_DATA, 1, 0); - ioperm(VGAMISC_IN, 1, 0); - ioperm(VGAMISC_OUT, 1, 0); - ioperm(vgaSt1Addr, 1, 0); - ioperm(VGAPAL_DATA, 1, 0); -#endif - - munmap(gramMem, dInfo.gsize); - - SafeFree((void **)&gramMem); - SafeFree((void **)&fontBuff1); - if (savePlane3 && fontBuff2) - SafeFree((void **)&fontBuff2); -} - -/* Configure */ - -static - int ConfigPlane3(const char *confstr) -{ - savePlane3 = BoolConf(confstr); - return SUCCESS; -} - -static - int ConfigKanjiCursor(const char *confstr) -{ - kanjiCursor = BoolConf(confstr); - return SUCCESS; -} - -static - int ConfigCursorTop(const char *confstr) -{ - cursorTop = atoi(confstr); - return SUCCESS; -} - -static - int ConfigCursorBottom(const char *confstr) -{ - cursorBtm = atoi(confstr); - return SUCCESS; -} - -void VgaDefaultCaps() -{ - DefineCap("Pels", VgaReadPels, NULL); - DefineCap("SavePlane3", ConfigPlane3, "Off"); - DefineCap("KanjiCursor", ConfigKanjiCursor, "On"); - DefineCap("CursorTop", ConfigCursorTop, "14"); - DefineCap("CursorBottom", ConfigCursorBottom, "15"); -} - -#ifndef MINI_KON - -int VgaFmSetVideoType(struct videoInfo *info, const char *regs) -{ - union videoTimings video; - - *info = SvgaInfo; - info->sput = VgaSputFm; - info->wput = VgaWputFm; - fmPattern = (u_short) strtoul(regs, (char **) ®s, 16); - if (VgaReadNewRegs(regs, &video) == FAILURE) return FAILURE; - if (VgaAttach() < 0) return FAILURE; - VgaDefaultCaps(); - return SUCCESS; -} -#endif - -#endif diff --git a/loader/kon2/src/errors.c b/loader/kon2/src/errors.c deleted file mode 100644 index 5b73a1e69..000000000 --- a/loader/kon2/src/errors.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1993 by MAEDA Atusi (mad@math.keio.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY MAEDA ATUSI ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ -#include <config.h> -#include <types.h> - -#include <stdio.h> -#include <errno.h> -#include <stdarg.h> -#include <stdlib.h> -#include <string.h> -#include <sys/types.h> - -#include <defs.h> -#include <errors.h> -#include <vc.h> -#include <vt.h> - -#define MAX_MSGLEN 1024 - -static void KonPrintf(const char *head, const char *format, va_list args) -{ -#ifndef MINI_KON - char buf[MAX_MSGLEN]; - - if (con.text_mode) { - fprintf(stderr, "%s", head); - vfprintf(stderr, format, args); - } else { - VtEmu(head, strlen(head)); - vsprintf(buf, format, args); - VtEmu(buf, strlen(buf)); - } -#endif -} - -void fatal(const char *format, ...) -{ -#ifndef MINI_KON - va_list args; - - va_start(args, format); - fprintf(stderr, "KON> fatal error: "); - vfprintf(stderr, format, args); - va_end(args); -#endif - exit(EXIT_FAILURE); -} - -void kon_warn(const char *format, ...) -{ - va_list args; - - va_start(args, format); - KonPrintf("KON> warning: ", format, args); - va_end(args); -} - -void kon_error(const char *format, ...) -{ -#ifndef MINI_KON - va_list args; - - va_start(args, format); - KonPrintf("KON> error: ", format, args); - va_end(args); -#endif -} - -void message(const char *format, ...) -{ -#ifndef MINI_KON - va_list args; - - va_start(args, format); - KonPrintf("KON> ", format, args); - va_end(args); -#endif -} - -void Perror(const char *msg) -{ -#ifndef MINI_KON - message("system error - %s: %s\r\n", msg, strerror(errno)); -#endif -} - -void PerrorExit(const char *message) -{ -#ifndef MINI_KON - fprintf(stderr, "%s: %s\r\n", message, strerror(errno)); -#endif - exit(EXIT_FAILURE); -} diff --git a/loader/kon2/src/fnld.c b/loader/kon2/src/fnld.c deleted file mode 100644 index c747d49d2..000000000 --- a/loader/kon2/src/fnld.c +++ /dev/null @@ -1,300 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include <config.h> -#include <types.h> - -#include <stdio.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/file.h> -#include <string.h> -#include <unistd.h> -#include <sys/ipc.h> -#include <sys/shm.h> - -#include <interface.h> -#include <vt.h> -#include <fnld.h> - -struct fontRegs *dbFReg, *sbFReg; - -#ifdef MINI_KON - -/*#define USE_GZFONT 1*/ - -#ifdef USE_GZFONT -#define PATH_MINIFONT "/usr/lib/minikon.fnt.gz" -#define CMD_MINIFONT "/bin/gzip -dc "PATH_MINIFONT -#else -#define PATH_MINIFONT "/etc/minikon.fnt" -#endif - -void -LoadMiniFont() -{ - int addr, bytes; - u_char type, high; - u_short max; - FILE *fp; - struct fontRegs *freg; - struct { - u_short code; - u_char bitmap[32]; - } fent; - char dummy[]={ - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, - 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, - 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, - }; - - type = CodingByRegistry("JISX0208.1983-0"); - freg = &fDRegs[type & ~CHR_DFLD]; -#ifdef USE_GZFONT - if ((fp = popen(CMD_MINIFONT, "r")) == NULL) { -#else - if ((fp = fopen(PATH_MINIFONT, "r")) == NULL) { -#endif - perror(PATH_MINIFONT); - return; - } - fread(&high, sizeof(high), 1, fp); - fread(&max, sizeof(max), 1, fp); - max ++; - freg->size = freg->addr(max>>8, max & 0xFF); - freg->high = high; - freg->stat = FR_ATTACH; - freg->bitmap = malloc(freg->size); - for (addr = 0; addr < freg->size; addr += 32) { - memcpy(freg->bitmap + addr, dummy, 32); - } - bytes = high * 2; - - while (fread(&fent, sizeof(fent.code) + bytes, 1, fp) > 0) { - addr = freg->addr(fent.code >> 8, fent.code & 0xFF); - memcpy(freg->bitmap + addr, fent.bitmap, bytes); - } - -#ifdef USE_GZFONT - pclose(fp); -#else - fclose(fp); -#endif -} - -#ifdef USE_ROMFONT - -void -VgaLoadRomFont(char *fontbuff) -{ - static int loaded=0; - int i; - - if (loaded) return; - i = 1; - sbFReg = &fSRegs[0]; - sbFReg->size = 256 * 16; - sbFReg->high = 16; - sbFReg->stat = FR_ATTACH; - sbFReg->bitmap = calloc(sbFReg->size, 1); - while (fSRegs[i].registry) { - fSRegs[i].high = sbFReg->high; - fSRegs[i].stat = FR_PROXY; - fSRegs[i].size = sbFReg->size; - fSRegs[i].bitmap = sbFReg->bitmap; - i ++; - } - - for (i = 0; i < sbFReg->size; i += sbFReg->high) { - memcpy(&(sbFReg->bitmap[i]), &(fontbuff[i*2]), sbFReg->high); - } - loaded = 1; -} - -#else /* USE_ROMFONT */ - -#include "vgafont.h" - -void -VgaLoadStaticFont() -{ - static int loaded=0; - int i; - - if (loaded) return; - i = 1; - sbFReg = &fSRegs[0]; - sbFReg->size = 256 * 16; - sbFReg->high = 16; - sbFReg->stat = FR_ATTACH; - sbFReg->bitmap = vgaFont; - while (fSRegs[i].registry) { - fSRegs[i].high = sbFReg->high; - fSRegs[i].stat = FR_PROXY; - fSRegs[i].size = sbFReg->size; - fSRegs[i].bitmap = sbFReg->bitmap; - i ++; - } - loaded = 1; -} -#endif /* USE_ROMFONT */ - -#else - -#ifdef USE_ROMFONT - -void -VgaLoadRomFont(char *fontbuff) -{ - static int loaded=0; - key_t shmkey; - int shmid, i; - u_char *shmbuff, *buff; - struct fontInfo fi; - - if (loaded) return; - shmkey = ftok(CONFIG_NAME, CHR_SFLD); - fi.size = 256 * 16; - fi.high = 16; - fi.width = 8; - fi.type = CHR_SFLD; - shmid = shmget(shmkey, fi.size+sizeof(struct fontInfo), - IPC_CREAT|0666); - shmbuff = shmat(shmid, 0, 0); - memcpy(shmbuff, &fi, sizeof(struct fontInfo)); - buff = shmbuff + sizeof(struct fontInfo); - - for (i = 0; i < fi.size; i += fi.high) { - memcpy(&(buff[i]), &(fontbuff[i*2]), fi.high); - } - shmdt(shmbuff); - loaded = 1; -} - -#endif - -#ifdef USE_STATICFONT - -#include "vgafont.h" - -void -VgaLoadStaticFont() -{ - static int loaded=0; - key_t shmkey; - int shmid, i; - u_char *shmbuff, *buff; - struct fontInfo fi; - - if (loaded) return; - shmkey = ftok(CONFIG_NAME, CHR_SFLD); - fi.size = 256 * 16; - fi.high = 16; - fi.width = 8; - fi.type = CHR_SFLD; - shmid = shmget(shmkey, fi.size+sizeof(struct fontInfo), - IPC_CREAT|0666); - shmbuff = shmat(shmid, 0, 0); - memcpy(shmbuff, &fi, sizeof(struct fontInfo)); - buff = shmbuff + sizeof(struct fontInfo); - - memcpy(buff, vgaFont, fi.size); - shmdt(shmbuff); - loaded = 1; -} -#endif /* MINI_KON || USE_STATICFONT */ - -void FontDetach(bool down) -{ - int i; - - i = 0; - while (fSRegs[i].registry) { - if (fSRegs[i].stat & FR_ATTACH) - shmdt(fSRegs[i].bitmap - sizeof(struct fontInfo)); - if (down) DownShmem(i|CHR_SFLD); - fSRegs[i].width = fSRegs[i].high = - fSRegs[i].size = fSRegs[i].stat = 0; - i ++; - } - i = 0; - while (fDRegs[i].registry) { - if (fDRegs[i].stat & FR_ATTACH) - shmdt(fDRegs[i].bitmap - sizeof(struct fontInfo)); - if (down) DownShmem(i|CHR_DFLD); - fDRegs[i].width = fDRegs[i].high = - fDRegs[i].size = fDRegs[i].stat = 0; - i ++; - } -} - -void FontAttach() -{ - int i; - u_char *font; - struct fontInfo *fi; - - i = 0; - while (fSRegs[i].registry) { - if ((font = GetShmem(i|CHR_SFLD)) != NULL) { - fi = (struct fontInfo*)font; - fSRegs[i].high = fi->high; - fSRegs[i].stat = FR_ATTACH; - fSRegs[i].size = fi->size; - fSRegs[i].bitmap = font + sizeof(struct fontInfo); - sbFReg = &fSRegs[i]; - } else fSRegs[i].stat = 0; - i ++; - } - if (fSRegs[lInfo.sb].stat) sbFReg = &fSRegs[lInfo.sb]; -#if 1 - i = 0; - while (fSRegs[i].registry) { - if (!fSRegs[i].stat) { - fSRegs[i].high = sbFReg->high; - fSRegs[i].size = sbFReg->size; - fSRegs[i].bitmap = sbFReg->bitmap; - fSRegs[i].stat = FR_PROXY; - } - i ++; - } -#endif - i = 0; - while (fDRegs[i].registry) { - if ((font = GetShmem(i|CHR_DFLD)) != NULL) { - fi = (struct fontInfo*)font; - fDRegs[i].high = fi->high; - fDRegs[i].stat = FR_ATTACH; - fDRegs[i].size = fi->size; - fDRegs[i].bitmap = font + sizeof(struct fontInfo); - } - i ++; - } - dbFReg = &fDRegs[lInfo.db]; -} -#endif diff --git a/loader/kon2/src/main.c b/loader/kon2/src/main.c deleted file mode 100644 index 439da2c25..000000000 --- a/loader/kon2/src/main.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include <config.h> - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> - -#include <getcap.h> - -#include <version.h> -#include <term.h> - -void -kon_main(int argc, const char *argv[]) -{ - extern void ChangeNewConsole(); - -#if 0 /* disable version number by request */ -#ifdef MINI_KON - fprintf(stderr, "Kanji ON Console MINI " VERSION "\n\n"); -#else - fprintf(stderr, "Kanji ON Console " VERSION "\n\n"); -#endif -#endif - if (geteuid() != 0) { - fprintf(stderr, "can not get I/O permissions.\n"); - exit(EXIT_FAILURE); - } - ChangeNewConsole(); - TermInit(argc - 1, argv + 1); - if (ReadConfig(CONFIG_NAME) < 0) { - fprintf(stderr, "KON> error reading %s\n", CONFIG_NAME); - exit(EXIT_FAILURE); - } - TermStart(); -} diff --git a/loader/kon2/src/mouse.c b/loader/kon2/src/mouse.c deleted file mode 100644 index d27a0635d..000000000 --- a/loader/kon2/src/mouse.c +++ /dev/null @@ -1,408 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* - This code is based on selection. -*/ - -#include <config.h> - -#ifndef MINI_KON - -#include <unistd.h> -#include <sys/types.h> -#include <defs.h> -#include <mouse.h> - -struct mouseInfo mInfo; - -int mouseFd = -1; - -#ifdef HAS_MOUSE - -#include <stdio.h> -#include <stdlib.h> -#include <termios.h> -#include <fcntl.h> -#include <string.h> -#include <getcap.h> - -#include <errors.h> -#include <vc.h> - -static int cFlag; -static int headMask; -static int headId; -static int dataMask; -static int pkMax; - -typedef enum { - MOUSE_MICROSOFT, - MOUSE_MOUSESYSTEMS, - MOUSE_BUSMOUSE, - MOUSE_MMSERIES, - MOUSE_LOGITECH, - MOUSE_PS2, - MOUSE_NONE -} mtype; - -static mtype mouseType = MOUSE_NONE; - -#define MAX_PK_SIZE 5 - -struct mouseconf { - const char *name; - mtype type; - int cFlag; - int headMask; - int headId; - int dataMask; - int pkMax; -} mice[] = { - { - "Microsoft", MOUSE_MICROSOFT, - (CS7|CREAD|CLOCAL|HUPCL), - 0x40, 0x40, 0x40, 3 - }, - { - "MouseSystems", MOUSE_MOUSESYSTEMS, - (CS8|CSTOPB|CREAD|CLOCAL|HUPCL), - 0xf8, 0x80, 0x00, 5 - }, - { - "BusMouse", MOUSE_BUSMOUSE, - 0, - 0xf8, 0x80, 0x00, 5 - }, - { - "MmSeries", MOUSE_MMSERIES, - (CS8|PARENB|PARODD|CREAD|CLOCAL|HUPCL), - 0xe0, 0x80, 0x80, 3 - }, - { - "Logitech", MOUSE_LOGITECH, - (CS8|CSTOPB|CREAD|CLOCAL|HUPCL), - 0xe0, 0x80, 0x80, 3 - }, - { - "PS2", MOUSE_PS2, - (CS8|CREAD|CLOCAL|HUPCL), - 0xcc, 0x08, 0x00, 3 - }, - { - "None", MOUSE_NONE, - 0, - 0, 0, 0, 0 - }, - { - NULL, MOUSE_NONE, - 0, - 0, 0, 0, 0 - } -}; - -static int mouseBaud; - -static int ConfigMouseBaud(const char *config) -{ - int baud; - - sscanf(config, "%d", &baud); - - switch (baud) { - case 9600: - mouseBaud = B9600; - break; - case 4800: - mouseBaud = B4800; - break; - case 2400: - mouseBaud = B2400; - break; - default: - kon_warn("invalid mouse baud rate %d; set to default (1200)\r\n", baud); - case 1200: - mouseBaud = B1200; - break; - } - return SUCCESS; -} - -static char *mouseDev; - -static int ConfigMouseDev(const char *config) -{ - char name[MAX_COLS]; - sscanf(config, "%s", name); - - if (mouseDev) free(mouseDev); - mouseDev = strdup(name); - return SUCCESS; -} - -static int pasteButton; - -static int Config3Buttons(const char *config) -{ - pasteButton = BoolConf(config) ? MOUSE_MID: MOUSE_RGT; - return SUCCESS; -} - -static int ConfigMouse(const char *config) -{ - struct mouseconf *p; - char name[MAX_COLS]; - - mouseType = MOUSE_NONE; - mInfo.has_mouse = FALSE; - sscanf(config, "%s", name); - for (p = mice; p->name != NULL; p++) { - if (strcasecmp(name, p->name) == 0) { - mouseType = p->type; - if (mouseType == MOUSE_NONE) - return SUCCESS; - message("mouse type `%s'\r\n", name); - mInfo.has_mouse = TRUE; - cFlag = p->cFlag; - headMask = p->headMask; - headId = p->headId; - dataMask = p->dataMask; - pkMax = p->pkMax; - - if (mouseType != MOUSE_BUSMOUSE) { - DefineCap("MouseBaud", ConfigMouseBaud, "1200"); - } - DefineCap("Mouse3Buttons", Config3Buttons, "Off"); - DefineCap("MouseDev", ConfigMouseDev, "/dev/mouse"); - return SUCCESS; - } - } - kon_warn("unknown mouse type `%s' ignored; assuming no mouse\r\n", name); - return SUCCESS; -} - -static -void MouseSetBaud(int mfd, u_short baud, u_short cflag) -{ - struct termios mio; - char *cf; - - tcgetattr(mfd, &mio); - - mio.c_iflag = IGNBRK | IGNPAR; - mio.c_oflag = 0; - mio.c_lflag = 0; -#ifdef linux - mio.c_line = 0; -#endif - mio.c_cc[VTIME] = 0; - mio.c_cc[VMIN] = 1; - - mio.c_cflag = cflag; - cfsetispeed(&mio, baud); - cfsetospeed(&mio, baud); - - tcsetattr(mfd, TCSAFLUSH, &mio); - - switch(mouseBaud) { - case B9600: cf = "*q"; break; - case B4800: cf = "*p"; break; - case B2400: cf = "*o"; break; - case B1200: cf = "*n"; break; - } - - mio.c_cflag = cflag; - cfsetispeed(&mio, mouseBaud); - cfsetospeed(&mio, mouseBaud); - write(mfd, cf, 2); - usleep(100000); - tcsetattr(mfd, TCSAFLUSH, &mio); -} - -void MouseInit(void) -{ - mInfo.has_mouse = TRUE; - DefineCap("Mouse", ConfigMouse, "NONE"); -} - -int MouseStart(void) -{ - int mfd; - - if ((mfd = open(mouseDev, O_RDWR|O_NONBLOCK)) < 0) { - kon_warn("couldn't open mouse device; mouse disabled\n"); - Perror(mouseDev); - free(mouseDev); - mouseDev = NULL; - mInfo.has_mouse = FALSE; - return -1; - } - - if (mouseType != MOUSE_BUSMOUSE) { - MouseSetBaud(mfd, B9600, cFlag); - MouseSetBaud(mfd, B4800, cFlag); - MouseSetBaud(mfd, B2400, cFlag); - MouseSetBaud(mfd, B1200, cFlag); - - if (mouseType == MOUSE_LOGITECH) { - write(mfd, "S", 1); - MouseSetBaud(mfd, mouseBaud, CS8 | PARENB | PARODD | CREAD | - CLOCAL | HUPCL); - } - - write(mfd, "Q", 1); - } - - mouseFd = mfd; - return(mfd); -} - -void MouseCleanup(void) -{ - close(mouseFd); - mouseFd = -1; -} - -static -void MouseAnalyzePacket(u_char *packet) -{ - static char oldstat; - static int dx, dy; - - switch (mouseType) { - case MOUSE_NONE: - return; - case MOUSE_MICROSOFT: - mInfo.stat = ((packet[0] & 0x20) >> 3) | ((packet[0] & 0x10) >> 4); - dx += (char)(((packet[0] & 0x03) << 6) | (packet[1] & 0x3F)); - dy += (char)(((packet[0] & 0x0C) << 4) | (packet[2] & 0x3F)); - break; - case MOUSE_MOUSESYSTEMS: - mInfo.stat = (~packet[0]) & 0x07; - dx += (char)(packet[1]) + (char)(packet[3]); - dy += - ((char)(packet[2]) + (char)(packet[4])); - break; - case MOUSE_MMSERIES: - case MOUSE_LOGITECH: - mInfo.stat = packet[0] & 0x07; - dx += (packet[0] & 0x10) ? packet[1]: - packet[1]; - dy += (packet[0] & 0x08) ? - packet[2]: packet[2]; - break; - case MOUSE_PS2: - mInfo.stat = ((packet[0] & 0x01) << 2) | ((packet[0] & 0x02) >> 1); - dx += (char)(packet[1]); - dy -= (char)(packet[2]); - break; - case MOUSE_BUSMOUSE: - mInfo.stat = (~packet[0]) & 0x07; - dx += (char)packet[1]; - dy += - (char)packet[2]; - break; - } - mInfo.dx = dx >> 3; - dx -= mInfo.dx << 3; - mInfo.dy = dy / dInfo.glineChar; - dy -= mInfo.dy * dInfo.glineChar; - - mInfo.sw = MOUSE_LIFETIME; - if (mInfo.dx || mInfo.dy) { - mInfo.x += mInfo.dx; - mInfo.y += mInfo.dy; - - if (mInfo.x < 0) mInfo.x = 0; - else if (mInfo.x > dInfo.txmax) mInfo.x = dInfo.txmax; - if (mInfo.y < 0) mInfo.y = 0; - else if (mInfo.y > dInfo.tymax) mInfo.y = dInfo.tymax; - } - if (mInfo.stat & MOUSE_LFT) { - if (!(oldstat & MOUSE_LFT)) { - mInfo.sx = mInfo.x; - mInfo.sy = mInfo.y; - } else if (mInfo.dx || mInfo.dy) { - TextReverse(mInfo.sx, mInfo.sy, mInfo.x, mInfo.y); - TextRefresh(); - TextReverse(mInfo.sx, mInfo.sy, mInfo.x, mInfo.y); - } - } else if (oldstat & MOUSE_LFT) - TextCopy(mInfo.sx, mInfo.sy, mInfo.x, mInfo.y); - - if (mInfo.stat & pasteButton && !(oldstat & pasteButton)) TextPaste(); - oldstat = mInfo.stat; -} - -void MouseGetPacket(u_char *buff, int size) -{ - static u_char packet[MAX_PK_SIZE]; - static stat = 0; - int n; - - for (n = 0; n < size; n ++, buff ++) { - if (!stat) { - if ((*buff & headMask) == headId) { - packet[0] = *buff; - stat = 1; - } - continue; - } - if (mouseType != MOUSE_PS2 - && ((*buff & dataMask) || *buff == 0x80)) { - stat = 0; - continue; - } - packet[stat] = *buff; - stat ++; - if (stat == pkMax) { - MouseAnalyzePacket(packet); - stat = 0; - } - } -} - -#else /* HAS_MOUSE */ - -/* Dummy routines. */ - -void MouseInit(void) -{ - mInfo.has_mouse = FALSE; -} - -void MouseGetPacket(u_char *buff, int size) -{ -} - -int MouseStart(void) -{ - return -1; -} - -void MouseCleanup(void) -{ -} - -#endif -#endif diff --git a/loader/kon2/src/sock.c b/loader/kon2/src/sock.c deleted file mode 100644 index 00a18136f..000000000 --- a/loader/kon2/src/sock.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Terrence R. Lambert. - * 4. The name Terrence R. Lambert may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include <config.h> - -#ifndef MINI_KON - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <sys/types.h> -#include <sys/time.h> -#include <sys/file.h> -#include <sys/types.h> -#include <sys/socket.h> - -#include <defs.h> -#include <errors.h> -#include <interface.h> -#include <sock.h> -#include <fnld.h> -#include <vc.h> -#include <vt.h> -#include <term.h> - -void StatReport() -{ - int i; - - i = 0; - while (fSRegs[i].registry) { - message("%2X %-15s %c%c\r\n", - i, fSRegs[i].registry, - (i == lInfo.sb) ? '*':' ', - (fSRegs[i].stat & FR_ATTACH) ? 'A': - ((fSRegs[i].stat & FR_PROXY) ? 'P':' ')); - i ++; - } - i = 0; - while (fDRegs[i].registry) { - message("%2X %-15s %c%c\r\n", - i|CHR_DBC, fDRegs[i].registry, - (i == lInfo.db) ? - ((lInfo.sc == CODE_EUC) ? 'E': - ((lInfo.sc == CODE_SJIS) ? 'S':' ')): ' ', - (fDRegs[i].stat & FR_ATTACH) ? 'A': - ((fDRegs[i].stat & FR_PROXY) ? 'P':' ')); - i ++; - } -} - -int SocketInit(char *tty) -{ - int len, sfd; - struct sockaddr sinfo; - -#if defined(linux) - sprintf(sinfo.sa_data, "/tmp/.kon%s", tty); -#elif defined(__FreeBSD__) - sprintf(sinfo.sa_data, "/tmp/.kon"); -#endif - unlink(sinfo.sa_data); - if ((sfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { - PerrorExit(sinfo.sa_data); - } - sinfo.sa_family = AF_UNIX; - len = sizeof(sinfo.sa_family) + strlen(sinfo.sa_data) + 1; - if (bind(sfd, &sinfo, len) < 0) { - message("can't bind socket"); - PerrorExit(sinfo.sa_data); - } - listen(sfd, 1); - chown(sinfo.sa_data, getuid(), getgid()); - return(sfd); -} - -void SocketInterface(int sfd) -{ - int fd, len; - struct sockaddr clt; - struct messageHeader mh; - - len = sizeof(struct sockaddr); - if ((fd = accept(sfd, &clt, &len)) < 0) PerrorExit("accept"); - SocketRecCommand(fd, &mh); - switch(mh.cmd) { - case CHR_LOAD: - FontAttach(); - break; - case CHR_UNLOAD: - FontDetach(FALSE); - break; - case CHR_TEXTMODE: - TextMode(); - message("switched to text mode.\r\n"); - SocketSendCommand(fd, CHR_ACK); - break; - case CHR_GRAPHMODE: - GraphMode(); - message("switched to graphics mode.\r\n"); - SocketSendCommand(fd, CHR_ACK); - break; - case CHR_RESTART: - SocketSendCommand(fd, CHR_ACK); - TermRestart(fd); - break; - case CHR_STAT: - SocketSendCommand(fd, CHR_ACK); - StatReport(); - break; - default: - message("unknown request.\r\n"); - SocketSendCommand(fd, CHR_NAK); - } - close(fd); -} -#endif diff --git a/loader/kon2/src/term.c b/loader/kon2/src/term.c deleted file mode 100644 index 5e2b16ff9..000000000 --- a/loader/kon2/src/term.c +++ /dev/null @@ -1,580 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <string.h> -#include <termios.h> -#if defined(__FreeBSD__) -#include <machine/console.h> -#endif -#include <signal.h> -#include <errno.h> -#if defined(linux) -#include <sys/vt.h> -#include <sys/kd.h> -#endif -#include <sys/time.h> -#include <sys/ioctl.h> -#include <sys/file.h> -#include <sys/wait.h> - -#include <config.h> -#include <types.h> -#include <getcap.h> - -#include <defs.h> -#include <errors.h> -#ifndef MINI_KON -#include <setutmp.h> -#endif -#include <version.h> -#include <vc.h> -#include <vt.h> -#include <child.h> -#include <interface.h> -#include <sock.h> -#ifdef MINI_KON -static int mouseFd=-1; -#else -static int sockFd; -#include <mouse.h> -#endif - -#ifdef __FreeBSD__ -#define TCSETA TIOCSETA -#define TCGETA TIOCGETA -#define SIGCLD SIGCHLD -#define XCASE 0 -#endif - -int masterPty; /* master pseudo-tty file descriptor */ - -#define MAX_TTYNAME 10 - -static int childPid, slavePty; -static struct termios oldTio; -static char ptyName[MAX_TTYNAME + 1]; -static int orgVtNum = -1; - -struct initInfo { - bool display; /* display initialized */ - bool utmp; /* utmp set */ - bool socket; /* socket opened */ - bool termios; /* termios saved */ -}; - -static struct initInfo init; - -static void CleanUp(void) -{ - if (init.display && con.active) { - TextMode(); - } -#ifndef MINI_KON - if (init.utmp) - ResetUtmp(ptyName); - if (init.socket) - SocketKill(sockFd); -#endif - if (init.termios) - tcsetattr(0, TCSAFLUSH, &oldTio); - signal(SIGCHLD, SIG_DFL); - signal(SIGHUP, SIG_DFL); - signal(SIGTERM, SIG_DFL); - signal(SIGSEGV, SIG_DFL); - signal(SIGUSR1, SIG_DFL); - signal(SIGUSR2, SIG_DFL); -#ifndef MINI_KON - FontDetach(TRUE); -#endif -} - -static void ExitTerm(int signum) -{ - fatal(sys_siglist[signum]); -} - -static void ExitPty(int signum) -{ - int stat; - -#if defined(__FreeBSD__) - signal(SIGCLD, SIG_DFL); -#endif - if (wait3(&stat, WNOHANG, 0) != childPid) { - TextMode(); - kill(0, SIGTSTP); - GraphMode(); - kill(childPid, SIGCONT); - signal(SIGCLD, ExitPty); - return; - } - if (WEXITSTATUS(stat) & 0x7f) - if (WIFSIGNALED(stat)) - fatal("child died with signal -- %s\r\n", sys_siglist[WTERMSIG(stat)]); - else - fatal("child exited with status %d\r\n", WEXITSTATUS(stat) & 0x7f); - else if (signum == SIGHUP) { - fprintf(stderr, "\r\nKON> switched to new VC\r\n"); - exit(EXIT_SUCCESS); - } else { - fprintf(stderr, "\r\nKON> finished\r\n"); - exit(EXIT_SUCCESS); - } -} - -static fd_set orgReadFds; -static int numFds; - -#ifndef MINI_KON -void MouseSetRfd(int mfd) -{ - if (mfd > 0) FD_SET(mfd, &orgReadFds); - if (mfd > sockFd) numFds = mfd + 1; - else numFds = sockFd + 1; -} - -void MouseResetRfd(int mfd) -{ - if (mfd > 0) FD_CLR(mfd, &orgReadFds); - numFds = sockFd + 1; -} -#endif - -static void ConsoleHandler(void) -{ - static u_char buff[BUFSIZ + 1]; - fd_set readFds; - int i = 0; - struct timeval tv; - - FD_ZERO(&orgReadFds); - FD_SET(0, &orgReadFds); - FD_SET(masterPty, &orgReadFds); -#ifdef MINI_KON - numFds = masterPty + 1; -#else - FD_SET(sockFd, &orgReadFds); - if (mInfo.has_mouse && mouseFd > 0) - MouseSetRfd(mouseFd); - else - MouseResetRfd(mouseFd); -#endif - /* Note: we use timeout on select call even if cursor blink is off - because of screen saver and mouse cursor timeout. */ - while (1) { - int v; - - do { - /* Idle loop. */ - PollCursor(FALSE); - readFds = orgReadFds; - tv.tv_sec = 0; - tv.tv_usec = 100000; /* 0.1 sec */ - v = select(numFds, &readFds, NULL, NULL, &tv); - } while (v == 0 || (v < 0 && (errno == EINTR || mouseFd < 0))); - if (v < 0) { - PerrorExit("select"); - } - if (FD_ISSET(masterPty, &readFds)) { - i = read(masterPty, buff, BUFSIZ); - if (i > 0) { - if (con.text_mode) { - write(1, buff, i); - } else { -/* buff[i] = 0;*/ - VtEmu(buff, i); - TextRefresh(); - } - } - } - if (FD_ISSET(0, &readFds)) { - i = read(0, buff, BUFSIZ); -#ifdef MINI_KON - if (i == 3 && !strncmp("\x1b\x5b\x50", buff, 3)) { - VgaChangeClock(); - } else -#endif - if (i > 0) write(masterPty, buff, i); -#if 0 - { - FILE *fff; - fff = fopen("in.log", "a"); - fwrite(buff, i, 1, fff); - fclose(fff); - } -#endif - PollCursor(TRUE); - } -#ifndef MINI_KON - if (FD_ISSET(sockFd, &readFds)) SocketInterface(sockFd); - if (mInfo.has_mouse) { - if (FD_ISSET(mouseFd, &readFds) && con.active) { - i = read(mouseFd, buff, BUFSIZ); - if (i > 0) MouseGetPacket(buff, i); - PollCursor(TRUE); - } - } -#endif - } -} - -static void ProcessArgs(int argc, const char *argv[]) -{ - int i = 0; - const char *video = "NORMAL"; - extern int ConfigExecProg(const char *); - - if (argc > 0 && argv[0][0] != '-') { - video = argv[0]; - i++; - } - ConsoleInit(video); - while (i < argc) { - const char *arg; - - if (argv[i][0] != '-') { - warn("bad arg `%s'; assumed `-%s'\r\n", argv[i]); - arg = (char *) argv[i]; - } else - arg = (char *) argv[i] + 1; - i++; - if (i >= argc) { - error("no value for `%s'\r\n", arg); - break; - } - if (!strcasecmp(arg, "e")) - ConfigExecProg(argv[i]); - else if (SetCapArg(arg, argv[i]) < 0) - warn("invalid capability `%s' ignored\r\n", arg); - i++; - } -} - -static int savedArgc; /* argc of startup time */ -static const char **savedArgv; /* argv of startup time */ - -/* Do initialization before reading config file */ -void TermInit(int argc, const char *argv[]) -{ - int i; - - init.display = init.utmp = init.socket = init.termios = FALSE; - /* Initialize subsystems. */ - - CapInit(); - -#ifndef MINI_KON - ChildInit(); - MouseInit(); -#endif - - VtInit(); - ProcessArgs(argc, argv); - savedArgc = argc; - savedArgv = malloc(argc * sizeof(const char *)); - for (i = 0; i < argc; i++) { - savedArgv[i] = strdup(argv[i]); - } -} - -static int TryTermReset(int argc, const char *argv[]) -{ - int i; - - fprintf(stderr, "KON> resetting kon for args ["); - for (i = 0; i < argc; i++) { - fprintf(stderr, " %s", argv[i]); - } - fprintf(stderr, " ]...\r\n"); - CapInit(); - ConsoleCleanup(); -#ifndef MINI_KON - if (mInfo.has_mouse) - MouseCleanup(); - MouseInit(); -#endif -#if 0 - VtCleanup(); -#endif - init.display = FALSE; - VtInit(); - ProcessArgs(argc, argv); - return ReadConfig(CONFIG_NAME); -} - -/* Called from SocketInterface with stream fd. */ -void TermRestart(int fd) -{ - int i; - int argc; - char **argv; - - read(fd, &argc, sizeof(argc)); - argv = alloca(argc * sizeof(char *)); - for (i = 0; i < argc; i++) { - int len; - - read(fd, &len, sizeof(len)); - argv[i] = alloca(len + 1); /* +1 for '\0' */ - read(fd, argv[i], (size_t) len); - argv[i][len] = '\0'; - } - TextMode(); - if (TryTermReset(argc, (const char **)argv) < 0 && - TryTermReset(savedArgc, savedArgv) < 0 && - TryTermReset(0, (const char **)NULL) < 0) - fatal("giving up\r\n"); -#ifndef MINI_KON - if (mInfo.has_mouse) - mouseFd = MouseStart(); -#endif - VtStart(); - ConsoleStart(); - init.display = TRUE; - message("reset done\r\n"); -} - -char * -TermName() -{ - static char *tty; - - if (!tty) { - char *tmp; - - tmp = ttyname(0); - tty = strdup(strcmp(tmp, "/dev/console") ? tmp: "/dev/tty1"); - } - return(tty); -} - -/* Start processing */ -void TermStart(void) -{ - struct termios newTio; - char ls, ln; -#ifdef MINI_KON - extern void LoadMiniFont(); -#endif - - /* Open PTY(master) */ - for (ls = 'p'; ls <= 's'; ls ++) { - for (ln = 0; ln <= 0xF; ln ++) { - sprintf(ptyName, "/dev/pty%1c%1x", ls, ln); - if ((masterPty = open(ptyName, O_RDWR)) >= 0) break; - } - if (masterPty >= 0) break; - } - if (masterPty < 0) { - message("can not get master pty\r\n"); - PerrorExit(ptyName); - } - ptyName[5] = 't'; - -#ifndef MINI_KON - if (mInfo.has_mouse) { - mouseFd = MouseStart(); - } -#endif - -#ifndef MINI_KON - chown("/dev/tty0", getuid(), getgid()); -#if defined(linux) - sockFd = SocketInit(TermName() + 8); -#elif defined(__FreeBSD__) - sockFd = SocketInit(ttyname(0) + 9); -#endif -#endif - init.socket = TRUE; - - /* Get old tio of 0 */ - tcgetattr(0, &oldTio); - init.termios = TRUE; - -#ifndef MINI_KON - SetUtmp(ptyName); -#endif - init.utmp = TRUE; - - /* fork handler */ - if ((childPid = fork()) < 0) { - PerrorExit("fork"); - } - if (childPid != 0) { - /* I'm parent. */ - atexit(CleanUp); - ChildCleanup(); - -#ifdef MINI_KON - LoadMiniFont(); -#endif - /* Signal Setting */ - signal(SIGCHLD, ExitPty); - signal(SIGHUP, ExitTerm); - signal(SIGTERM, ExitTerm); - signal(SIGSEGV, ExitTerm); - /* Set new tio of 0 */ - newTio = oldTio; - newTio.c_lflag &= ~(ECHO|ISIG|ICANON|XCASE); - newTio.c_iflag = 0; - newTio.c_oflag &= ~OPOST; - newTio.c_cc[VMIN] = 1; - newTio.c_cc[VTIME] = 0; -#if defined(__FreeBSD__) - newTio.c_cc[VDISCARD] = _POSIX_VDISABLE; - newTio.c_cc[VLNEXT] = _POSIX_VDISABLE; - newTio.c_cc[VSTART] = _POSIX_VDISABLE; - newTio.c_cc[VSTOP] = _POSIX_VDISABLE; - newTio.c_cc[VINTR] = _POSIX_VDISABLE; - newTio.c_cc[VSUSP] = _POSIX_VDISABLE; - newTio.c_cc[VDSUSP] = _POSIX_VDISABLE; - newTio.c_cc[VQUIT] = _POSIX_VDISABLE; -#endif - newTio.c_cflag |= CS8; -#ifdef linux - newTio.c_line = 0; -#endif - tcsetattr(0, TCSAFLUSH, &newTio); - /* VGA initialize */ - VtStart(); - ConsoleStart(); - init.display = TRUE; -#ifndef MINI_KON - FontAttach(); -#endif - ConsoleHandler(); - } else { - int efd; - FILE *errfp; - - efd = dup(2); - errfp = fdopen(efd, "w"); - /* I'm child */ - /* Make me process leader */ - setsid(); -#if defined(__FreeBSD__) - { - int devtty; - if ((devtty = open("/dev/tty",O_RDWR|O_NDELAY)) >= 0) { - ioctl(devtty, TIOCNOTTY, (char *)0); - close(devtty); - } - } -#endif - /* Open TTY(slave) */ - if ((slavePty = open(ptyName, O_RDWR)) < 0) { - PerrorExit(ptyName); - } - close(masterPty); - /* Set old tio to TTY */ - tcsetattr(slavePty, TCSAFLUSH, &oldTio); -#ifdef __FreeBSD__ - ioctl(slavePty, TIOCSCTTY, (char *)0); -#endif - /* Set std??? to pty */ - dup2(slavePty, 0); - dup2(slavePty, 1); - dup2(slavePty, 2); - ChildStart(errfp); - } -} - -void ChangeOrgConsole() -{ - int cfd; - -#if defined(linux) - cfd = open("/dev/console", O_WRONLY); - if (cfd < 0 && (cfd = open("/dev/console", O_RDONLY)) < 0) { - PerrorExit("/dev/console"); - } -#elif defined(__FreeBSD__) - cfd = open("/dev/vga", O_WRONLY); - if (cfd < 0 && (cfd = open("/dev/vga", O_RDONLY)) < 0) { - PerrorExit("/dev/vga"); - } -#endif - ioctl(cfd, VT_ACTIVATE, orgVtNum); - close(cfd); -} - -void ChangeNewConsole() -{ -#if defined(linux) - struct vt_stat vts; -#endif - int cfd, vfd, vtNum, child, parent, mode; - char vtty[MAX_TTYNAME + 1]; - -#if defined(linux) - cfd = open("/dev/console", O_WRONLY); - if (cfd < 0 && (cfd = open("/dev/console", O_RDONLY)) < 0) - fatal("can't open /dev/console"); -#elif defined(__FreeBSD__) - cfd = open("/dev/vga", O_WRONLY); - if (cfd < 0 && (cfd = open("/dev/vga", O_RDONLY)) < 0) - fatal("can't open /dev/vga"); -#endif - ioctl(cfd, KDGETMODE, &mode); - if (mode == KD_TEXT) { - close(cfd); - return; - } -#if defined(linux) - ioctl(cfd, VT_GETSTATE, &vts); - orgVtNum = vts.v_active; -#endif - ioctl(cfd, VT_OPENQRY, &vtNum); - if (vtNum < 0) - fatal("can't get free VC"); - parent = getpid(); - if ((child = fork()) == -1) - PerrorExit("fork"); - if (child) { - signal(SIGHUP, ExitPty); - pause(); - } - setsid(); -#if defined(linux) - sprintf(vtty, "/dev/tty%d", vtNum); -#elif defined(__FreeBSD__) - sprintf(vtty, "/dev/ttyv%d", vtNum); -#endif - if ((vfd = open(vtty, O_RDWR)) < 0) - fatal("can't open %s", vtty); - if (ioctl(cfd, VT_ACTIVATE, vtNum) != 0) - fatal("can't activate VC(%d)", vtNum); - atexit(ChangeOrgConsole); - close(cfd); - dup2(vfd, 0); - dup2(vfd, 1); - dup2(vfd, 2); - kill(parent, SIGHUP); -} diff --git a/loader/kon2/src/utmp.c b/loader/kon2/src/utmp.c deleted file mode 100644 index e795b5b09..000000000 --- a/loader/kon2/src/utmp.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* - Original utmp.c was ported from Wnn by komeda@ics.osaka-u.ac.jp. - This code is written by manabe@papilio.tutics.tut.ac.jp, - and this does not contain old code (Wnn's setutmp.c). - - Thanks to komeda@ics.osaka-u.ac.jp. -*/ - -#include <config.h> - -#ifndef MINI_KON - -#include <stdio.h> -#include <unistd.h> -#include <fcntl.h> -#include <string.h> -#include <pwd.h> -#include <utmp.h> -#include <grp.h> -#include <sys/stat.h> - -static int ttyGid; - -void SetUtmp(char *tty) -{ -#ifdef linux - struct utmp utmp; - struct passwd *pw; - struct group *ttygrp; - char *tn; - - pw = getpwuid(getuid()); - tn = rindex(tty, '/') + 1; - memset((char *)&utmp, 0, sizeof(utmp)); - strncpy(utmp.ut_id, tn + 3, sizeof(utmp.ut_id)); - utmp.ut_type = DEAD_PROCESS; - setutent(); - getutid(&utmp); - utmp.ut_type = USER_PROCESS; - utmp.ut_pid = getpid(); - strncpy(utmp.ut_line, tn, sizeof(utmp.ut_line)); - strncpy(utmp.ut_user, pw->pw_name, sizeof(utmp.ut_user)); - time(&(utmp.ut_time)); - pututline(&utmp); - endutent(); - if ((ttygrp = getgrnam("tty")) != NULL) - ttyGid = ttygrp->gr_gid; - else - ttyGid = -1; - chmod(tty, 0622); - chown(tty, getuid(), ttyGid); -#endif -} - -void ResetUtmp(char *tty) -{ -#ifdef linux - struct utmp utmp, *utp; - char *tn; - - tn = rindex(tty, '/') + 4; - memset((char *)&utmp, 0, sizeof(utmp)); - strncpy(utmp.ut_id, tn, sizeof(utmp.ut_id)); - utmp.ut_type = USER_PROCESS; - setutent(); - utp = getutid(&utmp); - utp->ut_type = DEAD_PROCESS; - memset(utp->ut_user, 0, sizeof(utmp.ut_user)); - utp->ut_type = DEAD_PROCESS; - time(&(utp->ut_time)); - pututline(utp); - endutent(); - chmod(tty, 0600); - chown(tty, 0, ttyGid); -#endif -} -#endif /* MINI_KON */ diff --git a/loader/kon2/src/vc.c b/loader/kon2/src/vc.c deleted file mode 100644 index b60068b91..000000000 --- a/loader/kon2/src/vc.c +++ /dev/null @@ -1,936 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992, 1993 MAEDA Atusi (mad@math.keio.ac.jp) - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY MAEDA ATUSI AND TAKASHI MANABE ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include <config.h> -#include <types.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#if defined(linux) -#include <sys/vt.h> -#endif -#include <fcntl.h> -#include <signal.h> -#include <termios.h> -#if defined(__FreeBSD__) -#include <machine/console.h> -#endif -#include <sys/ioctl.h> -#ifdef linux -#include <sys/kd.h> -#endif - -#include <mem.h> -#include <getcap.h> - -#include <defs.h> -#include <errors.h> -#include <fnld.h> -#ifndef MINI_KON -#include <mouse.h> -#endif -#include <vc.h> -#include <vt.h> -#include <term.h> - -struct dispInfo dInfo; -struct cursorInfo cInfo; -struct videoInfo vInfo; -#ifndef MINI_KON -static struct cursorInfo mouseCursor; -#endif - -static bool textClear; - -static int textHead, scrollLine; -static u_int textSize; -static u_char *textBuff, *attrBuff, *flagBuff; - -static int saveTime, saverCount; -static bool saved; -static bool useHardScroll; -static volatile bool busy; /* TRUE iff updating screen */ -static volatile bool release; /* delayed VC switch flag */ - -static void ShowCursor(struct cursorInfo *, bool); - -static void LeaveVC(int); -static void EnterVC(int); - -/* - - flagBuff: - | 7| 6| 5|4||3|2|1|0| - |CLEAN_S|LATCH_2|LATCH_1| ||<----->| - |0=latch| byte2| byte1| || LANG| - - */ - -#define KON_TMP_FILE "/tmp/.kontmp" - -static -inline void blatch(void *head, int n) -{ - - int i; - unsigned char *p=head; - - for (i = 0; i < n; i ++, p ++) *p &= 0x7F; - -#if 0 - __asm__("\t clc\n" - "1:\n" - "\t andb %%bl, (%%eax)\n" - "\t incl %%eax\n" - "\t loop 1b\n" - : - : "eax" ((long)head), "bl" (0x7F), "c" (n) - : "bl", "cx" ); -#endif -} - -static -inline void llatch(void *head, int n) -{ - blatch(head, n); - -#if 0 - __asm__("\t clc\n" - "1:\n" - "\t andl %%ebx, (%%eax)\n" - "\t addl $4, %%eax\n" - "\t loop 1b\n" - : - : "eax" ((long)head), "ebx" (0x7F7F7F7F), "c" (n>>2) - : "ebx", "cx" ); -#endif -} - -static inline u_int TextAddress(u_int x, u_int y) -{ - return (textHead + x + y * dInfo.glineByte) % textSize; -} - -static inline bool IsKanji(u_int x, u_int y) -{ - return(*(flagBuff + TextAddress(x, y)) & CODEIS_1); -} - -static inline bool IsKanji2(u_int x, u_int y) -{ - return(*(flagBuff + TextAddress(x, y)) & CODEIS_2); -} - -void euctosjis(ch, cl) -u_char *ch, *cl; -{ - u_char nh, nl; - - nh = ((*ch - 0x21) >> 1) + 0x81; - if (nh > 0x9F) nh += 0x40; - if (*ch & 1) { - nl = *cl + 0x1F; - if (*cl > 0x5F) - nl ++; - } else nl = *cl + 0x7E; - *cl = nl; - *ch = nh; -} - -void TextDeleteChar(int n) -{ - u_int addr, dx; - - addr = TextAddress(con.x, con.y); - dx = dInfo.glineByte - con.x - n; - - memcpy(textBuff + addr, textBuff + addr + n, dx); - memcpy(attrBuff + addr, attrBuff + addr + n, dx); - memcpy(flagBuff + addr, flagBuff + addr + n, dx); - - blatch(flagBuff + addr, dx); - - addr = TextAddress(dInfo.glineByte - n, con.y); - bzero(textBuff + addr, n); - bzero(attrBuff + addr, n); - bzero(flagBuff + addr, n); -} - -void TextInsertChar(int n) -{ - u_int addr, dx; - - addr = TextAddress(con.x, con.y); - - dx = dInfo.txmax - con.x - n; - memmove(textBuff + addr + n, textBuff + addr, dx); - memmove(attrBuff + addr + n, attrBuff + addr, dx); - memmove(flagBuff + addr + n, flagBuff + addr, dx); - - blatch(flagBuff + addr + n, dx); - bzero(textBuff + addr, n); - bzero(attrBuff + addr, n); - bzero(flagBuff + addr, n); -} - -void TextRefresh(void) -{ - u_int fnt, i; - u_char ch, ch2, fc, bc; - - busy = TRUE; - if (!con.active) { - busy = FALSE; - return; - } - ShowCursor(&cInfo, FALSE); -#ifndef MINI_KON - ShowCursor(&mouseCursor, FALSE); -#endif - if (textClear) vInfo.clear_all(); - if (useHardScroll) { - if (scrollLine > 0) vInfo.hard_scroll_up(scrollLine); - else if (scrollLine < 0) vInfo.hard_scroll_down(- scrollLine); - scrollLine = 0; - } - textClear = FALSE; - for (i = 0; i < textSize; i ++) { - if (*(flagBuff + i)&CLEAN_S) continue; /* already clean */ - vInfo.set_address(i); - fc = *(attrBuff + i); - bc = *(attrBuff + i) >> 4; - ch = *(textBuff + i); - *(flagBuff + i) |= CLEAN_S; - if (*(flagBuff + i) & CODEIS_1) { - dbFReg = &fDRegs[*(flagBuff + i)&LANG_CODE]; - i ++; - *(flagBuff + i) |= CLEAN_S; - ch2 = *(textBuff + i); - fnt = dbFReg->addr(ch2, ch); -#if 0 - { - FILE *fp=fopen("errlog", "a"); - fprintf(fp,"<%x %s %d %X %X %X>\n", - *(flagBuff + i - 1)&LANG_CODE, - dbFReg->registry, dbFReg->size, ch2, ch, fnt); - fclose(fp); - } -#endif - if (con.ins) TextInsertChar(2); - if (fnt < dbFReg->size) - vInfo.wput(dbFReg->bitmap + fnt, fc, bc); - } else { - sbFReg = &fSRegs[*(flagBuff + i)&LANG_CODE]; -#if 0 - { - FILE *fp=fopen("errlog", "a"); - fprintf(fp,"<%x %s %d>\n", - *(flagBuff + i)&LANG_CODE, - sbFReg->registry, sbFReg->size); - fclose(fp); - } -#endif - if (con.ins) TextInsertChar(1); - vInfo.sput(ch ? sbFReg->bitmap + (ch << 4):0, fc, bc); - } - } - cInfo.kanji = IsKanji(con.x, con.y); - vInfo.set_cursor_address(&cInfo, con.x, con.y); - ShowCursor(&cInfo, TRUE); - busy = FALSE; - if (release) LeaveVC(SIGUSR1); -} - -static struct winsize text_win; - -static void SetTextMode(void) -{ - ShowCursor(&cInfo, FALSE); - vInfo.clear_all(); - vInfo.text_mode(); - ioctl(0, KDSETMODE, KD_TEXT); - ioctl(0, TIOCCONS, NULL); -} - -void TextMode(void) -{ - struct vt_mode vtm; - - signal(SIGUSR1, SIG_DFL); - signal(SIGUSR2, SIG_DFL); - vtm.mode = VT_AUTO; - vtm.waitv = 0; - vtm.relsig = 0; - vtm.acqsig = 0; - ioctl(0, VT_SETMODE, &vtm); -#if defined(__FreeBSD__) - ioctl(0, VT_RELDISP, 1); -#endif - con.text_mode = TRUE; - SetTextMode(); - ioctl(masterPty, TIOCSWINSZ, &text_win); -} - -void GraphMode(void) -{ - struct winsize win; - struct vt_mode vtm; - - con.text_mode = FALSE; - ioctl(0, KDSETMODE, KD_GRAPHICS); -#if defined(__FreeBSD__) - ioctl(0, VT_RELDISP, VT_ACKACQ); -#endif - signal(SIGUSR1, LeaveVC); - signal(SIGUSR2, EnterVC); - vtm.mode = VT_PROCESS; - vtm.waitv = 0; - vtm.relsig = SIGUSR1; - vtm.acqsig = SIGUSR2; - ioctl(0, VT_SETMODE, &vtm); - vInfo.graph_mode(); - if (useHardScroll) - vInfo.set_start_address(); - - win.ws_row = dInfo.tymax + 1; /* Note: con.ymax may be changed by application */ - win.ws_col = dInfo.txmax + 1; - win.ws_xpixel = win.ws_ypixel = 0; - ioctl(masterPty, TIOCSWINSZ, &win); - ioctl(masterPty, TIOCCONS, NULL); - - llatch(flagBuff, textSize); - textClear = TRUE; - TextRefresh(); -} - -static - void LeaveVC(int signum) -{ - - signal(SIGUSR1, LeaveVC); /* should use sigaction()? */ - if (busy) { - release = TRUE; - return; - } - release = FALSE; - con.active = FALSE; - SetTextMode(); -#ifdef HAS_MOUSE - if (mInfo.has_mouse) { - MouseResetRfd(mouseFd); - MouseCleanup(); - } -#endif - ioctl(0, VT_RELDISP, 1); -} - -static - void EnterVC(int signum) -{ - signal(SIGUSR2, EnterVC); - if (!con.active) { - con.active = TRUE; - GraphMode(); - signal(SIGUSR2, EnterVC); -#ifdef HAS_MOUSE - if (mInfo.has_mouse) { - MouseStart(); - MouseSetRfd(mouseFd); - } -#endif - } -} - -static - void TextScrollUp(int line) -{ - int oldhead, len; - - oldhead = textHead; - textHead += line * dInfo.glineByte; - if (textHead > textSize) { - textHead -= textSize; - len = textSize - oldhead; - if (textHead) { - bzero(textBuff, textHead); - bzero(attrBuff, textHead); - bzero(flagBuff, textHead); - } - } else len = textHead - oldhead; - bzero(textBuff + oldhead, len); - bzero(attrBuff + oldhead, len); - bzero(flagBuff + oldhead, len); -} - -static - void TextScrollDown(int line) -{ - int oldhead, len; - - oldhead = textHead; - textHead -= line * dInfo.glineByte; - if (textHead < 0) { - textHead += textSize; - if (oldhead) { - bzero(textBuff, oldhead); - bzero(attrBuff, oldhead); - bzero(flagBuff, oldhead); - } - len = textSize - textHead; - } else len = oldhead - textHead; - bzero(textBuff + textHead, len); - bzero(attrBuff + textHead, len); - bzero(flagBuff + textHead, len); -} - -void TextWput(u_char ch1, u_char ch2) -{ - u_int addr; - u_char *p; - - addr = TextAddress(con.x, con.y); - *(attrBuff + addr) = con.fcol | (con.bcol << 4); - *(p = textBuff + addr) = ch2; - *(p + 1) = ch1; - *(p = flagBuff + addr) = con.db; - *(p + 1) = LATCH_2; -} - -void TextSput(u_char ch) -{ - u_int addr; - - addr = TextAddress(con.x, con.y); - *(flagBuff + addr) = LATCH_S|con.sb; - *(attrBuff + addr) = con.fcol | (con.bcol << 4); - *(textBuff + addr) = ch; -} - -void TextClearAll(void) -{ -#if 1 - u_int y, addr; - - for (y = 0; y <= con.ymax; y ++) { - addr = TextAddress(0, y); - bzero(textBuff + addr, dInfo.glineByte); - bzero(attrBuff + addr, dInfo.glineByte); - } -#else - bzero(textBuff, textSize); - bzero(attrBuff, textSize); -#endif - bzero(flagBuff, textSize); -#ifndef MINI_KON - mInfo.sw = 0; -#endif - textClear = TRUE; -} - -void TextClearEol(u_char mode) -{ - u_int addr; - u_char len, x=0; - - switch(mode) { - case 1: - len = con.x; - break; - case 2: - len = dInfo.glineByte; - break; - default: - x = con.x; - len = dInfo.glineByte - con.x; - break; - } - addr = TextAddress(x, con.y); - bzero(textBuff + addr, len); - bzero(attrBuff + addr, len); - bzero(flagBuff + addr, len);/* needless to latch */ -} - -void TextClearEos(u_char mode) -{ - u_int addr, len, y; - - if (mode == 2) { - TextClearAll(); - return; - } - switch(mode) { - case 1: - for (y = 0; y < con.y; y ++) { - addr = TextAddress(0, y); - bzero(textBuff + addr, dInfo.glineByte); - bzero(attrBuff + addr, dInfo.glineByte); - bzero(flagBuff + addr, dInfo.glineByte);/* needless to latch */ - } - addr = TextAddress(0, con.y); - bzero(textBuff + addr, con.x); - bzero(attrBuff + addr, con.x); - bzero(flagBuff + addr, con.x);/* needless to latch */ - break; - default: - for (y = con.y + 1; y <= con.ymax; y ++) { - addr = TextAddress(0, y); - bzero(textBuff + addr, dInfo.glineByte); - bzero(attrBuff + addr, dInfo.glineByte); - bzero(flagBuff + addr, dInfo.glineByte);/* needless to latch */ - } - addr = TextAddress(con.x, con.y); - len = dInfo.glineByte - con.x; - bzero(textBuff + addr, len); - bzero(attrBuff + addr, len); - bzero(flagBuff + addr, len);/* needless to latch */ - break; - } -} - -static - void TextClearBand(u_int top, u_int btm) -{ - u_int y, addr; - - for (y = top; y <= btm; y ++) { - addr = TextAddress(0, y); - bzero(textBuff + addr, dInfo.glineByte); - bzero(attrBuff + addr, dInfo.glineByte); - bzero(flagBuff + addr, dInfo.glineByte);/* needless to latch */ - } -} - -void TextMoveDown(int top, int btm, int line) -{ - u_int n, src, dst; - - if (btm - top - line + 1 <= 0) { - TextClearBand(top, btm); - return; - } - for (n = btm; n >= top + line; n --) { - dst = TextAddress(0, n); - src = TextAddress(0, n - line); - memcpy(textBuff + dst, textBuff + src, dInfo.glineByte); - memcpy(attrBuff + dst, attrBuff + src, dInfo.glineByte); - memcpy(flagBuff + dst, flagBuff + src, dInfo.glineByte); - llatch(flagBuff + dst, dInfo.glineByte); - } - TextClearBand(top, top + line - 1); -} - -void TextMoveUp(int top, int btm, int line) -{ - u_int n, src, dst; - - if (btm - top - line + 1 <= 0) { - TextClearBand(top, btm); - return; - } - for (n = top; n <= btm - line; n ++) { - dst = TextAddress(0, n); - src = TextAddress(0, n + line); - memcpy(textBuff + dst, textBuff + src, dInfo.glineByte); - memcpy(attrBuff + dst, attrBuff + src, dInfo.glineByte); - memcpy(flagBuff + dst, flagBuff + src, dInfo.glineByte); - llatch(flagBuff + dst, dInfo.glineByte); - } - TextClearBand(btm - line + 1, btm); -} - -void ScrollUp(int line) -{ - if (useHardScroll && !con.soft) { - TextScrollUp(line); - scrollLine += line; - } else - TextMoveUp(con.ymin, con.ymax, line); -} - -void ScrollDown(int line) -{ - if (useHardScroll && !con.soft) { - TextScrollDown(line); - scrollLine -= line; - } else - TextMoveDown(con.ymin, con.ymax, line); -} - -static inline void KanjiAdjust(int *x, int *y) -{ - if (IsKanji2(*x, *y)) { - --*x; - } -} - -void TextReverse(int fx, int fy, int tx, int ty) -{ - u_int from, to, y, swp, xx, x; - u_char fc, bc, fc2, bc2; - - KanjiAdjust(&fx, &fy); - KanjiAdjust(&tx, &ty); - if (fy > ty) { - swp = fy; - fy = ty; - ty = swp; - swp = fx; - fx = tx; - tx = swp; - } else if (fy == ty && fx > tx) { - swp = fx; - fx = tx; - tx = swp; - } - for (xx = dInfo.txmax, y = fy; y <= ty; y ++) { - if (y == ty) xx = tx; - from = TextAddress(fx, y); - to = TextAddress(xx, y); - if (flagBuff[from] & CODEIS_2) - /* 2nd byte of kanji */ - from--; - for (x = from; x <= to; x ++) { - if (!textBuff[x]) continue; - fc = attrBuff[x]; - bc = fc >> 4; - bc2 = (bc & 8) | (fc & 7); - fc2 = (fc & 8) | (bc & 7); - attrBuff[x] = fc2 | (bc2 << 4); - flagBuff[x] &= ~CLEAN_S; - } - fx = 0; - } -} - -#ifndef MINI_KON - -void TextCopy(int fx, int fy, int tx, int ty) -{ - int fd; - u_int from, to, y, swp, xx, x; - u_char ch, ch2; - - unlink(KON_TMP_FILE); - if ((fd = open(KON_TMP_FILE, O_WRONLY|O_CREAT, 0600)) < 0) return; - - KanjiAdjust(&fx, &fy); - KanjiAdjust(&tx, &ty); - if (fy > ty) { - swp = fy; - fy = ty; - ty = swp; - swp = fx; - fx = tx; - tx = swp; - } else if (fy == ty && fx > tx) { - swp = fx; - fx = tx; - tx = swp; - } - for (xx = dInfo.txmax, y = fy; y <= ty; y ++) { - if (y == ty) xx = tx; - from = TextAddress(fx, y); - if (flagBuff[from] & CODEIS_2) - /* 2nd byte of kanji */ - from--; - to = TextAddress(xx, y); - for (x = to; x >= from; x --) if (textBuff[x] > ' ') break; - to = x; - for (x = from; x <= to; x ++) { - ch = textBuff[x]; - if (!ch) ch = ' '; - if (flagBuff[x] & CODEIS_1) { - x ++; - ch2 = textBuff[x]; - switch(lInfo.sc) { - case CODE_EUC: - ch2 |= 0x80; - ch |= 0x80; - break; - case CODE_SJIS: - jistosjis(ch2, ch); - break; - } - write(fd, &ch2, 1); - write(fd, &ch, 1); - } else write(fd, &ch, 1); - } - if (y < ty) { - ch = '\n'; - write(fd, &ch, 1); - } - fx = 0; - } - close(fd); -} - -void TextPaste(void) -{ - u_char ch; - int fd; - - if ((fd = open(KON_TMP_FILE, O_RDONLY)) < 0) return; - while(read(fd, &ch, 1) == 1) write(masterPty, &ch, 1); - close(fd); -} - -#endif - -/* Cursor related routines. */ - -static void ToggleCursor(struct cursorInfo *c) -{ - c->count = 0; - if (con.text_mode) - return; - c->shown = ! c->shown; - vInfo.cursor(c); -} - -static void ShowCursor(struct cursorInfo *c, bool show) -{ - if (!con.active || !c->sw) - return; - if (c->shown != show) - ToggleCursor(c); -} - -static void SaveScreen(bool save) -{ - if (saved != save) { - saved = save; - vInfo.screen_saver(save); - } - saverCount = 0; -} - -#ifndef MINI_KON -static void PollMouseCursor(void) -{ - ShowCursor(&mouseCursor, FALSE); - if (mInfo.sw > 0) { - --mInfo.sw; - if (cInfo.shown) { - int x = mInfo.x, y = mInfo.y; - - KanjiAdjust(&x, &y); - mouseCursor.kanji = IsKanji(x, y); - vInfo.set_cursor_address(&mouseCursor, x, y); - ShowCursor(&mouseCursor, TRUE); - } - } -} -#endif - -/* Called when some action was over, or every 1/10 sec when idle. */ - -void PollCursor(bool wakeup) -{ - if (!con.active) - return; - if (wakeup) { - SaveScreen(FALSE); - ShowCursor(&cInfo, TRUE); -#ifndef MINI_KON - PollMouseCursor(); -#endif - return; - } - /* Idle. */ - if (saved) - return; - if ((saveTime > 0) && (++saverCount == saveTime)) { - ShowCursor(&cInfo, FALSE); -#ifndef MINI_KON - ShowCursor(&mouseCursor, FALSE); -#endif - SaveScreen(TRUE); - return; - } - if ((cInfo.interval > 0) && (++cInfo.count == cInfo.interval)) { - ToggleCursor(&cInfo); - } -#ifndef MINI_KON - if (mInfo.has_mouse) { - PollMouseCursor(); - } -#endif -} - -/* Configuration routines. */ - -extern int SvgaSetVideoType(struct videoInfo*, const char*); -extern int VgaFmSetVideoType(struct videoInfo*, const char*); -extern int S3SetVideoType(struct videoInfo*, const char*); -extern int J31SXSetVideoType(struct videoInfo*, const char*); - -static struct videoconf { - const char *name; - int (*set)(struct videoInfo*, const char*); -} videos[] = { -#ifdef HAS_VGA - {"VGA", SvgaSetVideoType}, -#ifndef MINI_KON - {"VGAFM", VgaFmSetVideoType}, - {"EGA", SvgaSetVideoType}, - {"SVGA", SvgaSetVideoType}, -#endif -#endif -#ifdef HAS_S3 - {"S3", S3SetVideoType}, -#endif -#ifdef HAS_J31SX - {"J3100SX", J31SXSetVideoType}, -#endif - {NULL, NULL} -}; - -static int ConfigHardScroll(const char *confstr) -{ - bool value = BoolConf(confstr); - useHardScroll = value; - if (value) { - message("hardware scroll mode.\r\n"); - } - return SUCCESS; -} - -static char *videoName; - -static int ConfigDisplay(const char *config) -{ - struct videoconf *v; - char name[MAX_COLS]; - - sscanf(config, "%s", name); - for (v = videos; v->name != NULL; v++) { - if (strcasecmp(name, v->name) == 0) { - config = strchr(config, '\n'); - if (config == NULL) { - error("invalid entry for %s\r\n", videoName); - return FAILURE; - } - if (v->set(&vInfo, config) == FAILURE) - return FAILURE; - message("video type `%s' selected\r\n", name); - if (vInfo.has_hard_scroll) { - DefineCap("HardScroll", ConfigHardScroll, "On"); - } else - useHardScroll = FALSE; - return SUCCESS; - } - } - error("unknown video type `%s'\r\n", name); - return FAILURE; -} - -/* Beep routines. */ - -#define COUNTER_ADDR 0x61 - -static int beepCount; - -static int ConfigBeep(const char *confstr) -{ - beepCount = atoi(confstr) * 10000; -#if defined(linux) - if (beepCount > 0) - ioperm(COUNTER_ADDR, 1, TRUE); -#endif - return SUCCESS; -} - -void Beep(void) -{ - if (!con.active || beepCount <= 0) return; -#if defined(linux) - PortOutb(PortInb(COUNTER_ADDR)|3, COUNTER_ADDR); - usleep(beepCount); - PortOutb(PortInb(COUNTER_ADDR)&0xFC, COUNTER_ADDR); -#endif -} - -static int ConfigInterval(const char *confstr) -{ - cInfo.interval = atoi(confstr); -#ifndef MINI_KON - mouseCursor.interval = cInfo.interval; -#endif - return SUCCESS; -} - -static int ConfigSaver(const char *confstr) -{ - saveTime = atoi(confstr) * 600; /* convert unit from minitue to 1/10 sec */ - return SUCCESS; -} - -/* Initialize routine. */ - -void ConsoleInit(const char *video) -{ - videoName = strdup(video); - DefineCap(videoName, ConfigDisplay, NULL); - DefineCap("BeepCounter", ConfigBeep, "5"); - DefineCap("CursorInterval", ConfigInterval, "4"); - DefineCap("SaveTime", ConfigSaver, "4"); -} - -void ConsoleStart(void) -{ - /* What to do if calloc failed? */ - textBuff = (u_char *)calloc(dInfo.glineByte, dInfo.tymax + 1); - attrBuff = (u_char *)calloc(dInfo.glineByte, dInfo.tymax + 1); - flagBuff = (u_char *)calloc(dInfo.glineByte, dInfo.tymax + 1); - textSize = dInfo.glineByte * (dInfo.tymax + 1); - ioctl(0, KDSETMODE, KD_GRAPHICS); - ioctl(0, TIOCGWINSZ, &text_win); - vInfo.init(); - cInfo.shown = FALSE; -#ifndef MINI_KON - mouseCursor.shown = FALSE; - mouseCursor.sw = TRUE; -#endif - saved = FALSE; - GraphMode(); -} - -void ConsoleCleanup(void) -{ - scrollLine = textHead = 0; - vInfo.detatch(); - SafeFree((void **)&textBuff); - SafeFree((void **)&attrBuff); - SafeFree((void **)&flagBuff); -#ifdef linux - ioperm(COUNTER_ADDR, 1, FALSE); -#endif - - SafeFree((void **)&videoName); -} diff --git a/loader/kon2/src/vt.c b/loader/kon2/src/vt.c deleted file mode 100644 index 106eefbce..000000000 --- a/loader/kon2/src/vt.c +++ /dev/null @@ -1,746 +0,0 @@ -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include <types.h> - -#include <stdio.h> -#include <unistd.h> -#include <string.h> -#include <termios.h> -#if defined(linux) -#include <malloc.h> -#elif defined(__FreeBSD__) -#include <stdlib.h> -#endif -#include <sys/types.h> -#include <sys/ioctl.h> - -#include <getcap.h> -#include <defs.h> -#include <term.h> -#include <interface.h> -#include <fnld.h> -#include <vt.h> -#include <vc.h> - -struct _con_info con; - -#define CHAR_NUL '\x00' -#define CHAR_BEL '\x07' -#define CHAR_BS '\x08' -#define CHAR_HT '\x09' -#define CHAR_LF '\x0A' -#define CHAR_VT '\x0B' -#define CHAR_FF '\x0C' -#define CHAR_CR '\x0D' -#define CHAR_SO '\x0E' -#define CHAR_SI '\x0F' -#define CHAR_XON '\x11' -#define CHAR_XOFF '\x12' -#define CHAR_CAN '\x18' -#define CHAR_SUB '\x1A' -#define CHAR_ESC '\x1B' -#define CHAR_DEL '\x7F' -#define CHAR_CSI '\x9B' -#define CHAR_SS2 '\x8E' - -#define LEN_REPORT 9 - -struct attrStack { - struct attrStack *prev; - u_char x, y, attr, bcol, fcol; -}; - -static struct attrStack *saveAttr; - -static int scroll; /* ¥¹¥¯¥í¡¼¥ë¹Ô¿ô */ -struct langInfo lInfo; - -static void -SaveAttr(struct attrStack **asp) -{ - struct attrStack *tmp; - - tmp = (struct attrStack *)malloc(sizeof(struct attrStack)); - if (!asp) { - if (saveAttr) tmp->prev = saveAttr; - else tmp->prev = NULL; - saveAttr = tmp; - } else *asp = tmp; - tmp->x = con.x; - tmp->y = con.y; - tmp->attr = con.attr; - tmp->fcol = con.fcol; - tmp->bcol = con.bcol; -} - -static void -RestoreAttr(struct attrStack *asp) -{ - if (!asp) { - if ((asp = saveAttr) == NULL) return; - saveAttr = asp->prev; - } - con.x = asp->x; - con.y = asp->y; - if (con.y < con.ymin) con.y = con.ymin; - if (con.y > con.ymax) con.y = con.ymax; - con.attr = asp->attr; - con.fcol = asp->fcol; - con.bcol = asp->bcol; - free(asp); -} - -static void EscSetAttr(int col) -{ - static u_char table[] = {0, 4, 2, 6, 1, 5, 3, 7}; - u_char swp; - - switch(col) { - case 0: /* off all attributes */ - con.bcol = 0; - con.fcol = 7; - con.attr = 0; - break; - case 1: /* highlight */ - con.attr |= ATTR_HIGH; - if (con.fcol) con.fcol |= 8; - break; - case 21: - con.attr &= ~ATTR_HIGH; - con.fcol &= ~8; - break; - case 4: /* ²¼Àþ */ - con.attr |= ATTR_ULINE; - con.bcol |= 8; - break; - case 24: - con.attr &= ~ATTR_ULINE; - con.bcol &= ~8; - break; - case 7: /* ȿž */ - if (!(con.attr & ATTR_REVERSE)) { - con.attr |= ATTR_REVERSE; - swp = con.fcol & 7; - if (con.attr & ATTR_ULINE) swp |= 8; - con.fcol = con.bcol & 7; - if (con.attr & ATTR_HIGH && con.fcol) con.fcol |= 8; - con.bcol = swp; - } - break; - case 27: - if (con.attr & ATTR_REVERSE) { - con.attr &= ~ATTR_REVERSE; - swp = con.fcol & 7; - if (con.attr & ATTR_ULINE) swp |= 8; - con.fcol = con.bcol & 7; - if (con.attr & ATTR_HIGH && con.fcol) con.fcol |= 8; - con.bcol = swp; - } - break; - case 10: - if (con.trans == CS_GRAPH) con.trans = CS_LEFT; - break; - case 11: - con.trans = CS_GRAPH; - break; - default: - if (col >= 30 && col <= 37) { - swp = table[col - 30]; - if (con.attr & ATTR_REVERSE) { - if (con.attr & ATTR_ULINE) swp |= 8; - con.bcol = swp; - } else { - if (con.attr & ATTR_HIGH) swp |= 8; - con.fcol = swp; - } - } else if (col >= 40 && col <= 47) { - swp = table[col - 40]; - if (con.attr & ATTR_REVERSE) { - if (con.attr & ATTR_HIGH) swp |= 8; - con.fcol = swp; - } else { - if (con.attr & ATTR_ULINE) swp |= 8; - con.bcol = swp; - } - } - break; - } -} - -static void VtSetMode(u_char mode, bool sw) -{ - switch(mode) { - case 4: - con.ins = sw; - break; - case 25: - cInfo.sw = sw; - break; - } -} - -static void -EscReport(u_char mode, u_short arg) -{ - static char report[LEN_REPORT]; - - switch(mode) { - case 'n': - if (arg == 6) { - int x = (con.x < con.xmax) ? con.x : con.xmax; - int y = (con.y < con.ymax) ? con.y : con.ymax; - sprintf(report, "\x1B[%d;%dR", y + 1, x + 1); - } else if (arg == 5) - strcpy(report, "\x1B[0n\0"); - break; - case 'c': - if (arg == 0) strcpy(report, "\x1B[?6c\0"); - break; - } - write(masterPty, report, strlen(report)); -} - -static void -SetRegion(int ymin, int ymax) -{ - con.ymin = ymin; - con.ymax = ymax; - con.x = 0; - if (con.y < con.ymin || con.y > con.ymax) con.y = con.ymin; - con.wrap = FALSE; - if (con.ymin || con.ymax != dInfo.tymax) - con.soft = TRUE; - else - con.soft = FALSE; -} - -void -SetWinSize() -{ - struct winsize win; - - win.ws_row = con.ymax + 1; - win.ws_col = dInfo.txmax + 1; - win.ws_xpixel = win.ws_ypixel = 0; - ioctl(masterPty, TIOCSWINSZ, &win); -} - -static void -EscStatusLine(u_char mode) -{ - static void EscBracket(u_char); - static struct attrStack *asp; - - switch(mode) { - case 'T': /* To */ - if (con.sl == SL_ENTER) break; - if (!asp) SaveAttr(&asp); - case 'S': /* Show */ - if (con.sl == SL_NONE) { - con.ymax = dInfo.tymax - 1; - SetWinSize(); - } - if (mode == 'T') { - con.sl = SL_ENTER; - SetRegion(dInfo.tymax, dInfo.tymax); - } - break; - case 'F': /* From */ - if (con.sl == SL_ENTER) { - con.sl = SL_LEAVE; - SetRegion(0, dInfo.tymax - 1); - if (asp) RestoreAttr(asp); - asp = NULL; - } - break; - case 'H': /* Hide */ - case 'E': /* Erase */ - if (con.sl == SL_NONE) break; - SetRegion(0, dInfo.tymax); - SetWinSize(); - con.sl = SL_NONE; - break; - default: - con.esc = EscBracket; - EscBracket(mode); - return; - } - con.wrap = FALSE; - con.esc = NULL; -} - -#define MAX_NARG 8 - -static void -EscBracket(u_char ch) -{ - u_char n; - static u_short varg[MAX_NARG], narg, question; - - if (ch >= '0' && ch <= '9') { - varg[narg] = (varg[narg] * 10) + (ch - '0'); - } else if (ch == ';') { - /* °ú¿ô¤Ï MAX_NARG ¤Þ¤Ç¤·¤«¥µ¥Ý¡¼¥È¤·¤Ê¤¤!! */ - if (narg < MAX_NARG) { - narg ++; - varg[narg] = 0; - } else con.esc = NULL; - } else { - con.esc = NULL; - switch(ch) { - case 'K': - TextClearEol(varg[0]); - break; - case 'J': - TextClearEos(varg[0]); - break; - case 'A': - con.y -= varg[0] ? varg[0]: 1; - if (con.y < con.ymin) { - scroll -= con.y - con.ymin; - con.y = con.ymin; - } - break; - case 'B': - con.y += varg[0] ? varg[0]: 1; - if (con.y > con.ymax) { - scroll += con.y - con.ymin; - con.y = con.ymax; - } - break; - case 'C': - con.x += varg[0] ? varg[0]: 1; - con.wrap = FALSE; - break; - case 'D': - con.x -= varg[0] ? varg[0]: 1; - con.wrap = FALSE; - break; - case 'G': - con.x = varg[0] ? varg[0] - 1: 0; - con.wrap = FALSE; - break; - case 'P': - TextDeleteChar(varg[0] ? varg[0]: 1); - break; - case '@': - TextInsertChar(varg[0] ? varg[0]: 1); - break; - case 'L': - TextMoveDown(con.y, con.ymax, - varg[0] ? varg[0] : 1); - break; - case 'M': - TextMoveUp(con.y, con.ymax, - varg[0] ? varg[0] : 1); - break; - case 'H': - case 'f': - if (varg[1]) con.x = varg[1] - 1; - else con.x = 0; - con.wrap = FALSE; - case 'd': - con.y = varg[0] ? varg[0] - 1: 0; - break; - case 'm': - for (n = 0; n <= narg; n ++) - EscSetAttr(varg[n]); - break; - case 'r': - n = varg[1] ? (varg[1] - 1): dInfo.tymax; - if (con.sl != SL_NONE) { - if (n == dInfo.tymax) n --; - } - SetRegion(varg[0] ? (varg[0] - 1): 0, n); - break; - case 'l': - for (n = 0; n <= narg; n ++) - VtSetMode(varg[n], FALSE); - break; - case 'h': - for (n = 0; n <= narg; n ++) - VtSetMode(varg[n], TRUE); - break; - case '?': - con.esc = EscStatusLine; -#if 0 - question = TRUE; - con.esc = EscBracket; -#endif - break; - case 's': - SaveAttr(NULL); - break; - case 'u': - RestoreAttr(NULL); - break; - case 'n': - case 'c': - if (question != TRUE) - EscReport(ch, varg[0]); - break; - case 'R': - break; - } - if (con.esc == NULL) - question = narg = varg[0] = varg[1] = 0; - } -} - -static - void EscSetDCodeG0(u_char ch) -{ - int i; - - switch(ch) { - case '(': /* EscSetDCodeG0 */ - case ')': /* EscSetDCodeG1 */ - return; - case '@': - ch = 'B'; - default: - i = 0; - while (fDRegs[i].sign0) { -#if 0 -{FILE *fp=fopen("errlog", "a"); -fprintf(fp,"[%d %c %s]\n", i, ch, fDRegs[i].registry); -fclose(fp);} -#endif - if (fDRegs[i].sign0 == ch) { - con.db = (u_char)i|LATCH_1; - break; - } - i ++; - } - con.trans = CS_DBCS; - break; - } - con.esc = NULL; -} - -static - void EscSetSCodeG0(u_char ch) -{ - int i=0; - - switch(ch) { - case '0': - con.g[0] = CS_GRAPH; - break; - case 'U': - con.g[0] = CS_GRAPH; - break; - default: - while (fSRegs[i].sign0) { - if (fSRegs[i].sign0 == ch) { - con.sb = (u_char)i; - con.g[0] = CS_LEFT; - break; - } else if (fSRegs[i].sign1 == ch) { - con.sb = (u_char)i; - con.g[0] = CS_RIGHT; - break; - } - i ++; - } - } - con.trans = con.g[0]; - con.esc = NULL; -} - -static - void EscSetSCodeG1(u_char ch) -{ - switch(ch) { - case 'U': - con.g[1] = CS_LEFT; - break; - case '0': - con.g[1] = CS_GRAPH; - break; - case 'A': - case 'J': - case 'B': - break; - } - con.trans = con.g[1]; - con.esc = NULL; -} - -static - void EscStart(u_char ch) -{ - con.esc = NULL; - switch(ch) { - case '[': - con.esc = EscBracket; - break; - case '$':/* Set Double Byte Code */ - con.esc = EscSetDCodeG0; - break; - case '(':/* Set 94 to G0 */ - case ',':/* Set 96 to G0 */ - con.esc = EscSetSCodeG0; - break; - case ')':/* Set G1 */ - con.esc = EscSetSCodeG1; - break; - case 'E': - con.x = 0; - con.wrap = FALSE; - case 'D': - if (con.y == con.ymax) scroll ++; - else con.y ++; - break; - case 'M': - if (con.y == con.ymin) scroll --; - else con.y --; - break; - case 'c': - con.fcol = 7; - con.attr = 0; - con.knj1 = con.bcol = 0; - con.wrap = FALSE; - con.trans = CS_LEFT; - con.sb = lInfo.sb; - con.db = lInfo.db|LATCH_1; - case '*': - con.x = con.y = 0; - con.wrap = FALSE; - TextClearAll(); - break; - case '7': - SaveAttr(NULL); - break; - case '8': - RestoreAttr(NULL); - con.wrap = FALSE; - break; - } -} - -static inline - bool iskanji(u_char c) -{ - switch(lInfo.sc) { - case CODE_SJIS: - return (c >=0x81 && c<=0x9F) || (c >=0xE0 && c <=0xFC); - default: - return (c & 0x80); - } -} - -void VtEmu(const char *buff, int nchars) -{ - u_char ch; - -#if 0 - { - FILE *fff; - fff = fopen("esc.log", "a"); - fwrite(buff, nchars, 1, fff); - fclose(fff); - } -#endif - - while (nchars-- > 0) { - ch = *buff; - buff ++; - if (! ch) - continue; - if (con.esc) { - con.esc(ch); - } else switch (ch) { - case CHAR_BEL: - Beep(); - break; - case CHAR_DEL: - break; - case CHAR_BS: - if (con.x) con.x --; - con.wrap = FALSE; - break; - case CHAR_HT: - con.x += con.tab - (con.x % con.tab); - con.wrap = FALSE; - if (con.x > con.xmax) con.x -= con.xmax + 1; - else break; - case CHAR_VT: - case CHAR_FF: -#if 1 - con.trans = CS_LEFT; - con.sb = lInfo.sb; - con.db = lInfo.db|LATCH_1; -#endif - case CHAR_LF: - con.wrap = FALSE; -/* if (con.sl != SL_ENTER) {*/ - if (con.y == con.ymax) scroll ++; - else con.y ++; -/* }*/ - break; - case CHAR_CR: - con.x = 0; - con.wrap = FALSE; - break; - case CHAR_ESC: - con.esc = EscStart; - continue; - case CHAR_SO: - con.trans = con.g[1] | G1_SET; - continue; - case CHAR_SI: - con.trans = con.g[0]; - continue; -/* case ' ': con.trans = CS_LEFT;*/ - default: - if (con.x == con.xmax + 1) { - con.wrap = TRUE; - con.x --; - } - if (con.wrap) { - con.x -= con.xmax; -/* if (con.sl != SL_ENTER) {*/ - if (con.y == con.ymax) scroll ++; - else con.y ++; -/* }*/ - con.wrap = FALSE; - buff --; - nchars ++; - break; - } - if (con.knj1) { - /* Âè 2 ´Á»ú¥â¡¼¥É */ - if (con.knj1 & 0x80) switch(lInfo.sc) { - case CODE_EUC: - if (con.knj1 == (u_char)CHAR_SS2) { - /* handling 'kata-kana' */ - if (con.ins) TextInsertChar(1); - TextSput(ch); - con.x ++; - con.knj1 = 0; - continue; - } - con.knj1 &= 0x7F; - ch &= 0x7F; - break; - case CODE_SJIS: - sjistojis(con.knj1, ch); - break; - } else { - if (con.db == (DF_BIG5_0|LATCH_1)) - muletobig5(con.db, con.knj1, ch); - } - if (con.ins) TextInsertChar(2); - TextWput(con.knj1, ch); - con.x += 2; - con.knj1 = 0; - continue; - } else if (con.trans == CS_DBCS - || (iskanji(ch) && con.trans == CS_LEFT)) { - /* Âè 1 ´Á»ú¥â¡¼¥É */ - if (con.x == con.xmax) con.wrap = TRUE; - con.knj1 = ch; - continue; - } else { - /* ANK ¥â¡¼¥É */ - if (con.ins) TextInsertChar(1); - TextSput(con.trans == CS_RIGHT ? ch | 0x80: ch); - con.x ++; - continue; - } - } - if (scroll > 0) { - ScrollUp(scroll); - } else if (scroll < 0) { - ScrollDown(- scroll); - } - scroll = 0; - } - if (con.x == con.xmax + 1) { - con.wrap = TRUE; - con.x --; - } -} - -static int ConfigCoding(const char *confstr) -{ - char reg[3][MAX_COLS]; - int n, i; - - *reg[0] = *reg[1] = *reg[2] = '\0'; - sscanf(confstr, "%s %s %s", reg[0], reg[1], reg[2]); - for (i = 0; i < 3 && *reg[i]; i ++) { - n = (int)CodingByRegistry(reg[i]); - if (n < 0) { - if (!strcasecmp(reg[i], "EUC")) - lInfo.sc = CODE_EUC; - else if (!strcasecmp(reg[i], "SJIS")) - lInfo.sc = CODE_SJIS; -/* - else if (!strcasecmp(reg[i], "BIG5")) - lInfo.sc = CODE_BIG5; -*/ - else - lInfo.sc = 0; - } else if (n & CHR_DBC) - lInfo.db = n & ~CHR_DFLD; - else - lInfo.sb = n & ~CHR_SFLD; -#if 0 -{FILE *fp=fopen("errlog", "a"); -fprintf(fp,"[<%s> %d %d %d %d]\n", reg[i], n, lInfo.sb, lInfo.db, lInfo.sc); -fclose(fp);} -#endif - } - return SUCCESS; -} - -void VtInit(void) -{ - con.text_mode = TRUE; - DefineCap("Coding", ConfigCoding, - "JISX0201.1976-0 JISX0208.1983-0 EUCJ"); -} - -void VtStart(void) -{ - /* xmax, ymax ¤Ï kon.cfg ¤òÆɤó¤À¸å¤Ç¤Ê¤¤¤Èʬ¤«¤é¤Ê¤¤¡£*/ - con.x = con.y = 0; - con.xmax = dInfo.txmax; - con.ymax = dInfo.tymax; - con.tab = 8; - con.fcol = 7; - con.attr = 0; - con.esc = NULL; - con.g[0] = con.g[1] = CS_LEFT; - con.trans = con.soft = con.ins = con.wrap = FALSE; - con.sb = lInfo.sb; - con.db = lInfo.db|LATCH_1; - con.active = cInfo.sw = TRUE; -} diff --git a/loader/kon2/termcap.kon b/loader/kon2/termcap.kon deleted file mode 100644 index cadba2ca8..000000000 --- a/loader/kon2/termcap.kon +++ /dev/null @@ -1,19 +0,0 @@ -kon|kanji on console:\ - :am:eo:mi:ms:ut:xn:xo:\ - :co#80:it#8:li#25:\ - :&7=^Z:@7=\E[4~:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:\ - :F1=\E[23~:F2=\E[24~:F3=\E[25~:F4=\E[26~:F5=\E[28~:\ - :F6=\E[29~:F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~:\ - :IC=\E[%d@:K2=\E[G:al=\E[L:bl=^G:cd=\E[J:ce=\E[K:\ - :ch=\E[%i%dG:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\ - :cs=\E[%i%d;%dr:ct=\E[3g:cv=\E[%i%dd:dc=\E[P:dl=\E[M:\ - :do=^J:ei=\E[4l:ho=\E[H:ic=\E[@:im=\E[4h:k1=\E[[A:\ - :k2=\E[[B:k3=\E[[C:k4=\E[[D:k5=\E[[E:k6=\E[17~:\ - :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kB=\E[Z:\ - :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=^H:kd=\E[B:\ - :kh=\E[1~:kl=\E[D:kr=\E[C:ku=\E[A:le=^H:mr=\E[7m:\ - :nd=\E[C:nw=^M^J:r1=\Ec:rc=\E8:sc=\E7:sf=^J:sr=\EM:\ - :st=\EH:ta=^I:u6=\E[%i%d;%dR:u7=\E[6n:u8=\E[?6c:\ - :u9=\E[c:up=\E[A:vb=200\E[?5h\E[?5l:ve=\E[?25h:\ - :vi=\E[?25l:tc=klone+sgr:tc=klone+color:\ - :hs:es:ts=\E[?T:fs=\E[?F:ds=\E[?H\E[?E: diff --git a/loader/kon2/terminfo.kon b/loader/kon2/terminfo.kon deleted file mode 100644 index b51d75e69..000000000 --- a/loader/kon2/terminfo.kon +++ /dev/null @@ -1,32 +0,0 @@ -kon|kanji on console, - am, bce, ccc, eo, mir, msgr, xenl, xon, - colors#8, cols#80, it#8, lines#25, ncv#3, pairs#64, - acsc=`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~q\304r\362s_t\303u\264v\301w\302x\263y\371z\372{\373|\374}\375~\376.\031-\030\054\021+^P0\333p\304r\304y\363z\362{\343|\330}\234, - bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, - clear=\E[H\E[J, cnorm=\E[?25h, cr=^M, - csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C, - cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, dch=\E[%p1%dP, - dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, - ed=\E[J, el=\E[K, flash=\E[?5h\E[?5l$<200/>, - home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, - ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, - ind=^J, initc=\E]P%p1%x%p2%02x%p3%02x%p4%02x, - invis=\E[8m, kb2=\E[G, kbs=\177, kcbt=\E[Z, - kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, - kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~, - kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, - kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, - kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, - kf4=\E[[D, kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, - kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~, - knp=\E[6~, kpp=\E[5~, kspd=^Z, nel=^M^J, oc=\E]R, - op=\E[m, rc=\E8, rev=\E[7m, ri=\EM, rmacs=\E[10m, - rmir=\E[4l, rmpch=\E[10m, rmso=\E[m, rmul=\E[24m, - rs1=\Ec, sc=\E7, setab=\E[4%p1%dm, - setaf=\E[3%p1%dm, setb=\E[%p1%{40}%+%dm, - setf=\E[%p1%{30}%+%dm, - sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, - sgr0=\E[0;10m, smacs=\E[11m, smir=\E[4h, - smpch=\E[11m, smso=\E[7m, smul=\E[4m, tbc=\E[3g, - u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?6c, u9=\E[c, - vpa=\E[%i%p1%dd, hs, eslok, tsl=\E[?T, fsl=\E[?F, dsl=\E[?H\E[?E, diff --git a/loader/kon2/tools/Configure.FreeBSD b/loader/kon2/tools/Configure.FreeBSD deleted file mode 100755 index 94d19b5e9..000000000 --- a/loader/kon2/tools/Configure.FreeBSD +++ /dev/null @@ -1,108 +0,0 @@ -#! /bin/sh - -CONFIG_H=include/config.h -CONFIG_IN=config.in.FreeBSD -CONFIG_OUT=config.out -CONFIG_MK=.config - -#if [ -f config.org ] -#then -# echo -n >$CONFIG_OUT -#else -# mv config.in config.org -#fi - -echo -n >$CONFIG_OUT - -cat << 'END' > $CONFIG_H - -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992, 1993 MAEDA Atusi (mad@math.keio.ac.jp) - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* - NOTE: This is automatically generated config. - >>>>>>>>>>>>>> DO NOT EDIT !! <<<<<<<<<<<<<< -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -END - -cat << 'END' > $CONFIG_MK - -TOPDIR = /usr/local -BINDIR = $(TOPDIR)/bin -LIBDIR = $(TOPDIR)/etc -MANDIR = $(TOPDIR)/man/ja_JP.EUC/man1 -CONFIG_NAME = kon.cfg -CFLAGS += -DCONFIG_NAME=\"$(LIBDIR)/$(CONFIG_NAME)\" - -END - -echo "KON Kanji ON FreeBSD console" - -while read mess -do - echo $mess >>$CONFIG_OUT - echo >>$CONFIG_H - echo '/*' $mess '*/' >>$CONFIG_H - read sig def - echo -n $mess '['$def']? ' - read ans < /dev/tty - if [ "$ans" = "" ] - then - ans=$def - fi - echo $sig $ans >>$CONFIG_OUT - if [ "$def" != "y" -a "$def" != "n" ] - then - if [ "$sig" = "SELECTION" ] - then - echo "#define" $ans >>$CONFIG_H - else - echo $expr >>$CONFIG_OUT - echo -n "#define "$sig" " >>$CONFIG_H - fi - else - if [ "$ans" = "y" ] - then - echo "#define" $sig >>$CONFIG_H - echo $sig" = "$sig >>$CONFIG_MK - fi - fi - prep=$ans -done - -#mv config.out config.in - -echo "#endif" >>$CONFIG_H - -cat << 'END' - -END diff --git a/loader/kon2/tools/Configure.linux b/loader/kon2/tools/Configure.linux deleted file mode 100755 index 153a05bba..000000000 --- a/loader/kon2/tools/Configure.linux +++ /dev/null @@ -1,119 +0,0 @@ -#! /bin/sh - -CONFIG_H=include/config.h -CONFIG_IN=config.in.linux -CONFIG_OUT=config.out -CONFIG_MK=.config - -#if [ -f config.org ] -#then -# echo -n >$CONFIG_OUT -#else -# mv config.in config.org -#fi -echo -n >$CONFIG_OUT - -cat << 'END' > $CONFIG_H - -/* - * KON2 - Kanji ON Console - - * Copyright (C) 1992, 1993 MAEDA Atusi (mad@math.keio.ac.jp) - * Copyright (C) 1992-1996 Takashi MANABE (manabe@papilio.tutics.tut.ac.jp) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY TAKASHI MANABE ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -/* - NOTE: This is automatically generated config. - >>>>>>>>>>>>>> DO NOT EDIT !! <<<<<<<<<<<<<< -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -END - -echo "INCDIR = "`pwd`/include > $CONFIG_MK -echo "LIB = "`pwd`/lib/libgon.a >> $CONFIG_MK - -cat << 'END' >> $CONFIG_MK - -TOPDIR = -BINDIR = $(TOPDIR)/usr/bin -LIBDIR = $(TOPDIR)/etc -MANDIR = $(TOPDIR)/usr/man/ja_JP.ujis/man1 -CONFIG_NAME = kon.cfg -OPTS = -DCONFIG_NAME=\"$(LIBDIR)/$(CONFIG_NAME)\" -I$(INCDIR) -CFLAGS = -O2 -Wall $(OPTS) -LD = gcc $(CFLAGS) -RM = rm -f -INSTALL = install -c -s - -END - -echo "KON Kanji ON Linux console" - -while read mess -do - echo $mess >>$CONFIG_OUT - echo >>$CONFIG_H - echo '/*' $mess '*/' >>$CONFIG_H - read sig def - echo -n $mess '['$def']? ' - read ans < /dev/tty - if [ "$ans" = "" ] - then - ans=$def - fi - echo $sig $ans >>$CONFIG_OUT - if [ "$def" != "y" -a "$def" != "n" ] - then - if [ "$sig" = "SELECTION" ] - then - echo "#define" $ans >>$CONFIG_H - else - echo $expr >>$CONFIG_OUT - echo -n "#define "$sig" " >>$CONFIG_H - fi - else - if [ "$ans" = "y" ] - then - echo "#define" $sig >>$CONFIG_H - echo $sig" = "$sig >>$CONFIG_MK - fi - fi - prep=$ans -done - -#mv config.out config.in - -echo "#endif" >>$CONFIG_H - -cat << 'END' >> $CONFIG_H - -#ifdef MINI_KON -#undef USE_ROMFONT -#define USE_ROMFONT -#endif - -END diff --git a/loader/kon2/tools/Makefile b/loader/kon2/tools/Makefile deleted file mode 100644 index 9b7ebd83e..000000000 --- a/loader/kon2/tools/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -TOOLS = swkon rel newvc mkminifont -SRCS = swkon.c rel.c newvc.c mkminifont.c - -ifeq (../.config,$(wildcard ../.config)) -include ../.config -endif - -ifdef SYSLOG_K -SYSTOOLS = syslogk -SYSSRCS = syslogk.c -SYSDIR = $(TOPDIR)/etc -endif -CC:=$(CC) -g - -LDFLAGS = -N -LOADLIBES = $(LIB) - -all: $(TOOLS) $(SYSTOOLS) - -depend .depend: - $(CC) $(CFLAGS) -M $(SRCS) $(SYSSRCS) > .depend - -clean: - $(RM) -f *.o $(TOOLS) $(SYSTOOLS) *~ .depend - -install: all - $(INSTALL) swkon $(BINDIR) - $(INSTALL) -m 4755 newvc $(BINDIR) -ifdef SYSLOG_K - $(INSTALL) $(SYSTOOLS) $(SYSDIR) -endif - -swkon: $(LIB) - -ifeq (.depend,$(wildcard .depend)) -include .depend -endif diff --git a/loader/kon2/tools/logto.c b/loader/kon2/tools/logto.c deleted file mode 100644 index d3abf4875..000000000 --- a/loader/kon2/tools/logto.c +++ /dev/null @@ -1,40 +0,0 @@ -#define LOGTO_C -#include <stdio.h> -#include <limits.h> -#include <sys/stat.h> -#include <sys/socket.h> - -#include <interface.h> - -void main(argc, argv) -int argc; -char *argv[]; -{ - int s, len; - char name[_POSIX_PATH_MAX], path[_POSIX_PATH_MAX]; - - if ((s = SocketClientOpen()) == -1) { - fprintf(stderr, "%s> connect fail.\n", argv[0]); - exit(EOF); - } - if (argc < 2) { - len = 0; - } else { - getcwd(path, _POSIX_PATH_MAX); - sprintf(name, "%s/%s", path, argv[1]); - len = strlen(name) + 1; - } - SocketSendStr(s, STR_LOGTO); - if (SocketRecCtrl(s) != CHR_ACK) { - fprintf(stderr, "%s> no answer.\n", argv[0]); - exit(EOF); - } - if (SocketSendData((void *)&len, sizeof(int), s) == EOF) { - fprintf(stderr, "%s> data length send error.\n", argv[0]); - exit(EOF); - } - if (SocketSendData(name, len, s) == EOF) { - fprintf(stderr, "%s> data send error.\n", argv[0]); - exit(EOF); - } -} diff --git a/loader/kon2/tools/makedir b/loader/kon2/tools/makedir deleted file mode 100755 index 54812e5c5..000000000 --- a/loader/kon2/tools/makedir +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -echo -n 'checking' $1 '...' - -if [ -d $1 ] -then - echo 'ok' -else - echo ' not exist' - mkdir -p $1 -fi diff --git a/loader/kon2/tools/minifont.list b/loader/kon2/tools/minifont.list deleted file mode 100644 index c89ac9da0..000000000 --- a/loader/kon2/tools/minifont.list +++ /dev/null @@ -1,2526 +0,0 @@ -¡¡ -¡¢ -¡£ -¡¤ -¡¥ -¡¦ -¡§ -¡¨ -¡© -¡ª -¡« -¡¬ -¡ -¡® -¡¯ -¡° -¡± -¡² -¡³ -¡´ -¡µ -¡¶ -¡· -¡¸ -¡¹ -¡º -¡» -¡¼ -¡½ -¡¾ -¡¿ -¡À -¡Á -¡Â -¡Ã -¡Ä -¡Å -¡Æ -¡Ç -¡È -¡É -¡Ê -¡Ë -¡Ì -¡Í -¡Î -¡Ï -¡Ð -¡Ñ -¡Ò -¡Ó -¡Ô -¡Õ -¡Ö -¡× -¡Ø -¡Ù -¡Ú -¡Û -¡Ü -¡Ý -¡Þ -¡ß -¡à -¡á -¡â -¡ã -¡ä -¡å -¡æ -¡ç -¡è -¡é -¡ê -¡ë -¡ì -¡í -¡î -¡ï -¡ð -¡ñ -¡ò -¡ó -¡ô -¡õ -¡ö -¡÷ -¡ø -¡ù -¡ú -¡û -¡ü -¡ý -¡þ -¢¡ -¢¢ -¢£ -¢¤ -¢¥ -¢¦ -¢§ -¢¨ -¢© -¢ª -¢« -¢¬ -¢ -¢® -¢º -¢» -¢¼ -¢½ -¢¾ -¢¿ -¢À -¢Á -¢Ê -¢Ë -¢Ì -¢Í -¢Î -¢Ï -¢Ð -¢Ü -¢Ý -¢Þ -¢ß -¢à -¢á -¢â -¢ã -¢ä -¢å -¢æ -¢ç -¢è -¢é -¢ê -¢ò -¢ó -¢ô -¢õ -¢ö -¢÷ -¢ø -¢ù -¢þ -£€ -£ -£‚ -£ƒ -£„ -£… -£† -£‡ -£ˆ -£‰ -£Š -£’ -£“ -£” -£• -£– -£— -£˜ -£™ -£ž -£° -£± -£² -£³ -£´ -£µ -£¶ -£· -£¸ -£¹ -£Á -£Â -£Ã -£Ä -£Å -£Æ -£Ç -£È -£É -£Ê -£Ë -£Ì -£Í -£Î -£Ï -£Ð -£Ñ -£Ò -£Ó -£Ô -£Õ -£Ö -£× -£Ø -£Ù -£Ú -£á -£â -£ã -£ä -£å -£æ -£ç -£è -£é -£ê -£ë -£ì -£í -£î -£ï -£ð -£ñ -£ò -£ó -£ô -£õ -£ö -£÷ -£ø -£ù -£ú -¤ -¤‚ -¤ƒ -¤„ -¤… -¤† -¤‡ -¤ˆ -¤‰ -¤Š -¤‹ -¤Œ -¤ -¤Ž -¤ -¤ -¤‘ -¤’ -¤“ -¤” -¤• -¤– -¤— -¤˜ -¤™ -¤š -¤¡ -¤¢ -¤£ -¤¤ -¤¥ -¤¦ -¤§ -¤¨ -¤© -¤ª -¤« -¤¬ -¤ -¤® -¤¯ -¤° -¤± -¤² -¤³ -¤´ -¤µ -¤¶ -¤· -¤¸ -¤¹ -¤º -¤» -¤¼ -¤½ -¤¾ -¤¿ -¤À -¤Á -¤Â -¤Ã -¤Ä -¤Å -¤Æ -¤Ç -¤È -¤É -¤Ê -¤Ë -¤Ì -¤Í -¤Î -¤Ï -¤Ð -¤Ñ -¤Ò -¤Ó -¤Ô -¤Õ -¤Ö -¤× -¤Ø -¤Ù -¤Ú -¤Û -¤Ü -¤Ý -¤Þ -¤ß -¤à -¤á -¤â -¤ã -¤ä -¤å -¤æ -¤ç -¤è -¤é -¤ê -¤ë -¤ì -¤í -¤î -¤ï -¤ð -¤ñ -¤ò -¤ó -¥€ -¥ -¥‚ -¥ƒ -¥„ -¥… -¥† -¥‡ -¥ˆ -¥‰ -¥Š -¥‹ -¥Œ -¥ -¥Ž -¥ -¥ -¥‘ -¥’ -¥“ -¥¡ -¥¢ -¥£ -¥¤ -¥¥ -¥¦ -¥§ -¥¨ -¥© -¥ª -¥« -¥¬ -¥ -¥® -¥¯ -¥° -¥± -¥² -¥³ -¥´ -¥µ -¥¶ -¥· -¥¸ -¥¹ -¥º -¥» -¥¼ -¥½ -¥¾ -¥¿ -¥À -¥Á -¥Â -¥Ã -¥Ä -¥Å -¥Æ -¥Ç -¥È -¥É -¥Ê -¥Ë -¥Ì -¥Í -¥Î -¥Ï -¥Ð -¥Ñ -¥Ò -¥Ó -¥Ô -¥Õ -¥Ö -¥× -¥Ø -¥Ù -¥Ú -¥Û -¥Ü -¥Ý -¥Þ -¥ß -¥à -¥á -¥â -¥ã -¥ä -¥å -¥æ -¥ç -¥è -¥é -¥ê -¥ë -¥ì -¥í -¥î -¥ï -¥ð -¥ñ -¥ò -¥ó -¥ô -¥õ -¥ö -¦€ -¦ -¦‚ -¦ƒ -¦„ -¦… -¦† -¦‡ -¦ˆ -¦‰ -¦Š -¦‹ -¦Œ -¦ -¦Ž -¦ -¦ -¦‘ -¦’ -¦“ -¦” -¦• -¦– -¦¡ -¦¢ -¦£ -¦¤ -¦¥ -¦¦ -¦§ -¦¨ -¦© -¦ª -¦« -¦¬ -¦ -¦® -¦¯ -¦° -¦± -¦² -¦³ -¦´ -¦µ -¦¶ -¦· -¦¸ -¦Á -¦Â -¦Ã -¦Ä -¦Å -¦Æ -¦Ç -¦È -¦É -¦Ê -¦Ë -¦Ì -¦Í -¦Î -¦Ï -¦Ð -¦Ñ -¦Ò -¦Ó -¦Ô -¦Õ -¦Ö -¦× -¦Ø -§¡ -§¢ -§£ -§¤ -§¥ -§¦ -§§ -§¨ -§© -§ª -§« -§¬ -§ -§® -§¯ -§° -§± -§² -§³ -§´ -§µ -§¶ -§· -§¸ -§¹ -§º -§» -§¼ -§½ -§¾ -§¿ -§À -§Á -§Ñ -§Ò -§Ó -§Ô -§Õ -§Ö -§× -§Ø -§Ù -§Ú -§Û -§Ü -§Ý -§Þ -§ß -§à -§á -§â -§ã -§ä -§å -§æ -§ç -§è -§é -§ê -§ë -§ì -§í -§î -§ï -§ð -§ñ -°¡ -°¥ -°¦ -° -°® -°µ -°· -°Â -°Å -°Æ -°Ê -°Ì -°Í -°Î -°Ï -°Ñ -°Ò -°Ó -°Õ -°Ö -°× -°Ù -°Û -°Ü -°Ý -°Þ -°ß -°á -°ã -°ä -°å -°æ -°è -°é -°ì -°í -°ï -°ð -°ò -°õ -°÷ -°ø -°ù -°ú -°û -±¡ -±¢ -±£ -±¤ -±¦ -±§ -±© -±« -±² -±º -±¿ -±À -±Ä -±Æ -±Ç -±É -±Ê -±Ë -±Ñ -±Ò -±Ó -±Ô -±Õ -±Ö -±× -±Ø -±Ù -±Ú -±Û -±Ü -±ß -±à -±ã -±ä -±ç -±è -±é -±ê -±ì -±î -±ï -±ó -±ô -±ö -±ø -±ú -±û -±ü -±ý -±þ -²¡ -²£ -²¤ -²¥ -²¦ -²§ -²« -² -²¯ -²° -²± -²µ -²· -²¸ -²¹ -²º -²» -²¼ -²½ -²¾ -²¿ -²Á -²Â -²Ã -²Ä -²Æ -²Ç -²È -²É -²Ê -²Ë -²Ì -²Í -²Î -²Ï -²Ð -²Ò -²Ô -²Õ -²Ö -²Ù -²Ú -²Û -²Ý -²ß -²á -²ã -²æ -²è -²ê -²ì -²í -²î -²ð -²ñ -²ò -²ó -²ô -²õ -²÷ -²ø -²ù -²û -²ü -²ý -²þ -³£ -³¤ -³¥ -³¦ -³§ -³¨ -³« -³¬ -³ -³¯ -³° -³² -³´ -³µ -³¶ -³¹ -³º -³À -³Å -³Æ -³È -³Ê -³Ë -³Ì -³Í -³Î -³Ï -³Ð -³Ñ -³Ó -³Ô -³Õ -³Ö -³× -³Ø -³Ù -³Ú -³Û -³Ý -³ã -³ä -³å -³ç -³è -³é -³ê -³ì -³í -³î -³ô -´¢ -´¥ -´§ -´¨ -´© -´ª -´« -´¬ -´ -´® -´° -´± -´² -´³ -´´ -´µ -´¶ -´· -´¸ -´¹ -´º -´½ -´¾ -´¿ -´À -´Á -´Ä -´Å -´Æ -´Ç -´É -´Ê -´Ë -´Ì -´Î -´Ï -´Ñ -´Ó -´Ô -´Õ -´Ö -´× -´Ø -´Ù -´Û -´Ý -´Þ -´ß -´ã -´ä -´è -´é -´ê -´ë -´í -´î -´ï -´ð -´ñ -´ó -´ô -´õ -´ö -´÷ -´ø -´ù -´ú -´û -´ü -´ý -´þ -µ¡ -µ¢ -µ¤ -µ¥ -µ§ -µ¨ -µª -µ¬ -µ -µ® -µ¯ -µ° -µ± -µ² -µ³ -µ´ -µ¶ -µ· -µ¹ -µº -µ» -µ¼ -µ½ -µ¾ -µ¿ -µÁ -µÄ -µÆ -µÈ -µÊ -µÍ -µÑ -µÒ -µÓ -µÔ -µÕ -µÖ -µ× -µÙ -µÚ -µÛ -µÜ -µÝ -µÞ -µß -µà -µá -µã -µå -µæ -µç -µé -µê -µë -µì -µí -µî -µï -µð -µñ -µò -µó -µõ -µö -µ÷ -µù -µû -µý -µþ -¶¡ -¶¥ -¶¦ -¶§ -¶¨ -¶« -¶ -¶® -¶¯ -¶² -¶³ -¶´ -¶µ -¶¶ -¶· -¶¸ -¶¹ -¶º -¶» -¶¼ -¶½ -¶¿ -¶À -¶Á -¶Ã -¶Ä -¶Å -¶Ç -¶È -¶É -¶Ê -¶Ë -¶Ì -¶Ð -¶Ñ -¶Ô -¶× -¶Ø -¶Ú -¶Û -¶Ý -¶ß -¶à -¶á -¶â -¶ã -¶ä -¶å -¶ç -¶è -¶ì -¶î -¶ñ -¶ò -¶ó -¶õ -¶ö -¶ø -¶ù -¶þ -·¡ -·¤ -·« -·¬ -·® -·¯ -·° -·± -·² -·³ -·´ -·¸ -·¹ -·º -·» -·¼ -·¿ -·À -·Á -·Â -·Ã -·Ä -·Æ -·Ç -·È -·É -·Ê -·Ì -·Ï -·Ð -·Ñ -·Ô -·Ö -·× -·Ù -·Ú -·Ü -·Ý -·Þ -·ß -·à -·â -·ã -·æ -·ç -·è -·é -·ê -·ë -·ì -·î -·ï -·ð -·ò -·ó -·ô -·õ -·÷ -·ø -·ù -·ú -·û -·ü -¸¡ -¸¢ -¸¤ -¸¥ -¸¦ -¸¨ -¸© -¸ª -¸« -¸¬ -¸ -¸® -¸¯ -¸± -¸² -¸³ -¸µ -¸¶ -¸· -¸¸ -¸¹ -¸º -¸» -¸¼ -¸½ -¸À -¸Â -¸Ä -¸Å -¸Æ -¸Ç -¸É -¸Ê -¸Ë -¸Ì -¸Í -¸Î -¸Ï -¸Ð -¸Ø -¸Û -¸Ü -¸Ý -¸Þ -¸ß -¸á -¸â -¸ä -¸å -¸æ -¸ç -¸ë -¸ì -¸í -¸î -¸ò -¸ô -¸õ -¸÷ -¸ø -¸ù -¸ú -¸ü -¸ý -¸þ -¹¡ -¹£ -¹¥ -¹¦ -¹§ -¹© -¹ª -¹¬ -¹ -¹¯ -¹± -¹² -¹³ -¹´ -¹µ -¹¶ -¹¹ -¹» -¹½ -¹¾ -¹¿ -¹Á -¹Â -¹Ã -¹Ä -¹Å -¹Æ -¹È -¹Ê -¹Ë -¹Ì -¹Í -¹Î -¹Ò -¹Ó -¹Ô -¹Õ -¹Ö -¹× -¹Ø -¹Ù -¹Ú -¹Û -¹Ý -¹ß -¹à -¹á -¹â -¹ä -¹æ -¹ç -¹é -¹ë -¹î -¹ï -¹ð -¹ñ -¹ò -¹ó -¹õ -¹ö -¹ø -¹ü -¹þ -º£ -º¤ -º¦ -º§ -º¨ -º© -º« -º¬ -º® -º° -º² -º´ -º¶ -º¸ -º¹ -ºº -º½ -º¾ -º¿ -ºÂ -ºÄ -ºÅ -ºÆ -ºÇ -ºÊ -ºË -ºÌ -ºÍ -ºÎ -ºÏ -ºÐ -ºÑ -ºÒ -ºÕ -º× -ºØ -ºÙ -ºÚ -ºÛ -ºÜ -ºÝ -ºÞ -ºß -ºà -ºá -ºâ -ºä -ºé -ºê -ºî -ºï -ºñ -ºò -ºö -º÷ -ºø -ºù -ºý -ºþ -»¡ -»£ -»¤ -»¥ -»¦ -»¨ -»® -»° -»± -»² -»³ -»´ -»¶ -»· -»º -»» -»½ -»¿ -»À -»Ã -»Ä -»Å -»Ç -»È -»É -»Ê -»Ë -»Ì -»Í -»Î -»Ï -»Ð -»Ñ -»Ò -»Ô -»Õ -»Ö -»× -»Ø -»Ù -»Ü -»Ý -»Þ -»ß -»à -»á -»ã -»ä -»å -»æ -»ç -»è -»é -»ê -»ë -»ì -»í -»î -»ï -»ð -»ñ -»ò -»ó -»ô -»õ -»ö -»÷ -»ø -»ù -»ú -»û -»ü -»ý -»þ -¼¡ -¼¢ -¼£ -¼¥ -¼§ -¼¨ -¼ª -¼« -¼ -¼° -¼± -¼´ -¼· -¼¹ -¼º -¼¼ -¼¾ -¼¿ -¼À -¼Á -¼Â -¼Ç -¼Ë -¼Ì -¼Í -¼Î -¼Ï -¼Ð -¼Ñ -¼Ò -¼Ô -¼Õ -¼Ö -¼× -¼Ø -¼Ù -¼Ú -¼Û -¼Ü -¼ß -¼à -¼á -¼ã -¼ä -¼å -¼ç -¼è -¼é -¼ê -¼ë -¼ì -¼í -¼î -¼ï -¼ñ -¼ò -¼ó -¼ô -¼õ -¼÷ -¼ø -¼ù -¼û -¼ü -¼ý -¼þ -½¡ -½¢ -½£ -½¤ -½¥ -½¦ -½¨ -½© -½ª -½¬ -½ -½® -½° -½± -½µ -½· -½¸ -½¹ -½» -½¼ -½½ -½¾ -½À -½Á -½Â -½Ã -½Ä -½Å -½Æ -½Ç -½É -½Ê -½Ë -½Ì -½Í -½Î -½Ï -½Ð -½Ñ -½Ò -½Ó -½Õ -½Ö -½Ú -½Û -½Ü -½Þ -½à -½á -½â -½ã -½ä -½å -½ç -½è -½é -½ê -½ë -½î -½ï -½ð -½ñ -½ô -½õ -½ö -½÷ -½ø -½ù -½ü -½ý -½þ -¾¡ -¾¢ -¾£ -¾¤ -¾¦ -¾§ -¾© -¾¬ -¾ -¾® -¾¯ -¾° -¾² -¾´ -¾µ -¾¶ -¾· -¾¸ -¾º -¾¼ -¾½ -¾¾ -¾Â -¾Ã -¾Ä -¾Æ -¾Ç -¾È -¾É -¾Ê -¾Ë -¾Ì -¾Í -¾Î -¾Ï -¾Ð -¾Ñ -¾Ò -¾Ó -¾× -¾Ù -¾Ú -¾Û -¾Ü -¾Ý -¾Þ -¾â -¾ã -¾å -¾æ -¾è -¾é -¾ê -¾ë -¾ì -¾í -¾î -¾ï -¾ð -¾ò -¾ô -¾õ -¾ö -¾ø -¾ù -¾ú -¾û -¾ü -¾þ -¿¢ -¿£ -¿¥ -¿¦ -¿§ -¿¨ -¿© -¿« -¿ -¿® -¿¯ -¿° -¿± -¿² -¿³ -¿´ -¿µ -¿¶ -¿· -¿¹ -¿» -¿¼ -¿½ -¿¿ -¿À -¿Â -¿Ã -¿Å -¿Æ -¿Ç -¿È -¿É -¿Ê -¿Ë -¿Ì -¿Í -¿Î -¿Ï -¿Ò -¿Ó -¿Ô -¿× -¿Ø -¿Ý -¿Þ -¿á -¿â -¿ã -¿ä -¿å -¿æ -¿ç -¿è -¿ê -¿ë -¿ì -¿î -¿ï -¿ñ -¿ò -¿ô -¿õ -¿ø -¿ù -À¡ -À£ -À¤ -À¥ -À¦ -À§ -À© -Àª -À« -À¬ -À -À® -À¯ -À° -À± -À² -Àµ -À¶ -À· -À¸ -À¹ -Àº -À» -À¼ -À½ -À¾ -À¿ -ÀÀ -ÀÁ -À -ÀÄ -ÀÅ -ÀÆ -ÀÇ -ÀÉ -ÀÊ -ÀË -ÀÍ -ÀÎ -ÀÏ -ÀÐ -ÀÑ -ÀÒ -ÀÓ -ÀÕ -ÀÖ -À× -ÀÚ -ÀÛ -ÀÜ -ÀÝ -ÀÞ -Àß -Àà -Àá -Àâ -Àã -Àä -Àå -Àç -Àè -Àé -Àê -Àë -Àì -Àî -Àï -Àð -Àò -Àô -Àõ -Àö -À÷ -Àø -Àû -Àþ -Á¡ -Á¥ -Á¦ -Á© -Áª -Á« -Á¬ -Á -Á¯ -Á° -Á± -Á² -Á³ -Á´ -Áµ -Á¶ -Áº -Á¼ -Á -Áà -ÁÄ -ÁÅ -ÁÆ -ÁÇ -ÁÈ -ÁÊ -ÁË -ÁÎ -ÁÏ -ÁÐ -ÁÒ -ÁÓ -ÁÔ -ÁÕ -ÁØ -ÁÛ -ÁÜ -ÁÝ -ÁÞ -Áà -Áá -Áâ -Áã -Áå -Áç -Áè -Áê -Áë -Áí -Áð -Áñ -Áò -Áô -Áõ -Áö -Á÷ -Áø -Áú -Áû -Áü -Áý -Áþ -¡ -¢ -£ -¤ -Â¥ -¦ -§ -¨ -© -« -¬ - -® -¯ -° -± -² -³ -´ -¸ -¹ -º -» -¼ -¾ -¿ -ÂÀ -ÂÄ -ÂÅ -ÂÆ -ÂÇ -ÂÌ -ÂÎ -ÂÐ -ÂÑ -ÂÓ -ÂÔ -ÂÕ -ÂÖ -ÂØ -ÂÙ -ÂÚ -ÂÛ -ÂÞ -Âß -Âà -Âá -Ââ -Âå -Âæ -Âç -Âè -Âê -Âì -Âî -Âð -Âò -Âó -Âô -Âõ -Â÷ -Âù -Âú -â -ã -Ã¥ -æ -ê -ë -ð -ñ -ò -ô -õ -ø -ú -û -ü -ÃÀ -à-Ãà -ÃÄ -ÃÅ -ÃÆ -ÃÇ -ÃÈ -ÃÊ -ÃË -ÃÌ -ÃÍ -ÃÎ -ÃÏ -ÃÑ -ÃÓ -ÃÔ -ÃÕ -ÃÖ -Ã× -ÃÙ -ÃÛ -ÃÜ -ÃÝ -Ãß -Ãà -Ãá -Ãâ -Ãã -Ãä -Ãå -Ãæ -Ãç -Ãè -Ãé -Ãê -Ãë -Ãì -Ãí -Ãî -Ãï -Ãò -Ãó -Ãø -Ãù -Ãú -Ãû -Ä¢ -Ä£ -Ĥ -Ä¥ -Ħ -ħ -Ĩ -Ä© -Ä« -Ĭ -Ä® -į -Ä° -ı -IJ -Ä´ -Ķ -Ä· -Ĺ -ĺ -Ä» -ļ -ľ -Ä¿ -ÄÀ -ÄÁ -Ä -Äà -ÄÄ -ÄÅ -ÄÆ -ÄÉ -ÄË -ÄÌ -ÄÍ -ÄÒ -ÄÚ -Äà -Äâ -Äã -Ää -Äå -Äç -Äè -Äé -Äê -Äë -Äì -Äí -Äî -Äï -Äñ -Äó -Äø -Äù -Äú -Äû -Äþ -Å¡ -Å¥ -Ŧ -Ũ -Å© -Ū -Å« -Ŭ -ů -Å° -ű -ų -Å´ -ŵ -Å· -Ÿ -Ź -ź -ž -ÅÀ -ÅÁ -Å -ÅÄ -ÅÅ -ÅÇ -ÅÉ -ÅÌ -ÅÍ -ÅÏ -ÅÐ -ÅÓ -ÅÔ -ÅØ -ÅÙ -ÅÚ -ÅÛ -ÅÜ -ÅÝ -ÅÞ -Åß -Åà -Åá -Åâ -Åã -Åç -Åé -Åê -Åë -Åì -Åí -Åï -Åð -Åò -Åô -Åö -Å÷ -Åù -Åú -Åû -Åü -Åý -Åþ -Ƥ -Æ¥ -Ʀ -Ƨ -ƨ -Æ© -Æ« -Ƭ -Æ -Æ® -Ư -Æ° -Ʊ -Ʋ -Ƴ -ƶ -Ƹ -ƹ -Æ» -Ƽ -ƽ -Æ¿ -ÆÀ -ÆÁ -Æà -ÆÄ -ÆÆ -ÆÇ -ÆÈ -ÆÉ -ÆÌ -ÆÍ -ÆÏ -ÆÖ -ÆÚ -ÆÞ -Æß -Æâ -Æì -Æî -Æð -Æñ -Æó -Æô -Æõ -Æù -Æü -Æý -Æþ -Ç¡ -Ç¢ -Ǥ -Ç¥ -Ǧ -ǧ -Ç« -Ç -Ç® -ǯ -Ç° -dz -Ç´ -Ǻ -Ç» -Ǽ -ǽ -Ǿ -ÇÀ -ÇÄ -ÇÆ -ÇÈ -ÇÉ -ÇË -ÇÌ -ÇÏ -ÇÐ -ÇÑ -ÇÒ -ÇÓ -ÇÔ -ÇÕ -ÇØ -ÇÙ -ÇÚ -ÇÛ -ÇÜ -ÇÝ -ÇÞ -Çß -Çã -Çä -Çå -Çæ -Çì -Çî -Çï -Çñ -Çò -Çõ -Çö -Ç÷ -Çù -Çú -Çû -Çþ -È¢ -È© -Ȫ -Ȭ -È -ȯ -ȱ -Ȳ -ȳ -È´ -ȶ -ȼ -Ƚ -Ⱦ -È¿ -ÈÁ -È -ÈÄ -ÈÇ -ÈÈ -ÈÉ -ÈÊ -ÈË -ÈÌ -ÈÍ -ÈÎ -ÈÏ -ÈÑ -ÈÒ -ÈÓ -ÈÕ -ÈÖ -È× -ÈÚ -ÈÜ -ÈÝ -ÈÞ -Èà -Èá -Èâ -Èã -Èä -Èæ -Èç -Èè -Èé -Èê -Èë -Èí -Èî -Èï -Èñ -Èò -Èó -Èô -È÷ -Èø -Èù -Èþ -É¡ -ɤ -ɬ -É® -ɱ -É´ -ɶ -ɸ -ɹ -ɺ -ɼ -ɽ -ɾ -ÉÁ -É -Éà -ÉÄ -ÉÊ -ÉÍ -ÉÏ -ÉÐ -ÉÑ -ÉÒ -ÉÓ -ÉÔ -ÉÕ -É× -ÉØ -ÉÙ -ÉÛ -ÉÜ -ÉÝ -ÉÞ -Éß -Éá -Éâ -Éã -Éä -Éå -Éæ -Éè -Éé -Éê -Éë -Éí -Éî -Éð -Éñ -Éô -Éõ -É÷ -Éú -Éû -Éü -Éý -Éþ -Ê¡ -Ê¢ -Ê£ -ʤ -ʧ -ʨ -Ê© -ʪ -ʬ -Ê® -ʯ -Ê° -ʳ -Ê´ -ʶ -Ê· -ʸ -ʹ -ʺ -Ê» -ʼ -ʽ -ʾ -Ê¿ -ÊÀ -ÊÁ -Ê -ÊÄ -ÊÅ -ÊÆ -ÊÉ -ÊÊ -ÊÌ -ÊÐ -ÊÑ -ÊÒ -ÊÔ -ÊÕ -ÊÖ -Ê× -ÊØ -ÊÙ -ÊÛ -ÊÝ -ÊÞ -Êá -Êâ -Êä -Êæ -Êç -Êè -Êé -Êë -Êì -Êí -Êï -Êð -Êñ -Êó -Êô -Êõ -Êö -Êø -Êú -Êü -Êý -Ë¡ -Ë¢ -ˤ -Ë¥ -˦ -˧ -Ë« -ˬ -Ë -Ë® -Ë° -˳ -Ë´ -˵ -˶ -Ë· -˸ -˹ -˺ -Ë» -˼ -˽ -˾ -Ë¿ -ËÀ -ËÁ -Ë -Ëà -ËÄ -ËÅ -ËÇ -ËÉ -ËÌ -ËÍ -ËÏ -ËÐ -ËÑ -ËÒ -Ë× -ËÙ -ËÛ -ËÜ -ËÝ -ËÞ -Ëß -Ëà -Ëá -Ëâ -Ëã -Ëä -Ëå -Ëç -Ëè -Ëë -Ëì -Ëô -Ëõ -Ëö -Ëú -Ëü -Ëý -Ëþ -Ì¡ -Ì£ -̤ -Ì¥ -̨ -Ì© -Ì® -̯ -̱ -̲ -̳ -Ì´ -̵ -Ì· -̸ -Ì» -̼ -̾ -Ì¿ -ÌÀ -ÌÁ -Ì -Ìà -ÌÄ -ÌÇ -ÌÈ -ÌÊ -ÌÌ -ÌÏ -ÌÐ -ÌÑ -ÌÓ -ÌÔ -ÌÕ -ÌÖ -Ì× -ÌÚ -ÌÛ -ÌÜ -Ìá -Ìä -Ìæ -Ìç -Ìè -Ìë -Ìî -Ìð -Ìñ -Ìò -Ìó -Ìô -Ìõ -Ìö -Ìø -Ìû -Ìý -Ìþ -Í¡ -Í¢ -Í£ -Í¥ -ͦ -ͧ -Í© -ͪ -Í« -Í -ͱ -ͳ -͵ -Ͷ -Í· -͹ -ͺ -Í» -ͼ -ͽ -; -Í¿ -ÍÀ -Í -ÍÄ -ÍÆ -ÍÇ -ÍÈ -ÍÉ -ÍÊ -ÍË -ÍÍ -ÍÎ -ÍÏ -ÍÑ -ÍÒ -ÍÓ -ÍÕ -Í× -ÍØ -ÍÙ -ÍÛ -ÍÜ -ÍÞ -Íß -Íá -Íâ -Íã -Íå -Íç -Íè -Íê -Íë -Íí -Íî -Íï -Íð -Íñ -Íó -Íô -Í÷ -Íø -Íù -Íú -Íý -Ρ -΢ -Τ -Î¥ -Φ -Χ -Ψ -Ω -ά -ή -α -β -γ -δ -ε -θ -ι -κ -λ -ν -ξ -ÎÀ -ÎÁ -Îà -ÎÄ -ÎÅ -ÎÈ -ÎÉ -ÎÌ -ÎÍ -ÎÎ -ÎÏ -ÎÐ -ÎÑ -ÎÒ -ÎÓ -Î× -ÎØ -ÎÙ -ÎÝ -ÎÞ -Îß -Îà -Îá -Îã -Îä -Îå -Îé -Îë -Îì -Îí -Îî -Îï -Îð -Îñ -Îò -Îó -Îô -Îõ -Îö -Î÷ -Îø -Îý -Ï¢ -Ï£ -ϧ -Ï© -Ϫ -Ï« -Ï -ϯ -Ï° -ϲ -ϳ -Ï· -Ϻ -Ï» -Ï¿ -ÏÀ -Ï -Ïà -ÏÅ -ÏÇ -ÏÈ -ÏÑ -ÏÓ diff --git a/loader/kon2/tools/mkminifont.c b/loader/kon2/tools/mkminifont.c deleted file mode 100644 index f94b41a98..000000000 --- a/loader/kon2/tools/mkminifont.c +++ /dev/null @@ -1,40 +0,0 @@ -#include <stdio.h> -#include <errno.h> -#include <interface.h> -#include <fnld.h> - -struct _fontent { - unsigned short code; - unsigned char bitmap[32]; -} fent[65535]; - -void -main() -{ - unsigned short code, max=0; - unsigned int fnt, i, num=0; - unsigned char line[10], *font, bytes, high; - struct fontInfo *fi; - struct fontRegs *freg=&fDRegs[1]; - - if ((font = GetShmem(1|CHR_DFLD)) == NULL) { - perror("GetShmem"); - exit(-1); - } - fi = (struct fontInfo *)font; - high = fi->high; - bytes = sizeof(fent[0].code) + high * 2; - font += sizeof(struct fontInfo); - while (fgets(line, sizeof(line), stdin)) { - code = ((line[0] << 8) & 0x7F00) | (line[1] & 0x7F); - if (code > max) max = code; - fnt = freg->addr(line[0] & 0x7F, line[1] & 0x7F); - fent[num].code = code; - memcpy(fent[num].bitmap, font + fnt, 32); - num ++; - } - fwrite(&high, sizeof(high), 1, stdout); - fwrite(&max, sizeof(max), 1, stdout); - for (i = 0; i < num; i ++) if (fent[i].code) - fwrite(&fent[i], bytes, 1, stdout); -} diff --git a/loader/kon2/tools/newvc.c b/loader/kon2/tools/newvc.c deleted file mode 100644 index 3b60e7e5f..000000000 --- a/loader/kon2/tools/newvc.c +++ /dev/null @@ -1,167 +0,0 @@ -/* Newvc - run a program in another virtual console */ - -/* Copyright (C) 1992 by MAEDA Atusi (mad@math.keio.ac.jp) */ -/* Version 0.1 92/1/11 */ -/* Version 0.2 92/1/19 */ - -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <unistd.h> -#include <limits.h> -#include <pwd.h> -#include <utmp.h> -#include <time.h> -#include <sys/file.h> -#include <sys/ioctl.h> -#include <sys/kd.h> -#include <sys/vt.h> -#include <sys/wait.h> - -#define MAXTTYLEN 12 - -#define MAXCMDLEN 4096 - -char cmdBuf[MAXCMDLEN]; - -char *progName; -char newTtyName[MAXTTYLEN]; - -void error(const char *message, const char *perrorMessage) { - fprintf(stderr, "%s: %s\n", progName, message); - if (perrorMessage) { - perror(perrorMessage); - } - exit(EXIT_FAILURE); -} - -struct passwd *pw; -struct utmp ut; - -void setUtmpEntry(int pid) { - - pw = getpwuid(getuid()); - setutent(); /* open utmp */ - strncpy(ut.ut_id, newTtyName + strlen("/dev/tty"), sizeof(ut.ut_id)); - ut.ut_type = DEAD_PROCESS; - getutid(&ut); /* set position */ - /* Set up the new entry. */ - ut.ut_type = USER_PROCESS; - strncpy(ut.ut_line, newTtyName + strlen("/dev/"), sizeof(ut.ut_line)); - strncpy(ut.ut_user, (pw && pw->pw_name) ? pw->pw_name : "????", - sizeof(ut.ut_user)); -/* - gethostname(ut.ut_host, sizeof(ut.ut_host)); -*/ - ut.ut_pid = pid; - ut.ut_time = time(NULL); - pututline(&ut); - endutent(); /* close utmp */ -} - -void restoreUtmpEntry(int pid) { - struct utmp *utp; - - pw = getpwuid(getuid()); - setutent(); /* open utmp */ - strncpy(ut.ut_id, newTtyName + strlen("/dev/tty"), sizeof(ut.ut_id)); - ut.ut_type = USER_PROCESS; - utp = getutid(&ut); /* search entry */ - /* Set up the new entry. */ - if (utp && utp->ut_pid == pid) { - ut.ut_type = DEAD_PROCESS; - ut.ut_time = time(NULL); - pututline(&ut); - } - endutent(); /* close utmp */ -} - -int main(int argc, char* argv[]) { - int curVcNum, newVcNum; - int consoleFd = 0; - int newVcFd; - int childPid; - struct vt_stat vts; - - progName = argv[0]; - - if ((consoleFd = open("/dev/console", 0)) < 0) { - error("can't open console", "/dev/console"); - } - - ioctl(consoleFd, VT_GETSTATE, &vts); - curVcNum = vts.v_active; - - ioctl(consoleFd, VT_OPENQRY, &newVcNum); - if (newVcNum < 0) { - error("can't find unused virtual console", NULL); - } - sprintf(newTtyName, "/dev/tty%d", newVcNum); - - setsid(); - - if ((newVcFd = open(newTtyName, O_RDWR)) < 0) { - error("can't open virtual console", newTtyName); - } - if (ioctl(consoleFd, VT_ACTIVATE, newVcNum) != 0) { - error("can't switch virtual console", "ioctl VT_ACTIVATE"); - } - - dup2(newVcFd, 0); - dup2(newVcFd, 1); - dup2(newVcFd, 2); - - if ((childPid = fork()) < 0) { - error("fork failed", "fork"); - } - if (childPid) { - /* Parent process. */ - int status; - - setUtmpEntry(childPid); - - wait(&status); - - restoreUtmpEntry(childPid); - - if (ioctl(0, VT_ACTIVATE, curVcNum) != 0) { - error("couldn't restore original console", "ioctl(0, VT_ACTIVATE)"); - } - return WEXITSTATUS(status); - } else { - /* Child process. */ - char *shell, *command; - char *newArgv[] = {"/bin/sh", "-c", cmdBuf, NULL}; - - setuid(getuid()); - setgid(getgid()); - - if ((shell = getenv("SHELL")) == NULL) { - shell = "/bin/sh"; - } - if (argc == 1) { - /* No command specified. Run shell as default. */ - if ((command = rindex(shell, '/')) == NULL) { - command = shell; - } else { - command++; - } - newArgv[1] = NULL; - } else { - int i; - - command = argv[1]; - for (i = 1; i < argc; i++) { - strncat(cmdBuf, argv[i], MAXCMDLEN); - strncat(cmdBuf, " ", MAXCMDLEN); - } - } - newArgv[0] = command; - - execv(shell, newArgv); - - error("can't exec", shell); - - return EXIT_FAILURE; - } -} diff --git a/loader/kon2/tools/rel.c b/loader/kon2/tools/rel.c deleted file mode 100644 index d5e8afd78..000000000 --- a/loader/kon2/tools/rel.c +++ /dev/null @@ -1,18 +0,0 @@ -#include <sys/types.h> -#include <sys/kd.h> -#include <sys/vt.h> -#include <sys/ioctl.h> - -int main(void) -{ - struct vt_mode vtm; - - ioctl(0, KDSETMODE, KD_TEXT); - vtm.mode = VT_AUTO; - vtm.waitv = 0; - vtm.relsig = 0; - vtm.acqsig = 0; - ioctl(0, VT_SETMODE, &vtm); - - return 0; -} diff --git a/loader/kon2/tools/swkon.c b/loader/kon2/tools/swkon.c deleted file mode 100644 index d750e30a4..000000000 --- a/loader/kon2/tools/swkon.c +++ /dev/null @@ -1,88 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <errno.h> -#include <string.h> -#include <ctype.h> -#include <sys/stat.h> -#include <sys/socket.h> -#include <signal.h> - -#include <interface.h> - -const char *progName; - -int OpenSocket(void) -{ - int s; - - if ((s = SocketClientOpen()) == -1) { - fprintf(stderr, "%s> connect fail.\n", progName); - exit(EXIT_FAILURE); - } - return s; -} - -int WaitAck(int s) -{ - struct messageHeader mh; - bzero(&mh, sizeof(mh)); - SocketRecCommand(s, &mh); - if (mh.cmd != CHR_ACK) { - fprintf(stderr, "%s> no answer.\n", progName); - return EXIT_FAILURE; - } - return EXIT_SUCCESS; -} - -int ChangeMode(char cmd) -{ - int s = OpenSocket(); - SocketSendCommand(s, cmd); - return WaitAck(s); -} - -int ResetKon(int argc, const char *argv[]) -{ - int s = OpenSocket(); - int i, len; - - SocketSendCommand(s, CHR_RESTART); - if (WaitAck(s) != EXIT_SUCCESS) - return EXIT_FAILURE; - write(s, &argc, sizeof(argc)); - for (i = 0; i < argc; i++) { - len = strlen(argv[i]); - write(s, &len, sizeof(len)); - write(s, argv[i], len); - } - return EXIT_SUCCESS; -} - -void usage(void) -{ - fprintf(stderr, "usage:\n" - " %s -h|-help (print this help)\n" - " %s -t (switch to text mode)\n" - " %s -g (switch to graphics mode)\n" - " %s [video] [-capability value ...] (reset KON)\n", - progName, progName, progName, progName); -} - -int main(int argc, const char *argv[]) -{ - progName = argv[0]; - - if (argc == 2) { - if (strcasecmp(argv[1], "-h") == 0 || strcasecmp(argv[1], "-help") == 0) { - usage(); - return EXIT_SUCCESS; - } else if (strcasecmp(argv[1], "-t") == 0) - return ChangeMode(CHR_TEXTMODE); - else if (strcasecmp(argv[1], "-g") == 0) - return ChangeMode(CHR_GRAPHMODE); - else if (strcasecmp(argv[1], "-s") == 0) - return ChangeMode(CHR_STAT); - } - return ResetKon(argc - 1, argv + 1); -} diff --git a/loader/lang.c b/loader/lang.c deleted file mode 100644 index 1c979d6d0..000000000 --- a/loader/lang.c +++ /dev/null @@ -1,679 +0,0 @@ -#include <alloca.h> -#include <errno.h> -#include <fcntl.h> -#include <netinet/in.h> -#include <newt.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/ioctl.h> -#include <unistd.h> - -#include <glob.h> /* XXX rpmlib.h */ -#include <dirent.h> /* XXX rpmlib.h */ - -#include <linux/keyboard.h> -#include <linux/kd.h> - -#include "isys/cpio.h" -#include "loader.h" -#include "lang.h" -#include "log.h" -#include "misc.h" -#include "windows.h" -#include "stubs.h" -#include "kickstart.h" - -#define errorWindow(String) \ - newtWinMessage(_("Error"), _("OK"), String, strerror (errno)); - -extern int haveKon; - -struct aString { - unsigned int hash; - short length; - char * str; -} ; - -struct aString * strings = NULL; -int numStrings = 0, allocedStrings = 0; - -static char * topLineWelcome = N_("Welcome to %s"); -static char * bottomHelpLine = N_(" <Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen "); - -static int aStringCmp(const void * a, const void * b) { - const struct aString * first = a; - const struct aString * second = b; - - if (first->hash < second->hash) - return -1; - else if (first->hash == second->hash) - return 0; - - return 1; -} - -char * translateString(char * str) { - unsigned int sum = 0, xor = 0; - int len = 0; - char * chptr; - struct aString * match; - struct aString key; - - for (chptr = str; *chptr; chptr++) { - sum += *chptr; - xor ^= *chptr; - len++; - } - - key.hash = (sum << 16) | ((xor & 0xFF) << 8) | (len & 0xFF); - - match = bsearch(&key, strings, numStrings, sizeof(*strings), aStringCmp); - if (!match) - return str; - - return match->str; -} - -struct langInfo { - char * lang, * key, * font, * map, * lc_all, * keyboard; -} ; - -static struct langInfo * languages = NULL; -static int numLanguages = 0; - -static void loadLanguageList(int flags) { - char * file = FL_TESTING(flags) ? "../lang-table" : - "/etc/lang-table"; - FILE * f; - char line[256]; - char name[256], key[256], font[256], map[256], code[256], - keyboard[256], timezone[256]; - int lineNum = 0; - - f = fopen(file, "r"); - if (!f) { - newtWinMessage(_("Error"), _("OK"), "cannot open %s: %s", - file, strerror (errno)); - return; - } - - while (fgets(line, sizeof(line), f)) { - lineNum++; - languages = realloc(languages, sizeof(*languages) * (numLanguages + 1)); - if (sscanf(line, "%s %s %s %s %s %s %s\n", name, key, font, map, - code, keyboard, timezone) != 7) { - logMessage("bad line %d in lang-table", lineNum); - } else { - languages[numLanguages].lang = strdup(name); - languages[numLanguages].key = strdup(key); - languages[numLanguages].font = strdup(font); - languages[numLanguages].map = strdup(map); - languages[numLanguages].lc_all = strdup(code); - languages[numLanguages].keyboard = strdup(keyboard); - numLanguages++; - } - } -} - -void loadLanguage (char * file, int flags) { - char filename[200]; - gzFile stream; - int fd, hash, rc; - char * key = getenv("LANGKEY"); - - if (!key || !strcmp(key, "en_US")) { - if (strings) { - free(strings), strings = NULL; - numStrings = allocedStrings = 0; - } - return; - } - - if (!file) { - file = filename; - if (FL_TESTING(flags)) - sprintf(filename, "loader.tr"); - else - sprintf(filename, "/etc/loader.tr"); - } - - stream = gunzip_open(file); - - if (!stream) { - newtWinMessage("Error", "OK", "Translation for %s is not available. " - "The Installation will proceed in English.", key); - return ; - } - - sprintf(filename, "%s.tr", key); - - rc = installCpioFile(stream, filename, "/tmp/translation", 1); - gunzip_close(stream); - - if (rc || access("/tmp/translation", R_OK)) { - newtWinMessage("Error", "OK", "Cannot get translation file %s.\n", - filename); - return; - } - - fd = open("/tmp/translation", O_RDONLY); - if (fd < 0) { - newtWinMessage("Error", "OK", "Failed to open /tmp/translation: %s\n", - strerror(errno)); - return; - } - - while (read(fd, &hash, 4) == 4) { - if (allocedStrings == numStrings) { - allocedStrings += 10; - strings = realloc(strings, sizeof(*strings) * allocedStrings); - } - - strings[numStrings].hash = ntohl(hash); - read(fd, &strings[numStrings].length, 2); - strings[numStrings].length = ntohs(strings[numStrings].length); - strings[numStrings].str = malloc(strings[numStrings].length + 1); - read(fd, strings[numStrings].str, strings[numStrings].length); - strings[numStrings].str[strings[numStrings].length] = '\0'; - numStrings++; - } - - close(fd); - unlink("/tmp/translation"); - - qsort(strings, numStrings, sizeof(*strings), aStringCmp); -} - -static int loadFont(char * fontFile, int flags) { - char font[8192]; - unsigned short map[E_TABSZ]; - struct unimapdesc d; - struct unimapinit u; - struct unipair desc[2048]; - int fd; - gzFile stream; - int rc; - - if (!strcmp(fontFile, "None") || !strcmp(fontFile, "Kon")) return 0; -#if 0 - if (!FL_TESTING(flags)) { -#endif - stream = gunzip_open("/etc/fonts.cgz"); - if (!stream) { - newtWinMessage("Error", "OK", - "Cannot open fonts: %s", strerror(errno)); - return LOADER_ERROR; - } - - rc = installCpioFile(stream, fontFile, "/tmp/font", 1); - gunzip_close(stream); - if (rc || access("/tmp/font", R_OK)) { - return LOADER_ERROR; - } - - fd = open("/tmp/font", O_RDONLY); - read(fd, font, sizeof(font)); - read(fd, map, sizeof(map)); - read(fd, &d.entry_ct, sizeof(d.entry_ct)); - d.entries = desc; - read(fd, desc, d.entry_ct * sizeof(desc[0])); - close(fd); - - if (ioctl(1, PIO_FONT, font)) - logMessage("PIO_FONT failed: %s", strerror(errno)); - - if (ioctl(1, PIO_UNIMAPCLR, &u)) - logMessage("PIO_UNIMAPCLR failed: %s", strerror(errno)); - - if (ioctl(1, PIO_UNIMAP, &d)) - logMessage("PIO_UNIMAP failed: %s", strerror(errno)); - - if (ioctl(1, PIO_UNISCRNMAP, map)) - logMessage("PIO_UNISCRNMAP failed: %s", strerror(errno)); - - fprintf(stderr, "\033(K"); -#if 0 - } -#endif - return 0; -} - -void setLanguage (char * key, int flags) { - int i; - - if (!languages) loadLanguageList(flags); - - for (i = 0; i < numLanguages; i++) { - if (!strcmp(languages[i].key, key)) { - if (!strcmp(languages[i].font, "Kon") && !haveKon) - break; - if (!strcmp(languages[i].font, "None")) - break; - setenv("LANG", languages[i].lc_all, 1); - setenv("LANGKEY", languages[i].key, 1); - setenv("LC_ALL", languages[i].lc_all, 1); - setenv("LINGUAS", languages[i].lc_all, 1); - loadLanguage (NULL, flags); - if (languages[i].map) - loadFont(languages[i].map, 0); - break; - } - } -} - -int chooseLanguage(char ** lang, int flags) { - int choice = 0; - char ** langs; - int i; - int english = 0; - int current = -1; - extern int continuing; - char * currentLangName = getenv("LANG"); - int numLangs = 0; - char * langPicked; - char * buf; - - if (!languages) loadLanguageList(flags); - - langs = alloca(sizeof(*langs) * (numLanguages + 1)); - - for (i = 0; i < numLanguages; i++) { - /* If we're running in kon, only offer languages which use the - Kon or default8x16 fonts. Don't display languages which require - Kon font if we have no way of providing it. */ - if (continuing && strcmp(languages[i].font, "Kon") && - continuing && strcmp(languages[i].font, "default8x16")) - continue; - - if (!strncmp(languages[i].key, "en", 2)) - english = numLangs; - if (currentLangName && - !strcmp(languages[i].lc_all, currentLangName)) - current = numLangs; - - langs[numLangs++] = languages[i].lang; - } - - langs[numLangs] = NULL; - - if (current >= 0) - choice = current; - else - choice = english; - - newtWinMenu(_("Choose a Language"), - _("What language would you like to use during the " - "installation process?"), 40, 5, 5, 8, - langs, &choice, _("OK"), NULL); - - langPicked = langs[choice]; - for (i = 0; i < numLanguages; i++) { - if (!strcmp(langPicked, languages[i].lang)) { - *lang = languages[i].lc_all; - choice = i; - break; - } - } - - /* this can't happen */ - if (i == numLanguages) abort(); - - if (!strncmp(languages[choice].key, "en", 2)) { - char *buf; - /* stick with the default (English) */ - unsetenv("LANG"); - unsetenv("LANGKEY"); - unsetenv("LC_ALL"); - unsetenv("LINGUAS"); - if (strings) { - free(strings), strings = NULL; - numStrings = allocedStrings = 0; - } - buf = sdupprintf(_(topLineWelcome), PRODUCTNAME); - newtDrawRootText(0, 0, buf); - free(buf); - newtPushHelpLine(_(bottomHelpLine)); - - return 0; - } - - /* only set the environment variables when we actually have a way - to display the language */ - if ((!strcmp(languages[choice].font, "Kon") && haveKon) || - (strcmp(languages[choice].font, "None") && - strcmp(languages[choice].font, "Kon"))) { - setenv("LANG", languages[choice].lc_all, 1); - setenv("LANGKEY", languages[choice].key, 1); - setenv("LC_ALL", languages[choice].lc_all, 1); - setenv("LINGUAS", languages[choice].lc_all, 1); - } - - if (strings) { - free(strings), strings = NULL; - numStrings = allocedStrings = 0; - } - - if (haveKon) { - extern void stopNewt(void); - - if (!strcmp (languages[choice].font, "Kon") && !continuing) { - char * args[4]; - - stopNewt(); - - args[0] = "kon"; - args[1] = "-e"; - args[2] = FL_TESTING(flags) ? "./loader" : "/sbin/continue"; - args[3] = NULL; - - execv(FL_TESTING(flags) ? "./loader" : "/sbin/loader", args); - } - } - - /* load the language only if it is displayable */ - /* If we need kon and have it, or if it's not kon or none, load the lang */ - if ((!strcmp(languages[choice].font, "None")) || - ((!strcmp(languages[choice].font, "Kon")) && (!haveKon))) { - newtWinMessage("Language Unavailable", "OK", - "%s display is unavailable in text mode. The " - "installation will continue in English until the " - "display of %s is possible.", languages[choice].lang, - languages[choice].lang); - } else { - loadLanguage (NULL, flags); - } - - if (languages[choice].map) - loadFont(languages[choice].map, flags); - - - buf = sdupprintf(_(topLineWelcome), PRODUCTNAME); - newtDrawRootText(0, 0, buf); - free(buf); - newtPushHelpLine(_(bottomHelpLine)); - - return 0; -} - -#ifdef __sparc__ -struct defaultKeyboardByLang { - char * lang, * keyboard; -} defaultSunKeyboards[] = { - { "fi_FI", "sunt5-fi-latin1" }, - { "cs_CZ", "sunt5-cz-us" }, - { NULL, NULL } }; -#endif - -/* the file pointer must be at the beginning of the section already! */ -static int loadKeymap(gzFile stream) { - int console; - int kmap, key; - struct kbentry entry; - int keymaps[MAX_NR_KEYMAPS]; - int count = 0; - int magic; - short keymap[NR_KEYS]; - - if (gunzip_read(stream, &magic, sizeof(magic)) != sizeof(magic)) { - logMessage("failed to read kmap magic: %s", strerror(errno)); - return LOADER_ERROR; - } - - if (magic != KMAP_MAGIC) { - logMessage("bad magic for keymap!"); - return LOADER_ERROR; - } - - if (gunzip_read(stream, keymaps, sizeof(keymaps)) != sizeof(keymaps)) { - logMessage("failed to read keymap header: %s", strerror(errno)); - return LOADER_ERROR; - } - - - console = open("/dev/console", O_RDWR); - if (console < 0) { - logMessage("failed to open /dev/console: %s", strerror(errno)); - return LOADER_ERROR; - } - - for (kmap = 0; kmap < MAX_NR_KEYMAPS; kmap++) { - if (!keymaps[kmap]) continue; - - if (gunzip_read(stream, keymap, sizeof(keymap)) != sizeof(keymap)) { - logMessage("failed to read keymap data: %s", strerror(errno)); - close(console); - return LOADER_ERROR; - } - - count++; - for (key = 0; key < NR_KEYS; key++) { - entry.kb_index = key; - entry.kb_table = kmap; - entry.kb_value = keymap[key]; - if (KTYP(entry.kb_value) != KT_SPEC) { - if (ioctl(console, KDSKBENT, &entry)) { - close(console); - logMessage("keymap ioctl failed: %s", strerror(errno)); - } - } - } - } - - logMessage("loaded %d keymap tables", count); - - close(console); - - return 0; -} - -int chooseKeyboard(char ** keymap, char ** kbdtypep, int flags) { - int num = -1; - int rc; - gzFile f; - struct kmapHeader hdr; - struct kmapInfo * infoTable; - char ** kbds; - char buf[16384]; /* I hope this is big enough */ - int i; - char * defkbd = keymap ? *keymap : NULL; - char *lang; - int argc; - char **argv; - -#ifdef __sparc__ -#define KBDTYPE_SUN 0 -#define KBDTYPE_PC 1 - struct defaultKeyboardByLang * kbdEntry; - int kbdtype = -1; - int j; -#endif - - if (FL_SERIAL (flags)) return LOADER_NOOP; - - /*if (testing) return 0;*/ - -#ifdef __sparc__ -#if 0 - if (kickstart) { - kbdtype = KBDTYPE_SUN; - if (!ksGetCommand(KS_CMD_KBDTYPE, NULL, &argc, &argv)) { - if (argc < 2) { - logMessage("no argument passed to keyboard " - "kickstart command"); - } else { - if (!strcasecmp (argv[1], "sun")) - kbdtype = KBDTYPE_SUN; - else if (!strcasecmp (argv[1], "pc")) - kbdtype = KBDTYPE_PC; - } - } - } else -#endif /* kickstart sparc crap */ - { - char twelve = 12; - int fd; - - if (ioctl (0, TIOCLINUX, &twelve) < 0) - kbdtype = KBDTYPE_SUN; /* probably serial console, but one should not call us in such a case */ - else { - fd = open("/dev/kbd", O_RDWR); - if (fd < 0) - kbdtype = KBDTYPE_PC; /* if PC keyboard, then there is no driver for /dev/kbd */ - else { - close(fd); - kbdtype = KBDTYPE_SUN; - } - } - } -#endif /* sparc */ - - if (!languages) loadLanguageList(flags); - - lang = getenv("LANG"); - if (!defkbd && lang) { - for (i = 0; i < numLanguages; i++) { - if (!strncmp(languages[i].lc_all, lang, 2)) { - defkbd = languages[i].keyboard; - break; - } - } - -#ifdef __sparc__ - if (kbdtype == KBDTYPE_SUN) - kbdEntry = defaultSunKeyboards; - while (kbdEntry->lang && - strcmp(kbdEntry->lang, getenv("LANG"))) - kbdEntry++; - if (kbdEntry->keyboard) defkbd = kbdEntry->keyboard; -#endif /* more sparc drain bamage */ - } - if (!defkbd) -#ifdef __sparc__ - if (kbdtype == KBDTYPE_SUN) - defkbd = "sunkeymap"; - else -#endif /* sparc drain bamage */ - defkbd = "us"; - - f = gunzip_open("/etc/keymaps.gz"); - if (!f) { - errorWindow("cannot open /etc/keymaps.gz: %s"); - return LOADER_ERROR; - } - - if (gunzip_read(f, &hdr, sizeof(hdr)) != sizeof(hdr)) { - errorWindow("failed to read keymaps header: %s"); - gunzip_close(f); - return LOADER_ERROR; - } - - logMessage("%d keymaps are available", hdr.numEntries); - - i = hdr.numEntries * sizeof(*infoTable); - infoTable = alloca(i); - if (gunzip_read(f, infoTable, i) != i) { - errorWindow("failed to read keymap information: %s"); - gunzip_close(f); - return LOADER_ERROR; - } - - if (FL_KICKSTART(flags)) { - if (!ksGetCommand(KS_CMD_KEYBOARD, NULL, &argc, &argv)) { - if (argc < 2) { - logMessage("no argument passed to keyboard " - "kickstart command"); - } else { - for (i = 0; i < hdr.numEntries; i++) - if (!strcmp(infoTable[i].name, argv[1])) break; -#ifdef __sparc__ - if (i < hdr.numEntries) { - if (kbdtype == KBDTYPE_SUN && strncmp (argv[1], "sun", 3)) - i = hdr.numEntries; - else if (kbdtype == KBDTYPE_PC && !strncmp (argv[1], "sun", 3)) - i = hdr.numEntries; - } -#endif - if (i < hdr.numEntries) - num = i; - else - newtWinMessage("Kickstart Error", "OK", "Bad keymap " - "name %s passed to kickstart command.", - argv[1]); - } - } - } - - if (num == -1 ) { -#ifdef __sparc__ - kbds = alloca(sizeof(*kbds) * (hdr.numEntries + 1)); - for (j = 0, i = 0; j < hdr.numEntries; j++) { - if (kbdtype == KBDTYPE_SUN && strncmp (infoTable[j].name, "sun", 3)) - continue; - else if (kbdtype == KBDTYPE_PC && !strncmp (infoTable[j].name, "sun", 3)) - continue; - kbds[i] = infoTable[j].name; - i++; - } -#else - kbds = alloca(sizeof(*kbds) * (hdr.numEntries + 1)); - for (i = 0; i < hdr.numEntries; i++) { - kbds[i] = infoTable[i].name; - } -#endif - - kbds[i] = NULL; - qsort(kbds, i, sizeof(*kbds), simpleStringCmp); - - for (i = 0; i < hdr.numEntries; i++) - if (!strcmp(kbds[i], defkbd)) - num = i; - - rc = newtWinMenu(_("Keyboard Type"), - _("What type of keyboard do you have?"), - 40, 5, 5, 8, kbds, &num, _("OK"), _("Back"), NULL); - if (rc == 2) return LOADER_BACK; - - /* num needs to index the right keyboard infoTable */ - for (i = 0; i < hdr.numEntries; i++) - if (!strcmp(kbds[num], infoTable[i].name)) break; - num = i; - } - - rc = 0; - -#ifdef __sparc__ - for (j = 0, i = 0; i < hdr.numEntries; i++) { - if (kbdtype == KBDTYPE_SUN && strncmp (infoTable[i].name, "sun", 3)) - continue; - if (kbdtype == KBDTYPE_PC && !strncmp (infoTable[i].name, "sun", 3)) - continue; - if (j == num) { - num = i; - break; - } - j++; - } -#endif - - for (i = 0; i < num; i++) { - if (gunzip_read(f, buf, infoTable[i].size) != infoTable[i].size) { - logMessage("error reading %d bytes from file: %s", - infoTable[i].size, strerror(errno)); - gunzip_close(f); - rc = LOADER_ERROR; - } - } - - if (!rc) rc = loadKeymap(f); - - gunzip_close(f); - - if (keymap) *keymap = strdup(infoTable[num].name); - -#ifdef __sparc__ - if (kbdtypep) *kbdtypep = (kbdtype == KBDTYPE_SUN) ? "sun" : "pc"; -#endif - - return rc; -} diff --git a/loader/lang.h b/loader/lang.h deleted file mode 100644 index 10b3ef4aa..000000000 --- a/loader/lang.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef _LANG_H_ -#define _LANG_H_ - -#define _(x) translateString (x) -#define N_(foo) (foo) - -int chooseLanguage(char ** lang, int flags); -int chooseKeyboard(char ** keymap, char ** kbdtypep, int flags); -char * translateString(char * str); -void setLanguage (char * key, int flags); - -/* define ask johnsonm@redhat.com where this came from */ -#define KMAP_MAGIC 0x8B39C07F -#define KMAP_NAMELEN 40 /* including '\0' */ - -struct kmapHeader { - int magic; - int numEntries; -}; - -struct kmapInfo { - int size; - char name[KMAP_NAMELEN]; -}; - - -#endif /* _LANG_H_ */ diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390 deleted file mode 100755 index 291249060..000000000 --- a/loader/linuxrc.s390 +++ /dev/null @@ -1,260 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2000,2001 by -# Bernhard Rosenkraenzer <bero@redhat.com> -# Oliver Paukstadt <opaukstadt@millenux.com> -# Karsten Hopp <karsten@redhat.de> -# Florian La Roche <laroche@redhat.com> -# Nils Philippsen <nils@redhat.de> -# Helge Deller <hdeller@redhat.de> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -debugshell() -{ - echo "You have defined DEBUG, so here is a shell. You can use 'exit'" - echo "to go on with the normal installation process." - /bin/sh -} - -startinetd() -{ - echo - echo "Starting telnetd and sshd to allow login over the network." - /sbin/inetd - echo "Generating ssh keys, This can take a while..." - (cd /etc/ssh - echo " Generating host_key" - ssh-keygen -q -t rsa1 -f ssh_host_key -C '' -N '' >/dev/null 2>&1 - echo " Generating rsa_key" - ssh-keygen -q -t rsa -f ssh_host_rsa_key -C '' -N '' >/dev/null 2>&1 - echo " Generating dsa_key" - ssh-keygen -q -t dsa -f ssh_host_dsa_key -C '' -N '' >/dev/null 2>&1 - chmod 600 ssh_host_key ssh_host_rsa_key ssh_host_dsa_key - chmod 644 *.pub - echo "Done" - ) - /sbin/sshd - while : ; do - echo - echo "Please connect now to $IPADDR and start 'rhsetup' or start" - echo "'rhsetup nointeractive' from this shell." - /bin/sh -l - done - # /sbin/mingetty console --noclear -} - - -echo "Starting the S390 initrd to configure networking. Version is 0.24." - -PATH="/bin:/sbin:/usr/bin:/usr/sbin" -export PATH - -#mount -n -o remount,rw / -mount -t proc none /proc -mount -t devpts none /dev/pts - -ifconfig lo 127.0.0.1 netmask 255.0.0.0 -route add -host 127.0.0.1 dev lo - -[ -n "$DEBUG" ] && debugshell - -# Parse configuration -if [ -n "$HOST" ]; then - set -- `echo $HOST |sed 's/:/ /g'` - HNAME=$1 - DEVICE=$2 - NETTYPE=`echo $DEVICE |sed -e 's/[0-9].*//'` - IPADDR=$3 - if [ ":$NETTYPE" = ":iucv" ]; then - IUCV="iucv=$4" - GATEWAY=$5 - MTU=$6 - elif [ ":$NETTYPE" = ":ctc" ]; then - GATEWAY=$4 - MTU=$5 - else - MTU=$4 - fi -fi -if [ -n "$MTU" ]; then - MMTU="mtu $MTU" -fi -if [ -n "$NETWORK" ]; then - set -- `echo $NETWORK | sed 's/:/ /g'` - NETWORKIP=$1 - NETMASK=$2 - BROADCAST=$3 - if [ ":$NETTYPE" != ":ctc" ] && [ ":$NETTYPE" != ":iucv" ]; then - GATEWAY=$4 - fi -fi - -# Check for missing parameters, prompt for them if necessary -while [ -z "$HNAME" ]; do - echo "Please enter the FQDN of your new virtual machine (e.g. s390.redhat.com):" - read HNAME -done -while [ -z "$DEVICE" ]; do - echo "Please enter the network device you intend to use (e.g. ctc0, iucv0, eth0, tr0):" - read DEVICE - NETTYPE=`echo $DEVICE |sed -e 's/[0-9].*//'` -done -while [ -z "$IPADDR" ]; do - echo "Please enter the IP address of your new virtual machine:" - read IPADDR -done -if [ ":$NETTYPE" = ":eth" ] || [ ":$NETTYPE" = ":tr" ]; then - while [ -z "$NETMASK" ]; do - echo "Please enter your netmask (e.g. 255.255.255.0):" - read NETMASK - done - while [ -z "$BROADCAST" ]; do - echo "Please enter your broadcast address:" - read BROADCAST - done - while [ -z "$NETWORKIP" ]; do - echo "Please enter your network address:" - read NETWORKIP - done - while [ -z "$GATEWAY" ]; do - echo "Please enter your default gateway:" - read GATEWAY - done - while [ -z "$LCS" ] && [ -z "$QETH" ]; do - echo "(1) for OSA-2 with LCS or (2) for OSA-Express with QDIO/QETH" - read INF - while [ -z "$LCS" ] && [ ":$INF" = ":1" ]; do - echo "OSA Device address (e.g. fc20,1 - or \"auto\" (may not work)):" - read LCS - done - while [ -z "$QETH" ] && [ ":$INF" = ":2" ]; do - echo "OSA-Express Device address (e.g. 0xf000,0xf001,0xf002 - or \"auto\" (may not work)):" - read QETH - done - done -else - while [ -z "$GATEWAY" ]; do - echo "Enter the IP of your ctc/iucv point-to-point partner:" - read GATEWAY - done - if [ ":$NETTYPE" = ":iucv" ]; then - while [ -z "$IUCV" ]; do - echo "Enter iucv kernel module options (usually iucv=HOST):" - read IUCV - done - fi -fi - -# configure network-interface -if [ ":$NETTYPE" = ":ctc" ]; then - insmod ctc $CTC - ifconfig $DEVICE $IPADDR $MMTU pointopoint $GATEWAY - route add -host $IPADDR dev $DEVICE -elif [ ":$NETTYPE" = ":iucv" ]; then - insmod netiucv $IUCV - ifconfig $DEVICE $IPADDR $MMTU pointopoint $GATEWAY - route add -host $IPADDR dev $DEVICE -else - if [ -z "$QETH" ]; then - if [ ":$LCS" = ":auto" ]; then - LCS="" - else - LCS=`echo $LCS | sed -e '/^0x\|^0X/ b; s/^/0x/'` - LCS="noauto=1 devno_portno_pairs=$LCS" - fi - insmod -f /lib/lcs.o $LCS - else - if [ ":$QETH" = ":auto" ]; then - QETH="qeth_options=" - else - QETH="qeth_options=noauto,$QETH" - fi - insmod -f /lib/qdio.o - insmod -f /lib/qeth.o $QETH - fi - ifconfig $DEVICE $IPADDR $MMTU netmask $NETMASK broadcast $BROADCAST - route add -net $NETWORKIP netmask $NETMASK dev $DEVICE -fi -route add default gw $GATEWAY dev $DEVICE - -[ -n "$HNAME" ] && hostname $HNAME - -# show interfaces and routing table -ifconfig -a -route -n - -[ -n "$DEBUG" ] && debugshell - -echo "Starting portmap." -portmap - -# convert to space-separated lists -DNS=`echo $DNS |sed -e 's/:/ /g'` -SEARCHDNS=`echo $SEARCHDNS |sed -e 's/:/ /g'` - -# transfer options into install environment -cat > /tmp/install.cfg <<EOF -HNAME="$HNAME" -DEVICE="$DEVICE" -NETTYPE="$NETTYPE" -IPADDR="$IPADDR" -GATEWAY="$GATEWAY" -MTU="$MTU" -NETWORKIP="$NETWORKIP" -NETMASK="$NETMASK" -BROADCAST="$BROADCAST" -INSTALL="$INSTALL" -INTERACTIVE="$INTERACTIVE" -DNS="$DNS" -SEARCHDNS="$SEARCHDNS" -RPMSERVER="$RPMSERVER" -MOUNTS="$MOUNTS" -FORCEDASDFORMAT="$FORCEDASDFORMAT" -SWAP="$SWAP" -DASD="$DASD" -LCS="$LCS" -QETH="$QETH" -IUCV="$IUCV" -CTC="$CTC" -DTZ="$DTZ" -ROOTPW="$ROOTPW" -CROOTPW="$CROOTPW" -export HNAME DEVICE NETTYPE IPADDR GATEWAY MTU INTERACTIVE -export NETWORKIP NETMASK BROADCAST INSTALL DNS SEARCHDNS FORCEDASDFORMAT -export RPMSERVER MOUNTS SWAP DASD LCS QETH IUCV DTZ ROOTPW CROOTPW -EOF -# immediately read it in again to export these into the shell below -. /tmp/install.cfg - -[ -n "$DEBUG" ] && debugshell - -if [ ":$INTERACTIVE" = ":0" ]; then - rhsetup nointeractive || startinetd -else - startinetd -fi - -umount -a -umount /proc -#umount / - -exit 0 -# vim:ts=3:sw=3 -# ;;; Local Variables: *** -# ;;; mode: sh *** -# ;;; tab-width:3 *** -# ;;; end: *** diff --git a/loader/loader.c b/loader/loader.c deleted file mode 100644 index 51a24077e..000000000 --- a/loader/loader.c +++ /dev/null @@ -1,3957 +0,0 @@ -/* - * loader.c - * - * This is the installer loader. Its job is to somehow load the rest - * of the installer into memory and run it. This may require setting - * up some devices and networking, etc. The main point of this code is - * to stay SMALL! Remember that, live by that, and learn to like it. - * - * Erik Troan <ewt@redhat.com> - * Matt Wilson <msw@redhat.com> - * Michael Fulbright <msf@redhat.com> - * Jeremy Katzj <katzj@redhat.com> - * - * Copyright 1997 - 2002 Red Hat, Inc. - * - * This software may be freely redistributed under the terms of the GNU - * public license. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#include <arpa/inet.h> -#include <ctype.h> -#include <dirent.h> -#include <errno.h> -#include <fcntl.h> -#include <kudzu/kudzu.h> -#include <net/if.h> -#include <newt.h> -#include <popt.h> -#include <syslog.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/ioctl.h> -#include <sys/signal.h> -#include <sys/socket.h> -#include <sys/sysmacros.h> -#include <sys/utsname.h> -#include <unistd.h> -#include <sys/vt.h> -#include <linux/fb.h> - -#if !defined(__s390__) && !defined(__s390x__) -#include <linux/cdrom.h> -#endif - -#include <popt.h> -/* Need to tell loop.h what the actual dev_t type is. */ -#undef dev_t -#if defined(__alpha) || (defined(__sparc__) && defined(__arch64__)) -#define dev_t unsigned int -#else -#if defined(__x86_64__) -#define dev_t unsigned long -#else -#define dev_t unsigned short -#endif -#endif -#include <linux/loop.h> -#undef dev_t -#define dev_t dev_t - -#include "balkan/balkan.h" -#include "isys/imount.h" -#include "isys/isys.h" -#include "isys/probe.h" -#include "stubs.h" - -#include "cdrom.h" -#include "devices.h" -#include "kickstart.h" -#include "lang.h" -#include "loader.h" -#include "log.h" -#include "mediacheck.h" -#include "misc.h" -#include "modules.h" -#include "net.h" -#include "pcmcia.h" -#include "urls.h" -#include "windows.h" - -int probe_main(int argc, char ** argv); -int combined_insmod_main(int argc, char ** argv); -int cardmgr_main(int argc, char ** argv); -int ourInsmodCommand(int argc, char ** argv); -int kon_main(int argc, char ** argv); -static int mountLoopback(char * fsystem, char * mntpoint, char * device); -static int umountLoopback(char * mntpoint, char * device); -int copyDirectory(char * from, char * to); -static char * mediaCheckISODir(char *path); -static void useMntSourceUpdates(char * path); -static int getISOStatusFromFD(int isof, char *mediasum); -static int getISOStatusFromFile(char *path, char *mediasum); -static int getISOStatusFromCDROM(char *cddriver, char *mediasum); -static void writeISOStatus(int status, char *mediasum); - -#if defined(__ia64__) -static char * floppyDevice = "hda"; -#else -static char * floppyDevice = "fd0"; -#endif - -struct knownDevices devices; - -struct installMethod { - char * name; - int network; - enum deviceClass deviceType; /* for pcmcia */ - char * (*mountImage)(struct installMethod * method, - char * location, struct knownDevices * kd, - moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags); -}; - -#ifdef INCLUDE_LOCAL -static char * mountCdromImage(struct installMethod * method, - char * location, struct knownDevices * kd, - moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags); -static char * mountHardDrive(struct installMethod * method, - char * location, struct knownDevices * kd, - moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags); -#endif -#ifdef INCLUDE_NETWORK -static char * mountNfsImage(struct installMethod * method, - char * location, struct knownDevices * kd, - moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags); -static char * mountUrlImage(struct installMethod * method, - char * location, struct knownDevices * kd, - moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags); -#endif - -static struct installMethod installMethods[] = { -#if defined(INCLUDE_LOCAL) - { N_("Local CDROM"), 0, CLASS_CDROM, mountCdromImage }, -#endif -#if defined(INCLUDE_NETWORK) - { N_("NFS image"), 1, CLASS_NETWORK, mountNfsImage }, - { "FTP", 1, CLASS_NETWORK, mountUrlImage }, - { "HTTP", 1, CLASS_NETWORK, mountUrlImage }, -#endif -#if !defined(__ia64__) -#if defined(INCLUDE_LOCAL) - { N_("Hard drive"), 0, CLASS_HD, mountHardDrive }, -#endif -#endif -}; -static int numMethods = sizeof(installMethods) / sizeof(struct installMethod); - -static int memoryOverhead = 0; -static int newtRunning = 0; -int continuing = 0; -#ifdef INCLUDE_KON -int haveKon = 1; -#else -int haveKon = 0; -#endif -static int defaultLang = 0; - -#define MAX_EXTRA_ARGS 128 - -void doSuspend(void) { - newtFinished(); - exit(1); -} - -static int setupRamdisk(void) { - gzFile f; - static int done = 0; - - if (done) return 0; - - done = 1; - - f = gunzip_open("/etc/ramfs.img"); - if (f) { - char buf[10240]; - int i, j = 0; - int fd; - - fd = open(RAMDISK_DEVICE, O_RDWR); - logMessage("copying file to fd %d", fd); - - while ((i = gunzip_read(f, buf, sizeof(buf))) > 0) { - j += write(fd, buf, i); - } - - logMessage("wrote %d bytes", j); - close(fd); - gunzip_close(f); - } - - if (doPwMount(RAMDISK_DEVICE, "/tmp/ramfs", "ext2", 0, 0, NULL, NULL)) - logMessage("failed to mount ramfs image"); - - return 0; -} - -void startNewt(int flags) { - if (!newtRunning) { - char *buf = sdupprintf(_("Welcome to %s"), PRODUCTNAME); - newtInit(); - newtCls(); - newtDrawRootText(0, 0, buf); - free(buf); - - newtPushHelpLine(_(" <Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen ")); - - newtRunning = 1; - if (FL_TESTING(flags)) - newtSetSuspendCallback((void *) doSuspend, NULL); - } -} - -void stopNewt(void) { - if (newtRunning) newtFinished(); - newtRunning = 0; -} - -static void spawnShell(int flags) { - pid_t pid; - int fd; - - if (FL_SERIAL(flags) || FL_NOSHELL(flags)) { - logMessage("not spawning a shell"); - return; - } - - fd = open("/dev/tty2", O_RDWR); - if (fd < 0) { - logMessage("cannot open /dev/tty2 -- no shell will be provided"); - return; - } else if (access("/bin/sh", X_OK)) { - logMessage("cannot open shell - /bin/sh doesn't exist"); - return; - } - - if (!(pid = fork())) { - dup2(fd, 0); - dup2(fd, 1); - dup2(fd, 2); - - close(fd); - setsid(); - if (ioctl(0, TIOCSCTTY, NULL)) { - logMessage("could not set new controlling tty"); - } - - signal(SIGINT, SIG_DFL); - signal(SIGTSTP, SIG_DFL); - - setenv("LD_LIBRARY_PATH", - "/lib:/usr/lib:/usr/X11R6/lib:/mnt/usr/lib:" - "/mnt/sysimage/lib:/mnt/sysimage/usr/lib", 1); - - execl("/bin/sh", "-/bin/sh", NULL); - logMessage("exec of /bin/sh failed: %s", strerror(errno)); - exit(1); - } - - close(fd); - - return; -} - -static int detectHardware(moduleInfoSet modInfo, - char *** modules, int flags) { - struct device ** devices, ** device; - char ** modList; - int numMods; - char *driver; - - logMessage("probing buses"); - - devices = probeDevices(CLASS_UNSPEC, - BUS_PCI | BUS_SBUS, - PROBE_ALL); - - logMessage("finished bus probing"); - - if (devices == NULL) { - *modules = NULL; - return LOADER_OK; - } - - numMods = 0; - for (device = devices; *device; device++) numMods++; - - if (!numMods) { - *modules = NULL; - return LOADER_OK; - } - - modList = malloc(sizeof(*modList) * (numMods + 1)); - numMods = 0; - - for (device = devices; *device; device++) { - driver = (*device)->driver; - if (strcmp (driver, "ignore") && strcmp (driver, "unknown") - && strcmp (driver, "disabled")) { - modList[numMods++] = strdup(driver); - } - - freeDevice (*device); - } - - modList[numMods] = NULL; - *modules = modList; - - free(devices); - - return LOADER_OK; -} - -int addDeviceManually(moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, struct knownDevices * kd, - int flags) { - char * pristineItems[] = { N_("SCSI"), N_("Network") }; - char * items[3]; - int i, rc; - int choice = 0; - enum deviceClass type; - - for (i = 0; i < sizeof(pristineItems) / sizeof(*pristineItems); i++) { - items[i] = _(pristineItems[i]); - } - - items[i] = NULL; - - do { - rc = newtWinMenu(_("Devices"), - _("What kind of device would you like to add"), 40, - 0, 20, 2, items, &choice, _("OK"), _("Back"), NULL); - if (rc == 2) return LOADER_BACK; - - if (choice == 1) - type = DRIVER_NET; - else - type = DRIVER_SCSI; - - rc = devDeviceMenu(type, modInfo, modLoaded, modDepsPtr, - floppyDevice, flags, NULL); - } while (rc); - - return 0; -} - -int manualDeviceCheck(moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, struct knownDevices * kd, - int flags) { - int i, rc; - char buf[2000]; - struct moduleInfo * mi; - newtComponent done, add, text, items, form, answer; - newtGrid grid, buttons; - int numItems; - int maxWidth; - - while (1) { - numItems = 0; - maxWidth = 0; - for (i = 0, *buf = '\0'; i < modLoaded->numModules; i++) { - if (!modLoaded->mods[i].weLoaded) continue; - - if (!(mi = isysFindModuleInfo(modInfo, modLoaded->mods[i].name))) { - continue; - } - - strcat(buf, " "); - strcat(buf, mi->description); - - if (maxWidth < strlen(mi->description)) - maxWidth = strlen(mi->description); - - strcat(buf, "\n"); - numItems++; - } - - if (numItems > 0) { - text = newtTextboxReflowed(-1, -1, - _("The following devices have been found on your system:"), - 40, 5, 20, 0); - buttons = newtButtonBar(_("Done"), &done, _("Add Device"), &add, - NULL); - items = newtTextbox(-1, -1, maxWidth + 8, - numItems < 10 ? numItems : 10, - (numItems < 10 ? 0 : NEWT_FLAG_SCROLL)); - - newtTextboxSetText(items, buf); - - grid = newtGridSimpleWindow(text, items, buttons); - newtGridWrappedWindow(grid, _("Devices")); - - form = newtForm(NULL, NULL, 0); - newtGridAddComponentsToForm(grid, form, 1); - - answer = newtRunForm(form); - newtPopWindow(); - - newtGridFree(grid, 1); - newtFormDestroy(form); - - if (answer != add) - break; - - addDeviceManually(modInfo, modLoaded, modDepsPtr, kd, flags); - } else { - rc = newtWinChoice(_("Devices"), _("Done"), _("Add Device"), - _("No special device drivers have been loaded for " - "your system. Would you like to load any now?")); - if (rc != 2) - break; - - addDeviceManually(modInfo, modLoaded, modDepsPtr, kd, flags); - } - } - - - return 0; -} - -int busProbe(moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps, - int justProbe, struct knownDevices * kd, int flags) { - int i; - char ** modList; - char modules[1024]; - - if (FL_NOPROBE(flags)) return 0; - - if (!access("/proc/bus/pci/devices", R_OK) || - !access("/proc/openprom", R_OK)) { - /* autodetect whatever we can */ - if (detectHardware(modInfo, &modList, flags)) { - logMessage("failed to scan pci bus!"); - return 0; - } else if (modList && justProbe) { - for (i = 0; modList[i]; i++) - printf("%s\n", modList[i]); - } else if (modList) { - *modules = '\0'; - - for (i = 0; modList[i]; i++) { - if (i) strcat(modules, ":"); - strcat(modules, modList[i]); - } - - mlLoadModuleSet(modules, modLoaded, modDeps, modInfo, flags); - - kdFindScsiList(kd, 0); - kdFindNetList(kd, 0); - } else - logMessage("found nothing"); - } - - return 0; -} - -static int setupStage2Image(int fd, char * dest, int flags, - char * device, char * mntpoint) { - int rc; - struct stat sb; - - rc = copyFileFd(fd, dest); - stat(dest, &sb); - logMessage("copied %d bytes to %s%s", sb.st_size, dest, - (rc) ? " (incomplete)" : ""); - - if (rc) { - /* just to make sure */ - unlink(dest); - return 1; - } - - if (mountLoopback(dest, mntpoint, device)) { - newtWinMessage(_("Error"), _("OK"), - "Error mounting /dev/%s on %s (%s). This shouldn't " - "happen, and I'm rebooting your system now.", - device, mntpoint, strerror(errno)); - exit(1); - } - - return 0; -} - -/* returns the *absolute* path (malloced) to the #1 iso image */ -char * validIsoImages(char * dirName) { - DIR * dir; - struct dirent * ent; - char isoImage[1024]; - - if (!(dir = opendir(dirName))) { - newtWinMessage(_("Error"), _("OK"), - _("Failed to read directory %s: %s"), - dirName, strerror(errno)); - return 0; - } - - /* Walk through the directories looking for a Red Hat CD image. */ - errno = 0; - while ((ent = readdir(dir))) { - sprintf(isoImage, "%s/%s", dirName, ent->d_name); - - if (!fileIsIso(isoImage)) { - errno = 0; - continue; - } - - if (mountLoopback(isoImage, "/tmp/loopimage", "loop0")) { - logMessage("failed to mount %s", isoImage); - errno = 0; - continue; - } - - if (!access("/tmp/loopimage/RedHat/base/hdstg1.img", F_OK)) { - umountLoopback("/tmp/loopimage", "loop0"); - break; - } - - umountLoopback("/tmp/loopimage", "loop0"); - - errno = 0; - } - - closedir(dir); - - if (!ent) return NULL; - - return strdup(isoImage); -} - -#ifdef INCLUDE_LOCAL -static int loadLocalImages(char * prefix, char * dir, int flags, - char * device, char * mntpoint) { - int fd, rc; - char * path; - - /* In a kind world, this would do nothing more then mount a ramfs - * or tmpfs. The world isn't kind. */ - - setupRamdisk(); - - path = alloca(50 + strlen(prefix) + (dir ? strlen(dir) : 2)); - - sprintf(path, "%s/%s/RedHat/base/hdstg1.img", prefix, dir ? dir : ""); - - if ((fd = open(path, O_RDONLY)) < 0) { - logMessage("failed to open %s: %s", path, strerror(errno)); - return 1; - } - - /* handle updates.img now before we copy stage2 over... this allows - * us to keep our ramdisk size as small as possible */ - sprintf(path, "%s/%s/RedHat/base/updates.img", prefix, dir ? dir : ""); - useMntSourceUpdates(path); - - rc = setupStage2Image(fd, "/tmp/ramfs/hdstg1.img", flags, device, mntpoint); - - close(fd); - - return rc; -} - -static char * setupIsoImages(char * device, char * type, char * dirName, - int flags) { - int rc; - char * url; - char filespec[1024]; - char * path; - - logMessage("mounting device %s as %s", device, type); - - if (!FL_TESTING(flags)) { - /* +5 skips over /dev/ */ - if (devMakeInode(device, "/tmp/hddev")) - logMessage("devMakeInode failed!"); - - if (doPwMount("/tmp/hddev", "/tmp/hdimage", type, 1, 0, NULL, NULL)) - return NULL; - - sprintf(filespec, "/tmp/hdimage/%s", dirName); - - path = validIsoImages(filespec); - - if (path) { - char * updatesPath; - char mediasum[33]; - int isostatus; - - - /* handle updates.img now before we copy stage2 over... this allows - * us to keep our ramdisk size as small as possible */ - updatesPath = alloca(50 + strlen(filespec)); - sprintf(updatesPath, "%s/updates.img", filespec); - useMntSourceUpdates(updatesPath); - - rc = mountLoopback(path, "/tmp/loopimage", "loop0"); - if (!rc) { - rc = loadLocalImages("/tmp/loopimage", "/", flags, "loop1", - "/mnt/runtime"); - if (rc) { - newtWinMessage(_("Error"), _("OK"), - _("An error occured reading the install " - "from the ISO images. Please check your ISO " - "images and try again.")); - } - } - - umountLoopback("/tmp/loopimage", "loop0"); - - isostatus = getISOStatusFromFile(path, mediasum); - writeISOStatus(isostatus, mediasum); - - if (!FL_KICKSTART(flags) && FL_MEDIACHECK(flags)) - mediaCheckISODir("/mnt/source"); - - } else { - rc = 1; - } - - umount("/tmp/hdimage"); - - if (rc) return NULL; - } - - url = malloc(50 + strlen(dirName ? dirName : "")); - sprintf(url, "hd://%s:%s/%s", device, type, dirName ? dirName : "."); - - return url; -} - -static char * setupOldHardDrive(char * device, char * type, char * dir, - int flags) { - int rc; - char * url; - - logMessage("mounting device %s as %s", device, type); - - if (!FL_TESTING(flags)) { - /* +5 skips over /dev/ */ - if (devMakeInode(device, "/tmp/hddev")) - logMessage("devMakeInode failed!"); - - if (doPwMount("/tmp/hddev", "/tmp/hdimage", type, 1, 0, NULL, NULL)) - return NULL; - - rc = loadLocalImages("/tmp/hdimage", dir, flags, "loop0", - "/mnt/runtime"); - if (rc) umount("/mnt/hdimage"); - - umount("/tmp/hdimage"); - - if (rc) return NULL; - } - - url = malloc(50 + strlen(dir ? dir : "")); - sprintf(url, "oldhd://%s:%s/%s", device, type, dir ? dir : "."); - - return url; -} - -#endif - -static int umountLoopback(char * mntpoint, char * device) { - int loopfd; - - umount(mntpoint); - - logMessage("umounting loopback %s %s", mntpoint, device); - - devMakeInode(device, "/tmp/loop"); - loopfd = open("/tmp/loop", O_RDONLY); - - if (ioctl(loopfd, LOOP_CLR_FD, 0) < 0) - logMessage("LOOP_CLR_FD failed for %s %s", mntpoint, device); - - close(loopfd); - - return 0; -} - - -static int mountLoopback(char * fsystem, char * mntpoint, char * device) { - struct loop_info loopInfo; - int targfd, loopfd; - char *filename; - - mkdirChain(mntpoint); - filename = alloca(15 + strlen(device)); - sprintf(filename, "/tmp/%s", device); - - mkdirChain(mntpoint); - - targfd = open(fsystem, O_RDONLY); - if (targfd < 0) - logMessage("opening target filesystem %s failed", fsystem); - - devMakeInode(device, filename); - loopfd = open(filename, O_RDONLY); - logMessage("mntloop %s on %s as %s fd is %d", - device, mntpoint, fsystem, loopfd); - - if (ioctl(loopfd, LOOP_SET_FD, targfd)) { - logMessage("LOOP_SET_FD failed: %s", strerror(errno)); - close(targfd); - close(loopfd); - return LOADER_ERROR; - } - - close(targfd); - - memset(&loopInfo, 0, sizeof(loopInfo)); - strcpy(loopInfo.lo_name, fsystem); - - if (ioctl(loopfd, LOOP_SET_STATUS, &loopInfo)) { - logMessage("LOOP_SET_STATUS failed: %s", strerror(errno)); - close(loopfd); - return LOADER_ERROR; - } - - close(loopfd); - - if (doPwMount(filename, mntpoint, "iso9660", 1, - 0, NULL, NULL)) { - if (doPwMount(filename, mntpoint, "ext2", 1, - 0, NULL, NULL)) { - if (doPwMount(filename, mntpoint, "cramfs", 1, - 0, NULL, NULL)) { - - logMessage("failed to mount loop: %s", - strerror(errno)); - return LOADER_ERROR; - } - } - } - - return 0; -} - -static int totalMemory(void) { - int fd; - int bytesRead; - char buf[4096]; - char * chptr, * start; - int total = 0; - - fd = open("/proc/meminfo", O_RDONLY); - if (fd < 0) { - logMessage("failed to open /proc/meminfo: %s", strerror(errno)); - return 0; - } - - bytesRead = read(fd, buf, sizeof(buf) - 1); - if (bytesRead < 0) { - logMessage("failed to read from /proc/meminfo: %s", strerror(errno)); - close(fd); - return 0; - } - - close(fd); - buf[bytesRead] = '\0'; - - chptr = buf; - while (*chptr && !total) { - if (*chptr != '\n' || strncmp(chptr + 1, "MemTotal:", 9)) { - chptr++; - continue; - } - - start = ++chptr ; - while (*chptr && *chptr != '\n') chptr++; - - *chptr = '\0'; - - while (!isdigit(*start) && *start) start++; - if (!*start) { - logMessage("no number appears after MemTotal tag"); - return 0; - } - - chptr = start; - while (*chptr && isdigit(*chptr)) { - total = (total * 10) + (*chptr - '0'); - chptr++; - } - } - - logMessage("%d kB are available", total); - - return total; -} - -/* try to use the provided updates.img at path - */ -static void useMntSourceUpdates(char * path) { - if (!access(path, R_OK)) { - if (!mountLoopback(path, - "/tmp/update-disk", "loop7")) { - copyDirectory("/tmp/update-disk", "/tmp/updates"); - umountLoopback("/tmp/update-disk", "loop7"); - } - } -} - -/* get description of ISO image from stamp file */ -char *getReleaseDescriptorFromIso(char *file) { - DIR * dir; - FILE *f; - struct dirent * ent; - struct stat sb; - char *stampfile; - char *descr; - char tmpstr[1024]; - int filetype; - - lstat(file, &sb); - if (S_ISBLK(sb.st_mode)) { - filetype = 1; - if (doPwMount(file, "/tmp/testmnt", - "iso9660", 1, 0, NULL, NULL)) { - logMessage("Failed to mount device %s to get description", file); - return NULL; - } - } else if (S_ISREG(sb.st_mode)) { - filetype = 2; - if (mountLoopback(file, "/tmp/testmnt", "loop6")) { - logMessage("Failed to mount iso %s to get description", file); - return NULL; - } - } else { - logMessage("Unknown type of file %s to get description", file); - return NULL; - } - - if (!(dir = opendir("/tmp/testmnt"))) { - umount("/tmp/testmnt"); - if (filetype == 2) - umountLoopback("tmp/testmnt", "loop6"); - return NULL; - } - - errno = 0; - stampfile = NULL; - while ((ent = readdir(dir))) { - if (!strncmp(ent->d_name, ".discinfo", 9)) { - stampfile = strdup(".discinfo"); - break; - } - } - - closedir(dir); - descr = NULL; - if (stampfile) { - snprintf(tmpstr, sizeof(tmpstr), "/tmp/testmnt/%s", stampfile); - f = fopen(tmpstr, "r"); - if (f) { - char *tmpptr; - - /* skip over time stamp line */ - tmpptr = fgets(tmpstr, sizeof(tmpstr), f); - /* now read OS description line */ - if (tmpptr) - tmpptr = fgets(tmpstr, sizeof(tmpstr), f); - - if (tmpptr) - descr = strdup(tmpstr); - - /* skip over arch */ - if (tmpptr) - tmpptr = fgets(tmpstr, sizeof(tmpstr), f); - - /* now get the CD number */ - if (tmpptr) { - unsigned int len; - char *p, *newstr; - - tmpptr = fgets(tmpstr, sizeof(tmpstr), f); - - /* nuke newline from end of descr, stick number on end*/ - for (p=descr+strlen(descr); p != descr && !isspace(*p); p--); - - *p = '\0'; - len = strlen(descr) + strlen(tmpstr) + 10; - newstr = malloc(len); - strncpy(newstr, descr, len-1); - strncat(newstr, " ", len-1); - - /* is this a DVD or not? If disc id has commas, like */ - /* "1,2,3", its a DVD */ - if (strchr(tmpstr, ',')) - strncat(newstr, "DVD\n", len-1); - else { - strncat(newstr, "disc ", len-1); - strncat(newstr, tmpstr, len-1); - } - - free(descr); - descr = newstr; - } - - fclose(f); - } - } - - free(stampfile); - - umount("/tmp/testmnt"); - if (filetype == 2) - umountLoopback("tmp/testmnt", "loop6"); - - if (descr) { - char *dupdescr; - - dupdescr = strdup(descr); - dupdescr[strlen(dupdescr)-1] = '\0'; - return dupdescr; - } else { - return descr; - } -} - - - -/* XXX this ignores "location", which should be fixed */ -static char * mediaCheckISODir(char *path) { - DIR * dir; - struct dirent * ent; - char isoImage[1024]; - char tmpmessage[1024]; - int rc; - - - if (!(dir = opendir(path))) { - newtWinMessage(_("Error"), _("OK"), - _("Failed to read directory %s: %s"), - path, strerror(errno)); - return 0; - } - - /* Walk through the directories looking for a Red Hat CD images. */ - errno = 0; - while ((ent = readdir(dir))) { - sprintf(isoImage, "%s/%s", path, ent->d_name); - - if (!fileIsIso(isoImage)) { - errno = 0; - continue; - } - - - snprintf(tmpmessage, sizeof(tmpmessage), - _("Would you like to perform a checksum " - "test of the ISO image:\n\n %s?"), isoImage); - - rc = newtWinChoice(_("Checksum Test"), _("Test"), _("Skip"), - tmpmessage); - - if (rc == 2) { - logMessage("mediacheck: skipped checking of %s", isoImage); - continue; - /* - closedir(dir); - return NULL; - */ - } else { - char *descr; - - descr = getReleaseDescriptorFromIso(isoImage); - mediaCheckFile(isoImage, descr); - if (descr) - free(descr); - - continue; - } - } - - closedir(dir); - return NULL; -} - -static int getISOStatusFromCDROM(char *cddriver, char *mediasum) { - int isofd; - int isostatus; - - devMakeInode(cddriver, "/tmp/cdrom"); - isofd = open("/tmp/cdrom", O_RDONLY); - if (isofd < 0) { - logMessage("Could not check iso status: %s", strerror(errno)); - unlink("/tmp/cdrom"); - return 0; - } - - isostatus = getISOStatusFromFD(isofd, mediasum); - - close(isofd); - unlink("/tmp/cdrom"); - - return isostatus; -} - -static int getISOStatusFromFile(char *path, char *mediasum) { - int isofd; - int isostatus; - - isofd = open(path, O_RDONLY); - if (isofd < 0) { - logMessage("Could not check iso status: %s", strerror(errno)); - return 0; - } - - isostatus = getISOStatusFromFD(isofd, mediasum); - - close(isofd); - - return isostatus; -} - -/* get support status */ -/* if returns 1 we found status, and mediasum will be checksum */ -static int getISOStatusFromFD(int isofd, char *mediasum) { - unsigned char tmpsum[33]; - int skipsectors, isostatus; - long long isosize, pvd_offset; - - if (mediasum) - mediasum[0] = '\0'; - - if ((pvd_offset = parsepvd(isofd, tmpsum, &skipsectors, &isosize, &isostatus)) < 0) { - logMessage("Could not parse pvd"); - return 0; - } - - if (mediasum) - strcpy(mediasum, tmpsum); - - return isostatus; -} - -static void writeISOStatus(int status, char *mediasum) { - FILE *f; - - if (!(f = fopen("/tmp/isoinfo", "w"))) - return; - - fprintf(f, "ISOSTATUS=%d\n", status); - fprintf(f, "MEDIASUM=%s\n", mediasum); - - fclose(f); - -} - -#ifdef INCLUDE_LOCAL - -static char * mountHardDrive(struct installMethod * method, - char * location, struct knownDevices * kd, - moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags) { - int rc; - int fd; - int i, j; -#if defined (__s390__) || defined (__s390x__) - static struct networkDeviceConfig netDev; - struct iurlinfo ui; - char * devName; -#endif - struct { - char name[20]; - int type; - } partitions[1024], * part; - struct partitionTable table; - newtComponent listbox, label, dirEntry, form, okay, back, text; - struct newtExitStruct es; - newtGrid entryGrid, grid, buttons; - int done = 0; - char * dir = strdup(""); - char * tmpDir; - char * type; - char * url = NULL; - char * buf; - int numPartitions; - #ifdef __sparc__ - static int ufsloaded; - #endif - - while (!done) { - numPartitions = 0; -#if !defined (__s390__) && !defined (__s390x__) - for (i = 0; i < kd->numKnown; i++) { - if (kd->known[i].class == CLASS_HD) { - devMakeInode(kd->known[i].name, "/tmp/hddevice"); - if ((fd = open("/tmp/hddevice", O_RDONLY)) >= 0) { - if ((rc = balkanReadTable(fd, &table))) { - logMessage("failed to read partition table for " - "device %s: %d", kd->known[i].name, rc); - } else { - for (j = 0; j < table.maxNumPartitions; j++) { - switch (table.parts[j].type) { -#ifdef __sparc__ - case BALKAN_PART_UFS: - if (!ufsloaded) { - ufsloaded = 1; - mlLoadModuleSet("ufs", modLoaded, - *modDepsPtr, modInfo, - flags); - } - /* FALLTHROUGH */ -#endif - case BALKAN_PART_DOS: - case BALKAN_PART_EXT2: - if (!strncmp (kd->known[i].name, "cciss/", 6) || - !strncmp (kd->known[i].name, "ida/", 4) || - !strncmp (kd->known[i].name, "rd/", 3)) - - sprintf(partitions[numPartitions].name, - "/dev/%sp%d", kd->known[i].name, j + 1); - else - sprintf(partitions[numPartitions].name, - "/dev/%s%d", kd->known[i].name, j + 1); - - partitions[numPartitions].type = - table.parts[j].type; - numPartitions++; - } - } - } - - close(fd); - } else { - /* XXX ignore errors on removable drives? */ - } - - unlink("/tmp/hddevice"); - } - } - - if (!numPartitions) { - rc = newtWinChoice(_("Hard Drives"), _("Yes"), _("Back"), - _("You don't seem to have any hard drives on " - "your system! Would you like to configure " - "additional devices?")); - if (rc == 2) return NULL; - - devDeviceMenu(DRIVER_SCSI, modInfo, modLoaded, modDepsPtr, - floppyDevice, flags, - NULL); - kdFindScsiList(kd, 0); - - continue; - } - -#else - /* s390 */ - memset(&ui, 0, sizeof(ui)); - memset(&netDev, 0, sizeof(netDev)); - netDev.isDynamic = 1; - i = ensureNetDevice(kd, modInfo, modLoaded, modDepsPtr, flags, &devName); - if (i) return NULL; - rc = readNetConfig(devName, &netDev, flags); - if (rc) { - if (!FL_TESTING(flags)) pumpDisableInterface(devName); - return NULL; - } - setupRemote(&ui); - for(c = 'a'; c <= 'z'; c++) { - for(i = 1; i < 4; i++) { - char dev[7]; - sprintf(dev, "dasd%c%d", c, i); - devMakeInode(dev, "/tmp/hddevice"); - fd = open("/tmp/hddevice", O_RDONLY); - if (fd >= 0) { - close(fd); - sprintf(partitions[numPartitions].name, "/dev/%s", dev); - partitions[numPartitions].type = BALKAN_PART_EXT2; - numPartitions++; - } - } - } - mlLoadModule("isofs", NULL, modLoaded, *modDepsPtr, - NULL, modInfo, flags); - -#endif - - buf = sdupprintf(_("What partition and directory on that " - "partition hold the CD (iso9660) images " - "for %s? If you don't see the disk drive " - "you're using listed here, press F2 " - "to configure additional devices."), PRODUCTNAME); - text = newtTextboxReflowed(-1, -1, buf, 62, 5, 5, 0); - free(buf); - - listbox = newtListbox(-1, -1, numPartitions > 5 ? 5 : numPartitions, - NEWT_FLAG_RETURNEXIT | - (numPartitions > 5 ? NEWT_FLAG_SCROLL : 0)); - - for (i = 0; i < numPartitions; i++) - newtListboxAppendEntry(listbox, partitions[i].name, - partitions + i); - - label = newtLabel(-1, -1, _("Directory holding images:")); - - dirEntry = newtEntry(28, 11, dir, 28, &tmpDir, NEWT_ENTRY_SCROLL); - - entryGrid = newtGridHStacked(NEWT_GRID_COMPONENT, label, - NEWT_GRID_COMPONENT, dirEntry, - NEWT_GRID_EMPTY); - - buttons = newtButtonBar(_("OK"), &okay, _("Back"), &back, NULL); - - grid = newtCreateGrid(1, 4); - newtGridSetField(grid, 0, 0, NEWT_GRID_COMPONENT, text, - 0, 0, 0, 1, 0, 0); - newtGridSetField(grid, 0, 1, NEWT_GRID_COMPONENT, listbox, - 0, 0, 0, 1, 0, 0); - newtGridSetField(grid, 0, 2, NEWT_GRID_SUBGRID, entryGrid, - 0, 0, 0, 1, 0, 0); - newtGridSetField(grid, 0, 3, NEWT_GRID_SUBGRID, buttons, - 0, 0, 0, 0, 0, NEWT_GRID_FLAG_GROWX); - - newtGridWrappedWindow(grid, _("Select Partition")); - - form = newtForm(NULL, NULL, 0); - newtFormAddHotKey(form, NEWT_KEY_F2); - newtFormAddHotKey(form, NEWT_KEY_F12); - - newtGridAddComponentsToForm(grid, form, 1); - newtGridFree(grid, 1); - - newtFormRun(form, &es); - - part = newtListboxGetCurrent(listbox); - - free(dir); - if (tmpDir && *tmpDir) { - /* Protect from form free. */ - dir = strdup(tmpDir); - } else { - dir = strdup(""); - } - - newtFormDestroy(form); - newtPopWindow(); - - if (es.reason == NEWT_EXIT_COMPONENT && es.u.co == back) { - return NULL; - } else if (es.reason == NEWT_EXIT_HOTKEY && es.u.key == NEWT_KEY_F2) { - devDeviceMenu(DRIVER_SCSI, modInfo, modLoaded, modDepsPtr, - floppyDevice, flags, - NULL); - kdFindScsiList(kd, 0); - continue; - } - - logMessage("partition %s selected", part->name); - - switch (part->type) { - #ifdef __sparc__ - case BALKAN_PART_UFS: type = "ufs"; break; - #endif - case BALKAN_PART_EXT2: type = "ext2"; break; - case BALKAN_PART_DOS: type = "vfat"; break; - default: continue; - } - - url = setupIsoImages(part->name + 5, type, dir, flags); - if (!url) { - newtWinMessage(_("Error"), _("OK"), - _("Device %s does not appear to contain " - "Red Hat CDROM images."), part->name); - continue; - } - - done = 1; - - umount("/tmp/hdimage"); - rmdir("/tmp/hdimage"); - } - - free(dir); -#if defined (__s390__) || defined (__s390x__) - writeNetInfo("/tmp/netinfo", &netDev, kd); -#endif - - return url; -} - - -void ejectCdrom(void) { - int ejectfd; - - logMessage("ejecting /tmp/cdrom..."); - if ((ejectfd = open("/tmp/cdrom", O_RDONLY | O_NONBLOCK, 0)) >= 0) { - if (ioctl(ejectfd, CDROMEJECT, 0)) - logMessage("eject failed %d ", errno); - close(ejectfd); - } else { - logMessage("eject failed %d ", errno); - } -} - -/* XXX this ignores "location", which should be fixed */ -static char * mediaCheckCdrom(char *cddriver) { - int rc; - int first; - - devMakeInode(cddriver, "/tmp/cdrom"); - - first = 1; - do { - char *descr=NULL; - /* if first time through, see if they want to eject the CD */ - /* currently in the drive (most likely the CD they booted from) */ - /* and test a different disk. Otherwise just test the disk in */ - /* the drive since it was inserted in the previous pass through */ - /* this loop, so they want it tested. */ - if (first) { - first = 0; - rc = newtWinChoice(_("Media Check"), _("Test"), _("Eject CD"), - _("Choose \"%s\" to test the CD currently in " - "the drive, or \"%s\" to eject the CD and " - "insert another for testing."), _("Test"), - _("Eject CD")); - - if (rc == 1) { - descr = getReleaseDescriptorFromIso("/tmp/cdrom"); - mediaCheckFile("/tmp/cdrom", descr); - } - - } else { - descr = getReleaseDescriptorFromIso("/tmp/cdrom"); - mediaCheckFile("/tmp/cdrom", descr); - } - - if (descr) - free(descr); - - ejectCdrom(); - - rc = newtWinChoice(_("Media Check"), _("Test"), _("Continue"), - _("If you would like to test additional media, " - "insert the next CD and press \"%s\". " - "You do not have to test all CDs, although " - "it is recommended you do so at least once.\n\n" - "To begin the installation process " - "insert CD #1 into the drive " - "and press \"%s\"."), - _("Test"), _("Continue")); - - if (rc == 2) { - unlink("/tmp/cdrom"); - return NULL; - } else { - continue; - } - } while (1); - - return NULL; -} - -static void wrongCDMessage(void) { - char *buf = sdupprintf(_("The %s CD was not found " - "in any of your CDROM drives. Please insert " - "the %s CD and press %s to retry."), PRODUCTNAME, - PRODUCTNAME, _("OK")); - newtWinMessage(_("Error"), _("OK"), buf, _("OK")); - free(buf); -} - -/* put mounts back and continue */ -static void mountCdromStage2(char *cddev) { - int gotcd1=0; - - devMakeInode(cddev, "/tmp/cdrom"); - do { - do { - if (doPwMount("/tmp/cdrom", "/mnt/source", - "iso9660", 1, 0, NULL, NULL)) { - ejectCdrom(); - wrongCDMessage(); - } else { - break; - } - } while (1); - - if (mountLoopback("/mnt/source/RedHat/base/stage2.img", - "/mnt/runtime", "loop0")) { - umount("/mnt/source"); - ejectCdrom(); - wrongCDMessage(); - } else { - gotcd1 = 1; - } - } while (!gotcd1); -} - -/* ask about doing media check */ -static void queryMediaCheck(char *name, int flags) { - int rc; - char mediasum[33]; - int isostatus; - - /* dont bother to test in automated installs */ - if (FL_KICKSTART(flags)) - return; - - /* see what status is */ - isostatus = getISOStatusFromCDROM(name, mediasum); - writeISOStatus(isostatus, mediasum); - - /* see if we should check image(s) */ - if (!isostatus || FL_MEDIACHECK(flags)) { - - startNewt(flags); - rc = newtWinChoice(_("CD Found"), _("OK"), - _("Skip"), - _("To begin testing the CD media before installation press %s.\n\n" - "Choose %s to skip the media test and start the installation."), _("OK"), _("Skip")); - - if (rc != 2) { - - /* unmount CD now we've identified */ - /* a valid disc #1 is present */ - umount("/mnt/runtime"); - umountLoopback("/mnt/runtime", "loop0"); - umount("/mnt/source"); - - /* test CD(s) */ - mediaCheckCdrom(name); - - /* remount stage2 from CD #1 and proceed */ - mountCdromStage2(name); - } - } -} - -/* XXX this ignores "location", which should be fixed */ -static char * setupCdrom(struct installMethod * method, - char * location, struct knownDevices * kd, - moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags, int probeQuickly, - int needRedHatCD) { - int i; - int rc; - int hasCdrom = 0; - char * buf; - - do { - for (i = 0; i < kd->numKnown; i++) { - if (kd->known[i].class != CLASS_CDROM) continue; - - hasCdrom = 1; - - logMessage("trying to mount device %s", kd->known[i].name); - devMakeInode(kd->known[i].name, "/tmp/cdrom"); - if (!doPwMount("/tmp/cdrom", "/mnt/source", "iso9660", 1, 0, NULL, - NULL)) { - /* if probe quickly, then we're looking for a kickstart config - * and should just return if we can mount it */ - if (probeQuickly && !needRedHatCD) { - buf = malloc(200); - sprintf(buf, "cdrom://%s/mnt/source", kd->known[i].name); - return buf; - } - - if (!needRedHatCD || - !access("/mnt/source/RedHat/base/stage2.img", R_OK)) { - if (!mountLoopback("/mnt/source/RedHat/base/stage2.img", - "/mnt/runtime", "loop0")) { - useMntSourceUpdates("/mnt/source/RedHat/base/updates.img"); - - buf = malloc(200); - sprintf(buf, "cdrom://%s/mnt/source", kd->known[i].name); - queryMediaCheck(kd->known[i].name, flags); - return buf; - } - } - umount("/mnt/source"); - } - unlink("/tmp/cdrom"); - } - - if (probeQuickly) return NULL; - - if (hasCdrom) { - char *buf = sdupprintf(_("The %s CD was not found in any of your " - "CDROM drives. Please insert the %s CD " - "and press %s to retry."), PRODUCTNAME, - PRODUCTNAME, _("OK")); - rc = newtWinChoice(_("Error"), _("OK"), _("Back"), buf, _("OK")); - free(buf); - if (rc == 2) return NULL; - } else { - rc = setupCDdevice(kd, modInfo, modLoaded, modDepsPtr, - floppyDevice, flags); - if (rc == LOADER_BACK) return NULL; - } - } while (1); - - abort(); - - return NULL; -} - -static char * mountCdromImage(struct installMethod * method, - char * location, struct knownDevices * kd, - moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags) { - - /* first do media check if necessary */ - - return setupCdrom(method, location, kd, modInfo, modLoaded, modDepsPtr, - flags, 0, 1); -} - -int kickstartFromCdrom(char * ksFile, char * fromFile, - struct knownDevices * kd, - moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags) { - char * fullFn; - - if (!setupCdrom(NULL, NULL, kd, modInfo, modLoaded, modDepsPtr, - flags, 1, 0)) { - logMessage("kickstart failed to find CD device"); - return 1; - } - - fullFn = alloca(strlen(fromFile) + 20); - sprintf(fullFn, "/mnt/source/%s", fromFile); - copyFile(fullFn, ksFile); - umount("/mnt/source"); - unlink("/tmp/cdrom"); - - return 0; -} - -#endif - -#ifdef INCLUDE_NETWORK - -static int ensureNetDevice(struct knownDevices * kd, - moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags, - char ** devNamePtr) { - int i, rc; - char ** devices; - int deviceNums = 0; - int deviceNum; - - for (i = 0; i < kd->numKnown; i++) - if (kd->known[i].class == CLASS_NETWORK) - break; - - /* Give them a chance to insert a module. */ - if (i == kd->numKnown) { - rc = devDeviceMenu(DRIVER_NET, modInfo, modLoaded, modDepsPtr, - floppyDevice, flags, NULL); - if (rc) return rc; - kdFindNetList(kd, 0); - } - - devices = alloca((kd->numKnown + 1) * sizeof(*devices)); - for (i = 0; i < kd->numKnown; i++) { - if (kd->known[i].class == CLASS_NETWORK) { - devices[deviceNums++] = kd->known[i].name; - } - } - devices[deviceNums] = NULL; - - /* This shouldn't happen. devDeviceMenu() should get us a network device, - or return LOADER_BACK, in which case we don't get here. */ - if (!deviceNums) return LOADER_ERROR; - - if (deviceNums == 1 || FL_KICKSTART(flags) || FL_KSNFS(flags)) { - *devNamePtr = devices[0]; - return 0; - } - - startNewt(flags); - - deviceNum = 0; - rc = newtWinMenu(_("Networking Device"), - _("You have multiple network devices on this system. " - "Which would you like to install through?"), 40, 10, 10, - deviceNums < 6 ? deviceNums : 6, devices, - &deviceNum, _("OK"), _("Back"), NULL); - if (rc == 2) - return LOADER_BACK; - - *devNamePtr = devices[deviceNum]; - - return 0; -} - -#endif - -#ifdef INCLUDE_NETWORK - -#define NFS_STAGE_IP 1 -#define NFS_STAGE_NFS 2 -#define NFS_STAGE_MOUNT 3 -#define NFS_STAGE_DONE 4 - -static char * mountNfsImage(struct installMethod * method, - char * location, struct knownDevices * kd, - moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags) { - static struct networkDeviceConfig netDev; - struct iurlinfo ui; - char * devName; - int i, rc; - char * host = NULL; - char * dir = NULL; - char * fullPath; - char * path; - char * url = NULL; - int stage = NFS_STAGE_IP; - - initLoopback(); - - memset(&ui, 0, sizeof(ui)); - memset(&netDev, 0, sizeof(netDev)); - netDev.isDynamic = 1; - - i = ensureNetDevice(kd, modInfo, modLoaded, modDepsPtr, flags, &devName); - if (i) return NULL; - - while (stage != NFS_STAGE_DONE) { - switch (stage) { - case NFS_STAGE_IP: - logMessage("going to do getNetConfig"); - rc = readNetConfig(devName, &netDev, flags); - if (rc) { - if (!FL_TESTING(flags)) pumpDisableInterface(devName); - return NULL; - } -#if defined (__s390__) || defined (__s390x__) - setupRemote(&ui); - host = ui.address; - dir = ui.prefix; -#endif - stage = NFS_STAGE_NFS; - break; - - case NFS_STAGE_NFS: - logMessage("going to do nfsGetSetup"); - if (nfsGetSetup(&host, &dir) == LOADER_BACK) - stage = NFS_STAGE_IP; - else - stage = NFS_STAGE_MOUNT; - break; - - case NFS_STAGE_MOUNT: - if (FL_TESTING(flags)) { - stage = NFS_STAGE_DONE; - break; - } - - fullPath = alloca(strlen(host) + strlen(dir) + 2); - sprintf(fullPath, "%s:%s", host, dir); - - logMessage("mounting nfs path %s", fullPath); - - stage = NFS_STAGE_NFS; - - if (!doPwMount(fullPath, "/mnt/source", "nfs", 1, 0, NULL, NULL)) { - if (!access("/mnt/source/RedHat/base/stage2.img", R_OK)) { - if (!mountLoopback("/mnt/source/RedHat/base/stage2.img", - "/mnt/runtime", "loop0")) { - rmdir("/mnt/source"); - symlink("/mnt/source", "/mnt/source"); - useMntSourceUpdates("/mnt/source/RedHat/base/updates.img"); - stage = NFS_STAGE_DONE; - url = "nfs://mnt/source/."; - } - } else if ((path = validIsoImages("/mnt/source"))) { - useMntSourceUpdates("/mnt/source/updates.img"); - - if (mountLoopback(path, "/mnt/source2", "loop1")) - logMessage("failed to mount iso loopback!"); - else { - if (mountLoopback("/mnt/source2/RedHat/base/stage2.img", - "/mnt/runtime", "loop0")) { - logMessage("failed to mount install loopback!"); - } else { - char mediasum[33]; - int isostatus; - - useMntSourceUpdates("/mnt/source/RedHat/base/updates.img"); - stage = NFS_STAGE_DONE; - url = "nfsiso:/mnt/source"; - - isostatus = getISOStatusFromFile(path, mediasum); - writeISOStatus(isostatus, mediasum); - - if (!FL_KICKSTART(flags) && FL_MEDIACHECK(flags)) - mediaCheckISODir("/mnt/source"); - - } - } - } else { - umount("/mnt/source"); - newtWinMessage(_("Error"), _("OK"), - _("That directory does not seem to contain " - "a Red Hat installation tree.")); - } - } else { - newtWinMessage(_("Error"), _("OK"), - _("That directory could not be mounted from the server")); - } - - break; /* from switch */ - } - } - - writeNetInfo("/tmp/netinfo", &netDev, kd); - - free(host); - free(dir); - - return url; -} - -#endif - -#ifdef INCLUDE_NETWORK - -static int loadSingleUrlImage(struct iurlinfo * ui, char * file, int flags, - char * dest, char * mntpoint, char * device, - int silentErrors) { - int fd; - int rc; - char * newFile = NULL; - - fd = urlinstStartTransfer(ui, file, 1); - - if (fd == -2) return 1; - - if (fd < 0) { - /* file not found */ - - newFile = alloca(strlen(device) + 20); - sprintf(newFile, "disc1/%s", file); - - fd = urlinstStartTransfer(ui, newFile, 1); - - if (fd == -2) return 1; - if (fd < 0) { - if (!silentErrors) - newtWinMessage(_("Error"), _("OK"), - _("File %s/%s not found on server."), - ui->prefix, file); - return 1; - } - } - - rc = setupStage2Image(fd, dest, flags, device, mntpoint); - - urlinstFinishTransfer(ui, fd); - - if (newFile) { - newFile = malloc(strlen(ui->prefix ) + 20); - sprintf(newFile, "%s/disc1", ui->prefix); - free(ui->prefix); - ui->prefix = newFile; - } - - return rc; -} - -static int loadUrlImages(struct iurlinfo * ui, int flags) { - setupRamdisk(); - - /* try to pull the updates.img before getting the netstg1.img so - * we can minimize our ramdisk size */ - if (!loadSingleUrlImage(ui, "RedHat/base/updates.img", flags, - "/tmp/ramfs/updates-disk.img", - "/tmp/update-disk", "loop7", 1)) { - /* copy the updates, then unmount the loopback and unlink the img */ - copyDirectory("/tmp/update-disk", "/tmp/updates"); - umountLoopback("/tmp/update-disk", "loop7"); - unlink("/tmp/ramfs/updates-disk.img"); - } - - if (loadSingleUrlImage(ui, "RedHat/base/netstg1.img", flags, - "/tmp/ramfs/netstg1.img", - "/mnt/runtime", "loop0", 0)) { - newtWinMessage(ui->protocol == URL_METHOD_FTP ? - _("FTP") : _("HTTP"), _("OK"), - _("Unable to retrieve the first install image")); - return 1; - } - - return 0; -} - -static char * getLoginName(char * login, struct iurlinfo ui) { - int i; - - i = 0; - /* password w/o login isn't useful */ - if (ui.login && strlen(ui.login)) { - i += strlen(ui.login) + 5; - if (strlen(ui.password)) - i += 3*strlen(ui.password) + 5; - - if (ui.login || ui.password) { - login = malloc(i); - strcpy(login, ui.login); - if (ui.password) { - char * chptr; - char code[4]; - - strcat(login, ":"); - for (chptr = ui.password; *chptr; chptr++) { - sprintf(code, "%%%2x", *chptr); - strcat(login, code); - } - strcat(login, "@"); - } - } - } - - return login; -} - -#define URL_STAGE_IP 1 -#define URL_STAGE_MAIN 2 -#define URL_STAGE_SECOND 3 -#define URL_STAGE_FETCH 4 -#define URL_STAGE_DONE 20 - -static char * mountUrlImage(struct installMethod * method, - char * location, struct knownDevices * kd, - moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags) { - int i, rc; - int stage = URL_STAGE_IP; - char * devName; - struct iurlinfo ui; - char needsSecondary = ' '; - static struct networkDeviceConfig netDev; - char * url; - char * login; - char * finalPrefix; - int dir = 1; - enum urlprotocol_t proto = - !strcmp(method->name, "FTP") ? URL_METHOD_FTP : URL_METHOD_HTTP; - - if (totalMemory() < 18000) { - newtWinMessage(_("Error"), _("OK"), _("FTP and HTTP installs " - "require 20MB or more of system memory.")); - - return NULL; - } - - initLoopback(); - i = ensureNetDevice(kd, modInfo, modLoaded, modDepsPtr, flags, &devName); - if (i) return NULL; - - memset(&ui, 0, sizeof(ui)); - memset(&netDev, 0, sizeof(netDev)); - netDev.isDynamic = 1; - - while (stage != URL_STAGE_DONE) { - switch (stage) { - case URL_STAGE_IP: - rc = readNetConfig(devName, &netDev, flags); - if (rc) { - if (!FL_TESTING(flags)) pumpDisableInterface(devName); - return NULL; - } -#if defined (__s390__) || defined (__s390x__) - if (dir == -1) { - return NULL; - } - setupRemote(&ui); -#endif - stage = URL_STAGE_MAIN; - dir = 1; - - case URL_STAGE_MAIN: - rc = urlMainSetupPanel(&ui, proto, &needsSecondary); - if (rc) { - stage = URL_STAGE_IP; - dir = -1; - } else { - stage = needsSecondary != ' ' ? URL_STAGE_SECOND : URL_STAGE_FETCH; - dir = 1; - } - break; - - case URL_STAGE_SECOND: - rc = urlSecondarySetupPanel(&ui, proto); - if (rc) { - stage = URL_STAGE_MAIN; - dir = -1; - } else { - stage = URL_STAGE_FETCH; - dir = 1; - } - break; - - case URL_STAGE_FETCH: - if (FL_TESTING(flags)) { - stage = URL_STAGE_DONE; - dir = 1; - break; - } - - if (loadUrlImages(&ui, flags)) { - stage = URL_STAGE_MAIN; - dir = -1; - } else { - stage = URL_STAGE_DONE; - dir = 1; - } - break; - } - } - - login = ""; - login = getLoginName(login, ui); - - if (!strcmp(ui.prefix, "/")) - finalPrefix = "/."; - else - finalPrefix = ui.prefix; - - url = malloc(strlen(finalPrefix) + 25 + strlen(ui.address) + strlen(login)); - sprintf(url, "%s://%s%s/%s", - ui.protocol == URL_METHOD_FTP ? "ftp" : "http", - login, ui.address, finalPrefix); - - writeNetInfo("/tmp/netinfo", &netDev, kd); - - return url; -} - -#endif - -static char * doMountImage(char * location, - struct knownDevices * kd, - moduleInfoSet modInfo, - moduleList modLoaded, - moduleDeps * modDepsPtr, - char ** lang, - char ** keymap, - char ** kbdtype, - int flags) { - static int defaultMethod = 0; - int i, rc, dir = 1; - int validMethods[10]; - int numValidMethods = 0; - char * installNames[10]; - int methodNum = 0; - int networkAvailable = 0; - int localAvailable = 0; - void * class; - char * url = NULL; - enum { STEP_LANG, STEP_KBD, STEP_METHOD, STEP_URL, STEP_DONE } step; - - if ((class = isysGetModuleList(modInfo, DRIVER_NET))) { - networkAvailable = 1; - free(class); - } - - if ((class = isysGetModuleList(modInfo, DRIVER_SCSI))) { - localAvailable = 1; - free(class); - } - -#if defined(__s390__) || defined(__s390x__) - #define STARTMETHOD 1 -#else - #define STARTMETHOD 0 -#endif - -#if defined(__alpha__) || defined(__ia64__) \ - || defined(__s390__ ) || defined(__s390x__) || defined(__powerpc__) - for (i = 0; i < numMethods; i++) { - installNames[numValidMethods] = _(installMethods[i].name); - validMethods[numValidMethods++] = i; - } -#else - /* platforms with split boot/bootnet disks */ -#if defined(INCLUDE_PCMCIA) - for (i = 0; i < numMethods; i++) { - int j; - - for (j = 0; j < kd->numKnown; j++) - if (installMethods[i].deviceType == kd->known[j].class) break; - - if (j < kd->numKnown) { - if (i == defaultMethod) methodNum = numValidMethods; - - installNames[numValidMethods] = _(installMethods[i].name); - validMethods[numValidMethods++] = i; - } - } -#endif - - if (!numValidMethods) { - for (i = 0; i < numMethods; i++) { - if ((networkAvailable && installMethods[i].network) || - (localAvailable && !installMethods[i].network)) { - if (i == defaultMethod) methodNum = numValidMethods; - - installNames[numValidMethods] = _(installMethods[i].name); - validMethods[numValidMethods++] = i; - } - } - } -#endif - - installNames[numValidMethods] = NULL; - - if (!numValidMethods) { - logMessage("no install methods have the required devices!\n"); - exit(1); - } - - /* This is a check for NFS or CD-ROM rooted installs */ - if (!access("/mnt/source/RedHat/instimage/usr/bin/anaconda", X_OK)) - return "cdrom://unknown/mnt/source/."; - -#if defined (INCLUDE_LOCAL) - /* If no network is available, check any attached CDROM device for a - Red Hat CD. If there is one there, just die happy */ - if (!FL_ASKMETHOD(flags) && !FL_KICKSTART(flags)) { - url = setupCdrom(NULL, location, kd, modInfo, modLoaded, modDepsPtr, - flags, 1, 1); - if (url) return url; - } -#endif /* defined (INCLUDE_LOCAL) */ - - startNewt(flags); - -#ifdef INCLUDE_KON - if (continuing) - step = STEP_KBD; - else - step = STEP_LANG; -#else - step = STEP_LANG; -#endif - - while (step != STEP_DONE) { - switch (step) { - case STEP_LANG: -#if !defined (__s390__) && !defined (__s390x__) - chooseLanguage(lang, flags); -#endif - defaultLang = 0; - step = STEP_KBD; - dir = 1; - break; - - case STEP_KBD: -#if !defined (__s390__) && !defined (__s390x__) - rc = chooseKeyboard (keymap, kbdtype, flags); - - if (rc == LOADER_NOOP) { - if (dir == -1) - step = STEP_LANG; - else - step = STEP_METHOD; - break; - } - - if (rc == LOADER_BACK) { - step = STEP_LANG; - dir = -1; - } else { - step = STEP_METHOD; - dir = 1; - } -#else - step = STEP_METHOD; - dir = 1; -#endif - break; - - case STEP_METHOD: - rc = newtWinMenu(FL_RESCUE(flags) ? _("Rescue Method") : - _("Installation Method"), - FL_RESCUE(flags) ? - _("What type of media contains the rescue image?") - : - _("What type of media contains the packages to be " - "installed?"), - 30, 10, 20, 6, installNames, - &methodNum, _("OK"), _("Back"), NULL); - if (rc && rc != 1) { - step = STEP_KBD; - dir = -1; - } else { - step = STEP_URL; - dir = 1; - } - break; - case STEP_URL: -logMessage("starting to STEP_URL"); - url = installMethods[validMethods[methodNum]].mountImage( - installMethods + validMethods[methodNum], location, - kd, modInfo, modLoaded, modDepsPtr, flags); - logMessage("got url %s", url); - if (!url) { - step = STEP_METHOD; - dir = -1; - } else { - step = STEP_DONE; - dir = 1; - } - break; - default: - break; - } - - } - - return url; -} - -static int kickstartDevices(struct knownDevices * kd, moduleInfoSet modInfo, - moduleList modLoaded, moduleDeps * modDepsPtr, - int flags) { - char ** ksArgv = NULL; - int ksArgc, rc; - char * opts, * device, * type; - char ** optv; - poptContext optCon; - int doContinue, missingOkay; /* obsolete */ - char * fsType = "ext2"; - char * fsDevice = NULL; - struct moduleInfo * mi; - struct driverDiskInfo * ddi; - struct poptOption diskTable[] = { - { "type", 't', POPT_ARG_STRING, &fsType, 0 }, - { 0, 0, 0, 0, 0 } - }; - struct poptOption table[] = { - { "continue", '\0', POPT_ARG_STRING, &doContinue, 0 }, - { "missingok", '\0', POPT_ARG_STRING, &missingOkay, 0 }, - { "opts", '\0', POPT_ARG_STRING, &opts, 0 }, - { 0, 0, 0, 0, 0 } - }; - - if (!ksGetCommand(KS_CMD_DRIVERDISK, NULL, &ksArgc, &ksArgv)) { - optCon = poptGetContext(NULL, ksArgc, (const char **) ksArgv, diskTable, 0); - - ddi = calloc(sizeof(*ddi), 1); - - do { - if ((rc = poptGetNextOpt(optCon)) < -1) { - logMessage("bad argument to kickstart driverdisk command " - "%s: %s", - poptBadOption(optCon, POPT_BADOPTION_NOALIAS), - poptStrerror(rc)); - break; - } - - fsDevice = (char *) poptGetArg(optCon); - - if (!fsDevice || poptGetArg(optCon)) { - logMessage("bad arguments to kickstart driverdisk command"); - break; - } - - ddi->fs = strdup(fsType); - - if (strcmp(ddi->fs, "nfs")) { - ddi->device = strdup(fsDevice); - ddi->mntDevice = "/tmp/disk"; - - devMakeInode(ddi->device, ddi->mntDevice); - } else { - ddi->mntDevice = fsDevice; - } - - logMessage("looking for driver disk (%s, %s, %s)", - ddi->fs, ddi->device, ddi->mntDevice); - - if (doPwMount(ddi->mntDevice, "/tmp/drivers", ddi->fs, 1, 0, - NULL, NULL)) { - logMessage("failed to mount %s", ddi->mntDevice); - break; - } - - if (devInitDriverDisk(modInfo, modLoaded, modDepsPtr, flags, - "/tmp/drivers", ddi)) { - logMessage("driver information missing!"); - } - - umount("/tmp/drivers"); - } while (0); - } - - ksArgv = NULL; - while (!ksGetCommand(KS_CMD_DEVICE, ksArgv, &ksArgc, &ksArgv)) { - opts = NULL; - - optCon = poptGetContext(NULL, ksArgc, (const char **) ksArgv, table, 0); - - if ((rc = poptGetNextOpt(optCon)) < -1) { - logMessage("bad argument to kickstart device command %s: %s", - poptBadOption(optCon, POPT_BADOPTION_NOALIAS), - poptStrerror(rc)); - continue; - } - - type = (char *) poptGetArg(optCon); - device = (char *) poptGetArg(optCon); - - if (!type || !device || poptGetArg(optCon)) { - logMessage("bad arguments to kickstart device command"); - poptFreeContext(optCon); - continue; - } - - if (!(mi = isysFindModuleInfo(modInfo, device))) { - logMessage("unknown module %s", device); - continue; - } - - logMessage("found information on module %s", device); - - if (opts) - poptParseArgvString(opts, &rc, (const char ***) &optv); - else - optv = NULL; - - rc = mlLoadModule(device, modLoaded, - *modDepsPtr, optv, modInfo, flags); - if (optv) free(optv); - - if (rc) - logMessage("module %s failed to insert", device); - else - logMessage("module %s inserted successfully", device); - } - - if (!ksGetCommand(KS_CMD_DEVICEPROBE, ksArgv, &ksArgc, &ksArgv)) { - if (ksArgc != 1) { - logMessage("unexpected arguments to deviceprobe command"); - } - - logMessage("forcing device probe"); - - busProbe(modInfo, modLoaded, *modDepsPtr, 0, kd, flags); - } - - kdFindScsiList(kd, 0); - kdFindNetList(kd, 0); - - return 0; -} - -static char * setupKickstart(char * location, struct knownDevices * kd, - moduleInfoSet modInfo, - moduleList modLoaded, - moduleDeps * modDepsPtr, int * flagsPtr, - char * netDevice) { - char ** ksArgv; - int ksArgc; - int ksType; - int i, rc; - int flags = *flagsPtr; - enum deviceClass ksDeviceType; - struct poptOption * table; - poptContext optCon; - char * dir = NULL; - char * imageUrl; -#ifdef INCLUDE_NETWORK - struct iurlinfo ui; - char * chptr; - static struct networkDeviceConfig netDev; - char * host = NULL, * url = NULL, * proxy = NULL, * proxyport = NULL; - char * fullPath, *isopath; - - struct poptOption ksNfsOptions[] = { - { "server", '\0', POPT_ARG_STRING, &host, 0 }, - { "dir", '\0', POPT_ARG_STRING, &dir, 0 }, - { 0, 0, 0, 0, 0 } - }; - - struct poptOption ksUrlOptions[] = { - { "url", '\0', POPT_ARG_STRING, &url, 0 }, - { "proxy", '\0', POPT_ARG_STRING, &proxy, 0 }, - { "proxyport", '\0', POPT_ARG_STRING, &proxyport, 0 }, - { 0, 0, 0, 0, 0 } - }; -#endif -#ifdef INCLUDE_LOCAL - char * partname = NULL; - struct poptOption ksHDOptions[] = { - { "dir", '\0', POPT_ARG_STRING, &dir, 0 }, - { "partition", '\0', POPT_ARG_STRING, &partname, 0 }, - { 0, 0, 0, 0, 0 } - }; -#endif - - kickstartDevices(kd, modInfo, modLoaded, modDepsPtr, flags); - - if (0) { -#ifdef INCLUDE_NETWORK - } else if (ksHasCommand(KS_CMD_NFS)) { - ksDeviceType = CLASS_NETWORK; - ksType = KS_CMD_NFS; - table = ksNfsOptions; - } else if (ksHasCommand(KS_CMD_URL)) { - ksDeviceType = CLASS_NETWORK; - ksType = KS_CMD_URL; - table = ksUrlOptions; -#endif -#ifdef INCLUDE_LOCAL - } else if (ksHasCommand(KS_CMD_CDROM)) { - ksDeviceType = CLASS_CDROM; - ksType = KS_CMD_CDROM; - table = NULL; - } else if (ksHasCommand(KS_CMD_HD)) { - ksDeviceType = CLASS_UNSPEC; - ksType = KS_CMD_HD; - table = ksHDOptions; -#endif - } else { - logMessage("no install method specified for kickstart"); - return NULL; - } - - if (ksDeviceType != CLASS_UNSPEC) { - if (!netDevice) { - for (i = 0; i < kd->numKnown; i++) - if (kd->known[i].class == ksDeviceType) break; - - if (i == kd->numKnown) { - logMessage("no appropriate device for kickstart method is " - "available"); - return NULL; - } - - netDevice = kd->known[i].name; - } - - logMessage("kickstarting through device %s", netDevice); - } - - if (!ksGetCommand(KS_CMD_XDISPLAY, NULL, &ksArgc, &ksArgv)) { - setenv("DISPLAY", ksArgv[1], 1); - } - - if (!ksGetCommand(KS_CMD_TEXT, NULL, &ksArgc, &ksArgv)) - (*flagsPtr) = (*flagsPtr) | LOADER_FLAGS_TEXT; - - if (table) { - ksGetCommand(ksType, NULL, &ksArgc, &ksArgv); - - optCon = poptGetContext(NULL, ksArgc, (const char **) ksArgv, table, 0); - - if ((rc = poptGetNextOpt(optCon)) < -1) { - logMessage("bad argument to kickstart method command %s: %s", - poptBadOption(optCon, POPT_BADOPTION_NOALIAS), - poptStrerror(rc)); - return NULL; - } - } - - chooseKeyboard(NULL, NULL, flags); - -#ifdef INCLUDE_NETWORK - if (ksType == KS_CMD_NFS || ksType == KS_CMD_URL) { - startNewt(flags); - if (kickstartNetwork(&netDevice, &netDev, NULL, flags)) return NULL; - writeNetInfo("/tmp/netinfo", &netDev, kd); - } -#endif - - imageUrl = NULL; - -#ifdef INCLUDE_NETWORK - if (ksType == KS_CMD_NFS) { - int count = 0; - fullPath = alloca(strlen(host) + strlen(dir) + 2); - sprintf(fullPath, "%s:%s", host, dir); - - logMessage("mounting nfs path %s", fullPath); - - while (count < 3 - && doPwMount(fullPath, "/mnt/source", "nfs", 1, 0, NULL, NULL)) { - logMessage("mount failed, retrying after 3 second sleep"); - sleep(3); - count++; - } - - if (count == 3) - return NULL; - - if (!access("/mnt/source/RedHat/base/stage2.img", R_OK)) { - if (!mountLoopback("/mnt/source/RedHat/base/stage2.img", - "/mnt/runtime", "loop0")) { - rmdir("/mnt/source"); - symlink("/mnt/source", "/mnt/source"); - useMntSourceUpdates("/mnt/source/RedHat/base/updates.img"); - imageUrl = "nfs://mnt/source/."; - } - } else if ((isopath = validIsoImages("/mnt/source"))) { - useMntSourceUpdates("/mnt/source/updates.img"); - - if (mountLoopback(isopath, "/mnt/source2", "loop1")) - logMessage("failed to mount iso loopback!"); - else { - if (mountLoopback("/mnt/source2/RedHat/base/stage2.img", - "/mnt/runtime", "loop0")) - logMessage("failed to mount install loopback!"); - else { - useMntSourceUpdates("/mnt/source2/RedHat/base/updates.img"); - imageUrl = "nfsiso:/mnt/source"; - } - } - } else { - logMessage("No valid tree or isos found in %s", fullPath); - umount("/mnt/source"); - return NULL; - } - - if (!imageUrl) - return NULL; - - } else if (ksType == KS_CMD_URL) { - char * finalPrefix; - char * login; - memset(&ui, 0, sizeof(ui)); - - imageUrl = strdup(url); - - if (!strncmp("ftp://", url, 6)) { - ui.protocol = URL_METHOD_FTP; - url += 6; - - /* There could be a username/password on here */ - if ((chptr = strchr(url, '@'))) { - if ((chptr = strchr(url, ':'))) { - *chptr = '\0'; - ui.login = strdup(url); - url = chptr + 1; - - chptr = strchr(url, '@'); - *chptr = '\0'; - ui.password = strdup(url); - url = chptr + 1; - } else { - *chptr = '\0'; - ui.login = strdup(url); - url = chptr + 1; - } - } - } else if (!strncmp("http://", url, 7)) { - ui.protocol = URL_METHOD_HTTP; - url +=7; - } else { - logMessage("unknown url protocol '%s'", url); - return NULL; - } - - /* url is left pointing at the hostname */ - chptr = strchr(url, '/'); - *chptr = '\0'; - ui.address = strdup(url); - url = chptr; - *url = '/'; - ui.prefix = strdup(url); - - logMessage("url address %s", ui.address); - logMessage("url prefix %s", ui.prefix); - - if (loadUrlImages(&ui, flags)) { - logMessage("failed to retrieve second stage"); - return NULL; - } - - /* now that we've loaded images, the url could have changed to handle - the multi-disc loopback stuff */ - if (!strcmp(ui.prefix, "/")) - finalPrefix = "/."; - else - finalPrefix = ui.prefix; - - login = ""; - login = getLoginName(login, ui); - - url = malloc(strlen(finalPrefix) + 25 + strlen(ui.address) + strlen(login)); - sprintf(url, "%s://%s%s/%s", - ui.protocol == URL_METHOD_FTP ? "ftp" : "http", - login, ui.address, finalPrefix); - } -#endif - -#ifdef INCLUDE_LOCAL - if (ksType == KS_CMD_CDROM) { - imageUrl = setupCdrom(NULL, location, kd, modInfo, modLoaded, - modDepsPtr, flags, 1, 1); - } else if (ksType == KS_CMD_HD) { - char *hdfstypes[]={"ext2", "vfat", "ufs", NULL}; - int i; - - if (!strncmp(partname, "/dev/", 5)) - partname += 5; - - logMessage("partname is %s", partname); - - for (i=0; hdfstypes[i]; i++) { - logMessage("Trying to find hdtree %s %s %s", partname, hdfstypes[i], dir); - imageUrl = setupOldHardDrive(partname, hdfstypes[i], dir, flags); - if (imageUrl) - break; - } - - if (!imageUrl) { - for (i=0; hdfstypes[i]; i++) { - logMessage("Trying to find hdiso %s %s %s", partname, hdfstypes[i], dir); - imageUrl = setupIsoImages(partname, hdfstypes[i], dir, flags); - if (imageUrl) { - logMessage("returned imageUrl = %s", imageUrl); - break; - } - } - } - - if (!imageUrl) - logMessage ("Failed to mount hd kickstart media"); - } -#endif - - return imageUrl; -} - -static int parseCmdLineFlags(int flags, char * cmdLine, char ** ksSource, - char ** ksDevice, char ** instClass, char *extraArgs[]) { - int fd; - char buf[500]; - int len; - char ** argv; - int argc; - int i; - int numExtraArgs = 0; - - logMessage("here with cmdLine %s", cmdLine); - - if (!cmdLine) { - if ((fd = open("/proc/cmdline", O_RDONLY)) < 0) return flags; - len = read(fd, buf, sizeof(buf) - 1); - close(fd); - if (len <= 0) return flags; - - buf[len] = '\0'; - cmdLine = buf; - } - - if (poptParseArgvString(cmdLine, &argc, (const char ***) &argv)) return flags; - - for (i = 0; i < argc; i++) { - if (!strcasecmp(argv[i], "expert")) - flags |= (LOADER_FLAGS_EXPERT | LOADER_FLAGS_MODDISK | - LOADER_FLAGS_ASKMETHOD); - else if (!strcasecmp(argv[i], "askmethod")) - flags |= LOADER_FLAGS_ASKMETHOD; - else if (!strcasecmp(argv[i], "telnet")) - flags |= LOADER_FLAGS_TELNETD; - else if (!strcasecmp(argv[i], "noshell")) - flags |= LOADER_FLAGS_NOSHELL; - else if (!strcasecmp(argv[i], "mediacheck")) - flags |= LOADER_FLAGS_MEDIACHECK; - else if (!strcasecmp(argv[i], "nousbstorage")) - flags |= LOADER_FLAGS_NOUSBSTORAGE; - else if (!strcasecmp(argv[i], "nousb")) - flags |= LOADER_FLAGS_NOUSB; - else if (!strcasecmp(argv[i], "nofirewire")) - flags |= LOADER_FLAGS_NOIEEE1394; - else if (!strcasecmp(argv[i], "noprobe")) - flags |= LOADER_FLAGS_NOPROBE; - else if (!strcasecmp(argv[i], "nopcmcia")) - flags |= LOADER_FLAGS_NOPCMCIA; - else if (!strcasecmp(argv[i], "text")) - flags |= LOADER_FLAGS_TEXT; - else if (!strcasecmp(argv[i], "updates")) - flags |= LOADER_FLAGS_UPDATES; - else if (!strncasecmp(argv[i], "class=", 6)) - *instClass = argv[i] + 6; - else if (!strcasecmp(argv[i], "isa")) - flags |= LOADER_FLAGS_ISA; - else if (!strcasecmp(argv[i], "mcheck")) - flags |= LOADER_FLAGS_MCHECK; - else if (!strcasecmp(argv[i], "dd")) - flags |= LOADER_FLAGS_MODDISK; - else if (!strcasecmp(argv[i], "driverdisk")) - flags |= LOADER_FLAGS_MODDISK; - else if (!strcasecmp(argv[i], "rescue")) - flags |= LOADER_FLAGS_RESCUE; - else if (!strcasecmp(argv[i], "nopass")) - flags |= LOADER_FLAGS_NOPASS; - else if (!strncasecmp(argv[i], "ksdevice=", 9)) { - *ksDevice = argv[i] + 9; - } else if (!strcasecmp(argv[i], "serial")) - flags |= LOADER_FLAGS_SERIAL; - else if (!strcasecmp(argv[i], "ks")) { - flags |= LOADER_FLAGS_KSNFS; - *ksSource = NULL; - } else if (!strncasecmp(argv[i], "ks=cdrom:", 9)) { - flags |= LOADER_FLAGS_KSCDROM; - *ksSource = argv[i] + 9; - } else if (!strncasecmp(argv[i], "ks=nfs:", 7)) { - flags |= LOADER_FLAGS_KSNFS; - *ksSource = argv[i] + 7; - } else if (!strncasecmp(argv[i], "ks=http://", 10)) { - flags |= LOADER_FLAGS_KSHTTP; - *ksSource = argv[i] + 10; - } else if (!strcasecmp(argv[i], "ks=floppy")) - flags |= LOADER_FLAGS_KSFLOPPY; - else if (!strncasecmp(argv[i], "display=", 8)) - setenv("DISPLAY", argv[i] + 8, 1); - else if (!strncasecmp(argv[i], "ks=hd:", 6)) { - flags |= LOADER_FLAGS_KSHD; - *ksSource = argv[i] + 6; - } else if (!strncasecmp(argv[i], "ks=file:", 8)) { - flags |= LOADER_FLAGS_KSFILE; - *ksSource = argv[i] + 8; - } else if (!strncasecmp(argv[i], "lang=", 5)) { - /* For Japanese, we have two options. We should just - display them so we don't have to start kon if it is not needed. */ -#ifndef INCLUDE_KON - setLanguage (argv[i] + 5, flags); - defaultLang = 1; -#endif - } else if (numExtraArgs < (MAX_EXTRA_ARGS - 1)) { - /* go through and append args we just want to pass on to */ - /* the anaconda script, but don't want to represent as a */ - /* LOADER_FLAG_XXX since loader doesn't care about these */ - /* particular options. */ - if (!strncasecmp(argv[i], "resolution=", 11) || - !strncasecmp(argv[i], "lowres", 6) || - !strncasecmp(argv[i], "skipddc", 7) || - !strncasecmp(argv[i], "nomount", 7)) { - int arglen; - - arglen = strlen(argv[i])+3; - extraArgs[numExtraArgs] = (char *) malloc(arglen*sizeof(char)); - snprintf(extraArgs[numExtraArgs], arglen, "--%s", argv[i]); - numExtraArgs = numExtraArgs + 1; - - if (numExtraArgs > (MAX_EXTRA_ARGS - 2)) { - logMessage("Too many command line arguments (128), " - "rest will be dropped."); - } - } - } - } - - /* NULL terminate the array of extra args */ - extraArgs[numExtraArgs] = NULL; - - return flags; -} - -#ifdef INCLUDE_NETWORK -int kickstartFromNfs(struct knownDevices * kd, char * location, - moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags, char * ksSource, - char * ksDevice) { - struct networkDeviceConfig netDev; - char * file, * fullFn; - char * ksPath; - char * devName; - - if (!ksDevice) { - if (ensureNetDevice(kd, modInfo, modLoaded, modDepsPtr, flags, - &devName)) - return 1; - } else { - devName = ksDevice; - } - - if (kickstartNetwork(&devName, &netDev, "dhcp", flags)) { - logMessage("no dhcp response received"); - return 1; - } - - writeNetInfo("/tmp/netinfo", &netDev, kd); - - if (!(netDev.dev.set & PUMP_INTFINFO_HAS_NEXTSERVER)) { - logMessage("no bootserver was found"); - return 1; - } - - if (!(netDev.dev.set & PUMP_INTFINFO_HAS_BOOTFILE)) { - file = "/kickstart/"; - logMessage("bootp: no bootfile received"); - } else { - file = netDev.dev.bootFile; - } - - if (ksSource) { - ksPath = alloca(strlen(ksSource) + 1); - strcpy(ksPath, ksSource); - } else { - ksPath = alloca(strlen(file) + - strlen(inet_ntoa(netDev.dev.nextServer)) + 70); - strcpy(ksPath, inet_ntoa(netDev.dev.nextServer)); - strcat(ksPath, ":"); - strcat(ksPath, file); - } - - if (ksPath[strlen(ksPath) - 1] == '/') { - ksPath[strlen(ksPath) - 1] = '\0'; - file = malloc(30); - sprintf(file, "%s-kickstart", inet_ntoa(netDev.dev.ip)); - } else { - file = strrchr(ksPath, '/'); - if (!file) { - file = ksPath; - ksPath = "/"; - } else { - *file++ = '\0'; - } - } - - logMessage("ks server: %s file: %s", ksPath, file); - - if (doPwMount(ksPath, "/tmp/nfskd", "nfs", 1, 0, NULL, NULL)) { - logMessage("failed to mount %s", ksPath); - return 1; - } - - fullFn = malloc(strlen(file) + 20); - sprintf(fullFn, "/tmp/nfskd/%s", file); - copyFile(fullFn, location); - - umount("/tmp/nfskd"); - - return 0; -} - -int kickstartFromHttp(struct knownDevices * kd, char * location, - moduleInfoSet modInfo, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags, char * ksSource, - char * ksDevice) { - struct networkDeviceConfig netDev; - struct iurlinfo ui; - char * file; - char * ksPath; - char * devName; - char * chptr; - int fd, rc; - - memset(&ui, 0, sizeof(ui)); - - if (!ksDevice) { - if (ensureNetDevice(kd, modInfo, modLoaded, modDepsPtr, flags, - &devName)) - return 1; - } else { - devName = ksDevice; - } - - if (kickstartNetwork(&devName, &netDev, "dhcp", flags)) { - logMessage("no dhcp response received"); - return 1; - } - - writeNetInfo("/tmp/netinfo", &netDev, kd); - - if (ksSource) { - ksPath = alloca(strlen(ksSource) + 1); - strcpy(ksPath, ksSource); - } else { - logMessage("no location specified"); - return 1; - } - - if (ksPath[strlen(ksPath) - 1] == '/') { - ksPath[strlen(ksPath) - 1] = '\0'; - file = malloc(30); - sprintf(file, "%s-kickstart", inet_ntoa(netDev.dev.ip)); - } else { - file = strrchr(ksPath, '/'); - if (!file) { - file = ksPath; - ksPath = "/"; - } else { - *file++ = '\0'; - } - } - - logMessage("ks location: http://%s/%s", ksPath, file); - - ui.protocol = URL_METHOD_HTTP; - chptr = strchr(ksPath, '/'); - if (chptr == NULL) { - ui.address = strdup(ksPath); - ui.prefix = strdup("/"); - } else { - *chptr = '\0'; - ui.address = strdup(ksPath); - ksPath = chptr; - *ksPath = '/'; - ui.prefix = strdup(ksPath); - } - - fd = urlinstStartTransfer(&ui, file, 1); - if (fd < 0) { - logMessage("failed to retrieve http://%s/%s/%s", ui.address, ui.prefix, file); - return 1; - } - - rc = copyFileFd(fd, "/tmp/ks.cfg"); - if (rc) { - unlink("/tmp/ks.cfg"); - logMessage("failed to copy ks.cfg to /tmp/ks.cfg"); - return 1; - } - - urlinstFinishTransfer(&ui, fd); - - return 0; -} -#endif - -int kickstartFromHardDrive(char * location, - moduleList modLoaded, moduleDeps * modDepsPtr, - char * source, int flags) { - char * device; - char * fileName; - char * fullFn; - -#ifdef __sparc__ - mlLoadModuleSet("ufs", modLoaded, *modDepsPtr, NULL, flags); -#endif - - fileName = strchr(source, '/'); - /* XXX FIX ME FOR THE NEXT RELEASE */ - /* change syntax to ks=hd:[device]:/path/to/ks.cfg */ - if (!strncmp (source, "cciss", 5) || - !strncmp (source, "ida", 3) || - !strncmp (source, "i2o", 3) || - !strncmp (source, "rd", 2)) { - /* chomp in the next part */ - fileName++; - fileName = strchr(fileName, '/'); - } - *fileName = '\0'; - fileName++; - device = source; - - if (devMakeInode(device, "/tmp/hddevice")) { - logMessage("failed to make device %s", device); - return 1; - } - - if (doPwMount("/tmp/hddevice", "/mnt/hddrive", "ext2", 1, 0, - NULL, NULL) && - doPwMount("/tmp/hddevice", "/mnt/hddrive", "vfat", 1, 0, - NULL, NULL)) { - logMessage("failed to mount %s", device); - } - - fullFn = alloca(strlen(fileName) + 20); - sprintf(fullFn, "/mnt/hddrive/%s", fileName); - copyFile(fullFn, location); - - umount("/mnt/hddrive"); - - return 0; -} - -int kickstartFromFloppy(char * location, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags) { - - if (devMakeInode(floppyDevice, "/tmp/floppy")) - return 1; - - if ((doPwMount("/tmp/floppy", "/tmp/ks", "vfat", 1, 0, NULL, NULL)) && - doPwMount("/tmp/floppy", "/tmp/ks", "ext2", 1, 0, NULL, NULL)) { - logMessage("failed to mount floppy: %s", strerror(errno)); - return 1; - } - - if (access("/tmp/ks/ks.cfg", R_OK)) { - newtWinMessage(_("Error"), _("OK"), - _("Cannot find ks.cfg on boot floppy.")); - return 1; - } - - copyFile("/tmp/ks/ks.cfg", location); - - umount("/tmp/ks"); - unlink("/tmp/floppy"); - - logMessage("kickstart file copied to %s", location); - - return 0; -} - -/* Recursive */ -int copyDirectory(char * from, char * to) { - DIR * dir; - struct dirent * ent; - int fd, outfd; - char buf[4096]; - int i; - struct stat sb; - char filespec[256]; - char filespec2[256]; - char link[1024]; - - mkdir(to, 0755); - - if (!(dir = opendir(from))) { - newtWinMessage(_("Error"), _("OK"), - _("Failed to read directory %s: %s"), - from, strerror(errno)); - return 1; - } - - errno = 0; - while ((ent = readdir(dir))) { - if (ent->d_name[0] == '.') continue; - - sprintf(filespec, "%s/%s", from, ent->d_name); - sprintf(filespec2, "%s/%s", to, ent->d_name); - - lstat(filespec, &sb); - - if (S_ISDIR(sb.st_mode)) { - logMessage("recursively copying %s", filespec); - if (copyDirectory(filespec, filespec2)) return 1; - } else if (S_ISLNK(sb.st_mode)) { - i = readlink(filespec, link, sizeof(link) - 1); - link[i] = '\0'; - if (symlink(link, filespec2)) { - logMessage("failed to symlink %s to %s: %s", - filespec2, link, strerror(errno)); - } - } else { - fd = open(filespec, O_RDONLY); - if (fd < 0) { - logMessage("failed to open %s: %s", filespec, - strerror(errno)); - return 1; - } - outfd = open(filespec2, O_RDWR | O_TRUNC | O_CREAT, 0644); - if (outfd < 0) { - logMessage("failed to create %s: %s", filespec2, - strerror(errno)); - } else { - fchmod(outfd, sb.st_mode & 07777); - - while ((i = read(fd, buf, sizeof(buf))) > 0) - write(outfd, buf, i); - close(outfd); - } - - close(fd); - } - - errno = 0; - } - - closedir(dir); - - return 0; -} - -void loadUpdates(struct knownDevices *kd, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags) { - int done = 0; - int rc; - - startNewt(flags); - - do { - rc = newtWinChoice(_("Updates Disk"), _("OK"), _("Cancel"), - _("Insert your updates disk and press \"OK\" to continue.")); - - if (rc == 2) return; - -#if 0 - _("The floppy disk you inserted is not a valid update disk " - "for this release of %s."), PRODUCTNAME -#endif - -logMessage("UPDATES floppy device is %s", floppyDevice); - - devMakeInode(floppyDevice, "/tmp/floppy"); - if (doPwMount("/tmp/floppy", "/tmp/update-disk", "ext2", 1, 0, NULL, - NULL)) { - newtWinMessage(_("Error"), _("OK"), - _("Failed to mount floppy disk.")); - } else { - /* Copy everything to /tmp/updates so .so files don't get run - from /dev/floppy. We could (and probably should) get smarter - about this at some point. */ - winStatus(40, 3, _("Updates"), _("Reading anaconda updates...")); - if (!copyDirectory("/tmp/update-disk", "/tmp/updates")) done = 1; - newtPopWindow(); - umount("/tmp/update-disk"); - } - } while (!done); - - return; -} - -#ifdef __sparc__ -/* Don't load the large ufs module if it will not be needed - to save some memory on lowmem SPARCs. */ -void loadUfs(struct knownDevices *kd, moduleList modLoaded, - moduleDeps * modDepsPtr, int flags) { - int i, j, fd, rc; - struct partitionTable table; - int ufsloaded = 0; - - for (i = 0; i < kd->numKnown; i++) { - if (kd->known[i].class == CLASS_HD) { - devMakeInode(kd->known[i].name, "/tmp/hddevice"); - if ((fd = open("/tmp/hddevice", O_RDONLY)) >= 0) { - if ((rc = balkanReadTable(fd, &table))) { - logMessage("failed to read partition table for " - "device %s: %d", kd->known[i].name, rc); - } else { - for (j = 0; j < table.maxNumPartitions; j++) { - if (table.parts[j].type == BALKAN_PART_UFS) { - if (!ufsloaded) { - mlLoadModuleSet("ufs", modLoaded, - *modDepsPtr, NULL, flags); - ufsloaded = 1; - } - } - } - } - - close(fd); - } - unlink("/tmp/hddevice"); - } - } -} -#else -#define loadUfs(kd,modLoaded,modDepsPtr,flags) do { } while (0) -#endif - -/* return value of global floppyDevice */ -char *getCurrentFloppyDevice() { - return floppyDevice; -} -void setFloppyDevice(int flags) { -#if defined(__i386__) || defined(__ia64__) || defined(__powerpc__) - struct device ** devices; - int foundFd0 = 0; - int i = 0; - - logMessage("probing for floppy devices"); - - devices = probeDevices(CLASS_FLOPPY, BUS_IDE | BUS_SCSI | BUS_MISC, PROBE_ALL); - - if (!devices) { - logMessage("no floppy devices found"); - return; - } - - for(i=0;devices[i];i++) { - if (devices[i]->detached == 0) { - logMessage("first non-detached floppy is %s", devices[i]->device); - foundFd0 = 1; - break; - } - } - - if (foundFd0) { - floppyDevice = strdup(devices[i]->device); - } - -#endif - logMessage("system floppy device is %s", floppyDevice); -} - - -static void sleepUntilUsbIsStable(void) { - struct stat sb; - time_t last = 0; - int i, count = 0; - - /* sleep for a maximum of 20 seconds, minimum of 2 seconds */ - logMessage("waiting for usb to become stable..."); - for (i = 0; i < 20; i++) { - stat("/proc/bus/usb/devices", &sb); - if (last == sb.st_mtime) { - count++; - /* if we get the same mtime twice in a row, should be - good enough to use now */ - if (count > 1) - break; - } else { - /* if we didn't match mtimes, reset the stability counter */ - count = 0; - } - last = sb.st_mtime; - sleep(1); - } - logMessage("%d seconds.", i); -} - -static int usbInitialize(moduleList modLoaded, moduleDeps modDeps, - moduleInfoSet modInfo, int flags) { - struct device ** devices; - char * buf; - - if (FL_NOUSB(flags)) return 0; - - logMessage("looking for usb controllers"); - - devices = probeDevices(CLASS_USB, BUS_PCI, PROBE_ALL); - - if (!devices) { - logMessage("no usb controller found"); - return 0; - } - - logMessage("found USB controller %s", devices[0]->driver); - - if (mlLoadModuleSet(devices[0]->driver, modLoaded, modDeps, modInfo, - flags)) { - logMessage("failed to insert usb module"); - /* dont return, just keep going. */ - /* may have USB built into kernel */ - /* return 1; */ - } - - if (FL_TESTING(flags)) return 0; - - if (doPwMount("/proc/bus/usb", "/proc/bus/usb", "usbdevfs", 0, 0, - NULL, NULL)) - logMessage("failed to mount device usbdevfs: %s", strerror(errno)); - - /* sleep so we make sure usb devices get properly enumerated. - that way we should block when initializing each usb driver until - the device is ready for use */ - sleepUntilUsbIsStable(); - - buf = alloca(40); - sprintf(buf, "hid:keybdev%s", - (FL_NOUSBSTORAGE(flags) ? "" : ":usb-storage")); - mlLoadModuleSet(buf, modLoaded, modDeps, modInfo, flags); - sleep(1); - - return 0; -} - -static int firewireInitialize(moduleList modLoaded, moduleDeps modDeps, - moduleInfoSet modInfo, int flags) { - struct device ** devices; - int i = 0; - - if (FL_NOIEEE1394(flags)) return 0; - - devices = probeDevices(CLASS_FIREWIRE, BUS_PCI, PROBE_ALL); - - if (!devices) { - logMessage("no firewire controller found"); - return 0; - } - - logMessage("found firewire controller %s", devices[0]->driver); - - startNewt(flags); - /* not the best message in the world, but better than sitting - * and looking silly */ - winStatus(40, 3, _("Loading"), _("Loading %s driver..."), - devices[0]->driver); - - if (mlLoadModuleSet(devices[0]->driver, modLoaded, modDeps, modInfo, - flags)) { - logMessage("failed to insert firewire module"); - newtPopWindow(); - return 1; - } - - sleep(3); - newtPopWindow(); - - logMessage("probing for firewire scsi devices"); - devices = probeDevices(CLASS_SCSI, BUS_FIREWIRE, PROBE_ALL); - - if (!devices) { - logMessage("no firewire scsi devices found"); - return 0; - } - - for (i=0;devices[i];i++) { - if ((devices[i]->detached == 0) && (devices[i]->driver != NULL)) { - logMessage("found firewire device using %s", devices[i]->device); - mlLoadModuleSet(devices[i]->driver, modLoaded, modDeps, - modInfo, flags); - } - } - - return 0; -} - -/* This loads the necessary parallel port drivers for printers so that - kudzu can autodetect and setup printers in post install*/ -static void initializeParallelPort(moduleList modLoaded, moduleDeps modDeps, - moduleInfoSet modInfo, int flags) { -#if !defined (__i386__) - return; -#endif - if (FL_NOPARPORT(flags)) return; - - logMessage("loading parallel port drivers..."); - if (mlLoadModuleSet("parport_pc", modLoaded, modDeps, modInfo, flags)) { - logMessage("failed to load parport_pc module"); - return; - } -} - -/* This forces a pause between initializing usb and trusting the /proc - stuff */ -static void usbInitializeMouse(moduleList modLoaded, moduleDeps modDeps, - moduleInfoSet modInfo, int flags) { - -#if defined (__s390__) && defined (__s390x__) - return; -#else - if (FL_NOUSB(flags)) return; - - if (access("/proc/bus/usb/devices", R_OK)) return; - - logMessage("looking for USB mouse..."); - if (probeDevices(CLASS_MOUSE, BUS_USB, PROBE_ALL)) { - logMessage("USB mouse found, loading mousedev module"); - if (mlLoadModuleSet("mousedev", modLoaded, modDeps, modInfo, flags)) { - logMessage ("failed to loading mousedev module"); - return; - } - } -#endif -} - - -static int agpgartInitialize(moduleList modLoaded, moduleDeps modDeps, - moduleInfoSet modInfo, int flags) { - struct device ** devices, *p; - int i; - -#if defined (__s390__) && defined (__s390x__) - /* obviously no agp on s/390 :) */ - return 0; -#else - - if (FL_TESTING(flags)) return 0; - - logMessage("looking for video cards requiring agpgart module"); - - devices = probeDevices(CLASS_VIDEO, BUS_UNSPEC, PROBE_ALL); - - if (!devices) { - logMessage("no video cards found"); - return 0; - } - - /* loop thru cards, see if we need agpgart */ - for (i=0; devices[i]; i++) { - p = devices[i]; - logMessage("found video card controller %s", p->driver); - - /* HACK - need to have list of cards which match!! */ - if (!strcmp(p->driver, "Card:Intel 810") || - !strcmp(p->driver, "Card:Intel 815")) { - logMessage("found %s card requiring agpgart, loading module", - p->driver+5); - - if (mlLoadModuleSet("agpgart", modLoaded, modDeps, modInfo, - flags)) { - logMessage("failed to insert agpgart module"); - return 1; - } else { - /* only load it once! */ - return 0; - } - - } - } - - return 0; -#endif -} - -static void scsiSetup(moduleList modLoaded, moduleDeps modDeps, - moduleInfoSet modInfo, int flags, - struct knownDevices * kd) { - mlLoadModuleSet("sd_mod:sr_mod", modLoaded, modDeps, modInfo, flags); -} - -static void ideSetup(moduleList modLoaded, moduleDeps modDeps, - moduleInfoSet modInfo, int flags, - struct knownDevices * kd) { - - /* This is fast enough that we don't need a screen to pop up */ - mlLoadModuleSet("ide-cd", modLoaded, modDeps, modInfo, flags); - - kdFindIdeList(kd, 0); -} - -static void checkForRam(int flags) { - if (!FL_EXPERT(flags) && (totalMemory() < MIN_RAM)) { - char *buf; - buf = sdupprintf(_("You do not have enough RAM to install %s " - "on this machine."), PRODUCTNAME); - startNewt(flags); - newtWinMessage(_("Error"), _("OK"), buf); - free(buf); - stopNewt(); - exit(0); - } -} - -/* verify that the stamp files in / of the initrd and the stage2 match */ -static void verifyImagesMatched() { - char *stamp1; - char *stamp2; - FILE *f; - int fail = 0; - - stamp1 = alloca(13); - stamp2 = alloca(13); - - /* grab the one from the initrd */ - f = fopen("/.buildstamp", "r"); - if (!f) { - fail = 1; - } else { - fgets(stamp1, 13, f); - - /* and the runtime */ - f = fopen("/mnt/runtime/.buildstamp", "r"); - if (!f) { - fail = 1; - } else { - fgets(stamp2, 13, f); - - if (strncmp(stamp1, stamp2, 12) != 0) { - fail = 1; - } - } - } - - if (fail == 1) { - newtWinMessage(_("Error"), _("OK"), - _("The second stage of the install which you have " - "selected does not match the boot disk which you " - "are using. This shouldn't happen, and I'm " - "rebooting your system now.")); - stopNewt(); - exit(1); - } -} - -static int checkFrameBuffer() { - int fd; - int rc = 0; - struct fb_fix_screeninfo fix; - - if ((fd = open("/dev/fb0", O_RDONLY)) == -1) { - return 0; - } - - if (ioctl(fd, FBIOGET_FSCREENINFO, &fix) >= 0) { - rc = 1; - } - close(fd); - return rc; -} - - -int main(int argc, char ** argv) { - char ** argptr; - char * anacondaArgs[50]; - char * arg, * url = NULL; - poptContext optCon; - int probeOnly = 0; - moduleList modLoaded; - char * cmdLine = NULL; - moduleDeps modDeps; - int i, rc; - int flags = 0; - int testing = 0; - int mediacheck = 0; - int useRHupdates = 0; - char * lang = NULL; - char * keymap = NULL; - char * kbdtype = NULL; - char * instClass = NULL; - struct knownDevices kd; - moduleInfoSet modInfo; - char * where; - char ** tmparg; -#ifdef INCLUDE_PCMCIA - char pcic[20] = ""; -#endif - struct moduleInfo * mi; - char twelve = 12; - char * ksFile = NULL, * ksSource = NULL; - char * ksNetDevice = NULL; - char * extraArgs[MAX_EXTRA_ARGS]; - struct stat sb; - struct poptOption optionTable[] = { - { "cmdline", '\0', POPT_ARG_STRING, &cmdLine, 0 }, - { "ksfile", '\0', POPT_ARG_STRING, &ksFile, 0 }, - { "probe", '\0', POPT_ARG_NONE, &probeOnly, 0 }, - { "test", '\0', POPT_ARG_NONE, &testing, 0 }, - { "mediacheck", '\0', POPT_ARG_NONE, &mediacheck, 0}, - { 0, 0, 0, 0, 0 } - }; - - if (!strcmp(argv[0] + strlen(argv[0]) - 6, "insmod")) - return ourInsmodCommand(argc, argv); - else if (!strcmp(argv[0] + strlen(argv[0]) - 5, "rmmod")) - return combined_insmod_main(argc, argv); - else if (!strcmp(argv[0] + strlen(argv[0]) - 8, "modprobe")) - return ourInsmodCommand(argc, argv); - -#ifdef INCLUDE_KON - else if (!strcmp(argv[0] + strlen(argv[0]) - 3, "kon")) { - setenv("TERM", "kon", 1); - i = kon_main(argc, argv); - return i; - } else if (!strcmp(argv[0] + strlen(argv[0]) - 8, "continue")) { - setenv("TERM", "kon", 1); - continuing = 1; - } -#endif - -#ifdef INCLUDE_PCMCIA - else if (!strcmp(argv[0] + strlen(argv[0]) - 7, "cardmgr")) - return cardmgr_main(argc, argv); - else if (!strcmp(argv[0] + strlen(argv[0]) - 5, "probe")) - return probe_main(argc, argv); -#endif - - /* The fstat checks disallows serial console if we're running through - a pty. This is handy for Japanese. */ - fstat(0, &sb); - if (major(sb.st_rdev) != 3 && major(sb.st_rdev) != 136) { - if (ioctl (0, TIOCLINUX, &twelve) < 0) - flags |= LOADER_FLAGS_SERIAL; - } - - /* don't start modules.conf if continuing as there could be modules - already loaded from a driver disk */ - if ((!FL_TESTING(flags)) && !continuing) { - int fd; - - fd = open("/tmp/modules.conf", O_WRONLY | O_CREAT, 0666); - if (fd < 0) { - logMessage("error creating /tmp/modules.conf: %s\n", - strerror(errno)); - } else { - /* HACK - notting */ -#ifdef __sparc__ - write(fd,"alias parport_lowlevel parport_ax\n",34); -#else - write(fd,"alias parport_lowlevel parport_pc\n",34); -#endif - close(fd); - } - } - - optCon = poptGetContext(NULL, argc, (const char **) argv, optionTable, 0); - - if ((rc = poptGetNextOpt(optCon)) < -1) { - fprintf(stderr, "bad option %s: %s\n", - poptBadOption(optCon, POPT_BADOPTION_NOALIAS), - poptStrerror(rc)); - exit(1); - } - - if ((arg = (char *) poptGetArg(optCon))) { - fprintf(stderr, "unexpected argument: %s\n", arg); - exit(1); - } - - /* Turn on mediacheck for testing */ - /* mediacheck = 1; */ - - if (testing) flags |= LOADER_FLAGS_TESTING; - if (mediacheck) flags |= LOADER_FLAGS_MEDIACHECK; - - /* we can't do kon on fb console (#60844) */ - if (checkFrameBuffer() == 1) haveKon = 0; - -#if defined (__s390__) && !defined (__s390x__) - flags |= LOADER_FLAGS_NOSHELL | LOADER_FLAGS_NOUSB; -#endif - - extraArgs[0] = NULL; - flags = parseCmdLineFlags(flags, cmdLine, &ksSource, &ksNetDevice, - &instClass, extraArgs); - - if (FL_SERIAL(flags) && !getenv("DISPLAY")) - flags |= LOADER_FLAGS_TEXT; - - arg = FL_TESTING(flags) ? "./module-info" : "/modules/module-info"; - modInfo = isysNewModuleInfoSet(); - - if (isysReadModuleInfo(arg, modInfo, NULL)) { - fprintf(stderr, "failed to read %s\n", arg); - sleep(5); - exit(1); - } - - openLog(FL_TESTING(flags)); - if (!FL_TESTING(flags)) - openlog("loader", 0, LOG_LOCAL0); - - checkForRam(flags); - - kd = kdInit(); - mlReadLoadedList(&modLoaded); - modDeps = mlNewDeps(); - mlLoadDeps(&modDeps, "/modules/modules.dep"); - - mlLoadModuleSet("cramfs:vfat:nfs:loop", modLoaded, modDeps, modInfo, flags); - - if (!continuing) { - ideSetup(modLoaded, modDeps, modInfo, flags, &kd); - scsiSetup(modLoaded, modDeps, modInfo, flags, &kd); - - /* Note we *always* do this. If you could avoid this you could get - a system w/o USB keyboard support, which would be bad. */ - usbInitialize(modLoaded, modDeps, modInfo, flags); - - /* now let's initialize any possible firewire. fun */ - firewireInitialize(modLoaded, modDeps, modInfo, flags); - } - - setFloppyDevice(flags); - - if (FL_KSFLOPPY(flags)) { - startNewt(flags); - ksFile = "/tmp/ks.cfg"; - kickstartFromFloppy(ksFile, modLoaded, &modDeps, flags); - flags |= LOADER_FLAGS_KICKSTART; - } - -#ifdef INCLUDE_KON - if (continuing) - setLanguage ("ja", flags); - startNewt(flags); -#endif - -#ifdef INCLUDE_PCMCIA - startNewt(flags); - - if (!continuing && !FL_NOPCMCIA(flags)) { - startPcmcia(floppyDevice, modLoaded, modDeps, modInfo, pcic, &kd, - flags); - } -#endif - - /* if we're in PCMCIA, we're always going to pass the PCMCIA code - to the probe */ -#ifdef INCLUDE_PCMCIA - kdFindIdeList(&kd, CODE_PCMCIA); - kdFindScsiList(&kd, CODE_PCMCIA); - kdFindNetList(&kd, CODE_PCMCIA); -#else - /* but if we're not in PCMCIA, there is a chance that we were run in - kon mode which means that the probes were done and modules were - inserted, but they're *not* PCMCIA */ - kdFindIdeList(&kd, continuing ? 0 : CODE_PCMCIA); - kdFindScsiList(&kd, continuing ? 0 : CODE_PCMCIA); - kdFindNetList(&kd, continuing ? 0 : CODE_PCMCIA); -#endif - - /* we have to explicitly read this to let libkudzu know we want to - merge in future tables rather then replace the initial one */ - pciReadDrivers("/modules/pcitable"); - - if (!continuing) { - if ((access("/proc/bus/pci/devices", R_OK) && - access("/proc/openprom", R_OK) && - access("/proc/iSeries", R_OK)) || FL_MODDISK(flags)) { - startNewt(flags); - devLoadDriverDisk(modInfo, modLoaded, &modDeps, flags, 1, 1, - floppyDevice); - } - - busProbe(modInfo, modLoaded, modDeps, probeOnly, &kd, flags); - if (probeOnly) exit(0); - } - - if (FL_KSHD(flags)) { - ksFile = "/tmp/ks.cfg"; - kickstartFromHardDrive(ksFile, modLoaded, &modDeps, ksSource, flags); - flags |= LOADER_FLAGS_KICKSTART; - } else if (FL_KSFILE(flags)) { - ksFile = ksSource; - flags |= LOADER_FLAGS_KICKSTART; - } - -#ifdef INCLUDE_LOCAL - if (FL_KSCDROM(flags)) { - ksFile = "/tmp/ks.cfg"; - kickstartFromCdrom(ksFile, ksSource, &kd, modInfo, modLoaded, &modDeps, - flags); - flags |= LOADER_FLAGS_KICKSTART; - } -#endif - -#ifdef INCLUDE_NETWORK - if (FL_KSNFS(flags)) { - ksFile = "/tmp/ks.cfg"; - startNewt(flags); - if (!kickstartFromNfs(&kd, ksFile, modInfo, modLoaded, &modDeps, flags, - ksSource, ksNetDevice)) - flags |= LOADER_FLAGS_KICKSTART; - } - if (FL_KSHTTP(flags)) { - ksFile = "/tmp/ks.cfg"; - startNewt(flags); - if (!kickstartFromHttp(&kd, ksFile, modInfo, modLoaded, &modDeps, flags, - ksSource, ksNetDevice)) - flags |= LOADER_FLAGS_KICKSTART; - } -#endif - - if (ksFile) { - startNewt(flags); - ksReadCommands(ksFile); - url = setupKickstart("/mnt/source", &kd, modInfo, modLoaded, &modDeps, - &flags, ksNetDevice); - } - -#ifdef INCLUDE_NETWORK - if (FL_TELNETD(flags)) { - struct networkDeviceConfig netDev; - - if (!ksNetDevice) { - if (ensureNetDevice(&kd, modInfo, modLoaded, &modDeps, flags, - &ksNetDevice)) - return 1; - } - - if (!FL_TESTING(flags)) { - kickstartNetwork(&ksNetDevice, &netDev, NULL, flags); - writeNetInfo("/tmp/netinfo", &netDev, &kd); - } - - if (!beTelnet(flags)) { - flags |= LOADER_FLAGS_TEXT | LOADER_FLAGS_NOSHELL; - haveKon = 0; - } - } -#endif - - if (!url) { - url = doMountImage("/mnt/source", &kd, modInfo, modLoaded, &modDeps, - &lang, &keymap, &kbdtype, - flags); - } - - if (!FL_TESTING(flags)) { - - unlink("/usr"); - symlink("mnt/runtime/usr", "/usr"); -#if defined(__x86_64__) - unlink("/lib64"); - symlink("mnt/runtime/lib64", "/lib64"); -#else - unlink("/lib"); - symlink("mnt/runtime/lib", "/lib"); -#endif - - unlink("/modules/modules.dep"); - unlink("/modules/module-info"); - unlink("/modules/pcitable"); - - symlink("../mnt/runtime/modules/modules.dep", - "/modules/modules.dep"); - symlink("../mnt/runtime/modules/module-info", - "/modules/module-info"); - symlink("../mnt/runtime/modules/pcitable", - "/modules/pcitable"); - -#ifndef __sparc__ - unlink("/modules/modules.cgz"); - - symlink("../mnt/runtime/modules/modules.cgz", - "/modules/modules.cgz"); -#else - /* All sparc32 modules are on the first stage image, if it is sparc64, - then we must keep both the old /modules/modules.cgz which may - either contain all modules, or the basic set + one of net or scsi - and we extend it with the full set of net + scsi modules. */ - symlink("../mnt/runtime/modules/modules64.cgz", - "/modules/modules65.cgz"); -#endif - } - - logMessage("getting ready to spawn shell now"); - - spawnShell(flags); /* we can attach gdb now :-) */ - - verifyImagesMatched(); - - /* XXX should free old Deps */ - modDeps = mlNewDeps(); - mlLoadDeps(&modDeps, "/modules/modules.dep"); - - /* merge in any new pci ids */ - pciReadDrivers("/modules/pcitable"); - - /* We reinit this from the beginning because we could have lost drivers - when we switched media, and we don't want to list ones that don't - exist. This is a bit unfortunate in that we lose information on - drivers we've loaded as well, which could include ISA drivers which - kudzu won't reprobe! */ - modInfo = isysNewModuleInfoSet(); - - if (isysReadModuleInfo(arg, modInfo, NULL)) { - fprintf(stderr, "failed to read %s\n", arg); - sleep(5); - exit(1); - } - - /* merge in drivers we know about from a driver disk so we probe things - properly */ - ddReadDriverDiskModInfo(modInfo); - - if (ksFile) - kickstartDevices(&kd, modInfo, modLoaded, &modDeps, flags); - - /* We may already have these modules loaded, but trying again won't - hurt. */ - ideSetup(modLoaded, modDeps, modInfo, flags, &kd); - scsiSetup(modLoaded, modDeps, modInfo, flags, &kd); - - busProbe(modInfo, modLoaded, modDeps, 0, &kd, flags); - - /* look for hard drives; if there aren't any warn the user and - let him add drivers manually */ - for (i = 0; i < kd.numKnown; i++) - if (kd.known[i].class == CLASS_HD) break; - - if (i == kd.numKnown) { - int rc; - - startNewt(flags); - rc = newtWinChoice(_("Warning"), _("Yes"), _("No"), - _("No hard drives have been found. You probably need to " - "manually choose device drivers for the installation to " - "succeed. Would you like to select drivers now?")); - - if (rc != 2) flags |= LOADER_FLAGS_ISA; - } - - if (((access("/proc/bus/pci/devices", R_OK) && - access("/proc/openprom", R_OK) && - access("/proc/iSeries", R_OK)) || - FL_ISA(flags) || FL_NOPROBE(flags)) && !ksFile) { - startNewt(flags); - manualDeviceCheck(modInfo, modLoaded, &modDeps, &kd, flags); - } - - if (FL_UPDATES(flags)) - loadUpdates(&kd, modLoaded, &modDeps, flags); - - loadUfs(&kd, modLoaded, &modDeps, flags); - - /* We must look for cards which require the agpgart module */ - agpgartInitialize(modLoaded, modDeps, modInfo, flags); - - mlLoadModuleSet("raid0:raid1:raid5:msdos:ext3:reiserfs:jfs:xfs:lvm-mod", - modLoaded, modDeps, modInfo, flags); - - initializeParallelPort(modLoaded, modDeps, modInfo, flags); - - usbInitializeMouse(modLoaded, modDeps, modInfo, flags); - -#if 0 - for (i = 0; i < kd.numKnown; i++) { - printf("%-5s ", kd.known[i].name); - if (kd.known[i].class == CLASS_CDROM) - printf("cdrom"); - else if (kd.known[i].class == CLASS_HD) - printf("disk "); - else if (kd.known[i].class == CLASS_NETWORK) - printf("net "); - if (kd.known[i].model) - printf(" %s\n", kd.known[i].model); - else - printf("\n"); - } -#endif - - /* Just in case */ - /* only use RHupdates if we're NFS, otherwise we'll use files on */ - /* the first ISO image and we won't be able to umount it */ - useRHupdates = 0; - if (!strncmp(url, "nfs:", 4)) { - logMessage("NFS install method detected, will use RHupdates/"); - useRHupdates = 1; - } - - if (useRHupdates) - setenv("PYTHONPATH", "/tmp/updates:/mnt/source/RHupdates", 1); - else - setenv("PYTHONPATH", "/tmp/updates", 1); - - argptr = anacondaArgs; - - if (!access("/tmp/updates/anaconda", X_OK)) - *argptr++ = "/tmp/updates/anaconda"; - else if (useRHupdates && !access("/mnt/source/RHupdates/anaconda", X_OK)) - *argptr++ = "/mnt/source/RHupdates/anaconda"; - else - *argptr++ = "/usr/bin/anaconda"; - - logMessage("Running anaconda script %s", *(argptr-1)); - - *argptr++ = "-m"; - if (strncmp(url, "ftp:", 4)) { - *argptr++ = url; - } else { - int fd; - - fd = open("/tmp/method", O_CREAT | O_TRUNC | O_RDWR, 0600); - write(fd, url, strlen(url)); - write(fd, "\r", 1); - close(fd); - *argptr++ = "@/tmp/method"; - } - - /* add extra args - this potentially munges extraArgs */ - tmparg = extraArgs; - while (*tmparg) { - char *idx; - - logMessage("adding extraArg %s", *tmparg); - idx = strchr(*tmparg, '='); - if (idx && ((idx-*tmparg) < strlen(*tmparg))) { - *idx = '\0'; - *argptr++ = *tmparg; - *argptr++ = idx+1; - } else { - *argptr++ = *tmparg; - } - - tmparg++; - } - - if (FL_RESCUE(flags)) { - startNewt(flags); - - if (!lang) { - int rc; - - do { - chooseLanguage(&lang, flags); - defaultLang = 0; - rc = chooseKeyboard (&keymap, &kbdtype, flags); - } while ((rc) && (rc != LOADER_NOOP)); - } - *argptr++ = "--rescue"; - } else { - if (FL_SERIAL(flags)) - *argptr++ = "--serial"; - if (FL_MCHECK(flags)) - setenv("MALLOC_CHECK_", "2", 1); - if (FL_TEXT(flags)) - *argptr++ = "-T"; - if (FL_EXPERT(flags)) - *argptr++ = "--expert"; - - if (FL_KICKSTART(flags)) { - *argptr++ = "--kickstart"; - *argptr++ = ksFile; - } - - if (!lang) - lang = getenv ("LC_ALL"); - - if (lang && !defaultLang && !FL_NOPASS(flags)) { - *argptr++ = "--lang"; - *argptr++ = lang; - } - - if (keymap && !FL_NOPASS(flags)) { - *argptr++ = "--keymap"; - *argptr++ = keymap; - } - - if (kbdtype && !FL_NOPASS(flags)) { - *argptr++ = "--kbdtype"; - *argptr++ = kbdtype; - } - - if (instClass) { - *argptr++ = "--class"; - *argptr++ = instClass; - } - - if (memoryOverhead) { - *argptr++ = "--overhead"; - *argptr = malloc(20); - sprintf(*argptr, "%d", memoryOverhead); - argptr++; - } - - for (i = 0; i < modLoaded->numModules; i++) { - if (!modLoaded->mods[i].path) continue; - - mi = isysFindModuleInfo(modInfo, modLoaded->mods[i].name); - if (!mi) continue; - if (mi->major == DRIVER_NET) - where = "net"; - else if (mi->major == DRIVER_SCSI) - where = "scsi"; - else - continue; - - *argptr++ = "--module"; - *argptr = alloca(80); - sprintf(*argptr, "%s:%s:%s", modLoaded->mods[i].path, where, - modLoaded->mods[i].name); - - argptr++; - } - } - - *argptr = NULL; - - stopNewt(); - closeLog(); - - if (!FL_TESTING(flags)) { - char *buf = sdupprintf(_("Running anaconda, the %s system installer - please wait...\n"), PRODUCTNAME); - printf("%s", buf); - execv(anacondaArgs[0], anacondaArgs); - perror("exec"); - } - - return 1; -} diff --git a/loader/loader.h b/loader/loader.h deleted file mode 100644 index aa97da452..000000000 --- a/loader/loader.h +++ /dev/null @@ -1,78 +0,0 @@ -#include "stubs.h" - -#define LOADER_OK 0 -#define LOADER_BACK 1 -#define LOADER_NOOP 2 -#define LOADER_ERROR -1 - -#define LOADER_FLAGS_TESTING (1 << 0) -#define LOADER_FLAGS_EXPERT (1 << 1) -#define LOADER_FLAGS_TEXT (1 << 2) -#define LOADER_FLAGS_RESCUE (1 << 3) -#define LOADER_FLAGS_KICKSTART (1 << 4) -#define LOADER_FLAGS_KSFLOPPY (1 << 5) -#define LOADER_FLAGS_KSHD (1 << 6) -#define LOADER_FLAGS_NOPROBE (1 << 7) -#define LOADER_FLAGS_MODDISK (1 << 8) -#define LOADER_FLAGS_ISA (1 << 9) -#define LOADER_FLAGS_SERIAL (1 << 10) -#define LOADER_FLAGS_UPDATES (1 << 11) -#define LOADER_FLAGS_KSFILE (1 << 12) -#define LOADER_FLAGS_KSCDROM (1 << 13) -#define LOADER_FLAGS_MCHECK (1 << 14) -#define LOADER_FLAGS_KSNFS (1 << 15) -#define LOADER_FLAGS_NOUSB (1 << 16) -#define LOADER_FLAGS_NOSHELL (1 << 17) -#define LOADER_FLAGS_NOPCMCIA (1 << 18) -#define LOADER_FLAGS_TELNETD (1 << 19) -#define LOADER_FLAGS_NOPASS (1 << 20) -#define LOADER_FLAGS_KSHTTP (1 << 21) -#define LOADER_FLAGS_MEDIACHECK (1 << 22) -#define LOADER_FLAGS_NOUSBSTORAGE (1 << 23) -#define LOADER_FLAGS_ASKMETHOD (1 << 24) -#define LOADER_FLAGS_NOPARPORT (1 << 25) -#define LOADER_FLAGS_NOIEEE1394 (1 << 26) - -#define FL_TESTING(a) ((a) & LOADER_FLAGS_TESTING) -#define FL_EXPERT(a) ((a) & LOADER_FLAGS_EXPERT) -#define FL_TEXT(a) ((a) & LOADER_FLAGS_TEXT) -#define FL_RESCUE(a) ((a) & LOADER_FLAGS_RESCUE) -#define FL_KICKSTART(a) ((a) & LOADER_FLAGS_KICKSTART) -#define FL_KSFLOPPY(a) ((a) & LOADER_FLAGS_KSFLOPPY) -#define FL_KSHD(a) ((a) & LOADER_FLAGS_KSHD) -#define FL_NOPROBE(a) ((a) & LOADER_FLAGS_NOPROBE) -#define FL_MODDISK(a) ((a) & LOADER_FLAGS_MODDISK) -#define FL_ISA(a) ((a) & LOADER_FLAGS_ISA) -#define FL_SERIAL(a) ((a) & LOADER_FLAGS_SERIAL) -#define FL_UPDATES(a) ((a) & LOADER_FLAGS_UPDATES) -#define FL_KSFILE(a) ((a) & LOADER_FLAGS_KSFILE) -#define FL_KSCDROM(a) ((a) & LOADER_FLAGS_KSCDROM) -#define FL_MCHECK(a) ((a) & LOADER_FLAGS_MCHECK) -#define FL_KSNFS(a) ((a) & LOADER_FLAGS_KSNFS) -#define FL_NOUSB(a) ((a) & LOADER_FLAGS_NOUSB) -#define FL_NOSHELL(a) ((a) & LOADER_FLAGS_NOSHELL) -#define FL_LOWRES(a) ((a) & LOADER_FLAGS_LOWRES) -#define FL_NOFB(a) ((a) & LOADER_FLAGS_NOFB) -#define FL_NOPCMCIA(a) ((a) & LOADER_FLAGS_NOPCMCIA) -#define FL_RESCUE_NOMOUNT(a) ((a) & LOADER_FLAGS_RESCUE_NOMOUNT) -#define FL_TELNETD(a) ((a) & LOADER_FLAGS_TELNETD) -#define FL_NOPASS(a) ((a) & LOADER_FLAGS_NOPASS) -#define FL_KSHTTP(a) ((a) & LOADER_FLAGS_KSHTTP) -#define FL_MEDIACHECK(a) ((a) & LOADER_FLAGS_MEDIACHECK) -#define FL_NOUSBSTORAGE(a) ((a) & LOADER_FLAGS_NOUSBSTORAGE) -#define FL_ASKMETHOD(a) ((a) & LOADER_FLAGS_ASKMETHOD) -#define FL_NOPARPORT(a) ((a) & LOADER_FLAGS_NOPARPORT) -#define FL_NOIEEE1394(a) ((a) & LOADER_FLAGS_NOIEEE1394) - -#define CODE_PCMCIA 1 - -#if !defined(__s390__) && !defined(__s390x__) -#define RAMDISK_DEVICE "/dev/ram" -#else -#define RAMDISK_DEVICE "/dev/ram2" -#endif - -void startNewt(int flags); -void stopNewt(void); - -void setFloppyDevice(int flags); diff --git a/loader/log.c b/loader/log.c deleted file mode 100644 index 85b92cfed..000000000 --- a/loader/log.c +++ /dev/null @@ -1,79 +0,0 @@ -#include <fcntl.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> - -#include "log.h" - -static FILE * logfile = NULL; -static int logfd; -#if 0 -static int logDebugMessages = 0; -#endif - -static FILE * logfile2 = NULL; -static int logfd2 = 0; - -static void doLogMessage(const char * s, va_list args); - -void logMessage(const char * s, ...) { - va_list args; - - if (!logfile) return; - - va_start(args, s); - - fprintf(logfile, "* "); - vfprintf(logfile, s, args); - fprintf(logfile, "\n"); - fflush(logfile); - - va_end(args); - - if (!logfile2) return; - - va_start(args, s); - - fprintf(logfile2, "* "); - vfprintf(logfile2, s, args); - fprintf(logfile2, "\n"); - fflush(logfile2); - - va_end(args); - - return; -} - -void openLog(int useLocal) { - if (!useLocal) { - logfile = fopen("/dev/tty3", "w"); - if (logfile) { - logfd = open("/dev/tty3", O_WRONLY); - logfile2 = fopen("/tmp/anaconda.log", "w"); - if (logfile2) - logfd2 = open("/tmp/anaconda.log", O_WRONLY | O_APPEND); - } else { - logfile = fopen("/tmp/anaconda.log", "w"); - logfd = open("/tmp/anaconda.log", O_WRONLY| O_APPEND); - } - } else { - logfile = fopen("debug.log", "w"); - logfd = open("debug.log", O_WRONLY); - } -#if 0 - if (getenv("DEBUG")) logDebugMessages = 1; -#endif -} - -void closeLog(void) { - if (logfile) { - fclose(logfile); - close(logfd); - } - if (logfile2) { - fclose(logfile2); - close(logfd2); - } -} - diff --git a/loader/log.h b/loader/log.h deleted file mode 100644 index 2fb3a6ab1..000000000 --- a/loader/log.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _LOG_H_ -#define _LOG_H_ - -#include <stdio.h> - -extern FILE * log; -extern int logfd; - -void logMessage(const char * s, ...); -void openLog(int useLocal); -void closeLog(void); - -#endif /* _LOG_H_ */ diff --git a/loader/md5.c b/loader/md5.c deleted file mode 100644 index 559298b6c..000000000 --- a/loader/md5.c +++ /dev/null @@ -1,258 +0,0 @@ -/* - * $Id$ - * - * This code implements the MD5 message-digest algorithm. - * The algorithm is due to Ron Rivest. This code was - * written by Colin Plumb in 1993, no copyright is claimed. - * This code is in the public domain; do with it what you wish. - * - * Equivalent code is available from RSA Data Security, Inc. - * This code has been tested against that, and is equivalent, - * except that you don't need to include two pages of legalese - * with every copy. - * - * To compute the message digest of a chunk of bytes, declare an - * MD5Context structure, pass it to MD5Init, call MD5Update as - * needed on buffers full of bytes, and then call MD5Final, which - * will fill a supplied 16-byte array with the digest. - * - */ - -#include <string.h> -#include "md5.h" - -#ifndef HIGHFIRST -#define byteReverse(buf, len) /* Nothing */ -#else -static void byteReverse(unsigned char *buf, unsigned longs); - -#ifndef ASM_MD5 -/* - * Note: this code is harmless on little-endian machines. - */ -static void byteReverse(unsigned char *buf, unsigned longs) -{ - uint32 t; - do { - t = (uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 | - ((unsigned) buf[1] << 8 | buf[0]); - *(uint32 *) buf = t; - buf += 4; - } while (--longs); -} -#endif -#endif - -void MD5_Transform(uint32 buf[4], uint32 const in[16]); - -/* - * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious - * initialization constants. - */ -void MD5_Init(struct MD5Context *ctx) -{ - ctx->buf[0] = 0x67452301U; - ctx->buf[1] = 0xefcdab89U; - ctx->buf[2] = 0x98badcfeU; - ctx->buf[3] = 0x10325476U; - - ctx->bits[0] = 0; - ctx->bits[1] = 0; -} - -/* - * Update context to reflect the concatenation of another buffer full - * of bytes. - */ -void MD5_Update(struct MD5Context *ctx, unsigned const char *buf, unsigned len) -{ - uint32 t; - - /* Update bitcount */ - - t = ctx->bits[0]; - if ((ctx->bits[0] = t + ((uint32) len << 3)) < t) - ctx->bits[1]++; /* Carry from low to high */ - ctx->bits[1] += len >> 29; - - t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ - - /* Handle any leading odd-sized chunks */ - - if (t) { - unsigned char *p = (unsigned char *) ctx->in + t; - - t = 64 - t; - if (len < t) { - memcpy(p, buf, len); - return; - } - memcpy(p, buf, t); - byteReverse(ctx->in, 16); - MD5_Transform(ctx->buf, (uint32 *) ctx->in); - buf += t; - len -= t; - } - /* Process data in 64-byte chunks */ - - while (len >= 64) { - memcpy(ctx->in, buf, 64); - byteReverse(ctx->in, 16); - MD5_Transform(ctx->buf, (uint32 *) ctx->in); - buf += 64; - len -= 64; - } - - /* Handle any remaining bytes of data. */ - - memcpy(ctx->in, buf, len); -} - -/* - * Final wrapup - pad to 64-byte boundary with the bit pattern - * 1 0* (64-bit count of bits processed, MSB-first) - */ -void MD5_Final(unsigned char digest[16], struct MD5Context *ctx) -{ - unsigned count; - unsigned char *p; - - /* Compute number of bytes mod 64 */ - count = (ctx->bits[0] >> 3) & 0x3F; - - /* Set the first char of padding to 0x80. This is safe since there is - always at least one byte free */ - p = ctx->in + count; - *p++ = 0x80; - - /* Bytes of padding needed to make 64 bytes */ - count = 64 - 1 - count; - - /* Pad out to 56 mod 64 */ - if (count < 8) { - /* Two lots of padding: Pad the first block to 64 bytes */ - memset(p, 0, count); - byteReverse(ctx->in, 16); - MD5_Transform(ctx->buf, (uint32 *) ctx->in); - - /* Now fill the next block with 56 bytes */ - memset(ctx->in, 0, 56); - } else { - /* Pad block to 56 bytes */ - memset(p, 0, count - 8); - } - byteReverse(ctx->in, 14); - - /* Append length in bits and transform */ - ((uint32 *) ctx->in)[14] = ctx->bits[0]; - ((uint32 *) ctx->in)[15] = ctx->bits[1]; - - MD5_Transform(ctx->buf, (uint32 *) ctx->in); - byteReverse((unsigned char *) ctx->buf, 4); - memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ -} - -#ifndef ASM_MD5 - -/* The four core functions - F1 is optimized somewhat */ - -/* #define F1(x, y, z) (x & y | ~x & z) */ -#define F1(x, y, z) (z ^ (x & (y ^ z))) -#define F2(x, y, z) F1(z, x, y) -#define F3(x, y, z) (x ^ y ^ z) -#define F4(x, y, z) (y ^ (x | ~z)) - -/* This is the central step in the MD5 algorithm. */ -#define MD5STEP(f, w, x, y, z, data, s) \ - ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x ) - -/* - * The core of the MD5 algorithm, this alters an existing MD5 hash to - * reflect the addition of 16 longwords of new data. MD5Update blocks - * the data and converts bytes into longwords for this routine. - */ -void MD5_Transform(uint32 buf[4], uint32 const in[16]) -{ - register uint32 a, b, c, d; - - a = buf[0]; - b = buf[1]; - c = buf[2]; - d = buf[3]; - - MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478U, 7); - MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756U, 12); - MD5STEP(F1, c, d, a, b, in[2] + 0x242070dbU, 17); - MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceeeU, 22); - MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0fafU, 7); - MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62aU, 12); - MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613U, 17); - MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501U, 22); - MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8U, 7); - MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7afU, 12); - MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1U, 17); - MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7beU, 22); - MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122U, 7); - MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193U, 12); - MD5STEP(F1, c, d, a, b, in[14] + 0xa679438eU, 17); - MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821U, 22); - - MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562U, 5); - MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340U, 9); - MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51U, 14); - MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aaU, 20); - MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105dU, 5); - MD5STEP(F2, d, a, b, c, in[10] + 0x02441453U, 9); - MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681U, 14); - MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8U, 20); - MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6U, 5); - MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6U, 9); - MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87U, 14); - MD5STEP(F2, b, c, d, a, in[8] + 0x455a14edU, 20); - MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905U, 5); - MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8U, 9); - MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9U, 14); - MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8aU, 20); - - MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942U, 4); - MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681U, 11); - MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122U, 16); - MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380cU, 23); - MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44U, 4); - MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9U, 11); - MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60U, 16); - MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70U, 23); - MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6U, 4); - MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127faU, 11); - MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085U, 16); - MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05U, 23); - MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039U, 4); - MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5U, 11); - MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8U, 16); - MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665U, 23); - - MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244U, 6); - MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97U, 10); - MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7U, 15); - MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039U, 21); - MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3U, 6); - MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92U, 10); - MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47dU, 15); - MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1U, 21); - MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4fU, 6); - MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0U, 10); - MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314U, 15); - MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1U, 21); - MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82U, 6); - MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235U, 10); - MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bbU, 15); - MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391U, 21); - - buf[0] += a; - buf[1] += b; - buf[2] += c; - buf[3] += d; -} - -#endif diff --git a/loader/md5.h b/loader/md5.h deleted file mode 100644 index bacfb534a..000000000 --- a/loader/md5.h +++ /dev/null @@ -1,25 +0,0 @@ - -#ifndef MD5_H -#define MD5_H - -#include <sys/types.h> - -typedef u_int32_t uint32; - -struct MD5Context { - uint32 buf[4]; - uint32 bits[2]; - unsigned char in[64]; -}; - -void MD5_Init(struct MD5Context *); -void MD5_Update(struct MD5Context *, unsigned const char *, unsigned); -void MD5_Final(unsigned char digest[16], struct MD5Context *); - -/* - * This is needed to make RSAREF happy on some MS-DOS compilers. - */ - -typedef struct MD5Context MD5_CTX; - -#endif /* MD5_H */ diff --git a/loader/mediacheck.c b/loader/mediacheck.c deleted file mode 100644 index f82a5fd37..000000000 --- a/loader/mediacheck.c +++ /dev/null @@ -1,370 +0,0 @@ -/* simple program to check implanted md5sum in an iso 9660 image */ -/* Copyright 2001 Red Hat, Inc. */ -/* Michael Fulbright msf@redhat.com */ - -#include <stdio.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <fcntl.h> -#include <string.h> -#include <newt.h> - -#include "md5.h" - -#include "log.h" - -#define APPDATA_OFFSET 883 -#define SIZE_OFFSET 84 - -#define MAX(x, y) ((x > y) ? x : y) -#define MIN(x, y) ((x < y) ? x : y) - -typedef void (*checkCallback)(void *, long long offset); - -struct progressCBdata { - newtComponent scale; - newtComponent label; -}; - -#ifdef TESTING -#define _(x) (x) -#else -#include "lang.h" -#endif - -/* finds primary volume descriptor and returns info from it */ -/* mediasum must be a preallocated buffer at least 33 bytes long */ -int parsepvd(int isofd, char *mediasum, int *skipsectors, long long *isosize, int *isostatus) { - unsigned char buf[2048]; - unsigned char buf2[512]; - unsigned char tmpbuf[512]; - int skipfnd, md5fnd, isostatusfnd; - unsigned int loc; - long long offset; - unsigned char *p; - - if (lseek(isofd, (off_t)(16L * 2048L), SEEK_SET) == -1) - return ((long long)-1); - - offset = (16L * 2048L); - for (;1;) { - if (read(isofd, buf, 2048) <= 0) - return ((long long)-1); - - if (buf[0] == 1) - /* found primary volume descriptor */ - break; - else if (buf[0] == 255) - /* hit end and didn't find primary volume descriptor */ - return ((long long)-1); - offset += 2048L; - } - - /* read out md5sum */ - memcpy(buf2, buf + APPDATA_OFFSET, 512); - buf2[511] = '\0'; - - *isostatus = 0; - - md5fnd = 0; - skipfnd = 0; - isostatusfnd = 0; - loc = 0; - while (loc < 512) { - if (!strncmp(buf2 + loc, "ISO MD5SUM = ", 13)) { - - /* logMessage("Found ISO MD5SUM"); */ - - /* make sure we dont walk off end */ - if ((loc + 32) > 511) - return -1; - - memcpy(mediasum, buf2 + loc + 13, 32); - mediasum[32] = '\0'; - md5fnd = 1; - - logMessage("MD5SUM -> %s", mediasum); - - loc += 45; - for (p=buf2+loc; loc < 512 && *p != ';'; p++, loc++); - } else if (!strncmp(buf2 + loc, "SKIPSECTORS = ", 14)) { - char *errptr; - - /* make sure we dont walk off end */ - if ((loc + 14) > 511) - return -1; - - /* logMessage("Found SKIPSECTORS"); */ - loc = loc + 14; - for (p=tmpbuf; loc < 512 && buf2[loc] != ';'; p++, loc++) - *p = buf2[loc]; - - *p = '\0'; - - /* logMessage("SKIPSECTORS -> |%s|", tmpbuf); */ - - *skipsectors = strtol(tmpbuf, &errptr, 10); - if (errptr && *errptr) { - logMessage("Could not parse |%s|", errptr); - return -1; - } else { - logMessage("skipsectors = %d", *skipsectors); - skipfnd = 1; - } - - for (p=buf2+loc; loc < 512 && *p != ';'; p++, loc++); - } else if (!strncmp(buf2 + loc, "RHLISOSTATUS=1", 14)) { - *isostatus = 1; - isostatusfnd = 1; - logMessage("isostatus = 1"); - } else if (!strncmp(buf2 + loc, "RHLISOSTATUS=0", 14)) { - *isostatus = 0; - isostatusfnd = 1; - logMessage("isostatus = 0"); - } else { - loc++; - } - - if ((skipfnd & md5fnd) & isostatusfnd) - break; - } - - if (!(skipfnd & md5fnd)) - return -1; - - /* get isosize */ - *isosize = (buf[SIZE_OFFSET]*0x1000000+buf[SIZE_OFFSET+1]*0x10000 + - buf[SIZE_OFFSET+2]*0x100 + buf[SIZE_OFFSET+3]) * 2048LL; - - return offset; -} - -/* returns -1 if no checksum encoded in media, 0 if no match, 1 if match */ -/* mediasum is the sum encoded in media, computedsum is one we compute */ -/* both strings must be pre-allocated at least 33 chars in length */ -int checkmd5sum(int isofd, char *mediasum, char *computedsum, - checkCallback cb, void *cbdata) { - int nread; - int i; - int appdata_start_offset, appdata_end_offset; - int nattempt; - int skipsectors; - int isostatus; - unsigned int bufsize = 32768; - unsigned char md5sum[16]; - unsigned int len; - unsigned char *buf; - long long isosize, offset, pvd_offset, apoff; - MD5_CTX md5ctx; - - isostatus = 0; - if ((pvd_offset = parsepvd(isofd, mediasum, &skipsectors, &isosize, &isostatus)) < 0) - return -1; - - /* rewind, compute md5sum */ - lseek(isofd, 0L, SEEK_SET); - - MD5_Init(&md5ctx); - - offset = 0; - apoff = pvd_offset + APPDATA_OFFSET; - - buf = malloc(bufsize * sizeof(unsigned char)); - while (offset < isosize - skipsectors*2048) { - nattempt = MIN(isosize - skipsectors*2048 - offset, bufsize); - - nread = read(isofd, buf, nattempt); - if (nread <= 0) - break; - - /* overwrite md5sum we implanted with original data */ - if (offset < apoff && offset+nread >= apoff) { - appdata_start_offset = apoff - offset; - appdata_end_offset = MIN(appdata_start_offset+MIN(nread, 512), - offset + nread - apoff); - len = appdata_end_offset - appdata_start_offset; - memset(buf+appdata_start_offset, ' ', len); - } else if (offset >= apoff && offset+nread < apoff + 512) { - appdata_start_offset = 0; - appdata_end_offset = nread; - len = appdata_end_offset - appdata_start_offset; - memset(buf+appdata_start_offset, ' ', len); - } else if (offset < apoff + 512 && offset+nread >= apoff + 512) { - appdata_start_offset = 0; - appdata_end_offset = apoff + 512 - offset; - len = appdata_end_offset - appdata_start_offset; - memset(buf+appdata_start_offset, ' ', len); - } - - MD5_Update(&md5ctx, buf, nread); - offset = offset + nread; - if (cb) - cb(cbdata, offset); - } - - if (cb) - cb(cbdata, isosize); - - sleep(1); - - free(buf); - - MD5_Final(md5sum, &md5ctx); - - *computedsum = '\0'; - for (i=0; i<16; i++) { - char tmpstr[4]; - snprintf (tmpstr, 4, "%02x", md5sum[i]); - strcat(computedsum, tmpstr); - } - - if (strcmp(mediasum, computedsum)) - return 0; - else - return 1; - } - - -static void readCB(void *co, long long pos) { - struct progressCBdata *data = co; - static int tick = 0; - char tickmark[2] = "-"; - char * ticks = "-\\|/"; - - newtScaleSet(data->scale, pos); - tick++; - if (tick > 399) tick = 0; - *tickmark = ticks[tick / 100]; - - newtLabelSetText(data->label, tickmark); - newtRefresh(); -} - -int doMediaCheck(int isofd, char *descr, char *mediasum, char *computedsum, long long *isosize, int *isostatus) { - struct progressCBdata data; - newtComponent t, f, scale, label; - int rc; - int dlen; - int llen; - int skipsectors; - char tmpstr[1024]; - - if (parsepvd(isofd, mediasum, &skipsectors, isosize, isostatus) < 0) { - newtWinMessage(_("Error"), _("OK"), - _("Unable to read the disc checksum from the " - "primary volume descriptor. This probably " - "means the disc was created without adding the " - "checksum.")); - return -1; - } - - if (descr) - snprintf(tmpstr, sizeof(tmpstr), _("Checking \"%s\"..."), descr); - else - snprintf(tmpstr, sizeof(tmpstr), _("Checking media now...")); - - dlen = strlen(tmpstr); - if (dlen > 65) - dlen = 65; - - newtCenteredWindow(dlen+8, 6, _("Media Check")); - t = newtTextbox(1, 1, dlen+4, 3, NEWT_TEXTBOX_WRAP); - - newtTextboxSetText(t, tmpstr); - llen = strlen(tmpstr); - - label = newtLabel(llen+1, 1, "-"); - f = newtForm(NULL, NULL, 0); - newtFormAddComponent(f, t); - scale = newtScale(3, 3, dlen, *isosize); - newtFormAddComponent(f, scale); - - newtDrawForm(f); - newtRefresh(); - - data.scale = scale; - data.label = label; - - rc = checkmd5sum(isofd, mediasum, computedsum, readCB, &data); - - newtFormDestroy(f); - newtPopWindow(); - - return rc; -} - -int mediaCheckFile(char *file, char *descr) { - int isofd; - int rc; - int isostatus; - char *result; - unsigned char mediasum[33], computedsum[33]; - char tmpstr[256]; - char descrstr[256]; - long long isosize; - newtComponent t, f; - - isofd = open(file, O_RDONLY); - - if (isofd < 0) { - newtWinMessage(_("Error"), _("OK"), _("Unable to find install image " - "%s"), file); - return -1; - } - - isostatus = 0; - rc = doMediaCheck(isofd, descr, mediasum, computedsum, &isosize, &isostatus); - close(isofd); - - if (rc == 0) { - result = _("FAIL.\n\nIt is not recommended to use this media."); - logMessage("mediacheck: %s (%s) FAILED", file, descr); - logMessage("value of isostatus iso flag is %d", isostatus); - } else if (rc > 0) { - result = _("PASS.\n\nIt is OK to install from this media."); - logMessage("mediacheck: %s (%s) PASSED", file, descr); - logMessage("value of isostatus iso flag is %d", isostatus); - } else { - result = _("NA.\n\nNo checksum information available, unable to verify media."); - logMessage("mediacheck: %s (%s) has no checksum info", file, descr); - } - - newtCenteredWindow(60, 13, _("Media Check Result")); - t = newtTextbox(4, 1, 52, 8, NEWT_TEXTBOX_WRAP); - if (descr) - snprintf(descrstr, sizeof(descrstr), - _("of the image:\n\n%s\n\n"), descr); - else - descrstr[0] = '\0'; - - snprintf(tmpstr, sizeof(tmpstr), _("The media check %sis complete, and " - "the result is: %s\n"), descrstr, result); - newtTextboxSetText(t, tmpstr); - f = newtForm(NULL, NULL, 0); - newtFormAddComponent(f, t); - newtFormAddComponent(f, newtButton(26, 9, _("OK"))); - - newtRunForm(f); - newtFormDestroy(f); - newtPopWindow(); - return rc; -} - -#ifdef TESTING - -int main(int argc, char **argv) { - int rc; - - if (argc < 2) { - printf("Usage: checkisomd5 <isofilename>\n\n"); - exit(1); - } - - newtInit(); - newtCls(); - rc = mediaCheckFile(argv[1]); - newtFinished(); -} -#endif diff --git a/loader/mediacheck.h b/loader/mediacheck.h deleted file mode 100644 index 5570cffb1..000000000 --- a/loader/mediacheck.h +++ /dev/null @@ -1,6 +0,0 @@ -/* simple program to check implanted md5sum in an iso 9660 image */ -/* Copyright 2001 Red Hat, Inc. */ -/* Michael Fulbright msf@redhat.com */ - -int mediaCheckFile(char *file, char *descr); -int parsepvd(int isofd, char *mediasum, int *skipsectors, long long *isosize, int *isostatus); diff --git a/loader/minikon.fnt b/loader/minikon.fnt Binary files differdeleted file mode 100644 index af19788a7..000000000 --- a/loader/minikon.fnt +++ /dev/null diff --git a/loader/minilibc.c b/loader/minilibc.c deleted file mode 100644 index 01ac57f7b..000000000 --- a/loader/minilibc.c +++ /dev/null @@ -1,249 +0,0 @@ -#define MINILIBC_INTERNAL - -#include "minilibc.h" - -int atexit (void (*__func) (void)) { - return 0; -} - -void exit(int arg) { - _do_exit(arg); - for (;;); /* Shut up gcc */ -} - -char ** _environ = NULL; -int errno = 0; - -void _init (int __status) { -} - -void __libc_init_first (int __status) { -} - -#ifndef __powerpc__ -int __libc_start_main (int (*main) (int, char **, char **), - int argc, char **argv, - void (*init) (void), void (*fini) (void), - void (*rtld_fini) (void), void * stack_end) -#else -struct startup_info -{ - void *sda_base; - int (*main) (int, char **, char **, void *); - int (*init) (int, char **, char **, void *); - void (*fini) (void); -}; - -int __libc_start_main (int argc, char **argv, - char **ubp_ev, - void *auxvec, void (*rtld_fini) (void), - struct startup_info *stinfo, - char **stack_on_entry) -#endif -{ - exit (main(argc, argv, NULL)); - /* never get here */ - return 0; -} - -void _fini (int __status) { -} - -/* x86_64 has to be different and use a separate syscall for each of the - * socket calls instead of doing a socketcall multiplexor. bleah - */ -#if !defined(__x86_64__) -inline int socket(int a, int b, int c) { - unsigned long args[] = { a, b, c }; - - return socketcall(SYS_SOCKET, args); -} - -inline int bind(int a, void * b, int c) { - unsigned long args[] = { a, (long) b, c }; - - return socketcall(SYS_BIND, args); -} - -inline int listen(int a, int b) { - unsigned long args[] = { a, b, 0 }; - - return socketcall(SYS_LISTEN, args); -} - -inline int accept(int a, void * addr, void * addr2) { - unsigned long args[] = { a, (long) addr, (long) addr2 }; - - return socketcall(SYS_ACCEPT, args); -} -#endif - -size_t strlen(const char * string) { - size_t i = 0; - - while (*string++) i++; - - return i; -} - -char * strncpy(char * dst, const char * src, size_t len) { - char * chptr = dst; - size_t i = 0; - - while (*src && i < len) *dst++ = *src++, i++; - if (i < len) *dst = '\0'; - - return chptr; -} - -char * strcpy(char * dst, const char * src) { - char * chptr = dst; - - while (*src) *dst++ = *src++; - *dst = '\0'; - - return chptr; -} - -void * memcpy(void * dst, const void * src, size_t count) { - char * a = dst; - const char * b = src; - - while (count--) - *a++ = *b++; - - return dst; -} - -void sleep(int secs) { - struct timeval tv; - - tv.tv_sec = secs; - tv.tv_usec = 0; - - select(0, NULL, NULL, NULL, &tv); -} - -int strcmp(const char * a, const char * b) { - int i, j; - - i = strlen(a); j = strlen(b); - if (i < j) - return -1; - else if (j < i) - return 1; - - while (*a && (*a == *b)) a++, b++; - - if (!*a) return 0; - - if (*a < *b) - return -1; - else - return 1; -} - -int strncmp(const char * a, const char * b, size_t len) { - char buf1[1000], buf2[1000]; - - strncpy(buf1, a, len); - strncpy(buf2, b, len); - buf1[len] = '\0'; - buf2[len] = '\0'; - - return strcmp(buf1, buf2); -} - -void printint(int i) { - char buf[10]; - char * chptr = buf + 9; - int j = 0; - - if (!i) { - write(1, "0", 1); - return; - } - - if (i < 0) { - write(1, "-", 1); - i = -1 * i; - } - - while (i) { - *chptr-- = '0' + (i % 10); - j++; - i = i / 10; - } - - write(1, chptr + 1, j); -} - -char * strchr(char * str, int ch) { - char * chptr; - - chptr = str; - while (*chptr) { - if (*chptr == ch) return chptr; - chptr++; - } - - return NULL; -} - -void printf(char * fmt, ...) { - char buf[2048]; - char * start = buf; - char * chptr = buf; - va_list args; - char * strarg; - int numarg; - - strcpy(buf, fmt); - va_start(args, fmt); - - while (start) { - while (*chptr != '%' && *chptr) chptr++; - - if (*chptr == '%') { - *chptr++ = '\0'; - printstr(start); - - switch (*chptr++) { - case 's': - strarg = va_arg(args, char *); - printstr(strarg); - break; - - case 'd': - numarg = va_arg(args, int); - printint(numarg); - break; - } - - start = chptr; - } else { - printstr(start); - start = NULL; - } - } -} - -int memcmp(const void *dst, const void *src, size_t count) { - int r; - const char *d=dst; - const char *s=src; - while (count--) { - if ((r=(*d - *s))) - return r; - ++d; - ++s; - } - return 0; -} - -void* memset(void * dst, int s, size_t count) { - char * a = dst; - while (count--) - *a++ = s; - return dst; -} diff --git a/loader/minilibc.h b/loader/minilibc.h deleted file mode 100644 index 16eb423b5..000000000 --- a/loader/minilibc.h +++ /dev/null @@ -1,236 +0,0 @@ -#include <stdarg.h> - -#define _LOOSE_KERNEL_NAMES 1 - -#define NULL ((void *) 0) - -#define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) -#define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) -#define WEXITSTATUS(status) (((status) & 0xff00) >> 8) -#define WTERMSIG(status) ((status) & 0x7f) -#define WSTOPSIG(status) WEXITSTATUS(status) -#define WIFEXITED(status) (WTERMSIG(status) == 0) -#define S_IFBLK 0060000 - -#define MS_MGC_VAL 0xc0ed0000 - -#define isspace(a) (a == ' ' || a == '\t') - -extern char ** _environ; - -extern int errno; - -/* from /usr/include/bits/sigset.h */ -/* A `sigset_t' has a bit for each signal. */ -#if defined(__i386__) -#define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) -typedef struct - { - unsigned long int __val[_SIGSET_NWORDS]; - } __sigset_t; - -/* from /usr/include/signal.h */ -typedef __sigset_t sigset_t; -#endif - -/* Aieee, gcc 2.95+ creates a stub for posix_types.h on i386 which brings - glibc headers in and thus makes __FD_SET etc. not defined with 2.3+ kernels. */ -#define _FEATURES_H 1 -#include <linux/socket.h> -#include <linux/types.h> -#include <linux/time.h> -#include <linux/if.h> -#include <linux/un.h> -#include <linux/loop.h> -#include <linux/net.h> -#include <asm/posix_types.h> -#include <asm/termios.h> -#include <asm/ioctls.h> -#include <asm/unistd.h> -#include <asm/fcntl.h> -#include <asm/signal.h> -#include <asm/stat.h> - -/* x86_64 sucks and has this stuff only available to the kernel. cheat. */ -#if defined(__x86_64__) -#undef __FD_SET -static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) -{ - unsigned long _tmp = fd / __NFDBITS; - unsigned long _rem = fd % __NFDBITS; - fdsetp->fds_bits[_tmp] |= (1UL<<_rem); -} - -#undef __FD_CLR -static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) -{ - unsigned long _tmp = fd / __NFDBITS; - unsigned long _rem = fd % __NFDBITS; - fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem); -} - -#undef __FD_ISSET -static __inline__ int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p){ - unsigned long _tmp = fd / __NFDBITS; - unsigned long _rem = fd % __NFDBITS; - return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0; - -} - -/* - * This will unroll the loop for the normal constant cases (8 or 32 longs, - * for 256 and 1024-bit fd_sets respectively) - */ -#undef __FD_ZERO -static __inline__ void __FD_ZERO(__kernel_fd_set *p) -{ - unsigned long *tmp = p->fds_bits; - int i; - - if (__builtin_constant_p(__FDSET_LONGS)) { - switch (__FDSET_LONGS) { - case 32: - tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0; - tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0; - tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0; - tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0; - tmp[16] = 0; tmp[17] = 0; tmp[18] = 0; tmp[19] = 0; - tmp[20] = 0; tmp[21] = 0; tmp[22] = 0; tmp[23] = 0; - tmp[24] = 0; tmp[25] = 0; tmp[26] = 0; tmp[27] = 0; - tmp[28] = 0; tmp[29] = 0; tmp[30] = 0; tmp[31] = 0; - return; - case 16: - tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0; - tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0; - tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0; - tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0; - return; - case 8: - tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0; - tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0; - return; - case 4: - tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0; - return; - } - } - i = __FDSET_LONGS; - while (i) { - i--; - *tmp = 0; - tmp++; - } -} -#endif /* x86_64 hackery */ - -void * alloca(size_t size); -void exit(int arg); - -/* x86_64 doesn't have some old crufty syscalls */ -#if defined(__x86_64__) -#define __NR__newselect __NR_select -#define __NR_signal __NR_rt_sigaction -#endif - - -#ifndef MINILIBC_INTERNAL -static inline _syscall5(int,mount,const char *,spec,const char *,dir,const char *,type,unsigned long,rwflag,const void *,data); -static inline _syscall5(int,_newselect,int,n,fd_set *,rd,fd_set *,wr,fd_set *,ex,struct timeval *,timeval); -static inline _syscall4(int,wait4,pid_t,pid,int *,status,int,opts,void *,rusage) -static inline _syscall3(int,write,int,fd,const char *,buf,unsigned long,count) -static inline _syscall3(int,reboot,int,magic,int,magic_too,int,flag) -static inline _syscall3(int,execve,const char *,fn,void *,argv,void *,envp) -static inline _syscall3(int,read,int,fd,const char *,buf,unsigned long,count) -static inline _syscall3(int,open,const char *,fn,int,flags,mode_t,mode) -static inline _syscall3(int,ioctl,int,fd,int,request,void *,argp) -static inline _syscall3(int,mknod,char *,path,int,mode,short,dev) -static inline _syscall2(int,dup2,int,one,int,two) -static inline _syscall2(int,kill,pid_t,pid,int,sig) -static inline _syscall2(int,symlink,const char *,a,const char *,b) -static inline _syscall2(int,chmod,const char * ,path,mode_t,mode) -static inline _syscall2(int,sethostname,const char *,name,int,len) -static inline _syscall2(int,setdomainname,const char *,name,int,len) -static inline _syscall2(int,setpgid,int,name,int,len) -static inline _syscall2(int,signal,int,num,void *,len) -static inline _syscall2(int,stat,const char *,file,struct stat *,buf) -static inline _syscall2(int,umount2,const char *,dir,int,flags) -static inline _syscall1(int,unlink,const char *,fn) -static inline _syscall1(int,close,int,fd) -static inline _syscall1(int,swapoff,const char *,fn) -static inline _syscall1(int,umask,int,mask) -static inline _syscall0(int,getpid) -static inline _syscall0(int,getppid) -static inline _syscall0(int,sync) -#ifdef __sparc__ -/* Nonstandard fork calling convention :( */ -static inline int fork(void) { - int __res; - __asm__ __volatile__ ( - "mov %0, %%g1\n\t" - "t 0x10\n\t" - "bcc 1f\n\t" - "dec %%o1\n\t" - "sethi %%hi(%2), %%g1\n\t" - "st %%o0, [%%g1 + %%lo(%2)]\n\t" - "b 2f\n\t" - "mov -1, %0\n\t" - "1:\n\t" - "and %%o0, %%o1, %0\n\t" - "2:\n\t" - : "=r" (__res) - : "0" (__NR_fork), "i" (&errno) - : "g1", "o0", "cc"); - return __res; -} -#else -static inline _syscall0(int,fork) -#endif -static inline _syscall0(pid_t,setsid) -static inline _syscall3(int,syslog,int, type, char *, buf, int, len); - -/* socket calls don't use the socketcall multiplexor on x86_64 */ -#if defined(__x86_64__) -static inline _syscall3(int,socket,int,domain,int,type,int,protocol); -static inline _syscall3(int,bind,int,sockfd,void *,addr,int,addrlen); -static inline _syscall2(int,listen,int,sockfd,int,backlog); -static inline _syscall3(int,accept,int,sockfd,void *,addr,void *,addrlen); -#endif /* x86_64 */ - - -#else -static inline _syscall5(int,_newselect,int,n,fd_set *,rd,fd_set *,wr,fd_set *,ex,struct timeval *,timeval); -static inline _syscall3(int,write,int,fd,const char *,buf,unsigned long,count) -#if !defined(__x86_64__) -static inline _syscall2(int,socketcall,int,code,unsigned long *, args) -#endif -#define __NR__do_exit __NR_exit -extern inline _syscall1(int,_do_exit,int,exitcode) -#endif - -#define select _newselect - -extern int errno; - -/* socket calls don't use the socketcall multiplexor on x86_64 */ -#if !defined(__x86_64__) -inline int socket(int a, int b, int c); -inline int bind(int a, void * b, int c); -inline int listen(int a, int b); -inline int accept(int a, void * addr, void * addr2); -#endif - - -size_t strlen(const char * string); -char * strcpy(char * dst, const char * src); -void * memcpy(void * dst, const void * src, size_t count); -void sleep(int secs); -int strcmp(const char * a, const char * b); -int strncmp(const char * a, const char * b, size_t len); -void printint(int i); -void printf(char * fmt, ...); -char * strchr(char * str, int ch); -char * strncpy(char * dst, const char * src, size_t len); -int memcmp(const void *dst, const void *src, size_t count); -void* memset(void * dst, int s, size_t count); - -void printstr(char * string); diff --git a/loader/misc.c b/loader/misc.c deleted file mode 100644 index 28599ba0c..000000000 --- a/loader/misc.c +++ /dev/null @@ -1,96 +0,0 @@ -#include <errno.h> -#include <fcntl.h> -#include <string.h> -#include <unistd.h> -#include <stdarg.h> -#include <stdlib.h> - -#include "log.h" - -int copyFileFd(int infd, char * dest) { - int outfd; - char buf[4096]; - int i; - int rc = 0; - - outfd = open(dest, O_CREAT | O_RDWR, 0666); - - if (outfd < 0) { - logMessage("failed to open %s: %s", dest, strerror(errno)); - return 1; - } - - while ((i = read(infd, buf, sizeof(buf))) > 0) { - if (write(outfd, buf, i) != i) { - rc = 1; - break; - } - } - - close(outfd); - - return rc; -} - -int copyFile(char * source, char * dest) { - int infd = -1; - int rc; - - infd = open(source, O_RDONLY); - - if (infd < 0) { - logMessage("failed to open %s: %s", source, strerror(errno)); - return 1; - } - - rc = copyFileFd(infd, dest); - - close(infd); - - return rc; -} - -char * readLine(FILE * f) { - char buf[1024]; - - fgets(buf, sizeof(buf), f); - - /* chop */ - buf[strlen(buf) - 1] = '\0'; - - return strdup(buf); -} - -int simpleStringCmp(const void * a, const void * b) { - const char * first = *((const char **) a); - const char * second = *((const char **) b); - - return strcmp(first, second); -} - -char * sdupprintf(const char *format, ...) { - char *buf = NULL; - char c; - va_list ap1, ap2; - size_t size = 0; - - va_start(ap1, format); - va_copy(ap2, ap1); - - /* XXX requires C99 vsnprintf behavior */ - size = vsnprintf(&c, 1, format, ap1) + 1; - if (size == -1) { - printf("ERROR: vsnprintf behavior is not C99\n"); - abort(); - } - - va_end(ap1); - - buf = malloc(size); - if (buf == NULL) - return NULL; - vsnprintf(buf, size, format, ap2); - va_end (ap2); - - return buf; -} diff --git a/loader/misc.h b/loader/misc.h deleted file mode 100644 index 3e673d6e5..000000000 --- a/loader/misc.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef H_LOADER_MISC_H -#define H_LOADER_MISC_H -#include <stdio.h> -#include <stdarg.h> - -int copyFile(char * source, char * dest); -int copyFileFd(int infd, char * dest); -char * readLine(FILE * f); -int simpleStringCmp(const void * a, const void * b); -char * sdupprintf(const char *format, ...); - -#endif diff --git a/loader/mkctype.c b/loader/mkctype.c deleted file mode 100644 index ed00411a9..000000000 --- a/loader/mkctype.c +++ /dev/null @@ -1,57 +0,0 @@ -#include <ctype.h> -#include <stdio.h> - -#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) -# define __ctype_b (*__ctype_b_loc()) -# define __ctype_tolower (*__ctype_tolower_loc()) -# define __ctype_toupper (*__ctype_toupper_loc()) -#endif - -int main(int argc, char ** argv) { - int i; - - printf("#include <sys/types.h>\n\n"); - - printf("static const unsigned short int __ctype_b_internal[] = {"); - - for (i = -128; i < 256; i++) { - if (!(i % 8)) { - printf("\n"); - } - - printf("\t0x%x,", __ctype_b[i]); - } - - printf("\n};\n\n"); - printf("const unsigned short int * __ctype_b = __ctype_b_internal + 128;\n\n"); - - printf("const int __ctype_toupper_internal[] = {"); - for (i = -128; i < 256; i++) { - if (!(i % 8)) { - printf("\n"); - } - - printf("\t0x%x,", __ctype_toupper[i]); - } - - printf("\n};\n\n"); - printf("const int * __ctype_toupper = __ctype_toupper_internal + 128;\n\n"); - - printf("const int __ctype_tolower_internal[] = {"); - for (i = -128; i < 256; i++) { - if (!(i % 8)) { - printf("\n"); - } - - printf("\t0x%x,", __ctype_tolower[i]); - } - - printf("\n};\n\n"); - printf("const int * __ctype_tolower = __ctype_tolower_internal + 128;\n\n"); - - printf ("const unsigned short int **__ctype_b_loc (void) { return &__ctype_b; }\n"); - printf ("const int **__ctype_toupper_loc (void) { return &__ctype_toupper; }\n"); - printf ("const int **__ctype_tolower_loc (void) { return &__ctype_tolower; }\n\n"); - - return 0; -}; diff --git a/loader/modstubs.c b/loader/modstubs.c deleted file mode 100644 index 4d3518d7a..000000000 --- a/loader/modstubs.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <stdlib.h> - -int insmod_main(int argc, char ** argv) { - return 0; -} - -int rmmod_main(int argc, char ** argv) { - return 0; -} diff --git a/loader/module-info b/loader/module-info deleted file mode 100644 index 0540cc024..000000000 --- a/loader/module-info +++ /dev/null @@ -1,842 +0,0 @@ -Version 0 -# The version 0 module-info format is ('|' denotes the left margin): -# |<module-name> -# | <module-type> [<module-alias>] -# | "<description-string>" -# | <argument> "<argument-description-string>" ["<match-regex>" ["<default>"]] -# |# <comment> -# Stanzas are delimited by non-indented lines, and continued with indented lines. -# Comments start in the first column, or are preceded only by whitespace. -# The []'s above are not literal, they delimit optional material. -# There can be multiple <argument> lines. -# <module-name> is the name of the module without any .o extension, just -# as the module name would be entered in /etc/modules.conf -# <module-type> is the base part of the string demanded by kerneld (eth, -# scsi_hostadapter, etc.) -# <module-alias> is an optional identifier to identify groups of similar -# drivers, such as the non-scsi cdrom devices which are requested by -# block-major-*; they are given an alias of "cdrom". -# <description-string> is a free-form string enclosed in quotes to describe -# the module to a human reader -# <argument> is an argument such as io or irq, as understood by the module -# <argument-description-string> is a free-form description -# <match-regex> is a regular expression which can be used to test the -# validity of a user-entered string -# <default> is a default value. This should not be provided unless it is -# almost always the correct value, and will not, say, hang a user's computer -# if it is wrong -# -# Ideas for version 1 file format: -# o Add long description, presumably including all known cards supported -# by the module in question -# o Sub-argument description, for arguments which have multiple parts -# separated by commas, particularly ones which share code with boot-time -# arguments. -# o Optional architecture flag(?) - -# drivers/net directory - -3c501 - eth - "3Com 3c501" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -3c503 - eth - "3Com EtherLink II" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - xcvr "Transceiver (0 = BNC; 1 = AUI)" "[01]" - -3c505 - eth - "3Com Etherlink Plus" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -3c507 - eth - "3Com EtherLink16" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -3c509 - eth - "3Com EtherLink III" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -3c515 - eth - "3Com 3c515 Corkscrew" - -3c59x - eth - "3Com 3c590/3c595/3c90x/3cx980" - -82596 - eth - "Apricot 82596" - -#a2065 -# eth -# "Amiga Linux/68k A2065" - -ac3200 - eth - "Ansel Communications Model 3200" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - mem "Base shared memory address" "0x[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]+" - -acenic - eth - "Alteon AceNIC Gigabit" - -#aironet4500_card -# eth -# "Aironet 4500 PCI-ISA-i365 wireless" - -arlan - eth - "Aironet Arlan 655" - -#apricot -# eth -# "Apricot 82596" -# io "Base I/O address" "0x[0-9a-fA-F]+" -# irq "IRQ level" "[0-9]+" - -#arcnet -# arc -# "ARCnet for IP driver" -# io "Base I/O address" "0x[0-9a-fA-F]+" -# irq "IRQ level" "[0-9]+" -# shmem "Base shared memory address" "0x[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]+" - -#ariadne -# eth -# "Amiga Linux/m68k Ariadne" - -at1700 - eth - "Allied Telesis AT1700" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -#atarilance -# eth -# "Atari Linux/m68k VME Lance" - -# Not yet modularized -#atp -# atp -# "Attached (pocket) ethernet adapter" - -bcm5700 - eth - "Broadcom BCM5700 10/100/1000 ethernet adapter" - line_speed "Line speed" "1[0]+" - -cs89x0 - eth - "Crystal SemiconductorCS89[02]0" - -de4x5 - eth - "DE4x5, DE434, DE450, and DE500 DEC EtherWORKS" - io "Base I/O address" "0x[0-9a-fA-F]+" - -de600 - eth - "D-Link DE-600 Ethernet pocket adapter" - -de620 - eth - "D-Link DE-620 Ethernet pocket adapter" - -depca - eth - "DEC DEPCA and EtherWORKS DE1xx, DE2xx, DE422" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -dgrs - eth - "Digi RightSwitch SE-4, SE-6" - dma "Toggle DMA use" "[01]" - spantree "Toggle Spantree" "[01]" - hashexpire "Hash Expiration" - ipaddr "List of four IP addresses" - ipxnet "IPX network number" - -#dlci - #dlci - #"RFC 1490 Frame Relay protocol" - -dmfe - eth - "Davicom DM9102(A)/DM9132/DM9801 fast ethernet" - - -dummy - dummy - "Placeholder device for intermittent links" - -e100 - eth - "Intel EtherExpress/100 driver" - -e1000 - eth - "Intel EtherExpress/1000 gigabit" - -e2100 - eth - "Cabletron E2100" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - mem "Base shared memory address" "0x[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]+" - xcvr "Transceiver (0 = internal; 1 = external)" "[01]" - -eepro - eth - "EtherExpress Pro/10" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -eepro100 - eth - "Intel EtherExpress Pro 100B" - -eexpress - eth - "EtherExpress" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -epic100 - eth - "SMC 83c170 EPIC/100" - -eql - eql - "Load balancing for point-to-point network interfaces" - -es3210 - eth - "Racal-Interlan ES3210 EISA" - -eth16i - eth - "ICL EtherTeam 16i/32 EISA" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -ewrk3 - eth - "EtherWORKS 3: DE203, DE204, DE205" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -fmv18x - eth - "Fujitsu FMV-181/182/183/184" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -hamachi - eth - "A Packet Engines GNIC-II Gigabit" - -hp-plus - eth - "HP PCLAN/plus" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -hp - eth - "HP LAN" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -hp100 - eth - "HP10/100VG ANY LAN: J257x, 27248B, J2585" - hp100_port "Base I/O address" "0x[0-9a-fA-F]+" - -#hydra -# eth -# "Amiga Linux/m68k Hydra" - -ibmtr - tr - "Shared-memory IBM Token Ring 16/4" - io "Base I/O address" "0x[0-9a-fA-F]+" - -lance - eth - "AT1500, HP J2405A, most NE2100/clone" - -# NOT YET MODULARIZED! -#lance32 -# eth -# "AMD PCnet32, PCnetPCI" - -lne390 - eth - "Mylex LNE390 EISA" - -natsemi - eth - "NatSemi DP83815 Fast Ethernet" - -myri_sbus - eth - "MyriCOM MyriNET SBUS" - -ne - eth - "NE1000, NE2000, and compatible" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -ne2k-pci - eth - "PCI NE2000 clones" - -ne3210 - eth - "Novell NE3210 EISA" - -ni5010 - eth - "MiCom-Interlan NI5010" - -ni52 - eth - "NI5210 Ethernet" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - memstart "Base shared memory address" "0x[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]+" - memend "Address of end of shared memory" "0x[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]+" - -ni65 - eth - "NI6510 Ethernet" - -ns83820 - eth - "Natsemi 83820 gigabit" - -olympic - tr - "IBM Olympic-based PCI roken ring" - -pcnet32 - eth - "AMD PCnet32" - -# not modularized -#pi2 - -plip - plip - "Parallel Link Internet Protocal" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -#ppp -# ppp -# "Point-to-Point Protocol" - -# NOT YET MODULARIZED! -#pt - -8139too - eth - "RTL8139, SMC EZ Card Fast Ethernet" - -8139cp - eth - "RTL8139, SMC EZ Card Fast Ethernet" - -sis900 - eth - "SiS 900/7016 PCI Fast Ethernet" - -sk98lin - eth - "SysKonnect SK-98xx Gigabit" - -sdla - sdla - "Sangoma S502/S508" - -# NOT YET MODULARIZED! -#seeq8005 -# What's a seeq8005, anyway? From the comments in the file: -# "seeq8005.c: A network driver for linux." No, really! - -# NOT YET MODULARIZED! -#sk_g16 -# eth -# "Schneider & Koch (SK) G16" - -sktr - tr - "SysKonnect Token Ring ISA/PCI" - -# slhc is never loaded explicitly, only by dependencies - -#slip -# sl -# "Serial Link Internet Protocol" - -smc-ultra - eth - "SMC Ultra, SMC EtherEZ ISA" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -smc-ultra32 - eth - "SMC Ultra32 EISA" - -smc9194 - eth - "SMC 9000 series Ethernet" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - ifport "Interface: 0 auto, 1 TP, 2 AUI/BNC" "[012]" - -strip - strip_proto - "Starmode Radio IP" - -sunlance - eth - "Linux/Sparc/Lance Ethernet" - -sunbmac - eth - "Sun BigMac Ethernet" - -sundance - eth - "Sundance ST201 Alta" - -sunhme - eth - "Sun Happy Meal Ethernet" - -sunqe - eth - "Sun Quad Ethernet" - -tg3 - eth - "Broadcom Tigon3 ethernet driver" - -tlan - eth - "ThunderLAN" - -tulip - eth - "DEC 21040, most 21*40 Ethernet" - io "Base I/O address" "0x[0-9a-fA-F]+" - -tulip_old - eth - "Older DEC 21040, most 21*40 Ethernet" - io "Base I/O address" "0x[0-9a-fA-F]+" - -tmspci - tr - "TMS380-based PCI token ring cards" - -lanstreamer - tr - "IBM Auto LANStreamer" - -abyss - tr - "Madge Smart 16/4 PCI Mk2 token ring" - -via-rhine - eth - "VIA VT86c100A Rhine-II PCI" - -wavelan - eth - "AT&T GIS WaveLAN transceiver" - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - -wd - eth - "WD8003 and WD8013 `compatible' ethercards." - io "Base I/O address" "0x[0-9a-fA-F]+" - irq "IRQ level" "[0-9]+" - mem "Base shared memory address" "0x[0-9a-fA-F]+" - mem_end "Address of end of shared memory (if non-standard size)" "0x[0-9a-fA-F]+" - -wic - wic - "parallel port network driver" - -winbond-840 - eth - "Compex RL100ATX-PCI" - -yellowfin - eth - "Packet Engines G-NIC PCI Gigabit" - -# S/390 stuff -netiucv - eth - "S/390 Inter-User Communication Vehicle (iucv)" - -ctc - eth - "S/390 Channel to Channel" - - -# NOT YET MODULARIZED! -#znet -# eth - -# drivers/scsi directory - -# XXX this needs to be put back -#53c7,8xx - #scsi_hostadapter - #"Symbios/NCR 53c700 and 53c800 series" - -3w-xxxx - scsi_hostadapter - "3ware Storage Controller" - -AM53C974 - scsi_hostadapter - "AM53/79C974 (PCscsi) driver" - -BusLogic - scsi_hostadapter - "BusLogic MultiMaster SCSI" - -NCR53c406a - scsi_hostadapter - "NCR53c406a-based SCSI" - -# not a module -#a2091 -#a3000 -a100u2w - scsi_hostadapter - "Initio INI-9100UW" - aha152x "ioport, irq, host scsiid" - -aacraid - scsi_hostadapter - "Adaptec AACRAID" - -advansys - scsi_hostadapter - "AdvanSys SCSI" - -aha152x - scsi_hostadapter - "Adaptec AHA-152x" - aha152x "ioport, irq, host scsiid" - -aha1542 - scsi_hostadapter - "Adaptec AHA-154x and 631x-based" - -aic7xxx - scsi_hostadapter - "Adaptec AHA-2740, 28xx, 29xx, 39xx" - -aic7xxx_mod - scsi_hostadapter - "New (experimental) Adaptec 28xx, 29xx, 39xx" - -aic7xxx_old - scsi_hostadapter - "Old Adaptec 28xx, 29xx, 39xx" - -aic79xx - scsi_hostadapter - "Adaptec Aic79xx SCSI Host Bus Adapter driver" - -atp870u - scsi_hostadapter - "ACARD ATP870U PCI scsi controller" - -cciss - scsi_hostadapter - "Compaq Smart Array 5xxx Controller" - -cpqarray - scsi_hostadapter - "Compaq Smart/2 RAID Controller" - -cpqfc - scsi_hostadapter - "Compaq FibreChannel Controller" - -DAC960 - scsi_hostadapter - "Mylex DAC960 RAID Controller" - -dmx319ld - scsi_hostadapter - "Domex DMX3191D" - -dpt_i2o - scsi_hostadapter - "Adaptec I2O RAID Driver" - -# deprecated -eata - scsi_hostadapter - "All DMA-capable DPT SCSI" -# deprecated -eata_dma - scsi_hostadapter - "All DMA-capable DPT SCSI (dma mode)" - -# deprecated -#eata_pio -# scsi_hostadapter -# "All PIO-capable DPT SCSI" - -fcal - scsi_hostadapter - "Sun Enterprise Network Array (FC-AL)" - -# not a module -# esp - -fdomain - scsi_hostadapter - "Future Domain TMC-16xx SCSI" - -g_NCR5380 - scsi_hostadapter - "NCR5380 (generic driver)" - -gdth - scsi_hostadapter - "ICP RAID Controller" - -# not a module -# gvp11 -i2o_pci - scsi - "I2O driver" - -i2o_block - scsi - "I2O Block driver" - -initio - scsi_hostadapter - "Initio SCSI" - -ips - scsi_hostadapter - "IBM ServeRAID" - -isp_mod - scsi_hostadapter - "QLogic SCSI" - -megaraid - scsi_hostadapter - "MegaRAID 418, 428, 438, 466, 762" - -mptbase - scsi_hostadapter - "LSI Logic Fusion MPT Base Driver" - -mptscsih - scsi_hostadapter - "LSI Logic Fusion MPT SCSI Driver" - -ncr53c8xx - scsi_hostadapter - "Symbios/NCR 53C8xx" - -pci2000 - scsi_hostadapter - "PCI-2000 IntelliCache" - -pci2220i - scsi_hostadapter - "PCI-2220I EIDE RAID" - -pluto - scsi_hostadapter - "SparcSTORAGE Array" - -pcd - block-major-46 cdrom - "Parallel-port IDE CDROM" - -qlogicfas - scsi_hostadapter - "Qlogic FAS408 SCSI" - -# XXX fixme - need space -#qlogicfc -# scsi_hostadapter -# "Qlogic ISP2x00 SCSI" - -qla1280 - scsi_hostadapter - "Qlogic 1280/12160" - -qla2x00 - scsi_hostadapter - "Qlogic 2x00" - -qla2200 - scsi_hostadapter - "Qlogic 2200" - -qla2300 - scsi_hostadapter - "Qlogic 2300" - -qlogicisp - scsi_hostadapter - "QLogic ISP1020 SCSI" - -qlogicpti - scsi_hostadapter - "QLogic ISP1020 SCSI SBUS" - -#scsi -# Can kerneld actually request this? -# scsi -# "SCSI Protocol support (midlevel driver)" - -#sd -# block-major-8 sd -# "SCSI disk protocol" - -seagate - scsi_hostadapter - "Seagate ST-01/02, Future Domain TMC-8xx" - -#sg -# char-major-21 sg -# "SCSI generic driver for user-level SCSI protocol drivers" - -#sr -# block-major-11 sr -# "SCSI CD-ROM protocol" - -#st -# char-major-10 st -# "SCSI tape protocol" - -#not currently used -#sym53c416 -# scsi_hostadapter -# "sym53c416" - -# needed for sparc -sym53c8xx - scsi_hostadapter - "Symbios 53C896" - -sym53c8xx_2 - scsi_hostadapter - "Alternate Symbios 53C896 Driver" - -tmscsim - scsi_hostadapter - "Tekram DC-390(T) PCI" - -u14-34f - scsi_hostadapter - "UltraStor 14F/34F (not 24F)" - -ultrastor - scsi_hostadapter - "UltraStor 14F/24F/34F" - -#wd33c93 -# scsi_hostadapter -# "Amiga A2091/590" - -# drivers/cdrom - -aztcd - block-major-29 cdrom - "Aztech CD268 CDROM" - aztcd "Base I/O Address" - -cdu31a - block-major-15 cdrom - "Sony CDU-31A CDROM" - cdu31a_port "Base I/O Address" - cdu31a_irq "IRQ" - -cm206 - block-major-32 cdrom - "Philips/LMS cm20 CDROM" - cm206 "Base I/O address, irq" - -gscd - block-major-16 cdrom - "GoldStar R420 CDROM" - gscd "Base I/O Address" - -isp16 -# module, but dynamic block number so kerneld can't request it... (?) - unknown cdrom - "ISP16/MAD16/Mozart soundcard-based CDROM" - isp16_cdrom_base "Base I/O Address" - isp16_cdrom_irq "IRQ" - isp16_cdrom_dma "DMA Channel (0,3,5,6,7)" - -mcd - block-major-23 cdrom - "Mitsumi CDROM" - mcd "Base I/O Address,irq" - -mcdx - block-major-20 cdrom - "Mitsumi XA/Multisession CDROM" - mcdx "Base I/O Address,irq" - -optcd - block-major-17 cdrom - "Optics Storage 8000 AT CDROM" - -sbpcd - block-major-25 cdrom - "SoundBlaster Pro/Panasonic CDROM" - sbpcd "Base I/O Address" - -sjcd - block-major-18 cdrom - "Sanyo CD-ROM device driver" - sjcd_base "Base I/O Address" - -sonycd535 - block-major-24 cdrom - "Sony CDU-535 CDROM" - sonycd535 "Base I/O Address" - -agpart - video - "Intel i810 Graphics Controller" diff --git a/loader/moduledeps.c b/loader/moduledeps.c deleted file mode 100644 index 16f9a0e3a..000000000 --- a/loader/moduledeps.c +++ /dev/null @@ -1,115 +0,0 @@ -#include <alloca.h> -#include <ctype.h> -#include <errno.h> -#include <fcntl.h> -#include <newt.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/stat.h> -#include <unistd.h> - -#include "misc.h" -#include "modules.h" -#include "moduledeps.h" - -moduleDeps mlNewDeps(void) { - moduleDeps md; - - md = malloc(sizeof(*md)); - md->name = NULL; - md->deps = NULL; - - return md; -} - -int mlLoadDeps(moduleDeps * moduleDepListPtr, const char * path) { - int fd; - char * buf; - struct stat sb; - char * start, * end, * chptr; - int i, numItems; - moduleDeps nextDep; - moduleDeps moduleDepList = *moduleDepListPtr; - - fd = open(path, O_RDONLY); - if (fd < 0) { - return -1; - } - - fstat(fd, &sb); - buf = alloca(sb.st_size + 1); - read(fd, buf, sb.st_size); - buf[sb.st_size] = '\0'; - close(fd); - - start = buf; - numItems = 0; - while (start) { - numItems++; - start = strchr(start + 1, '\n'); - } - - for (nextDep = moduleDepList; nextDep->name; nextDep++) numItems++; - - moduleDepList = realloc(moduleDepList, sizeof(*moduleDepList) * numItems); - for (nextDep = moduleDepList; nextDep->name; nextDep++) ; - - start = buf; - while (start < (buf + sb.st_size) && *start) { - end = strchr(start, '\n'); - *end = '\0'; - - chptr = strchr(start, ':'); - if (!chptr) { - start = end + 1; - continue; - } - - *chptr++ = '\0'; - while (*chptr && isspace(*chptr)) chptr++; - if (!*chptr) { - start = end + 1; - continue; - } - - /* found something */ - nextDep->name = strdup(start); - nextDep->deps = malloc(sizeof(char *) * (strlen(chptr) + 1)); - start = chptr, i = 0; - while (start && *start) { - chptr = strchr(start, ' '); - if (chptr) *chptr = '\0'; - nextDep->deps[i++] = strdup(start); - if (chptr) - start = chptr + 1; - else - start = NULL; - while (start && *start && isspace(*start)) start++; - } - nextDep->deps[i] = NULL; - nextDep->deps = realloc(nextDep->deps, sizeof(char *) * (i + 1)); - nextDep++; - - start = end + 1; - } - - nextDep->name = NULL; - nextDep->deps = NULL; - moduleDepList = realloc(moduleDepList, sizeof(*moduleDepList) * - (nextDep - moduleDepList + 1)); - - *moduleDepListPtr = moduleDepList; - - return 0; -} - -char ** mlGetDeps(moduleDeps modDeps, const char * modName) { - moduleDeps dep; - - for (dep = modDeps; dep->name && strcmp(dep->name, modName); dep++); - - if (dep) return dep->deps; - - return NULL; -} diff --git a/loader/moduledeps.h b/loader/moduledeps.h deleted file mode 100644 index 832423298..000000000 --- a/loader/moduledeps.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef MODULEDEPS_H -#define MODULEDEPS_H - -struct moduleDependency_s { - char * name; - char ** deps; -}; - -struct extractedModule { - char * path; - char * location; -}; - -moduleDeps mlNewDeps(void); -int mlLoadDeps(moduleDeps * moduleDepListPtr, const char * path); -char ** mlGetDeps(moduleDeps modDeps, const char * modName); - -#endif diff --git a/loader/modules.c b/loader/modules.c deleted file mode 100644 index ccacfe574..000000000 --- a/loader/modules.c +++ /dev/null @@ -1,881 +0,0 @@ -#include <alloca.h> -#include <ctype.h> -#include <errno.h> -#include <fcntl.h> -#include <newt.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/mount.h> -#include <sys/stat.h> -#include <sys/utsname.h> -#include <sys/wait.h> -#include <unistd.h> - -#include "isys/imount.h" -#include "isys/isys.h" -#include "isys/cpio.h" - -#include "lang.h" -#include "loader.h" -#include "log.h" -#include "misc.h" -#include "modules.h" -#include "moduledeps.h" -#include "devices.h" -#include "windows.h" -#include "stubs.h" - -static int ethCount(void); -static int scsiCount(void); -int mlReadLoadedList(moduleList * mlp); -void mlFreeList(moduleList ml); -char ** tsortModules(moduleList modLoaded, moduleDeps ml, char ** args, - int depth, char *** listPtr, int * listSizePtr); -static int loadModule(const char * modName, struct extractedModule * path, - moduleList modLoaded, char ** args, - moduleInfoSet modInfo, int flags); -static char * filterDriverModules(struct driverDiskInfo * ddi, - char * const * modNames); -static struct extractedModule * extractModules (struct driverDiskInfo * ddi, - char * const * modNames, struct extractedModule * oldPaths); -static int doLoadModules(const char * origModNames, moduleList modLoaded, - moduleDeps modDeps, moduleInfoSet modInfo, int flags, - const char * argModule, char ** args); -int mlLoadModule(const char * modName, - moduleList modLoaded, moduleDeps modDeps, char ** args, - moduleInfoSet modInfo, int flags); -int mlLoadModuleSet(const char * modNames, - moduleList modLoaded, moduleDeps modDeps, - moduleInfoSet modInfo, int flags); -int mlModuleInList(const char * modName, moduleList list); -int mlWriteConfModules(moduleList list, int fd); -int simpleRemoveLoadedModule(const char * modName, moduleList modLoaded, - int flags); -int reloadUnloadedModule(char * modName, void * location, - moduleList modLoaded, char ** args, int flags); - -static int ethCount(void) { - int fd; - char buf[16384]; - int i; - char * chptr; - int count = 0; - - fd = open("/proc/net/dev", O_RDONLY); - i = read(fd, buf, sizeof(buf) - 1); - buf[i] = '\0'; - - /* skip first two header lines */ - chptr = strchr(buf, '\n') + 1; - chptr = strchr(chptr, '\n') + 1; - - while (chptr) { - while (*chptr && isspace(*chptr)) chptr++; - if (!strncmp(chptr, "eth", 3)) - count++; - chptr = strchr(chptr, '\n'); - if (chptr) chptr++; - } - - return count; -} - -static int scsiCount(void) { - FILE *f; - char buf[16384]; - int count = 0; - - f = fopen("/tmp/modules.conf", "r"); - if (!f) - return 0; - while (fgets(buf, sizeof(buf) - 1, f)) { - if (!strncmp(buf, "alias scsi_hostadapter", 22)) - count++; - } - fclose(f); - return count; -} - -int mlReadLoadedList(moduleList * mlp) { - int fd; - char * start; - char * end; - char buf[4096]; - struct stat sb; - int i; - moduleList ml; - - if ((fd = open("/proc/modules", O_RDONLY)) < 0) - return -1; - - fstat(fd, &sb); - i = read(fd, buf, sizeof(buf)); - buf[i] = '\0'; - close(fd); - - ml = malloc(sizeof(*ml)); - ml->numModules = 0; - - start = buf; - while (start && *start) { - end = start; - while (!isspace(*end) && *end != '\n') end++; - *end = '\0'; - ml->mods[ml->numModules].name = strdup(start); - ml->mods[ml->numModules].args = NULL; - ml->mods[ml->numModules].path = NULL; - ml->mods[ml->numModules].weLoaded = 0; - *end = ' '; - /*ml->numModules++;*/ - start = strchr(end, '\n'); - if (start) start++; - } - - *mlp = ml; - - return 0; -} - -void mlFreeList(moduleList ml) { - int i; - int j; - - for (i = 0; i < ml->numModules; i++) { - free(ml->mods[i].name); - if (ml->mods[i].args) { - for (j = 0; ml->mods[j].args[j]; j++) - free(ml->mods[i].args[j]); - free(ml->mods[i].args); - } - } - free(ml); -} - -/* this leaks memory if their is a loop in the modules. oh well. */ -char ** tsortModules(moduleList modLoaded, moduleDeps ml, char ** args, - int depth, char *** listPtr, int * listSizePtr) { - int listSize; - char ** list; - char ** next; - char ** deps; - - if (!depth) { - int count; - - listSize = 5; - list = malloc((listSize + 1) * sizeof(*list)); - *list = NULL; - - listPtr = &list; - listSizePtr = &listSize; - - for (deps = args, count = 0; *deps; deps++, count++); - } else { - list = *listPtr; - listSize = *listSizePtr; - } - - if (depth++ > 100) { - return NULL; - } - - while (*args) { - /* don't load it twice */ - next = list; - while (*next && strcmp(*next, *args)) next++; - - if (*next || mlModuleInList(*args, modLoaded)) { - args++; - continue; - } - - /* load everything this depends on */ - deps = mlGetDeps(ml, *args); - if (deps) { - if (!tsortModules(modLoaded, ml, deps, depth, listPtr, listSizePtr)) - return NULL; - - list = *listPtr; - listSize = *listSizePtr; - } - - /* add this to the list */ - next = list; - while (*next) next++; - - if ((next - list) >= listSize) { - int count = next - list; - - listSize += 10; - /* leave room for a NULL */ - list = realloc(list, sizeof(*list) * (listSize + 1)); - - *listSizePtr = listSize; - *listPtr = list; - - next = list + count; - } - - next[0] = *args; - next[1] = NULL; - - args++; - } - - return list; -} - -static int loadModule(const char * modName, struct extractedModule * path, - moduleList modLoaded, char ** args, - moduleInfoSet modInfo, int flags) { - char fileName[200]; - int rc, i; - char ** arg, ** newArgs, ** argPtr; - struct moduleInfo * mi = NULL; - int ethDevices = -1; - pid_t child; - int status; - int popWindow = 0; - - if (mlModuleInList(modName, modLoaded)) - return 0; - - if (modInfo && (mi = isysFindModuleInfo(modInfo, modName))) { - if (mi->major == DRIVER_NET && mi->minor == DRIVER_MINOR_ETHERNET) { - ethDevices = ethCount(); - } - - if (mi->major == DRIVER_SCSI) { - startNewt(flags); - scsiWindow(modName); - popWindow = 1; - } - } - - sprintf(fileName, "%s.o", modName); - for (argPtr = args; argPtr && *argPtr; argPtr++) { - strcat(fileName, " "); - strcat(fileName, *argPtr); - } - - if (modInfo && (mi = isysFindModuleInfo(modInfo, modName))) { - if (mi->major == DRIVER_SCSI) { - /* XXX this shouldn't happen before every load but instead - * just before loading a module group */ - simpleRemoveLoadedModule("usb-storage", modLoaded, flags); - } - } - - if (FL_TESTING(flags)) { - logMessage("would have insmod %s", path); - rc = 0; - } else { - if (!(child = fork())) { - int fd = open("/dev/tty3", O_RDWR); - - dup2(fd, 0); - dup2(fd, 1); - dup2(fd, 2); - close(fd); - - rc = insmod(path->path, NULL, args); - _exit(rc); - } - - waitpid(child, &status, 0); - - if (!WIFEXITED(status) || WEXITSTATUS(status)) { - rc = 1; - } else { - rc = 0; - } - } - - if (modInfo && (strncmp(modName, "usb-storage", 11) != 0) && (mi = isysFindModuleInfo(modInfo, modName))) { - if (mi->major == DRIVER_SCSI) { - reloadUnloadedModule("usb-storage", NULL, modLoaded, NULL, flags); - setFloppyDevice(flags); - } - } - - if (!rc) { - modLoaded->mods[modLoaded->numModules].name = strdup(modName); - modLoaded->mods[modLoaded->numModules].weLoaded = 1; - modLoaded->mods[modLoaded->numModules].path = - path->location ? strdup(path->location) : NULL; - modLoaded->mods[modLoaded->numModules].firstDevNum = -1; - modLoaded->mods[modLoaded->numModules].lastDevNum = -1; - modLoaded->mods[modLoaded->numModules].written = 0; - - if (ethDevices >= 0) { - modLoaded->mods[modLoaded->numModules].firstDevNum = ethDevices; - modLoaded->mods[modLoaded->numModules].lastDevNum = ethCount() - 1; - } - - if (mi) { - modLoaded->mods[modLoaded->numModules].major = mi->major; - modLoaded->mods[modLoaded->numModules].minor = mi->minor; - } else { - modLoaded->mods[modLoaded->numModules].major = DRIVER_NONE; - modLoaded->mods[modLoaded->numModules].minor = DRIVER_MINOR_NONE; - } - - if (args) { - for (i = 0, arg = args; *arg; arg++, i++); - newArgs = malloc(sizeof(*newArgs) * (i + 1)); - for (i = 0, arg = args; *arg; arg++, i++) - newArgs[i] = strdup(*arg); - newArgs[i] = NULL; - } else { - newArgs = NULL; - } - - modLoaded->mods[modLoaded->numModules++].args = newArgs; - } - - if (popWindow) { - sleep(1); - newtPopWindow(); - } - - return rc; -} - -static char * filterDriverModules(struct driverDiskInfo * ddi, - char * const * modNames) { - struct utsname un; - gzFile from; - gzFile to; - int first = 1; - int fd; - char * buf; - struct stat sb; - int rc; - int failed; - char * toPath; - char * chptr; - char ** pattern, ** p; - int i; - - uname(&un); - /* strip off BOOT, -SMP, whatever */ - chptr = un.release + strlen(un.release) - 1; - while (!isdigit(*chptr)) chptr--; - *(chptr + 1) = '\0'; - - for (i = 0; modNames[i]; i++) ; - pattern = alloca((i + 1) * sizeof(*pattern)); - - for (i = 0, p = pattern; modNames[i]; i++, p++) { - *p = alloca(strlen(modNames[i]) + strlen(un.release) + 5); - sprintf(*p, "%s*/%s.o", un.release, modNames[i]); - logMessage("extracting pattern %s%s%s", *p, - ddi->title ? " from " : "", - ddi->title ? ddi->title : ""); - } - *p = NULL; - - if (ddi->device) - devMakeInode(ddi->device, ddi->mntDevice); - - while (1) { - failed = 0; - - if (doPwMount(ddi->mntDevice, "/tmp/drivers", ddi->fs, 1, 0, - NULL, NULL)) - failed = 1; - - if (failed && !first) { - newtWinMessage(_("Error"), _("OK"), - _("Failed to mount driver disk: %s."), strerror(errno)); - } else if (!failed) { - if ((fd = open("/tmp/drivers/rhdd-6.1", O_RDONLY)) < 0) - failed = 1; - if (!failed) { - fstat(fd, &sb); - buf = malloc(sb.st_size + 1); - read(fd, buf, sb.st_size); - if (buf[sb.st_size - 1] == '\n') - sb.st_size--; - buf[sb.st_size] = '\0'; - close(fd); - - failed = strcmp(buf, ddi->title); - free(buf); - } - - if (failed && !first) { - umount("/tmp/drivers"); - newtWinMessage(_("Error"), _("OK"), - _("The wrong diskette was inserted.")); - } - } - - if (!failed) { - from = gunzip_open("/tmp/drivers/modules.cgz"); - toPath = malloc(strlen(modNames[0]) + 30); - sprintf(toPath, "/tmp/modules/%s", modNames[0]); - mkdirChain(toPath); - strcat(toPath, "/modules.cgz"); - to = gzip_open(toPath, O_TRUNC | O_RDWR | O_CREAT, 0600); - - /* This message isn't good, but it'll do. */ - winStatus(50, 3, _("Loading"), _("Loading %s driver..."), - modNames[0]); - - myCpioFilterArchive(from, to, pattern); - - gunzip_close(from); - gunzip_close(to); - while(1) { - int rc; - extern int errno; - - rc = umount("/tmp/drivers"); - if ((rc != -1) || (errno != -EBUSY)) - break; - } - - newtPopWindow(); - - return toPath; - } - - first = 0; - - if (ddi->device) - eject(ddi->device); - - rc = newtWinChoice(_("Driver Disk"), _("OK"), _("Cancel"), - _("Please insert the %s driver disk now."), ddi->title); - if (rc == 2) return NULL; - } -} - -static struct extractedModule * extractModules (struct driverDiskInfo * ddi, - char * const * modNames, struct extractedModule * oldPaths) { - gzFile fd; - char * ballPath; - struct cpioFileMapping * map; - int i, numMaps; - char * const * m; - struct utsname u; - int rc; - const char * failedFile; - char fn[255]; - struct stat sb; - - /* this needs to know about modules64.cgz for sparc */ - - uname(&u); - - if (ddi) { - logMessage("looking for drivers on driver disk"); - ballPath = filterDriverModules(ddi, modNames); - } else { - ballPath = strdup("/modules/modules.cgz"); - } - - fd = gunzip_open(ballPath); - if (!fd) { - logMessage("failed to open %s", ballPath); - free(ballPath); - return NULL; - } - - for (m = modNames, i = 0; *m; i++, m++); - - map = alloca(sizeof(*map) * i); - memset(map, 0, sizeof(*map) * i); - if (!oldPaths) - /* +1 NULL terminates this list */ - oldPaths = calloc(i + 1, sizeof(*oldPaths)); - - for (m = modNames, i = 0, numMaps = 0; *m; m++, i++) { - if (!oldPaths[i].path) { - map[numMaps].archivePath = alloca(strlen(u.release) + - strlen(*m) + 25); - sprintf(map[numMaps].archivePath, "%s/%s.o", u.release, *m); - map[numMaps].fsPath = alloca(10 + strlen(*m)); - sprintf(map[numMaps].fsPath, "/tmp/%s.o", *m); - unlink(map[numMaps].fsPath); - map[numMaps].mapFlags = CPIO_MAP_PATH; - numMaps++; - } - } - - /* nothing to do */ - if (!numMaps) { - gunzip_close(fd); - free(ballPath); - return oldPaths; - } - - qsort(map, numMaps, sizeof(*map), myCpioFileMapCmp); - rc = myCpioInstallArchive(fd, map, numMaps, NULL, NULL, &failedFile); - - gunzip_close(fd); - - for (m = modNames, i = 0, numMaps = 0; *m; m++, i++) { - if (!oldPaths[i].path) { - /* can't trust map; the order changed thanks to qsort */ - sprintf(fn, "/tmp/%s.o", modNames[i]); - if (!stat(fn, &sb)) { - if (ddi) - logMessage("module %s found on driver disk %s (%d bytes)", - modNames[i], ddi->title, sb.st_size); - oldPaths[i].path = strdup(fn); - /* null otherwise from calloc() */ - if (ddi) - oldPaths[i].location = strdup(ballPath); - } - numMaps++; - } - } - - free(ballPath); - return oldPaths; -} - -static int doLoadModules(const char * origModNames, moduleList modLoaded, - moduleDeps modDeps, moduleInfoSet modInfo, int flags, - const char * argModule, char ** args) { - char * modNames; - char * end, * start, * next; - char ** initialList; - int i; - char ** list, ** l; - struct extractedModule * paths, * p; - struct moduleInfo * mi; - char items[1024] = ""; - - start = modNames = alloca(strlen(origModNames) + 1); - strcpy(modNames, origModNames); - - next = start, i = 1; - while (*next) { - if (*next == ':') i++; - next++; - } - - initialList = alloca(sizeof(*initialList) * (i + 1)); - - i = 0; - while (start) { - next = end = strchr(start, ':'); - if (next) *end = '\0', next++; - - if (mlModuleInList(start, modLoaded)) { - /* already loaded */ - start = next; - continue; - } - - initialList[i++] = start; - - start = next; - } - initialList[i] = NULL; - - list = tsortModules(modLoaded, modDeps, initialList, 0, NULL, NULL); - if (!list) { - logMessage("found loop in module dependencies; not inserting anything"); - return 1; - } - - for (i = 0; list[i]; i++) { - strcat(items, " "); - strcat(items, list[i]); - } - - logMessage("modules to insert%s", items); - - paths = NULL; - if (modInfo) { - for (i = 0; list[i]; i++) { - if (paths && paths[i].path) continue; - mi = isysFindModuleInfo(modInfo, list[i]); - - if (mi && mi->locationID) - paths = extractModules(mi->locationID, list, paths); - } - } - - paths = extractModules(NULL, list, paths); - i = 0; - if (!paths) { - logMessage("no modules found -- aborting insertion"); - return i; - i++; - } else { - *items = '\0'; - - /* if any modules weren't found, holler */ - for (l = list, p = paths; *l && p; l++, p++) { - if (!p->path) { - if (*items) strcat(items, " "); - strcat(items, *l); - i++; - } - } - - if (*items) logMessage("module(s) %s not found", items); - } - - /* insert the modules now */ - for (l = list, p = paths; paths && *l; l++, p++) { - if (p->path && loadModule(*l, p, modLoaded, - (argModule && !strcmp(argModule, *l)) ? args : NULL, - modInfo, flags)) { - logMessage("failed to insert %s", *p); - } else if (p->path) { - logMessage("inserted %s", p->path); - } - } - - if (!FL_TESTING(flags)) { - int fd; - - fd = open("/tmp/modules.conf", O_WRONLY | O_CREAT | O_APPEND, - 0666); - if (fd == -1) { - logMessage("error appending to /tmp/modules.conf: %s\n", - strerror(errno)); - } else { - mlWriteConfModules(modLoaded, fd); - close(fd); - } - } - - for (p = paths; p->path; p++) { - unlink(p->path); - free(p->path); - if (p->location) free(p->location); - } - - free(paths); - free(list); - - logMessage("load module set done"); - - return i; -} - -/* loads a single module (preloading and dependencies), passing "args" to - the module as its argument */ -int mlLoadModule(const char * modName, - moduleList modLoaded, moduleDeps modDeps, char ** args, - moduleInfoSet modInfo, int flags) { - return doLoadModules(modName, modLoaded, modDeps, modInfo, flags, - modName, args); -} - -/* loads a : separated list of modules. the arg only applies to the - first module in the list */ -int mlLoadModuleSet(const char * modNames, - moduleList modLoaded, moduleDeps modDeps, - moduleInfoSet modInfo, int flags) { - return doLoadModules(modNames, modLoaded, modDeps, modInfo, flags, - NULL, NULL); -} - -int mlModuleInList(const char * modName, moduleList list) { - int i; - - if (!list) return 0; - - for (i = 0; i < list->numModules; i++) - if (!strcmp(list->mods[i].name, modName)) return 1; - - return 0; -} - -int mlWriteConfModules(moduleList list, int fd) { - int i; - struct loadedModuleInfo * lm; - char buf[16384], buf2[512]; - int scsiNum; - int ethNum; - int trNum = 0; - int iucvNum = 0; - char ** arg; - char *iucvopt; - - if (!list) return 0; - - scsiNum = scsiCount(); - - for (i = 0, lm = list->mods; i < list->numModules; i++, lm++) { - if (!lm->weLoaded) continue; - if (lm->written) continue; - lm->written = 1; - if (lm->major != DRIVER_NONE) { - strcpy(buf, "alias "); - switch (lm->major) { - case DRIVER_CDROM: - strcat(buf, "cdrom "); - break; - - case DRIVER_SCSI: - if (scsiNum) - sprintf(buf2, "scsi_hostadapter%d ", scsiNum); - else - strcpy(buf2, "scsi_hostadapter "); - scsiNum++; - strcat(buf, buf2); - break; - - case DRIVER_NET: - switch (lm->minor) { - case DRIVER_MINOR_ETHERNET: - for (ethNum = lm->firstDevNum; - ethNum <= lm->lastDevNum; ethNum++) { - sprintf(buf2, "eth%d ", ethNum); - if (ethNum != lm->lastDevNum) { - strcat(buf2, lm->name); - strcat(buf2, "\nalias "); - } - strcat(buf, buf2); - if(!strstr(lm->name, "iucv")) - iucvNum++; - } - - break; - case DRIVER_MINOR_TR: - sprintf(buf2, "tr%d ", trNum++); - strcat(buf, buf2); - break; - default: - } - - default: - } - - strcat(buf, lm->name); - strcat(buf, "\n"); - write(fd, buf, strlen(buf)); - } - - if (lm->args) { - strcpy(buf, "options "); - strcat(buf, lm->name); - for (arg = lm->args; *arg; arg++) { - strcat(buf, " "); - strcat(buf, *arg); - } - strcat(buf, "\n"); - write(fd, buf, strlen(buf)); - } - } - if (iucvNum) { - iucvopt = getenv("IUCV"); - if (iucvopt && *iucvopt) { - sprintf(buf, "options netiucv %s\n", iucvopt); - write(fd, buf, strlen(buf)); - } - } - return 0; -} - -/* simple removal of a loaded module which is going to be reloaded. - * Note that this does NOT modify the modLoaded struct at all - */ -int simpleRemoveLoadedModule(const char * modName, moduleList modLoaded, - int flags) { - int status, rc = 0; - pid_t child; - - if (!mlModuleInList(modName, modLoaded)) { - return 0; - } - - if (FL_TESTING(flags)) { - logMessage("would have rmmod %s", modName); - rc = 0; - } else { - logMessage("going to rmmod %s", modName); - if (!(child = fork())) { - int fd = open("/dev/tty3", O_RDWR); - - dup2(fd, 0); - dup2(fd, 1); - dup2(fd, 2); - close(fd); - - execl("/sbin/rmmod", "/sbin/rmmod", modName, NULL); - _exit(rc); - } - - waitpid(child, &status, 0); - - if (!WIFEXITED(status) || WEXITSTATUS(status)) { - rc = 1; - } else { - rc = 0; - } - } - return rc; -} - -/* simple reinsertion of a module; just looks for the module and reloads it - * if we think it was already loaded - */ -int reloadUnloadedModule(char * modName, void * location, - moduleList modLoaded, char ** args, int flags) { - char fileName[200]; - int rc, status; - pid_t child; - struct extractedModule * path; - char ** argPtr; - char * list[2]; - - if (!mlModuleInList(modName, modLoaded)) { - return 0; - } - - list[0] = modName; - list[1] = NULL; - - if (location) - path = extractModules(location, tsortModules(modLoaded, NULL, list, 0, NULL, NULL), NULL); - - sprintf(fileName, "%s.o", modName); - for (argPtr = args; argPtr && *argPtr; argPtr++) { - strcat(fileName, " "); - strcat(fileName, *argPtr); - } - - sprintf(fileName, "%s.o", modName); - - if (FL_TESTING(flags)) { - logMessage("would have insmod %s", fileName); - rc = 0; - } else { - logMessage("going to insmod %s", fileName); - - if (!(child = fork())) { - int fd = open("/dev/tty3", O_RDWR); - - dup2(fd, 0); - dup2(fd, 1); - dup2(fd, 2); - close(fd); - - rc = insmod(fileName, NULL, args); - _exit(rc); - } - - waitpid(child, &status, 0); - - if (!WIFEXITED(status) || WEXITSTATUS(status)) { - rc = 1; - } else { - rc = 0; - } - } - - logMessage("reloadModule returning %d", rc); - return rc; -} - diff --git a/loader/modules.h b/loader/modules.h deleted file mode 100644 index ab3e1b280..000000000 --- a/loader/modules.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef H_MODULES -#define H_MODULES - -#include "isys/isys.h" - -typedef struct moduleList_s * moduleList; -typedef struct moduleDependency_s * moduleDeps; - -struct loadedModuleInfo { - char * name; - char ** args; - int weLoaded; - int written; - char * path; - int firstDevNum, lastDevNum; /* only used for ethernet currently */ - enum driverMajor major; - enum driverMinor minor; -}; - -struct moduleList_s { - struct loadedModuleInfo mods[50]; - int numModules; -}; - - -int mlReadLoadedList(moduleList * list); -void mlFreeList(moduleList list); -int mlLoadDeps(moduleDeps * moduleDepList, const char * path); -moduleDeps mlNewDeps(void); - -int mlLoadModuleSet(const char * origModNames, moduleList modLoaded, - moduleDeps modDeps, moduleInfoSet modInfo, - int flags); - -int mlLoadModule(const char * origModNames, moduleList modLoaded, - moduleDeps modDeps, char ** args, moduleInfoSet modInfo, - int flags); - -char ** mlGetDeps(moduleDeps modDeps, const char * modName); -int mlModuleInList(const char * modName, moduleList list); -int mlWriteConfModules(moduleList list, int fd); - -int simpleRemoveLoadedModule(const char * modName, moduleList modLoaded, - int flags); -int reloadUnloadedModule(char * modName, void * location, - moduleList modLoaded, char ** args, int flags); - -#endif diff --git a/loader/net.c b/loader/net.c deleted file mode 100644 index a0c473772..000000000 --- a/loader/net.c +++ /dev/null @@ -1,923 +0,0 @@ -/* - * Copyright 1999-2001 Red Hat, Inc. - * - * All Rights Reserved. - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of Red Hat shall not be - * used in advertising or otherwise to promote the sale, use or other dealings - * in this Software without prior written authorization from Red Hat. - * - */ - -#include <arpa/inet.h> -#include <errno.h> -#include <popt.h> -#include <resolv.h> -#include <net/if.h> -#include <newt.h> -#include <stdlib.h> -#include <string.h> - -#ifdef __STANDALONE__ -#include <netdb.h> -#include <libintl.h> -#include <locale.h> - -#define _(String) gettext((String)) -#define N_(String) String - -#define LOADER_BACK 2 -#define LOADER_OK 0 -#define LOADER_ERROR -1; - -#include "net.h" -#include "pump.h" - -#else - -# include "isys/dns.h" - -#include "kickstart.h" -#include "lang.h" -#include "loader.h" -#include "log.h" -#include "net.h" -#include "windows.h" -#include "misc.h" - -#endif /* __STANDALONE__ */ - -#ifndef __STANDALONE__ -char *netServerPrompt = \ - N_("Please enter the following information:\n" - "\n" - " o the name or IP number of your %s server\n" - " o the directory on that server containing\n" - " %s for your architecture\n"); -#endif - -struct intfconfig_s { - newtComponent ipEntry, nmEntry, gwEntry, nsEntry; - char * ip, * nm, * gw, * ns; -}; - -typedef int int32; - -#ifdef __STANDALONE__ -static FILE * logfile = NULL; - -#define FL_TESTING(foo) 1 - -void logMessage(const char * s, ...) { - va_list args; - - if (!logfile) return; - va_start(args, s); - - fprintf(logfile, "* "); - vfprintf(logfile, s, args); - fprintf(logfile, "\n"); - fflush(logfile); - - va_end(args); - - return; -} - -/* yawn. This really should be in newt. */ -void winStatus(int width, int height, char * title, - char * text, ...) { - newtComponent t, f; - char * buf = NULL; - int size = 0; - int i = 0; - va_list args; - - va_start(args, text); - - do { - size += 1000; - if (buf) free(buf); - buf = malloc(size); - i = vsnprintf(buf, size, text, args); - } while (i == size); - - va_end(args); - - newtCenteredWindow(width, height, title); - - t = newtTextbox(1, 1, width - 2, height - 2, NEWT_TEXTBOX_WRAP); - newtTextboxSetText(t, buf); - f = newtForm(NULL, NULL, 0); - - free(buf); - - newtFormAddComponent(f, t); - - newtDrawForm(f); - newtRefresh(); - newtFormDestroy(f); -} - -#endif - -static void ipCallback(newtComponent co, void * dptr) { - struct intfconfig_s * data = dptr; - struct in_addr ipaddr, nmaddr, addr; - char * ascii; - int broadcast, network; - - if (co == data->ipEntry) { - if (strlen(data->ip) && !strlen(data->nm)) { - if (inet_aton(data->ip, &ipaddr)) { - ipaddr.s_addr = ntohl(ipaddr.s_addr); - ascii = "255.255.255.0"; - newtEntrySet(data->nmEntry, ascii, 1); - } - } - } else if (co == data->nmEntry) { - if (!strlen(data->ip) || !strlen(data->nm)) return; - if (!inet_aton(data->ip, &ipaddr)) return; - if (!inet_aton(data->nm, &nmaddr)) return; - - network = ipaddr.s_addr & nmaddr.s_addr; - broadcast = (ipaddr.s_addr & nmaddr.s_addr) | (~nmaddr.s_addr); - - if (!strlen(data->gw)) { - addr.s_addr = htonl(ntohl(broadcast) - 1); - newtEntrySet(data->gwEntry, inet_ntoa(addr), 1); - } - - if (!strlen(data->ns)) { - addr.s_addr = htonl(ntohl(network) + 1); - newtEntrySet(data->nsEntry, inet_ntoa(addr), 1); - } - } -} - -#ifndef __STANDALONE__ -int nfsGetSetup(char ** hostptr, char ** dirptr) { - struct newtWinEntry entries[3]; - char * buf; - char * newServer = *hostptr ? strdup(*hostptr) : NULL; - char * newDir = *dirptr ? strdup(*dirptr) : NULL; - int rc; - - entries[0].text = _("NFS server name:"); - entries[0].value = &newServer; - entries[0].flags = NEWT_FLAG_SCROLL; - entries[1].text = _("Red Hat directory:"); - entries[1].value = &newDir; - entries[1].flags = NEWT_FLAG_SCROLL; - entries[2].text = NULL; - entries[2].value = NULL; - buf = sdupprintf(_(netServerPrompt), "NFS", PRODUCTNAME); - rc = newtWinEntries(_("NFS Setup"), buf, 60, 5, 15, - 24, entries, _("OK"), _("Back"), NULL); - free(buf); - - if (rc == 2) { - if (newServer) free(newServer); - if (newDir) free(newDir); - return LOADER_BACK; - } - - if (*hostptr) free(*hostptr); - if (*dirptr) free(*dirptr); - *hostptr = newServer; - *dirptr = newDir; - - return 0; -} -#endif - -static void fillInIpInfo(struct networkDeviceConfig * cfg) { - int32 * i; - char * nm; - - if (!(cfg->dev.set & PUMP_INTFINFO_HAS_NETMASK)) { - i = (int32 *) &cfg->dev.ip; - - nm = "255.255.255.0"; - - inet_aton(nm, &cfg->dev.netmask); - cfg->dev.set |= PUMP_INTFINFO_HAS_NETMASK; - } - - if (!(cfg->dev.set & PUMP_INTFINFO_HAS_BROADCAST)) { - *((int32 *) &cfg->dev.broadcast) = (*((int32 *) &cfg->dev.ip) & - *((int32 *) &cfg->dev.netmask)) | - ~(*((int32 *) &cfg->dev.netmask)); - cfg->dev.set |= PUMP_INTFINFO_HAS_BROADCAST; - } - - if (!(cfg->dev.set & PUMP_INTFINFO_HAS_NETWORK)) { - *((int32 *) &cfg->dev.network) = - *((int32 *) &cfg->dev.ip) & - *((int32 *) &cfg->dev.netmask); - cfg->dev.set |= PUMP_INTFINFO_HAS_NETWORK; - } -} - -#ifndef __STANDALONE__ -void initLoopback(void) { - struct pumpNetIntf dev; - - strcpy(dev.device, "lo"); - inet_aton("127.0.0.1", &dev.ip); - inet_aton("255.0.0.0", &dev.netmask); - inet_aton("127.0.0.0", &dev.network); - dev.set = PUMP_INTFINFO_HAS_NETMASK | PUMP_INTFINFO_HAS_IP - | PUMP_INTFINFO_HAS_NETWORK; - - pumpSetupInterface(&dev); -} -#endif - -static void dhcpBoxCallback(newtComponent co, void * ptr) { - struct intfconfig_s * c = ptr; - - newtEntrySetFlags(c->ipEntry, NEWT_FLAG_DISABLED, NEWT_FLAGS_TOGGLE); - newtEntrySetFlags(c->gwEntry, NEWT_FLAG_DISABLED, NEWT_FLAGS_TOGGLE); - newtEntrySetFlags(c->nmEntry, NEWT_FLAG_DISABLED, NEWT_FLAGS_TOGGLE); - newtEntrySetFlags(c->nsEntry, NEWT_FLAG_DISABLED, NEWT_FLAGS_TOGGLE); -} - -static int getDnsServers(struct networkDeviceConfig * cfg) { - int rc; - char * ns = ""; - struct newtWinEntry entry[] = { { N_("Nameserver IP"), &ns, 0 }, - { NULL, NULL, 0 } }; - - do { - rc = newtWinEntries(_("Nameserver"), - _("Your dynamic IP request returned IP configuration " - "information, but it did not include a DNS nameserver. " - "If you know what your nameserver is, please enter it " - "now. If you don't have this information, you can leave " - "this field blank and the install will continue."), - 40, 5, 10, 25, entry, _("OK"), _("Back"), NULL); - - if (rc == 2) return LOADER_BACK; - - if (ns && *ns && !inet_aton(ns, &cfg->dev.dnsServers[0])) { - newtWinMessage(_("Invalid IP Information"), _("Retry"), - _("You entered an invalid IP address.")); - rc = 2; - } - - } while (rc == 2); - - cfg->dev.set |= PUMP_NETINFO_HAS_DNS; - cfg->dev.numDns = 1; - - return LOADER_OK; -} - -int readNetConfig(char * device, struct networkDeviceConfig * cfg, int flags) { - newtComponent text, f, okay, back, answer, dhcpCheckbox; - newtGrid grid, subgrid, buttons; - struct networkDeviceConfig newCfg; - struct intfconfig_s c; - int i; - struct in_addr addr; - char dhcpChoice; - char * chptr; - -#if !defined(__s390__) && !defined(__s390x__) - text = newtTextboxReflowed(-1, -1, - _("Please enter the IP configuration for this machine. Each " - "item should be entered as an IP address in dotted-decimal " - "notation (for example, 1.2.3.4)."), 50, 5, 10, 0); - - subgrid = newtCreateGrid(2, 4); - newtGridSetField(subgrid, 0, 0, NEWT_GRID_COMPONENT, - newtLabel(-1, -1, _("IP address:")), - 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); - newtGridSetField(subgrid, 0, 1, NEWT_GRID_COMPONENT, - newtLabel(-1, -1, _("Netmask:")), - 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); - newtGridSetField(subgrid, 0, 2, NEWT_GRID_COMPONENT, - newtLabel(-1, -1, _("Default gateway (IP):")), - 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); - newtGridSetField(subgrid, 0, 3, NEWT_GRID_COMPONENT, - newtLabel(-1, -1, _("Primary nameserver:")), - 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); - - c.ipEntry = newtEntry(-1, -1, NULL, 16, &c.ip, 0); - c.nmEntry = newtEntry(-1, -1, NULL, 16, &c.nm, 0); - c.gwEntry = newtEntry(-1, -1, NULL, 16, &c.gw, 0); - c.nsEntry = newtEntry(-1, -1, NULL, 16, &c.ns, 0); - - if (!cfg->isDynamic) { - if (cfg->dev.set & PUMP_INTFINFO_HAS_IP) - newtEntrySet(c.ipEntry, inet_ntoa(cfg->dev.ip), 1); - - if (cfg->dev.set & PUMP_INTFINFO_HAS_NETMASK) - newtEntrySet(c.nmEntry, inet_ntoa(cfg->dev.netmask), 1); - - if (cfg->dev.set & PUMP_NETINFO_HAS_GATEWAY) - newtEntrySet(c.gwEntry, inet_ntoa(cfg->dev.gateway), 1); - - if (cfg->dev.numDns) - newtEntrySet(c.nsEntry, inet_ntoa(cfg->dev.dnsServers[0]), 1); - - dhcpChoice = ' '; - } else { - dhcpChoice = '*'; - } - - dhcpCheckbox = newtCheckbox(-1, -1, - _("Use dynamic IP configuration (BOOTP/DHCP)"), - dhcpChoice, NULL, &dhcpChoice); - newtComponentAddCallback(dhcpCheckbox, dhcpBoxCallback, &c); - if (dhcpChoice == '*') dhcpBoxCallback(dhcpCheckbox, &c); - - newtGridSetField(subgrid, 1, 0, NEWT_GRID_COMPONENT, c.ipEntry, - 1, 0, 0, 0, 0, 0); - newtGridSetField(subgrid, 1, 1, NEWT_GRID_COMPONENT, c.nmEntry, - 1, 0, 0, 0, 0, 0); - newtGridSetField(subgrid, 1, 2, NEWT_GRID_COMPONENT, c.gwEntry, - 1, 0, 0, 0, 0, 0); - newtGridSetField(subgrid, 1, 3, NEWT_GRID_COMPONENT, c.nsEntry, - 1, 0, 0, 0, 0, 0); - - buttons = newtButtonBar(_("OK"), &okay, _("Back"), &back, NULL); - - grid = newtCreateGrid(1, 4); - newtGridSetField(grid, 0, 0, NEWT_GRID_COMPONENT, text, - 0, 0, 0, 1, 0, 0); - newtGridSetField(grid, 0, 1, NEWT_GRID_COMPONENT, dhcpCheckbox, - 0, 0, 0, 1, 0, 0); - newtGridSetField(grid, 0, 2, NEWT_GRID_SUBGRID, subgrid, - 0, 0, 0, 1, 0, 0); - newtGridSetField(grid, 0, 3, NEWT_GRID_SUBGRID, buttons, - 0, 0, 0, 0, 0, NEWT_GRID_FLAG_GROWX); - - f = newtForm(NULL, NULL, 0); - newtGridAddComponentsToForm(grid, f, 1); - newtGridWrappedWindow(grid, _("Configure TCP/IP")); - newtGridFree(grid, 1); - - newtComponentAddCallback(c.ipEntry, ipCallback, &c); - newtComponentAddCallback(c.nmEntry, ipCallback, &c); - - do { - answer = newtRunForm(f); - - if (answer == back) { - newtFormDestroy(f); - newtPopWindow(); - return LOADER_BACK; - } - - if (dhcpChoice == ' ') { - i = 0; - memset(&newCfg, 0, sizeof(newCfg)); - if (*c.ip && inet_aton(c.ip, &addr)) { - i++; - newCfg.dev.ip = addr; - newCfg.dev.set |= PUMP_INTFINFO_HAS_IP; - } - - if (*c.nm && inet_aton(c.nm, &addr)) { - i++; - newCfg.dev.netmask = addr; - newCfg.dev.set |= PUMP_INTFINFO_HAS_NETMASK; - } - - if (i != 2) { - newtWinMessage(_("Missing Information"), _("Retry"), - _("You must enter both a valid IP address and a " - "netmask.")); - } - - strcpy(newCfg.dev.device, device); - newCfg.isDynamic = 0; - } else { - if (!FL_TESTING(flags)) { - winStatus(50, 3, _("Dynamic IP"), - _("Sending request for IP information..."), - 0); - chptr = pumpDhcpRun(device, 0, 0, NULL, &newCfg.dev, NULL); - newtPopWindow(); - } else { - chptr = NULL; - } - - if (!chptr) { - newCfg.isDynamic = 1; -#ifdef __STANDALONE__ - i = 2; -#else - if (!(newCfg.dev.set & PUMP_NETINFO_HAS_DNS)) { - logMessage("pump worked, but didn't return a DNS server"); - i = getDnsServers(&newCfg); - i = i ? 0 : 2; - } else { - i = 2; - } -#endif - } else { - logMessage("pump told us: %s", chptr); - i = 0; - } - } - } while (i != 2); - -#else /* s390 now */ - char * env; - /* quick and dirty hack by opaukstadt@millenux.com for s390 */ - /* ctc stores remoteip in broadcast-field until pump.h is changed */ - memset(&newCfg, 0, sizeof(newCfg)); - strcpy(newCfg.dev.device, device); - newCfg.isDynamic = 0; - env = getenv("IPADDR"); - if (env && *env) { - if(inet_aton(env, &newCfg.dev.ip)) - newCfg.dev.set |= PUMP_INTFINFO_HAS_IP; - } - env = getenv("NETMASK"); - if (env && *env) { - if(inet_aton(env, &newCfg.dev.netmask)) - newCfg.dev.set |= PUMP_INTFINFO_HAS_NETMASK; - } - env = getenv("GATEWAY"); - if (env && *env) { - if(inet_aton(env, &newCfg.dev.gateway)) - newCfg.dev.set |= PUMP_NETINFO_HAS_GATEWAY; - } - env = getenv("NETWORK"); - if (env && *env) { - if(inet_aton(env, &newCfg.dev.network)) - newCfg.dev.set |= PUMP_INTFINFO_HAS_NETWORK; - } - env = getenv("DNS"); - if (env && *env) { - char *s = strdup (env); - char *t = strtok (s, ":"); - if(inet_aton((t? t : s), &newCfg.dev.dnsServers[0])) - newCfg.dev.set |= PUMP_NETINFO_HAS_DNS; - } - if (!strncmp(newCfg.dev.device, "ctc", 3)) { - env = getenv("REMIP"); - if (env && *env) { - if(inet_aton(env, &newCfg.dev.gateway)) - newCfg.dev.set |= PUMP_NETINFO_HAS_GATEWAY; - } - } - env = getenv("BROADCAST"); - if (env && *env) { - if(inet_aton(env, &newCfg.dev.broadcast)) - newCfg.dev.set |= PUMP_INTFINFO_HAS_BROADCAST; - } -#endif /* s390 */ - -#ifdef __STANDALONE__ - if (!newCfg.isDynamic) -#endif - cfg->isDynamic = newCfg.isDynamic; - memcpy(&cfg->dev,&newCfg.dev,sizeof(newCfg.dev)); - - fillInIpInfo(cfg); - -#if !defined(__s390__) && !defined(__s390x__) - if (!(cfg->dev.set & PUMP_NETINFO_HAS_GATEWAY)) { - if (*c.gw && inet_aton(c.gw, &addr)) { - cfg->dev.gateway = addr; - cfg->dev.set |= PUMP_NETINFO_HAS_GATEWAY; - } - } - - if (!(cfg->dev.numDns)) { - if (*c.ns && inet_aton(c.ns, &addr)) { - cfg->dev.dnsServers[0] = addr; - cfg->dev.numDns = 1; - } - } - - newtPopWindow(); -#endif - if (!FL_TESTING(flags)) { - configureNetwork(cfg); - findHostAndDomain(cfg, flags); - writeResolvConf(cfg); - } - -#ifdef __STANDALONE__ - writeResolvConf(cfg); -#endif - return 0; -} - -int configureNetwork(struct networkDeviceConfig * dev) { -#if !defined(__s390__) && !defined(__s390x__) - pumpSetupInterface(&dev->dev); - - if (dev->dev.set & PUMP_NETINFO_HAS_GATEWAY) - pumpSetupDefaultGateway(&dev->dev.gateway); - -#endif - return 0; -} - -int writeNetInfo(const char * fn, struct networkDeviceConfig * dev, - struct knownDevices * kd) { - FILE * f; -#ifndef __STANDALONE__ - int i; -#endif - -#ifndef __STANDALONE__ - for (i = 0; i < kd->numKnown; i++) - if (!strcmp(kd->known[i].name, dev->dev.device)) break; -#endif - - if (!(f = fopen(fn, "w"))) return -1; - - fprintf(f, "DEVICE=%s\n", dev->dev.device); - -#ifndef __STANDALONE__ - if (i < kd->numKnown && kd->known[i].code == CODE_PCMCIA) - fprintf(f, "ONBOOT=no\n"); - else -#endif - fprintf(f, "ONBOOT=yes\n"); - - if (dev->isDynamic) { - fprintf(f, "BOOTPROTO=dhcp\n"); - } else { - fprintf(f, "BOOTPROTO=static\n"); - fprintf(f, "IPADDR=%s\n", inet_ntoa(dev->dev.ip)); - fprintf(f, "NETMASK=%s\n", inet_ntoa(dev->dev.netmask)); - if (dev->dev.set & PUMP_NETINFO_HAS_GATEWAY) { - fprintf(f, "GATEWAY=%s\n", inet_ntoa(dev->dev.gateway)); - if (!strncmp(dev->dev.device, "ctc", 3) || \ - !strncmp(dev->dev.device, "iucv", 4)) - fprintf(f, "REMIP=%s\n", inet_ntoa(dev->dev.gateway)); - } - if (dev->dev.set & PUMP_INTFINFO_HAS_BROADCAST) - fprintf(f, "BROADCAST=%s\n", inet_ntoa(dev->dev.broadcast)); - } - - if (dev->dev.set & PUMP_NETINFO_HAS_HOSTNAME) - fprintf(f, "HOSTNAME=%s\n", dev->dev.hostname); - if (dev->dev.set & PUMP_NETINFO_HAS_DOMAIN) - fprintf(f, "DOMAIN=%s\n", dev->dev.domain); - - fclose(f); - - return 0; -} - -int writeResolvConf(struct networkDeviceConfig * net) { - char * filename = "/etc/resolv.conf"; - FILE * f; - int i; -#if defined(__s390__) || defined(__s390x__) - return 0; -#endif - - if (!(net->dev.set & PUMP_NETINFO_HAS_DOMAIN) && !net->dev.numDns) - return LOADER_ERROR; - - f = fopen(filename, "w"); - if (!f) { - logMessage("Cannot create %s: %s\n", filename, strerror(errno)); - return LOADER_ERROR; - } - - if (net->dev.set & PUMP_NETINFO_HAS_DOMAIN) - fprintf(f, "search %s\n", net->dev.domain); - - for (i = 0; i < net->dev.numDns; i++) - fprintf(f, "nameserver %s\n", inet_ntoa(net->dev.dnsServers[i])); - - fclose(f); - - res_init(); /* reinit the resolver so DNS changes take affect */ - - return 0; -} - -int findHostAndDomain(struct networkDeviceConfig * dev, int flags) { - char * name, * chptr; -#ifdef __STANDALONE__ - struct hostent * he; -#endif - - if (!FL_TESTING(flags)) { - writeResolvConf(dev); - } - - if (!(dev->dev.set & PUMP_NETINFO_HAS_HOSTNAME)) { - winStatus(40, 3, _("Hostname"), - _("Determining host name and domain...")); -#ifdef __STANDALONE__ - he = gethostbyaddr( (char *) &dev->dev.ip, sizeof (dev->dev.ip), AF_INET); - name = he ? he->h_name : 0; -#else - name = mygethostbyaddr(inet_ntoa(dev->dev.ip)); -#endif - newtPopWindow(); - - if (!name) { - logMessage("reverse name lookup failed"); - return 1; - } - - logMessage("reverse name lookup worked"); - - dev->dev.hostname = strdup(name); - dev->dev.set |= PUMP_NETINFO_HAS_HOSTNAME; - } else { - name = dev->dev.hostname; - } - - if (!(dev->dev.set & PUMP_NETINFO_HAS_DOMAIN)) { - for (chptr = name; *chptr && (*chptr != '.'); chptr++) ; - if (*chptr == '.') { - if (dev->dev.domain) free(dev->dev.domain); - dev->dev.domain = strdup(chptr + 1); - dev->dev.set |= PUMP_NETINFO_HAS_DOMAIN; - } - } - - return 0; -} - -#ifndef __STANDALONE__ -int kickstartNetwork(char ** devicePtr, struct networkDeviceConfig * netDev, - char * bootProto, int flags) { - char ** ksArgv; - int ksArgc; - int netSet, rc; - char * arg, * chptr; - char * kshostname=NULL; - poptContext optCon; - struct in_addr * parseAddress; - int noDns = 0; - char * device; - struct poptOption ksOptions[] = { - { "bootproto", '\0', POPT_ARG_STRING, &bootProto, 0 }, - { "device", '\0', POPT_ARG_STRING, devicePtr, 0 }, - { "gateway", '\0', POPT_ARG_STRING, NULL, 'g' }, - { "ip", '\0', POPT_ARG_STRING, NULL, 'i' }, - { "nameserver", '\0', POPT_ARG_STRING, NULL, 'n' }, - { "netmask", '\0', POPT_ARG_STRING, NULL, 'm' }, - { "nodns", '\0', POPT_ARG_NONE, &noDns, 0 }, - { "hostname", '\0', POPT_ARG_STRING, NULL, 'h'}, - { 0, 0, 0, 0, 0 } - }; - - if (!bootProto) { - if (ksGetCommand(KS_CMD_NETWORK, NULL, &ksArgc, &ksArgv)) { - /* This is for compatibility with RH 5.0 */ - ksArgv = alloca(sizeof(*ksArgv) * 1); - ksArgv[0] = "network"; - ksArgc = 1; - } - - optCon = poptGetContext(NULL, ksArgc, (const char **) ksArgv, ksOptions, 0); - while ((rc = poptGetNextOpt(optCon)) >= 0) { - parseAddress = NULL; - netSet = 0; - - arg = (char *) poptGetOptArg(optCon); - - switch (rc) { - case 'g': - parseAddress = &netDev->dev.gateway; - netSet = PUMP_NETINFO_HAS_GATEWAY; - break; - - case 'i': - parseAddress = &netDev->dev.ip; - netSet = PUMP_INTFINFO_HAS_IP; - break; - - case 'n': - parseAddress = &netDev->dev.dnsServers[netDev->dev.numDns++]; - netSet = PUMP_NETINFO_HAS_DNS; - break; - - case 'm': - parseAddress = &netDev->dev.netmask; - netSet = PUMP_INTFINFO_HAS_NETMASK; - break; - - case 'h': - if (kshostname) - free(kshostname); - kshostname = strdup(arg); - logMessage("netDev->dev.hostname = %s", kshostname); - break; - } - - if (parseAddress && !inet_aton(arg, parseAddress)) { - logMessage("bad ip number in network command: %s", arg); - return -1; - } - - netDev->dev.set |= netSet; - } - - if (rc < -1) { - newtWinMessage(_("kickstart"), _("OK"), - _("bad argument to kickstart network command %s: %s"), - poptBadOption(optCon, POPT_BADOPTION_NOALIAS), - poptStrerror(rc)); - } else { - poptFreeContext(optCon); - } - } - - device = *devicePtr; - - if (!bootProto) - bootProto = "dhcp"; - - if (!strcmp(bootProto, "dhcp") || !strcmp(bootProto, "bootp")) { - logMessage("sending dhcp request through device %s", device); - winStatus(50, 3, _("Dynamic IP"), - _("Sending request for IP information..."), - 0); - - chptr = pumpDhcpRun(device, 0, 0, NULL, &netDev->dev, NULL); - newtPopWindow(); - if (chptr) { - logMessage("pump told us: %s", chptr); - return -1; - } - netDev->isDynamic = 1; - } else if (!strcmp(bootProto, "static")) { - strcpy(netDev->dev.device, device); - } else if (!strcmp(bootProto, "query")) { - strcpy(netDev->dev.device, device); - readNetConfig("eth0", netDev, flags); - } else { - newtWinMessage(_("kickstart"), _("OK"), - _("Bad bootproto %s specified in network command"), - bootProto); - return -1; - } - - fillInIpInfo(netDev); - configureNetwork(netDev); - - logMessage("nodns is %d", noDns); - - if (kshostname) { - logMessage("setting ks specified hostname of %s", kshostname); - netDev->dev.hostname=strdup(kshostname); - netDev->dev.set |= PUMP_NETINFO_HAS_HOSTNAME; - } - - if (!noDns) - findHostAndDomain(netDev, flags); - - writeResolvConf(netDev); - - return 0; -} -#endif - -#ifdef __STANDALONE__ -int main(int argc, const char **argv) { - int netSet, rc; - int x; - int noDns = 0; - char * bootProto = NULL; - char * device = NULL; - char * hostname = NULL; - char * domain = NULL; - const char * arg; - char path[256]; - char roottext[80]; - poptContext optCon; - struct networkDeviceConfig *netDev; - struct in_addr * parseAddress; - struct poptOption Options[] = { - POPT_AUTOHELP - { "bootproto", '\0', POPT_ARG_STRING, &bootProto, 0, - _("Boot protocol to use"), "(dhcp|bootp|none)" }, - { "gateway", '\0', POPT_ARG_STRING, NULL, 'g', - _("Network gateway"), NULL }, - { "ip", '\0', POPT_ARG_STRING, NULL, 'i', - _("IP address"), NULL }, - { "nameserver", '\0', POPT_ARG_STRING, NULL, 'n', - _("Nameserver"), NULL }, - { "netmask", '\0', POPT_ARG_STRING, NULL, 'm', - _("Netmask"), NULL }, - { "hostname", '\0', POPT_ARG_STRING, &hostname, 0, - _("Hostname"), NULL - }, - { "domain", '\0', POPT_ARG_STRING, &domain, 0, - _("Domain name"), NULL - }, - { "device", 'd', POPT_ARG_STRING, &device, 0, - _("Network device"), NULL - }, - { "nodns", '\0', POPT_ARG_NONE, &noDns, 0, - _("No DNS lookups"), NULL - }, - { 0, 0, 0, 0, 0 } - }; - - - netDev = malloc(sizeof(struct networkDeviceConfig)); - memset(netDev,'\0',sizeof(struct networkDeviceConfig)); - optCon = poptGetContext("netconfig", argc, argv, Options, 0); - while ((rc = poptGetNextOpt(optCon)) >= 0) { - parseAddress = NULL; - netSet = 0; - - arg = poptGetOptArg(optCon); - - switch (rc) { - case 'g': - parseAddress = &netDev->dev.gateway; - netSet = PUMP_NETINFO_HAS_GATEWAY; - break; - - case 'i': - parseAddress = &netDev->dev.ip; - netSet = PUMP_INTFINFO_HAS_IP; - break; - - case 'n': - parseAddress = &netDev->dev.dnsServers[netDev->dev.numDns++]; - netSet = PUMP_NETINFO_HAS_DNS; - break; - - case 'm': - parseAddress = &netDev->dev.netmask; - netSet = PUMP_INTFINFO_HAS_NETMASK; - break; - } - - if (!inet_aton(arg, parseAddress)) { - logMessage("bad ip number in network command: %s", arg); - return -1; - } - - netDev->dev.set |= netSet; - } - - if (rc < -1) { - fprintf(stderr, "%s: %s\n", - poptBadOption(optCon, POPT_BADOPTION_NOALIAS), - poptStrerror(rc)); - } else { - poptFreeContext(optCon); - } - - if (netDev->dev.set || - (bootProto && (!strcmp(bootProto, "dhcp") || !strcmp(bootProto, "bootp")))) { - if (!device) device="eth0"; - if (bootProto && (!strcmp(bootProto, "dhcp") || !strcmp(bootProto, "bootp"))) - netDev->isDynamic++; - strncpy(netDev->dev.device,device,10); - if (hostname) { - netDev->dev.hostname=strdup(hostname); - netDev->dev.set |= PUMP_NETINFO_HAS_HOSTNAME; - } - if (domain) { - netDev->dev.domain=strdup(domain); - netDev->dev.set |= PUMP_NETINFO_HAS_DOMAIN; - } - snprintf(path,256,"/etc/sysconfig/network-scripts/ifcfg-%s",device); - writeNetInfo(path,netDev, NULL); - } else { - newtInit(); - newtCls(); - newtPushHelpLine(_(" <Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen")); - snprintf(roottext,80,_("netconfig %s (C) 1999 Red Hat, Inc."), VERSION); - newtDrawRootText(0, 0, roottext); - x=newtWinChoice(_("Network configuration"),_("Yes"),_("No"), - _("Would you like to set up networking?")); - if (x==2) { - newtFinished(); - exit(0); - } - if (!device) device="eth0"; - strncpy(netDev->dev.device,device,10); - if (readNetConfig(device,netDev,0) != LOADER_BACK) { - snprintf(path,256,"/etc/sysconfig/network-scripts/ifcfg-%s",device); - writeNetInfo(path,netDev, NULL); - } - newtFinished(); - } - exit(0); -} -#endif diff --git a/loader/net.h b/loader/net.h deleted file mode 100644 index b4e6fd55a..000000000 --- a/loader/net.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef H_LOADER_NET -#define H_LOADER_NET - -#include "pump.h" -#ifdef __STANDALONE__ -struct knownDevices { -}; -#else -#include "../isys/probe.h" -#endif - -struct networkDeviceConfig { - struct pumpNetIntf dev; - int isDynamic; -}; - -int readNetConfig(char * device, struct networkDeviceConfig * dev, - int flags); -int configureNetwork(struct networkDeviceConfig * dev); -int writeNetInfo(const char * fn, struct networkDeviceConfig * dev, - struct knownDevices * kd); -int findHostAndDomain(struct networkDeviceConfig * dev, int flags); -int writeResolvConf(struct networkDeviceConfig * net); -#ifndef __STANDALONE__ -extern char *netServerPrompt; -int nfsGetSetup(char ** hostptr, char ** dirptr); -int kickstartNetwork(char ** devicePtr, struct networkDeviceConfig * netDev, - char * bootProto, int flags); -void initLoopback(void); -#endif - -#endif diff --git a/loader/pcmcia.c b/loader/pcmcia.c deleted file mode 100644 index 4dc2b2309..000000000 --- a/loader/pcmcia.c +++ /dev/null @@ -1,183 +0,0 @@ -#include <errno.h> -#include <fcntl.h> -#include <kudzu/kudzu.h> -#include <newt.h> -#include <stdlib.h> -#include <string.h> -#include <sys/wait.h> -#include <unistd.h> - -#include "../isys/imount.h" -#include "../isys/isys.h" -#include "../isys/probe.h" - -#include "lang.h" -#include "loader.h" -#include "log.h" -#include "devices.h" -#include "modules.h" -#include "windows.h" - -int probe_main (int argc, char ** argv); -int cardmgr_main (int argc, char ** argv); - -int startPcmcia(char * floppyDevice, moduleList modLoaded, moduleDeps modDeps, - moduleInfoSet modInfo, char * pcicPtr, - struct knownDevices * kd, int flags) { - pid_t child; - struct device ** devices, ** device; - char * probeArgs[] = { "/sbin/probe", NULL }; - char * cardmgrArgs[] = { "/sbin/cardmgr", "-o", "-m", "/modules", "-d", - NULL }; - int p[2]; - char buf[4096]; - int i, status; - char * pcic = NULL; - char * line = NULL; - int rc; - char * title = _("PC Card"); - char * text = _("Initializing PC Card Devices..."); - - logMessage("in startPcmcia()"); - - devices = probeDevices(CLASS_SOCKET, BUS_PCI, PROBE_ALL); - if (devices) { - logMessage("found cardbus pci adapter"); - pcic = "yenta_socket"; - - for (device = devices; *device; device++) - freeDevice(*device); - - free(devices); - } else { - pipe(p); - - if (!(child = fork())) { - close(p[0]); - dup2(p[1], 1); - close(p[1]); - exit(probe_main(1, probeArgs)); - } - - close(p[1]); - - waitpid(child, NULL, 0); - - i = read(p[0], buf, sizeof(buf)); - close(p[0]); - buf[i] = '\0'; - - logMessage("pcmcia probe returned: |%s|", buf); - - /* So this is totally counter-intuitive. Just remember that probe - stops printing output once it finds a pcic, so this is actually - correct */ - - line = strtok(buf, "\r\n"); - - do { - if (!strstr(line, "not found")) - { - if (strstr(line, "TCIC")) - pcic = "tcic"; - else - pcic = "i82365"; - } - } while((line = strtok(NULL, "\r\n"))); - } - - if (!pcic) - { - logMessage("no pcic controller found"); - return 0; - } - - logMessage("need to load %s", pcic); - - winStatus(40, 3, title, text); - if (mlLoadModuleSet("pcmcia_core", modLoaded, modDeps, modInfo, flags)) { - logMessage("failed to load pcmcia_core -- ask for pcmciadd"); - rc = 1; - newtPopWindow(); - } else { - rc = 0; - } - - while (rc) { - rc = newtWinChoice(_("PCMCIA"), _("OK"), _("Cancel"), - _("Please insert your PCMCIA driver disk " - "into your floppy drive now.")); - if (rc == 2) return LOADER_BACK; - - devMakeInode(floppyDevice, "/tmp/floppy"); - - rc = 1; - if (doPwMount("/tmp/floppy", "/modules", "ext2", 1, 0, NULL, - NULL)) { - newtWinMessage(_("Error"), _("OK"), _("Failed to mount disk.")); - } else { - int fd; - - fd = open("/modules/rhdd-6.1", O_RDONLY); - if (fd >= 0) { - char buf[30]; - int i; - - i = read(fd, buf, 30); - buf[23] = '\0'; - logMessage("read %s", buf); - if (i == 23 && !strcmp(buf, "PCMCIA Driver Diskette\n")) { - winStatus(40, 3, title, text); - if (mlLoadModuleSet("pcmcia_core", modLoaded, modDeps, - modInfo, flags)) { - newtPopWindow(); - newtWinMessage(_("Error"), _("OK"), - _("That floppy does not look like a " - "Red Hat PCMCIA driver disk.")); - } - - rc = 0; - } - - close(fd); - } - - if (rc) - umount("/modules"); - } - } - - sprintf(buf, "%s:ds", pcic); - - if (mlLoadModuleSet(buf, modLoaded, modDeps, modInfo, flags)) { - logMessage("failed to load pcic.o or ds.o"); - umount("/modules"); - return LOADER_ERROR; - } - - if (!(child = fork())) { - exit(cardmgr_main(5, cardmgrArgs)); - } - - logMessage("cardmgr running as pid %d", child); - - waitpid(child, &status, 0); - logMessage("cardmgr returned 0x%x", status); - - busProbe(modInfo, modLoaded, modDeps, 0, kd, flags); - - while(1) { - extern int errno; - sleep(2); - rc = umount("/modules"); - if ((rc != -1) || (errno != -EBUSY)) { - break; - } - logMessage("return code of /modules unmount is %d", rc); - } - - newtPopWindow(); - strcpy(pcicPtr, pcic); - - return 0; -} diff --git a/loader/pcmcia.h b/loader/pcmcia.h deleted file mode 100644 index 120d85c9b..000000000 --- a/loader/pcmcia.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef H_LOADER_PCMCIA -#define H_LOADER_PCMCIA - -#include "isys/probe.h" - -/* pcic should point to a space 20 characters long */ -int startPcmcia(char * floppyDevice, moduleList modLoaded, moduleDeps modDeps, - moduleInfoSet modInfo, char * pcic, - struct knownDevices * kd, int flags); - -#endif diff --git a/loader/popen.c b/loader/popen.c deleted file mode 100644 index 75a15031f..000000000 --- a/loader/popen.c +++ /dev/null @@ -1,74 +0,0 @@ -#include <errno.h> -#include <fcntl.h> -#include <popt.h> -#include <string.h> -#include <sys/wait.h> -#include <unistd.h> -#include <stdlib.h> - -#include <syslog.h> - -struct req { - FILE * f; - pid_t child; -}; - -struct req lastRequest = { NULL, -1 }; - -FILE * popen(const char * command, const char * type) { - char ** argv; - int argc; - int p[2]; - pid_t child; - - if (strcmp(type, "r") || lastRequest.f) - return NULL; - - if (poptParseArgvString(command, &argc, (const char ***) &argv)) { - return NULL; - } - - pipe(p); - - if (!(child = fork())) { - int i; - char ** args; - - close(p[0]); - dup2(p[1], 1); - dup2(p[1], 2); - close(p[1]); - - args = malloc(sizeof(*args) * (argc + 1)); - for (i = 0; i < argc; i++) { - args[i] = argv[i]; - } - - args[argc] = NULL; - - execv("/sbin/insmod", args); - exit(1); - } - - free(argv); - - close(p[1]); - - lastRequest.f = fdopen(p[0], "r"); - lastRequest.child = child; - - return lastRequest.f; -} - -int pclose(FILE * stream) { - int status; - - if (stream != lastRequest.f) return -1; - - fclose(stream); - - waitpid(lastRequest.child, &status, 0); - lastRequest.f = NULL; - - return status; -} diff --git a/loader/printf-stub.c b/loader/printf-stub.c deleted file mode 100644 index 39d4704d7..000000000 --- a/loader/printf-stub.c +++ /dev/null @@ -1,628 +0,0 @@ -/* - * linux/lib/vsprintf.c - * - * Copyright (C) 1991, 1992 Linus Torvalds - * Copyright (C) 2000 Jakub Jelinek <jakub@redhat.com> - */ - -/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */ -/* - * Wirzenius wrote this portably, Torvalds fucked it up :-) - */ - -#include <stdarg.h> -#include <stdio.h> -#include <string.h> -#include <ctype.h> - -/* Define ALIAS as a strong alias for ORIGINAL. */ -# define strong_alias(name, aliasname) _strong_alias(name, aliasname) -# define _strong_alias(name, aliasname) \ - extern __typeof (name) aliasname __attribute__ ((alias (#name))); - -#define do_div(n,base) ({ \ - int __res; \ - __res = ((unsigned long long) n) % (unsigned) base; \ - n = ((unsigned long long) n) / (unsigned) base; \ - __res; }) - -static int skip_atoi(const char **s) -{ - int i=0; - - while (isdigit(**s)) - i = i*10 + *((*s)++) - '0'; - return i; -} - -#define ZEROPAD 1 /* pad with zero */ -#define SIGN 2 /* unsigned/signed long */ -#define PLUS 4 /* show plus */ -#define SPACE 8 /* space if plus */ -#define LEFT 16 /* left justified */ -#define SPECIAL 32 /* 0x */ -#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ - -static char * number(char * str, long long num, int base, int size, int precision, int type) -{ - char c,sign,tmp[66]; - const char *digits="0123456789abcdefghijklmnopqrstuvwxyz"; - int i; - - if (type & LARGE) - digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - if ((type & LEFT) || precision >= 0) - type &= ~ZEROPAD; - if (base < 2 || base > 36) - return 0; - c = (type & ZEROPAD) ? '0' : ' '; - sign = 0; - if (type & SIGN) { - if (num < 0) { - sign = '-'; - num = -num; - size--; - } else if (type & PLUS) { - sign = '+'; - size--; - } else if (type & SPACE) { - sign = ' '; - size--; - } - } - if (type & SPECIAL) { - if (base == 16) - size -= 2; - else if (base == 8) - size--; - } - i = 0; - if (num == 0) - tmp[i++]='0'; - else while (num != 0) - tmp[i++] = digits[do_div(num,base)]; - if (i > precision) - precision = i; - size -= precision; - if (!(type&(ZEROPAD+LEFT))) - while(size-->0) - *str++ = ' '; - if (sign) - *str++ = sign; - if (type & SPECIAL) { - if (base==8) - *str++ = '0'; - else if (base==16) { - *str++ = '0'; - *str++ = digits[33]; - } - } - if (!(type & LEFT)) - while (size-- > 0) - *str++ = c; - while (i < precision--) - *str++ = '0'; - while (i-- > 0) - *str++ = tmp[i]; - while (size-- > 0) - *str++ = ' '; - return str; -} - -static char bigbuf[1024], *buf = NULL, *str, *lim; - -static void check(int width) -{ - if (str + width + 16 < lim) - return; - if (width < 512) width = 512; - if (buf == bigbuf) { - buf = (char *)malloc(1024 + width); - memcpy (buf, bigbuf, str - bigbuf); - str = buf + (str - bigbuf); - lim = buf + 1024 + width; - } else { - int w = lim - buf + width; - buf = (char *)realloc (buf, w); - lim = buf + w; - } -} - -static void xprintf(const char *fmt, va_list args) -{ - int len; - unsigned long long num; - int i, base; - const char *s; - - int flags; /* flags to number() */ - - int field_width; /* width of output field */ - int precision; /* min. # of digits for integers; max - number of chars for from string */ - int qualifier; /* 'h', 'l', or 'L' for integer fields */ - /* 'z' support added 23/7/1999 S.H. */ - /* 'z' changed to 'Z' --davidm 1/25/99 */ - - for (str=buf ; *fmt ; ++fmt) { - if (*fmt != '%') { - check (1); - *str++ = *fmt; - continue; - } - - /* process flags */ - flags = 0; - repeat: - ++fmt; /* this also skips first '%' */ - switch (*fmt) { - case '-': flags |= LEFT; goto repeat; - case '+': flags |= PLUS; goto repeat; - case ' ': flags |= SPACE; goto repeat; - case '#': flags |= SPECIAL; goto repeat; - case '0': flags |= ZEROPAD; goto repeat; - } - - /* get field width */ - field_width = -1; - if (isdigit(*fmt)) - field_width = skip_atoi(&fmt); - else if (*fmt == '*') { - ++fmt; - /* it's the next argument */ - field_width = va_arg(args, int); - if (field_width < 0) { - field_width = -field_width; - flags |= LEFT; - } - } - - /* get the precision */ - precision = -1; - if (*fmt == '.') { - ++fmt; - if (isdigit(*fmt)) - precision = skip_atoi(&fmt); - else if (*fmt == '*') { - ++fmt; - /* it's the next argument */ - precision = va_arg(args, int); - } - if (precision < 0) - precision = 0; - } - - /* get the conversion qualifier */ - qualifier = -1; - if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='Z') { - qualifier = *fmt; - ++fmt; - if (qualifier == 'l' && *fmt == 'l') { - qualifier = 'L'; - ++fmt; - } - } - - /* default base */ - base = 10; - - switch (*fmt) { - case 'c': - check(field_width + 2); - if (!(flags & LEFT)) { - while (--field_width > 0) - *str++ = ' '; - } - *str++ = (unsigned char) va_arg(args, int); - while (--field_width > 0) - *str++ = ' '; - continue; - - case 's': - s = va_arg(args, char *); - if (!s) - s = "(null)"; -got_string: - if (precision >= 0) - len = strnlen(s, precision); - else - len = strlen(s); - - check(field_width > len ? field_width : len); - if (!(flags & LEFT)) - while (len < field_width--) - *str++ = ' '; - for (i = 0; i < len; ++i) - *str++ = *s++; - while (len < field_width--) - *str++ = ' '; - continue; - - case 'p': - { - unsigned long ptr; - ptr = (unsigned long) va_arg(args, void *); - if (!ptr) { - if (precision >= 0 && precision < 5) - precision = 5; - s = "(nil)"; - goto got_string; - } - if (field_width == -1) { - field_width = 2*sizeof(void *)+2; - flags |= ZEROPAD; - } - check(field_width + 32 + precision); - str = number(str, ptr, 16, - field_width, precision, flags | SPECIAL); - } - continue; - - case 'n': - if (qualifier == 'l') { - long * ip = va_arg(args, long *); - *ip = (str - buf); - } else if (qualifier == 'Z') { - size_t * ip = va_arg(args, size_t *); - *ip = (str - buf); - } else { - int * ip = va_arg(args, int *); - *ip = (str - buf); - } - continue; - - case '%': - check(1); - *str++ = '%'; - continue; - - /* integer number formats - set up the flags and "break" */ - case 'o': - base = 8; - break; - - case 'X': - flags |= LARGE; - case 'x': - base = 16; - break; - - case 'd': - case 'i': - flags |= SIGN; - case 'u': - break; - - case 'e': - case 'E': - case 'f': - case 'g': - case 'G': - fputs("Floating point output not supported by xprintf\n", stderr); - exit(1); - - default: - check(2); - *str++ = '%'; - if (*fmt) - *str++ = *fmt; - else - --fmt; - continue; - } - if (qualifier == 'L') - num = va_arg(args, long long); - else if (qualifier == 'l') { - num = va_arg(args, unsigned long); - if (flags & SIGN) - num = (signed long) num; - } else if (qualifier == 'Z') { - num = va_arg(args, size_t); - } else if (qualifier == 'h') { - num = (unsigned short) va_arg(args, int); - if (flags & SIGN) - num = (signed short) num; - } else { - num = va_arg(args, unsigned int); - if (flags & SIGN) - num = (signed int) num; - } - check (field_width + 32 + precision); - str = number(str, num, base, field_width, precision, flags); - } - *str++ = '\0'; -} - -int vsnprintf(char * b, size_t n, const char *fmt, va_list args) -{ - buf = bigbuf; - lim = buf + 1024; - xprintf(fmt, args); - if (str - buf > n) { - memcpy(b, buf, n - 1); - b[n - 1] = '\0'; - } else - strcpy(b, buf); - if (buf != bigbuf) - free (buf); - return str - buf - 1; -} - -int snprintf(char * buf, size_t n, const char *fmt, ...) -{ - va_list args; - int i; - - va_start(args, fmt); - i=vsnprintf(buf,n,fmt,args); - va_end(args); - return i; -} - -int vsprintf(char * b, const char *fmt, va_list args) -{ - buf = b; - lim = (char *)~0UL; - xprintf(fmt, args); - return str - buf - 1; -} - -int sprintf(char * buf, const char *fmt, ...) -{ - va_list args; - int i; - - va_start(args, fmt); - i=vsprintf(buf,fmt,args); - va_end(args); - return i; -} - -int _IO_vfprintf(FILE *f, const char *fmt, va_list args) -{ - int i; - - buf = bigbuf; - lim = buf + 1024; - xprintf(fmt, args); - - for (i = 0; i < str - buf - 1; i++) - fputc(buf[i], f); - - if (buf != bigbuf) - free(buf); - return str - buf - 1; -} - -int fprintf(FILE *f, const char *fmt, ...) -{ - va_list args; - int i; - - va_start(args, fmt); - i=vfprintf(f,fmt,args); - va_end(args); - return i; -} - -int printf(const char *fmt, ...) -{ - va_list args; - int i; - - va_start(args, fmt); - i=vfprintf(stdout,fmt,args); - va_end(args); - return i; -} - -#define SUPPRESS 128 - -int _IO_sscanf(const char *str, const char *fmt, ...) -{ - va_list args; - int ret = EOF; - unsigned long long lnum; - unsigned long num; - int suppress, base, numbersigned; - int field_width; /* width of output field */ - int qualifier; /* 'h', 'l', or 'L' for integer fields */ - char *s, *p, *q; - const char *start = str; - - va_start(args, fmt); - - for (; *fmt ; ++fmt) { - if (isspace(*fmt)) { - while (isspace(*str)) - str++; - continue; - } - if (*fmt != '%') { - if (*str++ != *fmt) - goto done; - continue; - } - - if (ret == EOF) ret = 0; - - suppress = 0; - if (*++fmt == '*') { - suppress = 1; - fmt++; - } - - /* get field width */ - field_width = -1; - if (isdigit(*fmt)) - field_width = skip_atoi(&fmt); - - /* get the conversion qualifier */ - qualifier = -1; - if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L') { - qualifier = *fmt; - ++fmt; - if (qualifier == 'l' && *fmt == 'l') { - qualifier = 'L'; - ++fmt; - } - } - - if (strchr ("%c[", *fmt) == NULL) { - while (isspace(*str)) - str++; - } - - base = 0; - numbersigned = 0; - - switch (*fmt) { - case 'c': - if (field_width == -1) - field_width = 1; - if (strlen(str) < field_width) - goto done; - if (!suppress) { - p = va_arg(args, char *); - if (!p) goto done; - memcpy(p, str, field_width); - ret++; - } - str += field_width; - continue; - case 's': - for (s = (char *)str; *s && !isspace(*s) && field_width != 0; s++) - field_width--; -finish_s: - if (s == str) - goto done; - if (!suppress) { - p = va_arg(args, char *); - if (!p) goto done; - memcpy(p, str, s - str); - p[s - str] = '\0'; - ret++; - } - str = s; - continue; - case '[': { - int not_in = 0; - memset(bigbuf, 0, 256); - if (*++fmt == '^') { - not_in = 1; - fmt++; - } - if (*fmt == ']') { - bigbuf[']'] = 1; - fmt++; - } - while (*fmt != ']') { - if (!*fmt) goto done; - bigbuf[(unsigned char)*fmt] = 1; - if (fmt[1] == '-' && fmt[2] != ']') { - unsigned char c = (unsigned char)*fmt + 1; - while (c <= (unsigned char)fmt[2]) - bigbuf[c++] = 1; - fmt += 2; - } - fmt++; - } - if (not_in) { - int i; - for (i = 1; i < 256; i++) - bigbuf[i] ^= 1; - } - for (s = (char *)str; bigbuf[(unsigned char)*s] && field_width != 0; s++) - field_width--; - } - goto finish_s; - - case 'n': - if (qualifier == 'l') { - long * ip = va_arg(args, long *); - *ip = (str - start); - } else { - int * ip = va_arg(args, int *); - *ip = (str - start); - } - continue; - - case '%': - if (*str++ != '%') - goto done; - continue; - - case 'e': - case 'E': - case 'f': - case 'g': - case 'G': - fputs("Floating point output not supported by xprintf\n", stderr); - exit(1); - - default: - goto done; - - /* integer number formats - set up the flags and "break" */ - case 'o': - base = 8; - break; - - case 'p': - qualifier = 'l'; - case 'X': - case 'x': - base = 16; - break; - - case 'd': - base = 10; - case 'i': - numbersigned = 1; - break; - case 'u': - base = 10; - break; - } - p = (char *)str; - if (field_width >= 0) { - strncpy(bigbuf, str, field_width); - bigbuf[field_width] = 0; - p = bigbuf; - } - if (numbersigned) { - if (qualifier == 'L') - lnum = strtoll(p, &q, base); - else - num = strtol(p, &q, base); - } else { - if (qualifier == 'L') - lnum = strtoull(p, &q, base); - else - num = strtoull(p, &q, base); - } - if (p == q) - goto done; - str += (q - p); - if (!suppress) { - p = (char *)va_arg(args, char *); - if (p == NULL) - goto done; - if (qualifier == 'L') - *(unsigned long long *)p = lnum; - else if (qualifier == 'l') - *(unsigned long *)p = num; - else if (qualifier == 'h') - *(unsigned short *)p = num; - else - *(unsigned int *)p = num; - ret++; - } - } -done: - va_end (args); - return ret; -} - -strong_alias (_IO_vfprintf, vfprintf); -strong_alias (_IO_sscanf, sscanf); diff --git a/loader/pwd-stub.c b/loader/pwd-stub.c deleted file mode 100644 index 43da508f7..000000000 --- a/loader/pwd-stub.c +++ /dev/null @@ -1,33 +0,0 @@ -#include <sys/types.h> -#include <errno.h> -#include <pwd.h> -#include <string.h> - -static struct passwd pw_root = { - pw_name: "root", - pw_passwd: "", - pw_uid: 0, - pw_gid: 0, - pw_gecos: "root", - pw_dir: "/", - pw_shell: "/bin/bash" -}; - -struct passwd *getpwuid(uid_t u) -{ - if (u) return NULL; - return &pw_root; -} - -int __getpwnam_r(const char *name, struct passwd *result_buf, char *buf, - size_t buflen, struct passwd **result) -{ - if (strcmp (name, "root")) { - errno = 0; - *result = NULL; - return -1; - } - memcpy(result_buf, &pw_root, sizeof(struct passwd)); - *result = result_buf; - return 0; -} diff --git a/loader/s390/load_anaconda b/loader/s390/load_anaconda deleted file mode 100755 index 35c7ec23b..000000000 --- a/loader/s390/load_anaconda +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# Red Hat Linux S390 installer -# -# Copyright (C) 2000,2001 Red Hat Inc. -# David Sainty <dsainty@redhat.com> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -/sbin/loaderbin - -for file in `cat /proc/mounts | /bin/grep '/mnt/sysimage' | -/bin/awk 'BEGIN { FS=" " } -{ print length($2), $2 }' $* | -/bin/sort -n -r | -/bin/sed 's/^[0-9][0-9]* //'` -do - /bin/umount $file -done - diff --git a/loader/simplemot b/loader/simplemot deleted file mode 100755 index 467020be0..000000000 --- a/loader/simplemot +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/perl - -$inone = 0; -$intran = 0; -$total = 0; -while (<>) { - if (!$inone && /^msgid/) { - chop; - $str = substr($_, 7, length($_) - 8); - $inone = 1; - } elsif ($inone && /^"/) { - chop; - $str .= substr($_, 1, length($_) - 2); - } elsif ($inone) { - $inone = 0; - - $str =~ s/\\n/\n/g; - $str =~ s/\\t/\t/g; - $str =~ s/\\"/"/g; - - # the string is complete -- calculate a hash - $sum = 0; - $xor = 0; - for ($i = 0; $i < length($str); $i++) { - $char = ord(substr($str, $i, 1)); - $sum += $char; - $xor ^= $char; - } - - $total = ($sum << 16) | (($xor & 0xFF) << 8) | (length($str) & 0xFF); - } - - if (!$intran && /^msgstr/) { - chop; - $tran = substr($_, 8, length($_) - 9); - $intran = 1; - } elsif ($intran && /^"/) { - chop; - $tran .= substr($_, 1, length($_) - 2); - } elsif ($intran) { - $intran = 0; - - $tran =~ s/\\n/\n/g; - $tran =~ s/\\t/\t/g; - $tran =~ s/\\"/"/g; - - if (!$total && $str) { - print STDERR "Missing string for $tran"; - exit 1 - } elsif ($str && $tran) { - print pack("Nn", $total, length($tran)); - print $tran; - - #if ($tran < 60) { - #printf STDERR ("0x%x %s\n", $total, $tran); - #} - } - } -} diff --git a/loader/stubs.c b/loader/stubs.c deleted file mode 100644 index 1dde0e77c..000000000 --- a/loader/stubs.c +++ /dev/null @@ -1,139 +0,0 @@ -#include <gconv.h> -#include <stdlib.h> - -/* hj's gconv stubs, a little modified */ - -/* Define ALIASNAME as a strong alias for NAME. */ -# define strong_alias(name, aliasname) _strong_alias(name, aliasname) -# define _strong_alias(name, aliasname) \ - extern __typeof (name) aliasname __attribute__ ((alias (#name))); - -/* Don't drag in the dynamic linker. */ -void *__libc_stack_end; - -int -__gconv_OK () { -#if __GLIBC__ > 2 || __GLIBC_MINOR__ > 1 - return __GCONV_OK; -#else - return GCONV_OK; -#endif -} - -int -__gconv_NOCONV () { -#if __GLIBC__ > 2 || __GLIBC_MINOR__ > 1 - return __GCONV_NOCONV; -#else - return GCONV_NOCONV; -#endif -} - -strong_alias (__gconv_OK, - __gconv_close_transform); -strong_alias (__gconv_OK, - __gconv_close); - -strong_alias (__gconv_NOCONV, - __gconv); -strong_alias (__gconv_NOCONV, - __gconv_find_transform); -strong_alias (__gconv_NOCONV, - __gconv_open); - -/* These transformations should not fail in normal conditions */ -strong_alias (__gconv_OK, - __gconv_transform_ascii_internal); -strong_alias (__gconv_OK, - __gconv_transform_ucs2little_internal); -strong_alias (__gconv_OK, - __gconv_transform_utf16_internal); -strong_alias (__gconv_OK, - __gconv_transform_utf8_internal); -strong_alias (__gconv_OK, - __gconv_transform_ucs2_internal); - -/* We can assume no conversion for these ones */ -strong_alias (__gconv_NOCONV, - __gconv_transform_internal_ascii); -strong_alias (__gconv_NOCONV, - __gconv_transform_internal_ucs2); -strong_alias (__gconv_NOCONV, - __gconv_transform_internal_ucs2little); -strong_alias (__gconv_NOCONV, - __gconv_transform_internal_ucs4); -strong_alias (__gconv_NOCONV, - __gconv_transform_internal_utf16); -strong_alias (__gconv_NOCONV, - __gconv_transform_internal_utf8); - -strong_alias (__gconv_OK, - __gconv_transliterate); - -const char * -__gconv_lookup_alias (const char *name) -{ - return NULL; -} - -int -__gconv_compare_alias (const char *name1, const char *name2) { - return 0; -} - -int -__gconv_compare_alias_cache (const char *name1, const char *name2, int *result) { - return 0; -} - -void -__gconv_release_step () { } - -void -__gconv_release_cache () { } - -int RETURNZERO() { return 0; } - -int getlogin_r ( char * name, int size ) { - strdup(name, "root"); -} - -int __get_nprocs_conf() { return 1024; } -int __get_nprocs() { return 1; } -int __get_phys_pages() { return 4096; } -int __get_avphys_pages() { return 4096; } -int __getdtablesize() { return 100; } -int _nl_current_LC_TELEPHONE() { return 0; } -int _nl_current_LC_MEASUREMENT() { return 0; } -int _nl_current_LC_PAPER() { return 0; } -int _nl_current_LC_ADDRESS() { return 0; } -int __mpn_extract_long_double() { return 0; } -int __mpn_extract_double() { return 0; } -int _nl_C_LC_TELEPHONE() { return 0; } -int _nl_C_LC_MEASUREMENT() { return 0; } -int _nl_C_LC_PAPER() { return 0; } -int _nl_C_LC_ADDRESS() { return 0; } -int _dl_clktck() { return 0;} -int _dl_aux_init() { return 0;} -int _dl_non_dynamic_init() { return 0; } -void * _dl_important_hwcaps() { return 0; } -void * __libc_dlopen() {return 0;} -void * __libc_dlsym() {return 0;} -void * __libc_dlclose() {return 0;} -int __argz_create_sep() {return 0;} -int __argz_add_sep() {return 0;} -void __rpc_thread_key_cleanup() {} -void __rpc_thread_svc_cleanup() {} -void __rpc_thread_clnt_cleanup() {} -void _svcauth_des(void * a, void * b) {} - -int getdomainname(char * name, int len) { - *name = '\0'; - return 0; -} - -int _rpc_dtablesize(void) { - return __getdtablesize(); -} - -int _dl_pagesize = 4096; diff --git a/loader/telnet.c b/loader/telnet.c deleted file mode 100644 index fda836639..000000000 --- a/loader/telnet.c +++ /dev/null @@ -1,269 +0,0 @@ -/* telnet.c -- basic telnet protocol handling for ttywatch - * - * Copyright © 2001 Michael K. Johnson <johnsonm@redhat.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* Shamelessly stolen from ttywatch -- oot */ - -#include <ctype.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> - -#include "telnet.h" -#include "log.h" - -#define IAC "\xff" -#define DONT "\xfe" -#define WONT "\xfc" -#define WILL "\xfb" -#define DO "\xfd" -#define SB "\xfa" -#define SE "\xf0" -#define ECHO "\x01" -#define SUPPRESS_GO_AHEAD "\x03" -#define TERMINAL_TYPE "\x18" -#define NAWS "\x1f" -#define LINEMODE "\x22" -#define NEWENVIRON "\x27" -#define MODE "\x01" - -/* Make a request. Not intended to be RFC-compatible, just enough - * to convince telnet clients to do what we want... To do this - * right, we would have to honestly negotiate, not speak blind. - * - * For now, assume all responses will be favorable and stripped - * out in telnet_process_input()... Sending it all in a single - * write makes it more efficient because it will all go out in a - * single packet, and the responses are more likely to all come - * back in a single packet (and thus, practically, a single read) - * too. - */ -void -telnet_negotiate(int socket, char ** term_type_ptr, int * heightPtr, - int * widthPtr) { - char ch; - int done = 0; - char * termType = NULL; - int termLength = 0, termAlloced = 0; - enum { ST_NONE, ST_TERMTYPE, ST_WINDOWSIZE } state; - char sizeBuf[4]; - int height = -1, width = -1; - char * sizePtr = sizeBuf; - char request[]= - IAC DONT ECHO - IAC WILL ECHO - IAC WILL NAWS - IAC WILL SUPPRESS_GO_AHEAD - IAC DO SUPPRESS_GO_AHEAD - IAC DONT NEWENVIRON - IAC WONT NEWENVIRON - IAC WONT LINEMODE - IAC DO NAWS - IAC SB TERMINAL_TYPE "\x01" IAC SE - ; - - write(socket, request, sizeof(request)-1); - - /* Read from the terminal until we get the terminal type. This will - do bad things if the client doesn't send the terminal type, but - those clients have existed for aeons (right?) */ - - do { - read(socket, &ch, 1); - if (ch != '\xff') { - abort(); - } - - read(socket, &ch, 1); /* command */ - - if (ch != '\xfa') { - read(socket, &ch, 1); /* verb */ - continue; - } - - read(socket, &ch, 1); /* suboption */ - if (ch == '\x18') { - state = ST_TERMTYPE; - read(socket, &ch, 1); /* should be 0x0! */ - done = 1; - } else if (ch == '\x1f') { - state = ST_WINDOWSIZE; - } else { - state = ST_NONE;; - } - - read(socket, &ch, 1); /* data */ - while (ch != '\xff') { - if (state == ST_TERMTYPE) { - if (termAlloced == termLength) { - termAlloced += 10; - termType = realloc(termType, termAlloced + 1); - } - - termType[termLength++] = tolower(ch); - } else if (state == ST_WINDOWSIZE) { - if ((sizePtr - sizeBuf) < sizeof(sizeBuf)) - *sizePtr++ = ch; - } - - read(socket, &ch, 1); /* data */ - } - - read(socket, &ch, 1); /* should be a SE */ - - } while (!done); - - termType[termLength] = '\0'; - - if (sizePtr - sizeBuf == sizeof(sizeBuf)) { - width = (sizeBuf[0] << 8) + sizeBuf[1]; - height = (sizeBuf[2] << 8) + sizeBuf[3]; - } - - if (heightPtr) *heightPtr = height; - if (widthPtr) *widthPtr = width; - - if (term_type_ptr) *term_type_ptr = termType; -} - -int -telnet_process_input(telnet_state * ts, char *data, int len) { - char *s, *d; /* source, destination */ - -# if DEBUG_TELNET - printf("\nprinting packet:"); - for (s=data; s<data+len; s++) { - if (!((s-data)%10)) - printf("\n %03d: ", s-data); - printf("%02x ", *s & 0x000000FF); - } - printf("\n"); -# endif /* DEBUG_TELNET */ - - for (s=data, d=data; s<data+len; s++) { - switch (*ts) { - case TS_DATA: - if (*s == '\xff') { /* IAC */ - *ts = TS_IAC; - continue; - } -#if DEBUG_TELNET - printf("copying data element '%c'\n", *s); -#endif /* DEBUG_TELNET */ - if (s>d) { - *(d++) = *s; - } else { - d++; - } - break; - - case TS_IAC: - if (*s == '\xfa') { /* SB */ - *ts = TS_SB; - continue; - } - /* if not SB, skip IAC verb object */ -# if DEBUG_TELNET - printf("skipping verb/object (offset %d)...\n", s-data-1); -# endif /* DEBUG_TELNET */ - s += 1; - *ts = TS_DATA; - break; - - case TS_SB: -# if DEBUG_TELNET - printf("skipping SB (offset %d)...\n", s-data-1); -# endif /* DEBUG_TELNET */ - while (s < (data+(len-1))) { - if (*s == '\xff') { - break; /* fall through to TS_SB_IAC setting below */ - } else { - s++; - } - } - if (*s == '\xff') { - *ts = TS_SB_IAC; - } - break; - - case TS_SB_IAC: - if (*s == '\xf0') { /* SE */ -# if DEBUG_TELNET - printf("SE ends SB (offset %d)...\n", s-data-1); -# endif /* DEBUG_TELNET */ - *ts = TS_DATA; - } else { -# if DEBUG_TELNET - printf("IAC without SE in SB (offset %d)\n", s-data-1); -# endif /* DEBUG_TELNET */ - *ts = TS_SB; - } - break; - - default: - logMessage("unknown telnet state %d for data element %c", *ts, *s); - *ts = TS_DATA; - break; - } - } - - /* calculate new length after copying data around */ - len = d - data; -#if DEBUG_TELNET - printf("returning len: %d of packet:", len); - for (s=data; s<data+len; s++) { - if (!((s-data)%10)) - printf("\n %03d: ", s-data); - printf("%02x ", *s & 0x000000FF); - } - printf("\n"); -#endif /* DEBUG_TELNET */ - - return len; -} - -/* The telnet protocol requires CR/NL instead of just NL - * We normally deal with Unix, which just uses NL, so we need to translate. - * - * It would be easy to go through line-by-line and write each line, but - * that would create more packet overhead by sending out one packet - * per line, and over things like slow PPP connections, that is painful. - * Therefore, instead, we create a modified copy of the data and write - * the whole modified copy at once. - */ -void -telnet_send_output(int sock, char *data, int len) { - char *s, *d; /* source, destination */ - char *buf; - - buf = alloca((len*2)+1); /* max necessary size */ - - /* just may need to add CR before NL (but do not double existing CRs) */ - for (s=data, d=buf; d-buf<len; s++, d++) { - if ((*s == '\n') && (s == data || (*(s-1) != '\r'))) { - /* NL without preceding CR */ - *(d++) = '\r'; - len++; - } - *d = *s; - } - - /* now send it... */ - write(sock, buf, len); -} diff --git a/loader/telnet.h b/loader/telnet.h deleted file mode 100644 index 58ea5ba0a..000000000 --- a/loader/telnet.h +++ /dev/null @@ -1,40 +0,0 @@ -/* telnet.h -- basic telnet protocol handling for ttywatch - * - * Copyright © 2001 Michael K. Johnson <johnsonm@redhat.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __TELNET_H__ -#define __TELNET_H__ - -typedef enum { - TS_DATA = 0, - TS_IAC, - TS_SB, - TS_SB_IAC, -} telnet_state; - -void -telnet_negotiate(int socket, char ** term_type_ptr, int * heightPtr, - int * widthPtr); -int -telnet_process_input(telnet_state * ts, char *data, int len); -void -telnet_send_output(int sock, char *data, int len); - -#endif /* __TELNET_H__ */ diff --git a/loader/telnetd.c b/loader/telnetd.c deleted file mode 100644 index 3dcb318f8..000000000 --- a/loader/telnetd.c +++ /dev/null @@ -1,203 +0,0 @@ -/* Glue to tie telnet.c from ttywatch to the loader */ - -#include <arpa/inet.h> -#include <ctype.h> -#include <errno.h> -#include <fcntl.h> -#include <netinet/in.h> -#include <newt.h> -#include <pty.h> -#include <stdlib.h> -#include <string.h> -#include <sys/ioctl.h> -#include <sys/poll.h> -#include <sys/signal.h> -#include <sys/socket.h> -#include <sys/types.h> -#include <unistd.h> - -#include "lang.h" -#include "loader.h" -#include "log.h" -#include "telnet.h" -#include "windows.h" - -#ifndef IPPORT_TELNET -#define IPPORT_TELNET 23 -#endif - -/* Forks, keeping the loader as our child (so we know when it dies). */ -int beTelnet(int flags) { - int sock; - int conn; - int addrLength; - pid_t child; - int i; - int masterFd; - struct sockaddr_in address; - char buf[4096]; - struct pollfd fds[3]; - telnet_state ts = TS_DATA; - char * termType; - int height, width; - struct winsize ws; - - if ((sock = socket(PF_INET, SOCK_STREAM, 0)) < 0) { - logMessage("socket: %s", strerror(errno)); - return -1; - } - - address.sin_family = AF_INET; - address.sin_port = htons(IPPORT_TELNET); - memset(&address.sin_addr, 0, sizeof(address.sin_addr)); - addrLength = sizeof(address); - - /* Let the kernel reuse the socket address. This lets us run - twice in a row, without waiting for the (ip, port) tuple - to time out. Makes testing much easier*/ - conn = 1; - setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &conn, sizeof(conn)); - - bind(sock, (struct sockaddr *) &address, sizeof(address)); - listen(sock, 5); - - winStatus(45, 3, _("Telnet"), _("Waiting for telnet connection...")); - - if ((conn = accept(sock, (struct sockaddr *) &address, - &addrLength)) < 0) { - newtWinMessage(_("Error"), _("OK"), "accept failed: %s", - strerror(errno)); - close(sock); - return -1; - } - - stopNewt(); - - close(sock); - - telnet_negotiate(conn, &termType, &height, &width); - -#ifdef DEBUG - printf("got term type %s\n", termType); -#endif - - masterFd = open("/dev/ptyp0", O_RDWR); - if (masterFd < 0) { - logMessage("cannot open /dev/ttyp0"); - close(conn); - return -1; - } - - if (height != -1 && width != -1) { -#ifdef DEBUF - printf("setting window size to %d x %d\n", width, height); -#endif - ws.ws_row = height; - ws.ws_col = width; - ioctl(masterFd, TIOCSWINSZ, &ws); - } - - - child = fork(); - - if (child) { -#ifndef DEBUG - startNewt(flags); - winStatus(45, 3, _("Telnet"), _("Running anaconda via telnet...")); -#endif - - fds[0].events = POLLIN; - fds[0].fd = masterFd; - - fds[1].events = POLLIN; - fds[1].fd = conn; - - while ((i = poll(fds, 2, -1)) > 0) { - if (fds[0].revents) { - i = read(masterFd, buf, sizeof(buf)); - -#ifdef DEBUG - { - int j; - int row; - - for (row = 0; row < (i / 12) + 1; row++) { - printf("wrote:"); - for (j = (row * 12); j < i && j < ((row + 1) * 12); j++) - printf(" 0x%2x", (unsigned char) buf[j]); - printf("\n"); - printf("wrote:"); - for (j = (row * 12); j < i && j < ((row + 1) * 12); j++) - { - if (isprint(buf[j])) - printf(" %c ", buf[j]); - else - printf(" "); - } - printf("\n"); - } - } -#endif - /* child died */ - if (i < 0) - break; - - telnet_send_output(conn, buf, i); - } - - if (fds[1].revents) { - i = read(conn, buf, sizeof(buf)); - - /* connection went away */ - if (!i) - break; - - i = telnet_process_input(&ts, buf, i); - write(masterFd, buf, i); - -#ifdef DEBUG - { - int j; - - printf("got:"); - for (j = 0; j < i; j++) - printf(" 0x%x", (unsigned char) buf[j]); - printf("\n"); - } -#endif - - } - } - - - if (i < 0) { - logMessage("poll: %s", strerror(errno)); - } - -#ifndef DEBUG - stopNewt(); -#endif - - kill(child, SIGTERM); - close(conn); - - exit(0); - } - - close(masterFd); - setsid(); - close(0); - close(1); - close(2); - - open("/dev/ttyp0", O_RDWR); - dup(0); - dup(0); - - /* brand new tty! */ - setenv("TERM", termType, 1); - - startNewt(flags); - - return 0; -} diff --git a/loader/tr/.cvsignore b/loader/tr/.cvsignore deleted file mode 100644 index 596343c4a..000000000 --- a/loader/tr/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.tr diff --git a/loader/urls.c b/loader/urls.c deleted file mode 100644 index df93dcf43..000000000 --- a/loader/urls.c +++ /dev/null @@ -1,467 +0,0 @@ -#include <arpa/inet.h> -#include <ctype.h> -#include <fcntl.h> -#include <netinet/in.h> -#include <newt.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> - -#include "isys/dns.h" - -#include "ftp.h" -#include "lang.h" -#include "loader.h" -#include "urls.h" -#include "log.h" -#include "windows.h" -#include "misc.h" -#include "net.h" - -#if 0 -static const char * urlfilter(const char * u) -{ - int i = 0; - static char buf[256]; - - memset(&buf, 0, sizeof(buf)); - - if (u == NULL) - return u; - - while (*u && *u != '/') { - buf[i++] = *u; - u++; - } - while (*u && *u != ':') { - buf[i++] = *u; - u++; - } - if (*u) { - buf[i] = 0; - strcat(buf, ":[PASSWORD]"); - i += 11; - while (*u && *u != '@') { - u++; - } - } - while (*u) { - buf[i++] = *u; - u++; - } - return buf; -} -#endif - -int urlinstStartTransfer(struct iurlinfo * ui, char * filename, - int silentErrors) { - char * buf; - int fd; - char * finalPrefix; - - if (!strcmp(ui->prefix, "/")) - finalPrefix = "/."; - else - finalPrefix = ui->prefix; - - logMessage("transferring %s://%s/%s/%s to a fd", - ui->protocol == URL_METHOD_FTP ? "ftp" : "http", - ui->address, finalPrefix, filename); - - buf = alloca(strlen(finalPrefix) + strlen(filename) + 20); - sprintf(buf, "%s/%s", finalPrefix, filename); - - if (ui->protocol == URL_METHOD_FTP) { - ui->ftpPort = ftpOpen(ui->address, - ui->login ? ui->login : "anonymous", - ui->password ? ui->password : "rhinstall@", - NULL, -1); - if (ui->ftpPort < 0) { - newtWinMessage(_("Error"), _("OK"), - _("Failed to log into %s: %s"), ui->address, - ftpStrerror(ui->ftpPort)); - return -2; - } - - fd = ftpGetFileDesc(ui->ftpPort, buf); - if (fd < 0) { - close(ui->ftpPort); - if (!silentErrors) - newtWinMessage(_("Error"), _("OK"), - _("Failed to retrieve %s: %s"), buf, ftpStrerror(fd)); - return -1; - } - } else { - fd = httpGetFileDesc(ui->address, -1, buf); - if (fd < 0) { - if (!silentErrors) - newtWinMessage(_("Error"), _("OK"), - _("Failed to retrieve %s: %s"), buf, ftpStrerror(fd)); - return -1; - } - } - - winStatus(70, 3, _("Retrieving"), "%s %s...", _("Retrieving"), filename); - - return fd; -} - -int urlinstFinishTransfer(struct iurlinfo * ui, int fd) { - if (ui->protocol == URL_METHOD_FTP) - close(ui->ftpPort); - close(fd); - - newtPopWindow(); - - return 0; -} - -#if defined (__s390__) || defined (__s390x__) -int setupRemote(struct iurlinfo * ui) { - char *env, *d; - - if (!(env = getenv("RPMSERVER"))) { - ui->address = ""; - ui->prefix = ""; - return 0; - } - - if (!strncmp(env, "ftp://",6)) - env += 6; - else if (!strncmp(env, "http://",7)) - env += 7; - - if (!(d = index (env, '/'))) { - d = ""; - ui->prefix = strdup(d); - } - else /* make sure the path either starts with a / or a ~ */ - if(*d != '/') { - ui->prefix = (char *)malloc(strlen(d)+2); - *ui->prefix = '/'; - strcat(ui->prefix, d); - } - else ui->prefix = strdup(d); - - ui->address = strdup(env); - if (ui->address && (d = index (ui->address, '/'))) - *d = '\0'; - if (ui->address && (d = index (ui->address, ':'))) - *d = '\0'; - - return 0; -} -#endif /* #if defined (__s390__) || defined (__s390x__) */ - -char * addrToIp(char * hostname) { - struct in_addr ad; - char * chptr; - - for (chptr = hostname; *chptr; chptr++) - if (!(isdigit(*chptr) || *chptr == '.')) break; - - if (!*chptr) - return hostname; - - if (mygethostbyname(hostname, &ad)) - return NULL; - - return inet_ntoa(ad); -} - -int urlMainSetupPanel(struct iurlinfo * ui, urlprotocol protocol, - char * doSecondarySetup) { - newtComponent form, okay, cancel, siteEntry, dirEntry; - newtComponent answer, text; - newtComponent * cb = NULL; - char * site, * dir; - char * reflowedText = NULL; - int width, height; - newtGrid entryGrid, buttons, grid; - char * chptr; - char * buf; - - if (ui->address) { - site = ui->address; - dir = ui->prefix; - } else { - site = ""; - dir = ""; - } - - if (ui->login || ui->password || ui->proxy || ui->proxyPort) - *doSecondarySetup = '*'; - else - *doSecondarySetup = ' '; - - buttons = newtButtonBar(_("OK"), &okay, _("Back"), &cancel, NULL); - - switch (protocol) { - case URL_METHOD_FTP: - buf = sdupprintf(_(netServerPrompt), "FTP", PRODUCTNAME); - reflowedText = newtReflowText(buf, 47, 5, 5, &width, &height); - free(buf); - break; - case URL_METHOD_HTTP: - buf = sdupprintf(_(netServerPrompt), "Web", PRODUCTNAME); - reflowedText = newtReflowText(buf, 47, 5, 5, &width, &height); - free(buf); - break; - } - text = newtTextbox(-1, -1, width, height, NEWT_TEXTBOX_WRAP); - newtTextboxSetText(text, reflowedText); - free(reflowedText); - - siteEntry = newtEntry(22, 8, site, 24, &site, NEWT_ENTRY_SCROLL); - dirEntry = newtEntry(22, 9, dir, 24, &dir, NEWT_ENTRY_SCROLL); - - entryGrid = newtCreateGrid(2, 2); - newtGridSetField(entryGrid, 0, 0, NEWT_GRID_COMPONENT, - newtLabel(-1, -1, (protocol == URL_METHOD_FTP) ? - _("FTP site name:") : - _("Web site name:")), - 0, 0, 1, 0, NEWT_ANCHOR_LEFT, 0); - newtGridSetField(entryGrid, 0, 1, NEWT_GRID_COMPONENT, - newtLabel(-1, -1, _("Red Hat directory:")), - 0, 0, 1, 0, NEWT_ANCHOR_LEFT, 0); - newtGridSetField(entryGrid, 1, 0, NEWT_GRID_COMPONENT, siteEntry, - 0, 0, 0, 0, 0, 0); - newtGridSetField(entryGrid, 1, 1, NEWT_GRID_COMPONENT, dirEntry, - 0, 0, 0, 0, 0, 0); - - grid = newtCreateGrid(1, 4); - newtGridSetField(grid, 0, 0, NEWT_GRID_COMPONENT, text, - 0, 0, 0, 1, 0, 0); - newtGridSetField(grid, 0, 1, NEWT_GRID_SUBGRID, entryGrid, - 0, 0, 0, 1, 0, 0); - - switch (protocol) { - case URL_METHOD_FTP: - cb = newtCheckbox(3, 11, _("Use non-anonymous ftp"), - *doSecondarySetup, NULL, doSecondarySetup); - break; -#ifdef NO_PROXY - case URL_METHOD_HTTP: - cb = newtCheckbox(3, 11, _("Use proxy server"), - *doSecondarySetup, NULL, doSecondarySetup); -#endif - } - - if (cb) - newtGridSetField(grid, 0, 2, NEWT_GRID_COMPONENT, cb, - 0, 0, 0, 1, NEWT_ANCHOR_LEFT, 0); - - newtGridSetField(grid, 0, 3, NEWT_GRID_SUBGRID, buttons, - 0, 0, 0, 0, 0, NEWT_GRID_FLAG_GROWX); - - newtGridWrappedWindow(grid, (protocol == URL_METHOD_FTP) ? _("FTP Setup") : - _("HTTP Setup")); - - form = newtForm(NULL, NULL, 0); - newtGridAddComponentsToForm(grid, form, 1); - - do { - answer = newtRunForm(form); - if (answer != cancel) { - if (!strlen(site)) { - newtWinMessage(_("Error"), _("OK"), - _("You must enter a server name.")); - continue; - } - if (!strlen(dir)) { - newtWinMessage(_("Error"), _("OK"), - _("You must enter a directory.")); - continue; - } - - if (!addrToIp(site)) { - newtWinMessage(_("Unknown Host"), _("OK"), - _("%s is not a valid hostname."), site); - continue; - } - } - - break; - } while (1); - - if (answer == cancel) { - newtFormDestroy(form); - newtPopWindow(); - - return LOADER_BACK; - } - - if (ui->address) free(ui->address); - ui->address = strdup(site); - - if (ui->prefix) free(ui->prefix); - - /* add a slash at the start of the dir if it is missing */ - if (*dir != '/') { - char *buf = malloc(strlen(dir) + 2); - buf[0] = '/'; - buf[1] = '\0'; - strcat (buf, dir); - ui->prefix = buf; - } else - ui->prefix = strdup(dir); - - /* Get rid of trailing /'s */ - chptr = ui->prefix + strlen(ui->prefix) - 1; - while (chptr > ui->prefix && *chptr == '/') chptr--; - chptr++; - *chptr = '\0'; - -#if 0 - if (ui->urlprefix) free(ui->urlprefix); - len = strlen(ui->address); - if (len < 15) len = 15; - ui->urlprefix = malloc(sizeof(char) * (len + strlen(ui->prefix) + 10)); -#endif - - if (*doSecondarySetup != '*') { - if (ui->login) - free(ui->login); - if (ui->password) - free(ui->password); - if (ui->proxy) - free(ui->proxy); - if (ui->proxyPort) - free(ui->proxyPort); - ui->login = ui->password = ui->proxy = ui->proxyPort = NULL; - /* - delMacro(NULL, "_httpproxy"); - delMacro(NULL, "_ftpproxy"); - delMacro(NULL, "_httpproxyport"); - delMacro(NULL, "_ftpproxyport"); - */ - } - - ui->protocol = protocol; - - newtFormDestroy(form); - newtPopWindow(); - - return 0; -} - -int urlSecondarySetupPanel(struct iurlinfo * ui, urlprotocol protocol) { - newtComponent form, okay, cancel, answer, text, accountEntry = NULL; - newtComponent passwordEntry = NULL, proxyEntry = NULL; - newtComponent proxyPortEntry = NULL; - char * account, * password, * proxy, * proxyPort; - newtGrid buttons, entryGrid, grid; - char * reflowedText = NULL; - int width, height; - - if (protocol == URL_METHOD_FTP) { - reflowedText = newtReflowText( - _("If you are using non anonymous ftp, enter the account name and " - "password you wish to use below."), - 47, 5, 5, &width, &height); - } else { - reflowedText = newtReflowText( - _("If you are using a HTTP proxy server " - "enter the name of the HTTP proxy server to use."), - 47, 5, 5, &width, &height); - } - text = newtTextbox(-1, -1, width, height, NEWT_TEXTBOX_WRAP); - newtTextboxSetText(text, reflowedText); - free(reflowedText); - - if (protocol == URL_METHOD_FTP) { - accountEntry = newtEntry(-1, -1, NULL, 24, &account, - NEWT_FLAG_SCROLL); - passwordEntry = newtEntry(-1, -1, NULL, 24, &password, - NEWT_FLAG_SCROLL | NEWT_FLAG_PASSWORD); - } - proxyEntry = newtEntry(-1, -1, ui->proxy, 24, &proxy, NEWT_ENTRY_SCROLL); - proxyPortEntry = newtEntry(-1, -1, ui->proxyPort, 6, &proxyPort, - NEWT_FLAG_SCROLL); - - entryGrid = newtCreateGrid(2, 4); - if (protocol == URL_METHOD_FTP) { - newtGridSetField(entryGrid, 0, 0, NEWT_GRID_COMPONENT, - newtLabel(-1, -1, _("Account name:")), - 0, 0, 2, 0, NEWT_ANCHOR_LEFT, 0); - newtGridSetField(entryGrid, 0, 1, NEWT_GRID_COMPONENT, - newtLabel(-1, -1, _("Password:")), - 0, 0, 2, 0, NEWT_ANCHOR_LEFT, 0); - } -#if 0 - newtGridSetField(entryGrid, 0, 2, NEWT_GRID_COMPONENT, - protocol == URL_METHOD_FTP ? - newtLabel(-1, -1, _("FTP Proxy:")) : - newtLabel(-1, -1, _("HTTP Proxy:")), - 0, 1, 1, 0, NEWT_ANCHOR_LEFT, 0); - newtGridSetField(entryGrid, 0, 3, NEWT_GRID_COMPONENT, - protocol == URL_METHOD_FTP ? - newtLabel(-1, -1, _("FTP Proxy Port:")) : - newtLabel(-1, -1, _("HTTP Proxy Port:")), - 0, 0, 1, 0, NEWT_ANCHOR_LEFT, 0); -#endif - - if (protocol == URL_METHOD_FTP) { - newtGridSetField(entryGrid, 1, 0, NEWT_GRID_COMPONENT, accountEntry, - 0, 0, 0, 0, 0, 0); - newtGridSetField(entryGrid, 1, 1, NEWT_GRID_COMPONENT, passwordEntry, - 0, 0, 0, 0, 0, 0); - } - -#if 0 - newtGridSetField(entryGrid, 1, 2, NEWT_GRID_COMPONENT, proxyEntry, - 0, 1, 0, 0, 0, 0); - newtGridSetField(entryGrid, 1, 3, NEWT_GRID_COMPONENT, proxyPortEntry, - 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); -#endif - - buttons = newtButtonBar(_("OK"), &okay, _("Back"), &cancel, NULL); - - grid = newtCreateGrid(1, 3); - newtGridSetField(grid, 0, 0, NEWT_GRID_COMPONENT, text, 0, 0, 0, 0, 0, 0); - newtGridSetField(grid, 0, 1, NEWT_GRID_SUBGRID, entryGrid, - 0, 1, 0, 0, 0, 0); - newtGridSetField(grid, 0, 2, NEWT_GRID_SUBGRID, buttons, - 0, 1, 0, 0, 0, NEWT_GRID_FLAG_GROWX); - - - - if (protocol == URL_METHOD_FTP) { - newtGridWrappedWindow(grid, "Further FTP Setup"); - } else { - if (protocol == URL_METHOD_HTTP) - newtGridWrappedWindow(grid, "Further HTTP Setup"); - } - - form = newtForm(NULL, NULL, 0); - newtGridAddComponentsToForm(grid, form, 1); - newtGridFree(grid, 1); - - answer = newtRunForm(form); - if (answer == cancel) { - newtFormDestroy(form); - newtPopWindow(); - - return LOADER_BACK; - } - - if (protocol == URL_METHOD_FTP) { - if (ui->login) free(ui->login); - if (strlen(account)) - ui->login = strdup(account); - else - ui->login = NULL; - - if (ui->password) free(ui->password); - if (strlen(password)) - ui->password = strdup(password); - else - ui->password = NULL; - } - - newtFormDestroy(form); - newtPopWindow(); - - return 0; -} diff --git a/loader/urls.h b/loader/urls.h deleted file mode 100644 index 29cd46798..000000000 --- a/loader/urls.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef H_LOADER_URLS -#define H_LOADER_URLS - -enum urlprotocol_t { URL_METHOD_FTP, URL_METHOD_HTTP }; -typedef enum urlprotocol_t urlprotocol; - -struct iurlinfo { - urlprotocol protocol; - char * address; - char * login; - char * password; - char * prefix; - char * proxy; - char * proxyPort; - int ftpPort; -}; - -int setupRemote(struct iurlinfo * ui); -int urlMainSetupPanel(struct iurlinfo * ui, urlprotocol protocol, - char * doSecondarySetup); -int urlSecondarySetupPanel(struct iurlinfo * ui, urlprotocol protocol); -int urlinstStartTransfer(struct iurlinfo * ui, char * filename, - int silentErrors); -int urlinstFinishTransfer(struct iurlinfo * ui, int fd); - -#endif diff --git a/loader/urltest.c b/loader/urltest.c deleted file mode 100644 index 7df2bf555..000000000 --- a/loader/urltest.c +++ /dev/null @@ -1,45 +0,0 @@ -#include <newt.h> - -#include "urls.h" - -int haveKon = 0; -int continuing = 0; - -void stopNewt(void) { -} - -int main(void) { - struct iurlinfo iu; - char doSecondary; - int fd; - int size; - int total = 0; - char buf[16384]; - - - newtInit(); - newtCls(); - - memset(&iu, 0, sizeof(iu)); - - iu.protocol = URL_METHOD_HTTP; - iu.address = "localhost"; - iu.prefix = "/"; - - iu.protocol = URL_METHOD_FTP; - iu.address = "localhost"; - iu.prefix = "/pub/oot/i386"; - - fd = urlinstStartTransfer(&iu, "RedHat/base/netstg1.img", 1); - if (fd >= 0) { - while ((size = read(fd, buf, sizeof(buf))) > 0) - total += size; - urlinstFinishTransfer(&iu, fd); - - newtWinMessage("Got it", "OK", "Got: %d bytes\n", total); - } else { - newtWinMessage("Failed", "OK", ":-("); - } - - newtFinished(); -} diff --git a/loader/windows.c b/loader/windows.c deleted file mode 100644 index 61ca8e7ad..000000000 --- a/loader/windows.c +++ /dev/null @@ -1,48 +0,0 @@ -#include <errno.h> -#include <newt.h> -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <stdarg.h> - -#include "windows.h" -#include "lang.h" - -void winStatus(int width, int height, char * title, - char * text, ...) { - newtComponent t, f; - char * buf = NULL; - int size = 0; - int i = 0; - va_list args; - - va_start(args, text); - - do { - size += 1000; - if (buf) free(buf); - buf = malloc(size); - i = vsnprintf(buf, size, text, args); - } while (i == size); - - va_end(args); - - newtCenteredWindow(width, height, title); - - t = newtTextbox(1, 1, width - 2, height - 2, NEWT_TEXTBOX_WRAP); - newtTextboxSetText(t, buf); - f = newtForm(NULL, NULL, 0); - - free(buf); - - newtFormAddComponent(f, t); - - newtDrawForm(f); - newtRefresh(); - newtFormDestroy(f); -} - -void scsiWindow(const char * driver) { - winStatus(40, 3, _("Loading SCSI driver"), - _("Loading %s driver..."), driver); -} diff --git a/loader/windows.h b/loader/windows.h deleted file mode 100644 index 93b38b2c0..000000000 --- a/loader/windows.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _WINDOWS_H_ -#define _WINDOWS_H_ - -void winStatus(int width, int height, char * title, char * text, ...); -void scsiWindow(const char * driver); - -#endif /* _WINDOWS_H_ */ |