[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pbsd-mg2] Re: Vadem CLIO
In message "[pbsd-mg2] Vadem CLIO",
Warner Losh write:
>I've managed to boot the Vadem CLIO to the root partition prompt. I
>patched the keytrans table. Here are my changes. I think a more
>generic way of doing this is desired.
Thank you for your patch.
I agree to that we need more generic way, as
MC-CS series also need another key translation table.
Can I use platform id to choose which keytran is used?
パッチをありがとうございます。
MC-CSシリーズでも別の変換表が必要なようですし、
たしかにもっと一般的な方法が必要でしょうね。
platform idを使うべきなのでしょうか?
あと、えびはらさんも指摘されていますが、
現在の vrkiuでは initが shellを聞いてきても入力できません。
というわけで適当なパッチを流します。
但し、これだと逆に kernelが root partition を聞いてきたときには
答えられません。
うちやまさんのコードの方がいいのかも知れませんし、
それより wsconsに attachできるようにする方が最終的に楽かも、
と思いつつ中途半端なコードになっています。
すみません。
As Ebihara san mentioned, current version of vrkiu can't work
at 'init' prompt for the shell.
So I send a patch.
Note that if you apply this patch, you can't answer at
root partition prompt. Be carefull!
takesi
----------------------------------------------------------------
Index: sys/arch/hpcmips/vr/vrkiu.c
===================================================================
RCS file: /var/netbsd/pocketbsd/cvsroot/hpcmips/sys/arch/hpcmips/vr/Attic/vrkiu.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 vrkiu.c
--- vrkiu.c 1999/07/09 08:34:13 1.1.1.1
+++ vrkiu.c 1999/07/18 07:20:08
@@ -234,7 +234,6 @@
{ NONE, "", "", "" }, /* 127 */
};
-/* XXX: Make these queue obsolute, or move these into vrkiu_softc */
static int
vrkiumatch(parent, cf, aux)
struct device *parent;
@@ -281,6 +280,8 @@
sc->sc_iot = iot;
sc->sc_ioh = ioh;
+ sc->keybufhead = sc->keybuftail = 0;
+
/* set KIU */
vrkiu_write(sc, KIURST, 1); /* reset */
vrkiu_write(sc, KIUSCANLINE, 0); /* 96keys */
@@ -303,13 +304,17 @@
static void
vrkiu_intr(void *ctx, vrip_intr_mask_t mask, unsigned pc, unsigned status)
{
- struct vrkiu_softc *sc = (struct vrkiu_softc *)ctx;
/* When key scan finisshed, this entry is called. */
- wakeup(sc);
+
+ struct vrkiu_softc *sc = (struct vrkiu_softc *)ctx;
+ int spl = spltty();
+
DPRINTF(("%d", vrkiu_read(sc, KIUINT) & 7));
- vrkiu_write(sc, KIUINT, 0x7); /* Clear all interrupt */
+ detect_key(sc);
+ splx(spl);
+ vrkiu_write(sc, KIUINT, 0x7); /* Clear all interrupt */
}
static void
@@ -318,9 +323,6 @@
{
int i, k;
- tsleep(sc, 0, "vrkiu", 0);
- DPRINTF(("[detect_key():begin read]"));
-
for (i = 0; i < KIU_NSCANLINE / 2; i++) {
k = vrkiu_read(sc, KIUDATP + i * 2) ^ sc->keystat[i];
sc->keystat[i] = vrkiu_read(sc, KIUDATP + i * 2);
@@ -353,6 +355,7 @@
int k, brk;
{
char *p;
+ extern struct tty biconsdev_tty[];
switch (scan_codes[k].type) {
case ALT:
@@ -373,12 +376,21 @@
} else {
p = scan_codes[k].unshift;
}
+#if 1
+ (*linesw[0].l_rint)(sc->k_alt ? (*p | 0x80) : *p,
+ &biconsdev_tty [0]);
+ /* 0. where does the index of linesw come from?
+ * 1. where should we declare 'biconsdev_tty'?
+ * 2. isn't the span of interrupt long?
+ */
+#else
sc->keybuf[sc->keybufhead++] =
sc->k_alt ? (*p | 0x80) : *p;
/* XXX: multi byte key! */
if (sc->keybufhead >= NKEYBUF) {
sc->keybufhead = 0;
}
+#endif
}
break;
default:
@@ -390,6 +402,10 @@
int
vrkiu_getc()
{
+#if 1
+ DPRINTF(("[vrkiu_getc]"));
+ return 0;
+#else
int ret;
if (the_vrkiu == NULL) {
@@ -404,5 +420,6 @@
the_vrkiu->keybuftail = 0;
}
return ret;
+#endif
}