Implement GetChar()

console/Makefile:
    Quick install target to copy the binary to zizzer
This commit is contained in:
Nathan Binkert 2003-12-22 13:04:23 -05:00
parent d7fba9784e
commit fbe8ff04da
2 changed files with 9 additions and 6 deletions

View file

@ -11,7 +11,7 @@ INCLUDEH = ../h
dbmentry.o: dbmentry.s dbmentry.o: dbmentry.s
$(AS) $(INCLUDES) -nointrinsics -o $*.o $*.s $(AS) $(INCLUDES) -nointrinsics -o $*.o $*.s
console.o: console.c console.o: console.c
$(CC) -g3 $(INCLUDES) -nointrinsics -o $*.o -c $*.c $(CC) -g3 $(INCLUDES) -nointrinsics -o $*.o -c $*.c
printf.o: printf.c printf.o: printf.c
@ -45,5 +45,8 @@ console: console.o dbmentry.o printf.o paljtokern.c.o paljtoslave.c.o
$(LD) -o console -N -T $(DBMENTRY) -non_shared \ $(LD) -o console -N -T $(DBMENTRY) -non_shared \
dbmentry.o console.o printf.o paljtokern.c.o paljtoslave.c.o -lc dbmentry.o console.o printf.o paljtokern.c.o paljtoslave.c.o -lc
install: console
scp console zizzer.eecs.umich.edu:/z/m5/system/testing/binaries/console
clean: clean:
rm -f *.o console *.strip paljtokern.c paljtoslave.c rm -f *.o console *.strip paljtokern.c paljtoslave.c

View file

@ -8,8 +8,9 @@
* ******************************************/ * ******************************************/
/* from simos */ typedef unsigned long long uint64_t;
typedef unsigned long long uint64; typedef unsigned long long uint64;
typedef unsigned int uint32_t;
typedef unsigned int uint32; typedef unsigned int uint32;
#define CONSOLE #define CONSOLE
@ -119,7 +120,7 @@ void InitConsole(void)
char GetChar() char GetChar()
{ {
struct AlphaAccess *k1Conf = (struct AlphaAccess *)(__MAGIC_ZONE(0, 0, MAGIC_ZONE_EV5_ALIAS)); struct AlphaAccess *k1Conf = (struct AlphaAccess *)(__MAGIC_ZONE(0, 0, MAGIC_ZONE_EV5_ALIAS));
return 0; return k1Conf->inputChar;
} }
void PutChar(char c) void PutChar(char c)
@ -1127,12 +1128,11 @@ CallBackDispatcher(long a0, long a1, long a2, long a3, long a4)
long i; long i;
switch (a0) { switch (a0) {
case CONSCB_GETC: case CONSCB_GETC:
break; return GetChar();
case CONSCB_PUTS: case CONSCB_PUTS:
for(i = 0; i < a3; i++) { for(i = 0; i < a3; i++)
PutChar(*(char *)a2+i); PutChar(*(char *)a2+i);
}
return a3; return a3;
case CONSCB_GETENV: case CONSCB_GETENV: