#define SWAPTOP 0xFF00 /* can we stop at the top? not sure how. let's stop short. */
#define MAX_SWAPS 10 /* Well, that depends really, hmmmmmm. Pick a number, any number. */
-#define BOOT_TTY (512 + 1)/* Set this to default device for stdio, stderr */
- /* In this case, the default is the first TTY device */
-
/* We need a tidier way to do this from the loader */
#define CMDLINE (0x0081) /* Location of root dev name */
-/* Device parameters */
-#define NUM_DEV_TTY 2
-
-#define TTYDEV BOOT_TTY /* Device used by kernel for messages, panics */
//#define SWAPDEV (256 + 1) /* Device for swapping. (z80pack drive J) */
#define NBUFS 10 /* Number of block buffers */
#define NMOUNTS 4 /* Number of mounts at a time */
/* We have a DS1302, we can read the time of day from it */
#define CONFIG_RTC
#define CONFIG_RTC_INTERVAL 30 /* deciseconds between reading RTC seconds counter */
+
+/* We have a PropIOv2 board */
+#define CONFIG_PROPIO2
+#define PROPIO2_IO_BASE 0xA8
+
+/* Device parameters */
+#ifdef CONFIG_PROPIO2
+ #define NUM_DEV_TTY 3
+
+ /* PropIO as the console */
+ #define BOOT_TTY (512 + 3)
+#else
+ #define NUM_DEV_TTY 2
+
+ /* ANSI0 as the console */
+ #define BOOT_TTY (512 + 1)
+#endif
+
+#define TTYDEV BOOT_TTY /* Device used by kernel for messages, panics */
char tbuf1[TTYSIZ];
char tbuf2[TTYSIZ];
+#ifdef CONFIG_PROPIO2
+char tbufp[TTYSIZ];
+
+__sfr __at (PROPIO2_IO_BASE + 0x00) PROPIO2_STAT;
+__sfr __at (PROPIO2_IO_BASE + 0x01) PROPIO2_TERM;
+#endif
+
struct s_queue ttyinq[NUM_DEV_TTY+1] = { /* ttyinq[0] is never used */
{ NULL, NULL, NULL, 0, 0, 0 },
{ tbuf1, tbuf1, tbuf1, TTYSIZ, 0, TTYSIZ/2 },
{ tbuf2, tbuf2, tbuf2, TTYSIZ, 0, TTYSIZ/2 },
+#ifdef CONFIG_PROPIO2
+ { tbufp, tbufp, tbufp, TTYSIZ, 0, TTYSIZ/2 },
+#endif
};
void tty_setup(uint8_t minor)
}
}
+#ifdef CONFIG_PROPIO2
+void tty_poll_propio2(void)
+{
+ while(PROPIO2_STAT & 0x20)
+ tty_inproc(3, PROPIO2_TERM);
+}
+#endif
+
void tty_putc(uint8_t minor, unsigned char c)
{
switch(minor){
while(!(ASCI_STAT1 & 2));
ASCI_TDR1 = c;
break;
+#ifdef CONFIG_PROPIO2
+ case 3:
+ while(!(PROPIO2_STAT & 0x10));
+ PROPIO2_TERM = c;
+ break;
+#endif
}
}
/* kernel writes to system console -- never sleep! */
void kputchar(char c)
{
- tty_putc(1, c);
+ tty_putc(TTYDEV - 512, c);
if(c == '\n')
- tty_putc(1, '\r');
+ tty_putc(TTYDEV - 512, '\r');
}
-