summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2000-04-18 00:33:20 +0000
committerMatt Wilson <msw@redhat.com>2000-04-18 00:33:20 +0000
commit76de05be197968f874fdffd035ec577a7d0918d6 (patch)
tree2cd3a606ea116e2cd4310cd4194718ca99b458bd
parent92035702beb8056b4f5b745de2d724c4169f9149 (diff)
downloadanaconda-76de05be197968f874fdffd035ec577a7d0918d6.tar.gz
anaconda-76de05be197968f874fdffd035ec577a7d0918d6.tar.xz
anaconda-76de05be197968f874fdffd035ec577a7d0918d6.zip
partial merge to latest
-rw-r--r--loader/Makefile15
-rw-r--r--loader/kon2/include/mem.h66
-rw-r--r--loader/kon2/lib/mem.c44
-rw-r--r--loader/kon2/src/display/j31sx.c2
-rw-r--r--loader/kon2/src/display/vga.c44
-rw-r--r--loader/kon2/src/vc.c125
6 files changed, 133 insertions, 163 deletions
diff --git a/loader/Makefile b/loader/Makefile
index ec6af64ed..181fca581 100644
--- a/loader/Makefile
+++ b/loader/Makefile
@@ -27,11 +27,13 @@ ALLOBJS = $(OBJS) $(PCMCIAOBJS)
# XXX Japanese is i386 only at the moment
ifeq (i386, $(ARCH))
-BINS += loader-local loader-network loader-pcmcia \
- loader-local-kon loader-network-kon loader-pcmcia-kon
+BINS += loader-local loader-network loader-pcmcia
+ ifeq (1, $(JAPANESE))
+ BINS += loader-local-kon loader-network-kon loader-pcmcia-kon
+ KONOBJS = ./kon2/src/libkon.a ./kon2/src/display.a ./kon2/lib/libgon.a
+ endif
DIRS += pcmcia-install kon2
OBJS += stubs.o
-KONOBJS += ./kon2/src/libkon.a ./kon2/src/display.a ./kon2/lib/libgon.a
endif
ifeq (ia64, $(ARCH))
@@ -124,7 +126,7 @@ loader-local-kon: loader-local-kon.o $(OBJS)
-lkudzu_loader ../isys/libisys.a ../balkan/libbalkan.a \
$(MODULELINKAGE) \
-L ../stubs -lz -lresolv -lnewt -lslang -lpci \
- ./kon2/src/libkon.a ./kon2/src/display.a ./kon2/lib/libgon.a
+ $(KONOBJS)
loader-network: loader-net.o $(OBJS) $(NETOBJS)
$(CC) -g $(STATIC) -o $@ $^ -lpopt \
@@ -137,7 +139,7 @@ loader-network-kon: loader-net-kon.o $(OBJS) $(NETOBJS)
-lkudzu_loader ../isys/libisys.a ../balkan/libbalkan.a \
$(MODULELINKAGE) \
-lpump -lrpm -lbz2 -lz -lresolv -lnewt -lslang -lpci \
- ./kon2/src/libkon.a ./kon2/src/display.a ./kon2/lib/libgon.a
+ $(KONOBJS)
loader-pcmcia: loader-pcmcia.o pcmcia.o popen.o $(OBJS) $(PCMCIAOBJS)
$(CC) -g $(STATIC) -o $@ loader-pcmcia.o $(OBJS) \
@@ -153,7 +155,8 @@ loader-pcmcia-kon: loader-pcmcia-kon.o pcmcia.o popen.o $(OBJS) $(PCMCIAOBJS)
-lpopt \
-lkudzu_loader ../isys/libisys.a ../balkan/libbalkan.a \
$(MODULELINKAGE) \
- ./kon2/src/libkon.a ./kon2/src/display.a ./kon2/lib/libgon.a
+ -lpump -lrpm -lbz2 -lz -lresolv -lnewt -lslang -lpci \
+ $(KONOBJS)
loader.o: loader.c
$(CC) -DINCLUDE_LOCAL -DINCLUDE_NETWORK $(CFLAGS) -o $@ -c $^
diff --git a/loader/kon2/include/mem.h b/loader/kon2/include/mem.h
index 4294c1656..1efc44021 100644
--- a/loader/kon2/include/mem.h
+++ b/loader/kon2/include/mem.h
@@ -30,68 +30,28 @@
#ifndef MEM_H
#define MEM_H
-static inline
+static __inline__
void PortOutw(u_short value, u_short port)
{
- __asm__ ("outw %0,%1"
- ::"a" ((u_short) value),
- "d" ((u_short) port));
+ __asm__ volatile ("outw %0,%1"
+ ::"a" ((unsigned short) value), "d"((unsigned short) port));
}
-static inline
+static __inline__
void PortOutb(char value, u_short port)
{
- __asm__ ("outb %0,%1"
- ::"a" ((char) value),
- "d" ((u_short) port));
+ __asm__ volatile ("outb %0,%1"
+ ::"a" ((unsigned char) value), "d"((unsigned short) port));
}
-static inline
- void lzero(void *head, int n)
+static __inline__
+ unsigned char PortInb(unsigned short port)
{
- __asm__ ("cld\n\t"
- "rep\n\t"
- "stosl"
- ::"a" (0),
- "c" (n>>2),
- "D" ((long)head)
- :"cx","di");
-}
-
-static inline
- void bmove(void *dst, void *src, int n)
-{
- __asm__ ("cld\n\t"
- "rep\n\t"
- "movsb\n\t"
- ::"c" (n),
- "D" ((long)dst),
- "S" ((long)src)
- :"cx","di","si");
-}
-
-static inline
- void brmove(void *dst, void *src, int n)
-{
- __asm__ ("std\n\t"
- "rep\n\t"
- "movsb\n\t"
- ::"c" (n),
- "D" ((long)dst),
- "S" ((long)src)
- :"cx","di","si");
-}
-
-static inline
- void bzero2(void *head, int n)
-{
- __asm__ ("cld\n\t"
- "rep\n\t"
- "stosb"
- ::"a" (0),
- "c" (n),
- "D" ((long)head)
- :"cx","di");
+ unsigned char value;
+ __asm__ volatile ("inb %1,%0"
+ :"=a" (value)
+ :"d"((unsigned short) port));
+ return value;
}
extern u_char PortInb(u_short);
diff --git a/loader/kon2/lib/mem.c b/loader/kon2/lib/mem.c
index 978d938f0..dba505f55 100644
--- a/loader/kon2/lib/mem.c
+++ b/loader/kon2/lib/mem.c
@@ -33,6 +33,7 @@
#include <stdlib.h>
#endif
+#if 0
u_char PortInb(unsigned short port)
{
u_char _rval;
@@ -46,36 +47,43 @@ u_char PortInb(unsigned short port)
void wzero(void *head, int n)
{
+ int dummy_cx;
__asm__ ("cld\n\t"
- "rep\n\t"
- "stosw"
- ::"a" (0),
- "c" (n>>1),
- "D" ((long)head)
- :"cx","di");
+ "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" (n>>1),
- "D" ((long)dst),
- "S" ((long)src)
- :"cx","di","si");
+ "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" (n>>2),
- "D" ((long)dst),
- "S" ((long)src)
- :"cx","di","si");
+ "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)
{
diff --git a/loader/kon2/src/display/j31sx.c b/loader/kon2/src/display/j31sx.c
index 380c040a7..f93bdda1b 100644
--- a/loader/kon2/src/display/j31sx.c
+++ b/loader/kon2/src/display/j31sx.c
@@ -47,7 +47,7 @@
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
-/* #include <linux/mm.h> */
+#include <linux/mm.h>
#include <sys/kd.h>
#undef free
#include <stdlib.h>
diff --git a/loader/kon2/src/display/vga.c b/loader/kon2/src/display/vga.c
index f5bb3e176..48201f584 100644
--- a/loader/kon2/src/display/vga.c
+++ b/loader/kon2/src/display/vga.c
@@ -99,10 +99,8 @@ u_int vgaSt1Addr = 0x3DA;
static char *gramMem; /* dummy buffer for mmapping grahics memory */
static char *fontBuff1; /* saved font data - plane 2 */
-#ifndef MINI_KON
static bool savePlane3;
static char *fontBuff2; /* saved font data - plane 3 */
-#endif
static u_int writeAddr; /* address to write next character */
@@ -237,13 +235,15 @@ void VgaInit(void)
#ifdef USE_ROMFONT
VgaLoadRomFont(fontBuff1);
#endif
-#ifndef MINI_KON
- if (savePlane3) {
+#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);
}
-#endif
}
void VgaTextMode(void)
@@ -264,14 +264,12 @@ void VgaTextMode(void)
PortOutb(0x04, VGASEQ_DATA );
memcpy(gramMem, fontBuff1, FONT_SIZE);
-#ifndef MINI_KON
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);
}
-#endif
/* restore text mode VGA registers */
VgaSetRegisters(&regText);
@@ -435,17 +433,17 @@ void VgaHardScrollUp(int line)
if (line > dInfo.tymax) {
line %= dInfo.tymax + 1;
- lzero(gramMem, dInfo.gsize);
+ bzero(gramMem, dInfo.gsize);
}
oldhead = gramHead;
gramHead += line * dInfo.tlineByte;
if (gramHead >= dInfo.gsize) {
gramHead -= dInfo.gsize;
- lzero(gramMem + oldhead, dInfo.gsize - oldhead);
-/* if (gramHead) lzero(gramMem, gramHead);*/
- lzero(gramMem, gramHead);
- } else lzero(gramMem + oldhead, gramHead - oldhead);
+ bzero(gramMem + oldhead, dInfo.gsize - oldhead);
+/* if (gramHead) bzero(gramMem, gramHead);*/
+ bzero(gramMem, gramHead);
+ } else bzero(gramMem + oldhead, gramHead - oldhead);
vInfo.set_start_address();
}
@@ -457,17 +455,17 @@ void VgaHardScrollDown(int line)
if (line > dInfo.tymax) {
line %= dInfo.tymax + 1;
- lzero(gramMem, dInfo.gsize);
+ bzero(gramMem, dInfo.gsize);
}
oldhead = gramHead;
gramHead -= line * dInfo.tlineByte;
if (gramHead < 0) {
gramHead += dInfo.gsize;
-/* if (oldhead) lzero(gramMem, oldhead);*/
- lzero(gramMem, oldhead);
- lzero(gramMem + gramHead, dInfo.gsize - gramHead);
- } else lzero(gramMem + gramHead, oldhead - gramHead);
+/* if (oldhead) bzero(gramMem, oldhead);*/
+ bzero(gramMem, oldhead);
+ bzero(gramMem + gramHead, dInfo.gsize - gramHead);
+ } else bzero(gramMem + gramHead, oldhead - gramHead);
vInfo.set_start_address();
}
@@ -515,7 +513,7 @@ void VgaCursor(struct cursorInfo *ci)
void VgaClearAll(void)
{
VgaSetColor((con.attr & ATTR_REVERSE ? con.fcol:con.bcol)&7);
- lzero(gramMem, dInfo.gsize);
+ bzero(gramMem, dInfo.gsize);
}
void VgaScreenSaver(bool blank)
@@ -668,9 +666,7 @@ int VgaAttach(void)
}
#endif
if ((fontBuff1 = malloc(FONT_SIZE)) == NULL
-#ifndef MINI_KON
|| (savePlane3 && (fontBuff2 = malloc(FONT_SIZE)) == NULL)
-#endif
) {
Perror("malloc ");
return FAILURE;
@@ -728,22 +724,18 @@ void VgaDetach(void)
SafeFree((void **)&gramMem);
SafeFree((void **)&fontBuff1);
-#ifndef MINI_KON
- if (savePlane3)
+ if (savePlane3 && fontBuff2)
SafeFree((void **)&fontBuff2);
-#endif
}
/* Configure */
-#ifndef MINI_KON
static
int ConfigPlane3(const char *confstr)
{
savePlane3 = BoolConf(confstr);
return SUCCESS;
}
-#endif
static
int ConfigKanjiCursor(const char *confstr)
@@ -769,9 +761,7 @@ static
void VgaDefaultCaps()
{
DefineCap("Pels", VgaReadPels, NULL);
-#ifndef MINI_KON
DefineCap("SavePlane3", ConfigPlane3, "Off");
-#endif
DefineCap("KanjiCursor", ConfigKanjiCursor, "On");
DefineCap("CursorTop", ConfigCursorTop, "14");
DefineCap("CursorBottom", ConfigCursorBottom, "15");
diff --git a/loader/kon2/src/vc.c b/loader/kon2/src/vc.c
index 387cdefae..e2f588fad 100644
--- a/loader/kon2/src/vc.c
+++ b/loader/kon2/src/vc.c
@@ -97,6 +97,12 @@ 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"
@@ -105,12 +111,15 @@ inline void blatch(void *head, int 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"
@@ -119,6 +128,7 @@ inline void llatch(void *head, int n)
:
: "eax" ((long)head), "ebx" (0x7F7F7F7F), "c" (n>>2)
: "ebx", "cx" );
+#endif
}
static inline u_int TextAddress(u_int x, u_int y)
@@ -159,33 +169,33 @@ void TextDeleteChar(int n)
addr = TextAddress(con.x, con.y);
dx = dInfo.glineByte - con.x - n;
- bmove(textBuff + addr, textBuff + addr + n, dx);
- bmove(attrBuff + addr, attrBuff + addr + n, dx);
- bmove(flagBuff + addr, flagBuff + addr + n, dx);
+ 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);
- bzero2(textBuff + addr, n);
- bzero2(attrBuff + addr, n);
- bzero2(flagBuff + addr, n);
+ bzero(textBuff + addr, n);
+ bzero(attrBuff + addr, n);
+ bzero(flagBuff + addr, n);
}
void TextInsertChar(int n)
{
u_int addr, dx;
- addr = TextAddress(dInfo.txmax, con.y);
- dx = dInfo.glineByte - con.x - n;
- brmove(textBuff + addr, textBuff + addr - n, dx);
- brmove(attrBuff + addr, attrBuff + addr - n, dx);
- brmove(flagBuff + addr, flagBuff + addr - n, 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);
- bzero2(textBuff + addr, n);
- bzero2(attrBuff + addr, n);
- bzero2(flagBuff + addr, n);
+ bzero(textBuff + addr, n);
+ bzero(attrBuff + addr, n);
+ bzero(flagBuff + addr, n);
}
void TextRefresh(void)
@@ -253,8 +263,7 @@ void TextRefresh(void)
vInfo.set_cursor_address(&cInfo, con.x, con.y);
ShowCursor(&cInfo, TRUE);
busy = FALSE;
- if (release)
- LeaveVC(SIGUSR1);
+ if (release) LeaveVC(SIGUSR1);
}
static struct winsize text_win;
@@ -368,14 +377,14 @@ static
textHead -= textSize;
len = textSize - oldhead;
if (textHead) {
- lzero(textBuff, textHead);
- lzero(attrBuff, textHead);
- lzero(flagBuff, textHead);
+ bzero(textBuff, textHead);
+ bzero(attrBuff, textHead);
+ bzero(flagBuff, textHead);
}
} else len = textHead - oldhead;
- lzero(textBuff + oldhead, len);
- lzero(attrBuff + oldhead, len);
- lzero(flagBuff + oldhead, len);
+ bzero(textBuff + oldhead, len);
+ bzero(attrBuff + oldhead, len);
+ bzero(flagBuff + oldhead, len);
}
static
@@ -388,15 +397,15 @@ static
if (textHead < 0) {
textHead += textSize;
if (oldhead) {
- lzero(textBuff, oldhead);
- lzero(attrBuff, oldhead);
- lzero(flagBuff, oldhead);
+ bzero(textBuff, oldhead);
+ bzero(attrBuff, oldhead);
+ bzero(flagBuff, oldhead);
}
len = textSize - textHead;
} else len = oldhead - textHead;
- lzero(textBuff + textHead, len);
- lzero(attrBuff + textHead, len);
- lzero(flagBuff + textHead, len);
+ bzero(textBuff + textHead, len);
+ bzero(attrBuff + textHead, len);
+ bzero(flagBuff + textHead, len);
}
void TextWput(u_char ch1, u_char ch2)
@@ -429,14 +438,14 @@ void TextClearAll(void)
for (y = 0; y <= con.ymax; y ++) {
addr = TextAddress(0, y);
- lzero(textBuff + addr, dInfo.glineByte);
- lzero(attrBuff + addr, dInfo.glineByte);
+ bzero(textBuff + addr, dInfo.glineByte);
+ bzero(attrBuff + addr, dInfo.glineByte);
}
#else
- lzero(textBuff, textSize);
- lzero(attrBuff, textSize);
+ bzero(textBuff, textSize);
+ bzero(attrBuff, textSize);
#endif
- lzero(flagBuff, textSize);
+ bzero(flagBuff, textSize);
#ifndef MINI_KON
mInfo.sw = 0;
#endif
@@ -461,9 +470,9 @@ void TextClearEol(u_char mode)
break;
}
addr = TextAddress(x, con.y);
- bzero2(textBuff + addr, len);
- bzero2(attrBuff + addr, len);
- bzero2(flagBuff + addr, len);/* needless to latch */
+ bzero(textBuff + addr, len);
+ bzero(attrBuff + addr, len);
+ bzero(flagBuff + addr, len);/* needless to latch */
}
void TextClearEos(u_char mode)
@@ -478,27 +487,27 @@ void TextClearEos(u_char mode)
case 1:
for (y = 0; y < con.y; y ++) {
addr = TextAddress(0, y);
- lzero(textBuff + addr, dInfo.glineByte);
- lzero(attrBuff + addr, dInfo.glineByte);
- lzero(flagBuff + addr, dInfo.glineByte);/* needless to latch */
+ bzero(textBuff + addr, dInfo.glineByte);
+ bzero(attrBuff + addr, dInfo.glineByte);
+ bzero(flagBuff + addr, dInfo.glineByte);/* needless to latch */
}
addr = TextAddress(0, con.y);
- bzero2(textBuff + addr, con.x);
- bzero2(attrBuff + addr, con.x);
- bzero2(flagBuff + addr, con.x);/* needless to latch */
+ 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);
- lzero(textBuff + addr, dInfo.glineByte);
- lzero(attrBuff + addr, dInfo.glineByte);
- lzero(flagBuff + addr, dInfo.glineByte);/* needless to latch */
+ 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;
- bzero2(textBuff + addr, len);
- bzero2(attrBuff + addr, len);
- bzero2(flagBuff + addr, len);/* needless to latch */
+ bzero(textBuff + addr, len);
+ bzero(attrBuff + addr, len);
+ bzero(flagBuff + addr, len);/* needless to latch */
break;
}
}
@@ -510,9 +519,9 @@ static
for (y = top; y <= btm; y ++) {
addr = TextAddress(0, y);
- lzero(textBuff + addr, dInfo.glineByte);
- lzero(attrBuff + addr, dInfo.glineByte);
- lzero(flagBuff + addr, dInfo.glineByte);/* needless to latch */
+ bzero(textBuff + addr, dInfo.glineByte);
+ bzero(attrBuff + addr, dInfo.glineByte);
+ bzero(flagBuff + addr, dInfo.glineByte);/* needless to latch */
}
}
@@ -527,9 +536,9 @@ void TextMoveDown(int top, int btm, int line)
for (n = btm; n >= top + line; n --) {
dst = TextAddress(0, n);
src = TextAddress(0, n - line);
- lmove(textBuff + dst, textBuff + src, dInfo.glineByte);
- lmove(attrBuff + dst, attrBuff + src, dInfo.glineByte);
- lmove(flagBuff + dst, flagBuff + src, dInfo.glineByte);
+ 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);
@@ -546,9 +555,9 @@ void TextMoveUp(int top, int btm, int line)
for (n = top; n <= btm - line; n ++) {
dst = TextAddress(0, n);
src = TextAddress(0, n + line);
- lmove(textBuff + dst, textBuff + src, dInfo.glineByte);
- lmove(attrBuff + dst, attrBuff + src, dInfo.glineByte);
- lmove(flagBuff + dst, flagBuff + src, dInfo.glineByte);
+ 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);