Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


updated test_vm
Jack Lange [Tue, 31 Mar 2009 20:39:26 +0000 (15:39 -0500)]
Conflicts:

18 files changed:
misc/test_vm/build/Makefile
misc/test_vm/build/depend.mak
misc/test_vm/include/geekos/io.h
misc/test_vm/include/geekos/paging.h
misc/test_vm/include/geekos/screen.h
misc/test_vm/include/geekos/serial.h
misc/test_vm/src/geekos/crc32.c
misc/test_vm/src/geekos/idt.c
misc/test_vm/src/geekos/int.c
misc/test_vm/src/geekos/io.c
misc/test_vm/src/geekos/kthread.c
misc/test_vm/src/geekos/main.c
misc/test_vm/src/geekos/paging.c
misc/test_vm/src/geekos/screen.c
misc/test_vm/src/geekos/serial.c
misc/test_vm/src/geekos/timer.c
misc/test_vm/src/geekos/trap.c
misc/test_vm/src/geekos/tss.c

index bacef9f..47bd48e 100644 (file)
@@ -40,12 +40,11 @@ VPATH := $(PROJECT_ROOT)/src
 
 #when -DNDEBUG is set the kassert functions are disabled
 #JRLDEBUG=-DNDEBUG
-JRLDEBUG= -DSERIAL_PRINT_DEBUG=1 -DSERIAL_PRINT_DEBUG_LEVEL=1000 -DSERIAL_PRINT=1
-
-#
-#
-#Peter's compile flags
-PAD= 
+ifeq ($(SERIAL_DEBUG), 1)
+JRLDEBUG= -DDEBUG_SERIAL
+else 
+JRLDEBUG= 
+endif
 
 # Figure out if we're compiling with cygwin, http://cygwin.com
 SYSTEM_NAME := $(shell uname -s)
@@ -81,6 +80,8 @@ KERNEL_C_SRCS := idt.c int.c trap.c irq.c io.c \
        gdt.c tss.c segment.c \
        bget.c malloc.c \
        synch.c kthread.c \
+       vm_cons.c debug.c \
+       pci.c \
        serial.c  reboot.c \
         paging.c \
        main.c
@@ -177,7 +178,7 @@ NUMSECS := $(PERL) $(PROJECT_ROOT)/scripts/numsecs
 # ----------------------------------------------------------------------
 
 # Flags used for all C source files
-GENERAL_OPTS := -O -Wall $(EXTRA_C_OPTS) $(JRLDEBUG) $(PADFLAGS)
+GENERAL_OPTS := -O -Wall $(EXTRA_C_OPTS) $(JRLDEBUG)
 CC_GENERAL_OPTS := $(GENERAL_OPTS) -Werror 
 
 # Flags used for kernel C source files
@@ -238,7 +239,6 @@ guest-img: fd.img
        $(PAD) guest.img 1474560
 
 guest-iso: guest-img
-
        mkisofs -pad -b guest.img -R -o guest.iso guest.img
 
 
index e69de29..052def9 100644 (file)
@@ -0,0 +1,268 @@
+geekos/idt.o: ../src/geekos/idt.c ../include/geekos/kassert.h \
+  ../include/geekos/screen.h ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/defs.h ../include/geekos/idt.h \
+  ../include/geekos/int.h ../include/geekos/debug.h \
+  ../include/geekos/string.h ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h
+geekos/int.o: ../src/geekos/int.c ../include/geekos/idt.h \
+  ../include/geekos/int.h ../include/geekos/kassert.h \
+  ../include/geekos/screen.h ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/defs.h ../include/geekos/irq.h \
+  ../include/geekos/debug.h ../include/geekos/string.h \
+  ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/cpu.h
+geekos/trap.o: ../src/geekos/trap.c ../include/geekos/idt.h \
+  ../include/geekos/int.h ../include/geekos/kassert.h \
+  ../include/geekos/screen.h ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/defs.h ../include/geekos/kthread.h \
+  ../include/geekos/list.h ../include/geekos/trap.h \
+  ../include/geekos/debug.h ../include/geekos/string.h \
+  ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h
+geekos/irq.o: ../src/geekos/irq.c ../include/geekos/kassert.h \
+  ../include/geekos/screen.h ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/idt.h ../include/geekos/int.h \
+  ../include/geekos/defs.h ../include/geekos/io.h ../include/geekos/irq.h
+geekos/io.o: ../src/geekos/io.c ../include/geekos/io.h \
+  ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h
+geekos/blockdev.o: ../src/geekos/blockdev.c ../include/geekos/errno.h \
+  ../include/geekos/screen.h ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/string.h ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/malloc.h ../include/geekos/int.h \
+  ../include/geekos/kassert.h ../include/geekos/defs.h \
+  ../include/geekos/kthread.h ../include/geekos/list.h \
+  ../include/geekos/synch.h ../include/geekos/blockdev.h \
+  ../include/geekos/fileio.h
+geekos/ide.o: ../src/geekos/ide.c ../include/geekos/serial.h \
+  ../include/geekos/irq.h ../include/geekos/int.h \
+  ../include/geekos/kassert.h ../include/geekos/screen.h \
+  ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/defs.h ../include/geekos/string.h \
+  ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/io.h ../include/geekos/errno.h \
+  ../include/geekos/malloc.h ../include/geekos/timer.h \
+  ../include/geekos/kthread.h ../include/geekos/list.h \
+  ../include/geekos/blockdev.h ../include/geekos/fileio.h \
+  ../include/geekos/ide.h
+geekos/keyboard.o: ../src/geekos/keyboard.c ../include/geekos/kthread.h \
+  ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/list.h ../include/geekos/kassert.h \
+  ../include/geekos/screen.h ../include/geekos/fmtout.h \
+  ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/irq.h ../include/geekos/int.h \
+  ../include/geekos/defs.h ../include/geekos/io.h \
+  ../include/geekos/keyboard.h
+geekos/screen.o: ../src/geekos/screen.c \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/kassert.h ../include/geekos/screen.h \
+  ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  ../include/geekos/io.h ../include/geekos/int.h ../include/geekos/defs.h
+geekos/timer.o: ../src/geekos/timer.c \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/limits.h \
+  ../include/geekos/io.h ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/int.h ../include/geekos/kassert.h \
+  ../include/geekos/screen.h ../include/geekos/fmtout.h \
+  ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/defs.h ../include/geekos/irq.h \
+  ../include/geekos/kthread.h ../include/geekos/list.h \
+  ../include/geekos/timer.h ../include/geekos/debug.h \
+  ../include/geekos/string.h ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h
+geekos/mem.o: ../src/geekos/mem.c ../include/geekos/defs.h \
+  ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/kassert.h ../include/geekos/screen.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/bootinfo.h ../include/geekos/gdt.h \
+  ../include/geekos/int.h ../include/geekos/malloc.h \
+  ../include/geekos/string.h ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/paging.h ../include/geekos/list.h \
+  ../include/geekos/mem.h
+geekos/crc32.o: ../src/geekos/crc32.c ../include/geekos/crc32.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/kassert.h ../include/geekos/screen.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/serial.h ../include/geekos/irq.h \
+  ../include/geekos/int.h ../include/geekos/defs.h \
+  ../include/geekos/string.h ../include/geekos/../libc/string.h \
+  ../include/geekos/io.h
+geekos/gdt.o: ../src/geekos/gdt.c ../include/geekos/kassert.h \
+  ../include/geekos/screen.h ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/segment.h ../include/geekos/int.h \
+  ../include/geekos/defs.h ../include/geekos/tss.h \
+  ../include/geekos/gdt.h ../include/libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h
+geekos/tss.o: ../src/geekos/tss.c ../include/geekos/kassert.h \
+  ../include/geekos/screen.h ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/defs.h ../include/geekos/gdt.h \
+  ../include/geekos/segment.h ../include/geekos/string.h \
+  ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/tss.h ../include/geekos/serial.h \
+  ../include/geekos/irq.h ../include/geekos/int.h ../include/geekos/io.h
+geekos/segment.o: ../src/geekos/segment.c ../include/geekos/kassert.h \
+  ../include/geekos/screen.h ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/string.h ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/tss.h ../include/geekos/segment.h
+geekos/bget.o: ../src/geekos/bget.c ../include/geekos/string.h \
+  ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/kassert.h ../include/geekos/screen.h \
+  ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/bget.h
+geekos/malloc.o: ../src/geekos/malloc.c ../include/geekos/screen.h \
+  ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/int.h ../include/geekos/kassert.h \
+  ../include/geekos/defs.h ../include/geekos/bget.h \
+  ../include/geekos/malloc.h
+geekos/synch.o: ../src/geekos/synch.c ../include/geekos/kthread.h \
+  ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/list.h ../include/geekos/kassert.h \
+  ../include/geekos/screen.h ../include/geekos/fmtout.h \
+  ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/int.h ../include/geekos/defs.h \
+  ../include/geekos/synch.h
+geekos/kthread.o: ../src/geekos/kthread.c ../include/geekos/kassert.h \
+  ../include/geekos/screen.h ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/defs.h ../include/geekos/int.h \
+  ../include/geekos/mem.h ../include/geekos/list.h \
+  ../include/geekos/paging.h ../include/geekos/bootinfo.h \
+  ../include/geekos/symbol.h ../include/geekos/string.h \
+  ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/kthread.h ../include/geekos/malloc.h \
+  ../include/geekos/serial.h ../include/geekos/irq.h \
+  ../include/geekos/io.h
+geekos/vm_cons.o: ../src/geekos/vm_cons.c ../include/geekos/fmtout.h \
+  ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/string.h ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/idt.h ../include/geekos/int.h \
+  ../include/geekos/kassert.h ../include/geekos/screen.h \
+  ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/defs.h ../include/geekos/vm_cons.h \
+  ../include/geekos/io.h
+geekos/debug.o: ../src/geekos/debug.c ../include/geekos/string.h \
+  ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/debug.h ../include/geekos/fmtout.h \
+  ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/vm_cons.h ../include/geekos/io.h \
+  ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/screen.h
+geekos/serial.o: ../src/geekos/serial.c ../include/geekos/serial.h \
+  ../include/geekos/irq.h ../include/geekos/int.h \
+  ../include/geekos/kassert.h ../include/geekos/screen.h \
+  ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/defs.h ../include/geekos/string.h \
+  ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/io.h ../include/geekos/reboot.h \
+  ../include/geekos/gdt.h ../include/geekos/idt.h
+geekos/reboot.o: ../src/geekos/reboot.c ../include/geekos/reboot.h \
+  ../include/libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h
+geekos/paging.o: ../src/geekos/paging.c ../include/geekos/string.h \
+  ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/int.h ../include/geekos/kassert.h \
+  ../include/geekos/screen.h ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/defs.h ../include/geekos/idt.h \
+  ../include/geekos/kthread.h ../include/geekos/list.h \
+  ../include/geekos/mem.h ../include/geekos/paging.h \
+  ../include/geekos/bootinfo.h ../include/geekos/malloc.h \
+  ../include/geekos/gdt.h ../include/geekos/segment.h \
+  ../include/geekos/crc32.h ../include/geekos/debug.h
+geekos/main.o: ../src/geekos/main.c ../include/geekos/bootinfo.h \
+  ../include/geekos/string.h ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/screen.h ../include/geekos/ktypes.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdbool.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/geekos/mem.h ../include/geekos/defs.h \
+  ../include/geekos/list.h ../include/geekos/kassert.h \
+  ../include/geekos/paging.h ../include/geekos/crc32.h \
+  ../include/geekos/tss.h ../include/geekos/int.h \
+  ../include/geekos/kthread.h ../include/geekos/trap.h \
+  ../include/geekos/timer.h ../include/geekos/keyboard.h \
+  ../include/geekos/io.h ../include/geekos/serial.h \
+  ../include/geekos/irq.h ../include/geekos/reboot.h \
+  ../include/geekos/ide.h ../include/geekos/vm_cons.h \
+  ../include/geekos/debug.h ../include/geekos/gdt.h
+common/fmtout.o: ../src/common/fmtout.c \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h \
+  ../include/geekos/string.h ../include/geekos/../libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/limits.h \
+  ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h
+common/string.o: ../src/common/string.c ../include/libc/fmtout.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stdarg.h \
+  ../include/libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h
+common/memmove.o: ../src/common/memmove.c ../include/libc/string.h \
+  /home/jarusl/palacios/devtools/i386/lib/gcc/i386-elf/3.4.6/include/stddef.h
index bd23614..230300b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * x86 port IO routines
  * Copyright (c) 2001, David H. Hovemeyer <daveho@cs.umd.edu>
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
  * 
  * This is free software.  You are permitted to use,
  * redistribute, and modify it as specified in the file "COPYING".
@@ -18,6 +18,9 @@ uchar_t In_Byte(ushort_t port);
 void Out_Word(ushort_t port, ushort_t value);
 ushort_t In_Word(ushort_t port);
 
+void Out_DWord(ushort_t port, uint_t value);
+uint_t In_DWord(ushort_t port);
+
 void IO_Delay(void);
 
 #endif  /* GEEKOS_IO_H */
index 11b7531..72e9c73 100644 (file)
@@ -112,11 +112,11 @@ static __inline__ ulong_t Get_Page_Fault_Address(void)
     return faultAddress;
 }
 
-void SerialPrintPD(pde_t *pde);
-void SerialPrintPT(void *starting_address, pte_t *pte);
-void SerialPrintPDE(void *virtual_address, pde_t *pde);
-void SerialPrintPTE(void *virtual_address,pte_t *pte);
-void SerialDumpPageTables(pde_t *pde);
+void PrintPD(pde_t *pde);
+void PrintPT(void *starting_address, pte_t *pte);
+void PrintPDE(void *virtual_address, pde_t *pde);
+void PrintPTE(void *virtual_address,pte_t *pte);
+void DumpPageTables(pde_t *pde);
 
 pte_t *LookupPage(void *vaddr);
 
index 241fc6f..8bd39a5 100644 (file)
@@ -11,6 +11,7 @@
 #define GEEKOS_SCREEN_H
 
 #include <geekos/ktypes.h>
+#include <geekos/fmtout.h>
 
 #define BLACK   0
 #define BLUE    1
@@ -51,7 +52,7 @@ void Put_Char(int c);
 void Put_String(const char* s);
 void Put_Buf(const char* buf, ulong_t length);
 void Print(const char* fmt, ...) __attribute__ ((format (printf, 1, 2)));
-
+void PrintList(const char * fmt, va_list ap);
 #endif  /* GEEKOS */
 
 #endif  /* GEEKOS_SCREEN_H */
index 4ebe0b0..9b7b133 100644 (file)
 #define DEFAULT_SERIAL_ADDR 0x3F8
 
 
-#ifndef SERIAL_PRINT
-#define SERIAL_PRINT              1
-#endif
-#ifndef SERIAL_PRINT_DEBUG
-#define SERIAL_PRINT_DEBUG        1 
-#endif
-#ifndef SERIAL_PRINT_DEBUG_LEVEL
-#define SERIAL_PRINT_DEBUG_LEVEL  10
-#endif
-
-#define SERIAL_PRINT_MAXBUF       256
-
-#if SERIAL_PRINT                                                
-#define SerialPrint(format, args...)                             \
-do {                                                             \
-  char buf[SERIAL_PRINT_MAXBUF];                                                 \
-  snprintf( buf, SERIAL_PRINT_MAXBUF, format, ## args ) ;                       \
-  SerialPutLineN(buf, SERIAL_PRINT_MAXBUF);                                     \
-} while (0)  
-#else
-#define SerialPrint(format, args...) do {} while (0)
-#endif
-
-
-#define PrintBoth(format, args...) \
-do {  \
-  Print(format, ## args); \
-  SerialPrint(format, ##args); \
- } while (0)
-
-
-#if SERIAL_PRINT_DEBUG
-#define SerialPrintLevel(level, format, args...)                \
-do {                                                             \
-  char buf[SERIAL_PRINT_MAXBUF];                                                 \
-  if (level >= SERIAL_PRINT_DEBUG_LEVEL  ) {                                     \
-    snprintf( buf, SERIAL_PRINT_MAXBUF, format, ## args ) ;            \
-    SerialPutLineN(buf, SERIAL_PRINT_MAXBUF);                          \
-  }                                                                     \
-} while (0)  
-#else
-#define SerialPrintLevel(level, format, args...) do {} while (0)
-#endif
 
+void SerialPrint(const char * format, ...);
+void SerialPrintList(const char * format, va_list ap);
 
 void SerialPutLine(char * line); 
 void SerialPutLineN(char * line, int len);
index 0165c3b..2107e07 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <geekos/crc32.h>
 #include <geekos/kassert.h>
-#include <geekos/serial.h>
+#include <geekos/debug.h>
 
 #define POLYNOMIAL (ulong_t)0xedb88320
 static ulong_t crc_table[256];
index 5e23989..1000996 100644 (file)
@@ -10,7 +10,7 @@
 #include <geekos/kassert.h>
 #include <geekos/defs.h>
 #include <geekos/idt.h>
-#include <geekos/serial.h>
+#include <geekos/debug.h>
 
 /* ----------------------------------------------------------------------
  * Private data and functions
@@ -42,37 +42,17 @@ Interrupt_Handler g_interruptTable[ NUM_IDT_ENTRIES ];
 
 
 
-void DumpIDT()
-{
-  int i;
-  Print("IDT Contents:\n");
 
-  for (i=0;i<NUM_IDT_ENTRIES/16;i++) { 
-    if (s_IDT[i].ig.present) { 
-      Print("%d: segmentselector=%u, offset=%u, offsetLow=%u, segmentSelector=%u, reserved=%u, signature=%u, dpl=%u, present=%u, offsetHigh=%u\n",
-           i,
-           s_IDT[i].ig.segmentSelector,
-           (s_IDT[i].ig.offsetHigh<<16) + s_IDT[i].ig.offsetLow,
-           s_IDT[i].ig.offsetLow,
-           s_IDT[i].ig.segmentSelector,
-           s_IDT[i].ig.reserved,
-           s_IDT[i].ig.signature,
-           s_IDT[i].ig.dpl,
-           s_IDT[i].ig.present,
-           s_IDT[i].ig.offsetHigh);
-    }
-  }
-}
 
 
-void SerialDumpIDT()
+void DumpIDT()
 {
   int i;
-  SerialPrint("IDT Contents:\n");
+  PrintBoth("IDT Contents:\n");
 
   for (i=0;i<NUM_IDT_ENTRIES;i++) { 
     if (s_IDT[i].ig.present) { 
-      SerialPrint("%d: segmentselector=%u, offset=%u, offsetLow=%u, segmentSelector=%u, reserved=%u, signature=%u, dpl=%u, present=%u, offsetHigh=%u\n",
+      PrintBoth("%d: segmentselector=%u, offset=%u, offsetLow=%u, segmentSelector=%u, reserved=%u, signature=%u, dpl=%u, present=%u, offsetHigh=%u\n",
            i,
            s_IDT[i].ig.segmentSelector,
            (s_IDT[i].ig.offsetHigh<<16) + s_IDT[i].ig.offsetLow,
@@ -83,7 +63,7 @@ void SerialDumpIDT()
            s_IDT[i].ig.dpl,
            s_IDT[i].ig.present,
            s_IDT[i].ig.offsetHigh);
-      SerialPrint("\n");
+      PrintBoth("\n");
     }
   }
 }
index 2c59a5f..4d32039 100644 (file)
@@ -11,7 +11,8 @@
 #include <geekos/screen.h>
 #include <geekos/kassert.h>
 #include <geekos/int.h>
-#include <geekos/serial.h>
+#include <geekos/irq.h>
+#include <geekos/debug.h>
 
 #include <geekos/cpu.h>
 
@@ -33,8 +34,7 @@ static void Dummy_Interrupt_Handler(struct Interrupt_State* state)
 {
   Begin_IRQ(state);
 
-  Print("Unexpected Interrupt!  Ignoring!\n");
-  SerialPrint("*** Unexpected interrupt! *** Ignoring!\n");
+  PrintBoth("*** Unexpected interrupt! *** Ignoring!\n");
   Dump_Interrupt_State(state);
 
   End_IRQ(state);
@@ -42,19 +42,14 @@ static void Dummy_Interrupt_Handler(struct Interrupt_State* state)
   //  STOP();
 }
 
-#if 0
+
 static void Print_Selector(const char* regName, uint_t value)
 {
-    Print("%s: index=%d, ti=%d, rpl=%d\n",
+    PrintBoth("%s: index=%d, ti=%d, rpl=%d\n",
        regName, value >> 3, (value >> 2) & 1, value & 3);
 }
-#endif
 
-static void SerialPrint_Selector(const char* regName, uint_t value)
-{
-    SerialPrint("%s: index=%d, ti=%d, rpl=%d\n",
-       regName, value >> 3, (value >> 2) & 1, value & 3);
-}
+
 
 /* ----------------------------------------------------------------------
  * Public functions
@@ -100,7 +95,7 @@ void Dump_Interrupt_State(struct Interrupt_State* state)
 {
     uint_t errorCode = state->errorCode;
 
-   SerialPrint("eax=%08x ebx=%08x ecx=%08x edx=%08x\n"
+   PrintBoth("eax=%08x ebx=%08x ecx=%08x edx=%08x\n"
           "esi=%08x edi=%08x ebp=%08x\n"
           "eip=%08x cs=%08x eflags=%08x\n"
           "Interrupt number=%d, error code=%d\n"
@@ -113,11 +108,11 @@ void Dump_Interrupt_State(struct Interrupt_State* state)
     );
     if (Is_User_Interrupt(state)) {
        struct User_Interrupt_State *ustate = (struct User_Interrupt_State*) state;
-       SerialPrint("user esp=%08x, user ss=%08x\n", ustate->espUser, ustate->ssUser);
+       PrintBoth("user esp=%08x, user ss=%08x\n", ustate->espUser, ustate->ssUser);
     }
-    SerialPrint_Selector("cs", state->cs);
-    SerialPrint_Selector("ds", state->ds);
-    SerialPrint_Selector("es", state->es);
-    SerialPrint_Selector("fs", state->fs);
-    SerialPrint_Selector("gs", state->gs);
+    Print_Selector("cs", state->cs);
+    Print_Selector("ds", state->ds);
+    Print_Selector("es", state->es);
+    Print_Selector("fs", state->fs);
+    Print_Selector("gs", state->gs);
 }
index 70b9f50..1310cdc 100644 (file)
@@ -21,14 +21,11 @@ void Out_Byte(ushort_t port, uchar_t value)
     );
 }
 
-extern uchar_t InByteLL(ushort_t port);
-
 /*
  * Read a byte from an I/O port.
  */
 uchar_t In_Byte(ushort_t port)
 {
-  /*
     uchar_t value;
 
     __asm__ __volatile__ (
@@ -38,9 +35,6 @@ uchar_t In_Byte(ushort_t port)
     );
 
     return value;
-  */
-
-  return InByteLL(port);
 }
 
 /*
@@ -56,7 +50,7 @@ void Out_Word(ushort_t port, ushort_t value)
 }
 
 /*
- * Read a byte from an I/O port.
+ * Read a word from an I/O port.
  */
 ushort_t In_Word(ushort_t port)
 {
@@ -72,6 +66,34 @@ ushort_t In_Word(ushort_t port)
 }
 
 /*
+ * Write a double word to an I/O port.
+ */
+void Out_DWord(ushort_t port, uint_t value)
+{
+    __asm__ __volatile__ (
+       "outl %0, %1"
+       :
+       : "a" (value), "Nd" (port)
+    );
+}
+
+/*
+ * Read a double word from an I/O port.
+ */
+uint_t In_DWord(ushort_t port)
+{
+    uint_t value;
+
+    __asm__ __volatile__ (
+       "inl %1, %0"
+       : "=a" (value)
+       : "Nd" (port)
+    );
+
+    return value;
+}
+
+/*
  * Short delay.  May be needed when talking to some
  * (slow) I/O devices.
  */
index e2a6df2..7ccec20 100644 (file)
@@ -16,7 +16,7 @@
 #include <geekos/string.h>
 #include <geekos/kthread.h>
 #include <geekos/malloc.h>
-#include <geekos/serial.h>
+#include <geekos/debug.h>
 
 /* ----------------------------------------------------------------------
  * Private data
index 9d48319..177771a 100644 (file)
@@ -9,6 +9,7 @@
  * redistribute, and modify it as specified in the file "COPYING".
  */
 
+#include <geekos/debug.h>
 #include <geekos/bootinfo.h>
 #include <geekos/string.h>
 #include <geekos/screen.h>
 #include <geekos/mem.h>
 #include <geekos/paging.h>
 #include <geekos/ide.h>
-
+#include <geekos/vm_cons.h>
+#include <geekos/pci.h>
 #include <geekos/gdt.h>
 
 
+
+#define TEST_PAGING 0
+#define TEST_PCI 1
+
 /*
   static inline unsigned int cpuid_ecx(unsigned int op)
   {
@@ -186,12 +192,10 @@ void Keyboard_Listener(ulong_t arg) {
 
   while ((key_press = Wait_For_Key())) {    
     if (key_press == KEY_F4) {
-      Print("\nToggling Speaker Port\n");
-      SerialPrintLevel(100,"\nToggling Speaker Port\n");
+      PrintBoth("\nToggling Speaker Port\n");
       *doIBuzz = (*doIBuzz + 1) % 2;
     } else if (key_press == KEY_F5) {
-      Print("\nMachine Restart\n");
-      SerialPrintLevel(100,"\nMachine Restart\n");
+      PrintBoth("\nMachine Restart\n");
       machine_real_restart();
     }
   }
@@ -245,6 +249,8 @@ void Main(struct Boot_Info* bootInfo)
   Init_BSS();
   Init_Screen();
   InitSerial();
+
+  Init_VMCons();
   Init_Mem(bootInfo);
   Init_CRC32();
   Init_TSS();
@@ -265,17 +271,17 @@ void Main(struct Boot_Info* bootInfo)
 
 
 
-  SerialPrint("\n\nHello, Welcome to this horrid output-only serial interface\n");
-  SerialPrint("Eventually, this will let us control the VMM\n\n");
+  PrintBoth("\n\nHello, Welcome to this horrid output-only serial interface\n");
+  PrintBoth("Eventually, this will let us control the VMM\n\n");
  
-  SerialPrint("\n\n===>");
+  PrintBoth("\n\n===>");
   
 
 
   
 
   
-  SerialPrintLevel(1000,"Launching Noisemaker and keyboard listener threads\n");
+  PrintBoth("Launching Noisemaker and keyboard listener threads\n");
   
   key_thread = Start_Kernel_Thread(Keyboard_Listener, (ulong_t)&doIBuzz, PRIORITY_NORMAL, false);
   spkr_thread = Start_Kernel_Thread(Buzzer, (ulong_t)&doIBuzz, PRIORITY_NORMAL, false);
@@ -284,22 +290,31 @@ void Main(struct Boot_Info* bootInfo)
 
 
 
-  SerialPrintLevel(1000,"Next: setup GDT\n");
+  PrintBoth("Next: setup GDT\n");
 
-  {
-    int i = 0;
-    for (i = 0; i < 1024; i++) {
-      uint_t * addr = (uint_t *)0xa00000;
-      uint_t foo = *addr;
 
-      SerialPrint("Read From 0x%x=%d\n", (uint_t)addr, foo);
-    }
+  if (TEST_PAGING) {
+      int i = 0;
+      for (i = 0; i < 1024; i++) {
+         uint_t * addr = (uint_t *)0xa00000;
+         uint_t foo = *addr;
+         
+         PrintBoth("Read From 0x%x=%d\n", (uint_t)addr, foo);
+      }
 
+      
+      //  Invalidate_PG((void *)0x2000);
+      
+      //  VM_Test(bootInfo, 32);  
+      //VM_Test(bootInfo, 1536);
   }
-  //  Invalidate_PG((void *)0x2000);
 
-  //  VM_Test(bootInfo, 32);  
-  //VM_Test(bootInfo, 1536);
+
+  if (TEST_PCI) {
+      Init_PCI();
+
+
+  }
 
   while(1);
   
index d82f785..1a9778e 100644 (file)
@@ -22,7 +22,7 @@
 //#include <geekos/vfs.h>
 #include <geekos/crc32.h>
 #include <geekos/paging.h>
-#include <geekos/serial.h>
+#include <geekos/debug.h>
 
 
 /* ----------------------------------------------------------------------
  * flag to indicate if debugging paging code
  */
 int debugFaults = 0;
-#define Debug(args...) if (debugFaults) Print(args)
+#define Debug(args...) if (debugFaults) PrintBoth(args)
 
 
 
-void SerialPrintPD(pde_t *pde)
+void PrintPD(pde_t *pde)
 {
   uint_t i;
 
-  SerialPrint("Page Directory at %p:\n",pde);
+  PrintBoth("Page Directory at %p:\n",pde);
   for (i = 0; i < NUM_PAGE_DIR_ENTRIES; i++) { 
     if (pde[i].present) {
       if ((i * PAGE_SIZE * 1024) > 0x40000000) {
-       SerialPrintPDE((void*)(PAGE_SIZE*NUM_PAGE_TABLE_ENTRIES*i),&(pde[i]));
+       PrintPDE((void*)(PAGE_SIZE*NUM_PAGE_TABLE_ENTRIES*i),&(pde[i]));
       }
     }
   }
 }
 
-void SerialPrintPT(void *starting_address, pte_t *pte) 
+void PrintPT(void *starting_address, pte_t *pte) 
 {
   int i;
 
-  SerialPrint("Page Table at %p:\n",pte);
+  PrintBoth("Page Table at %p:\n",pte);
   for (i=0;i<NUM_PAGE_TABLE_ENTRIES;i++) { 
     if (pte[i].present) {
-      SerialPrintPTE(starting_address + PAGE_SIZE*i,&(pte[i]));
+      PrintPTE(starting_address + PAGE_SIZE*i,&(pte[i]));
     }
   }
 }
 
 
-void SerialPrintPDE(void *virtual_address, pde_t *pde)
+void PrintPDE(void *virtual_address, pde_t *pde)
 {
-  SerialPrint("PDE %p -> %p : present=%x, flags=%x, accessed=%x, reserved=%x, largePages=%x, globalPage=%x, kernelInfo=%x\n",
+  Print("PDE %p -> %p : present=%x, flags=%x, accessed=%x, reserved=%x, largePages=%x, globalPage=%x, kernelInfo=%x\n",
              virtual_address,
              (void*) (pde->pageTableBaseAddr << PAGE_POWER),
              pde->present,
@@ -84,9 +84,9 @@ void SerialPrintPDE(void *virtual_address, pde_t *pde)
              pde->kernelInfo);
 }
   
-void SerialPrintPTE(void *virtual_address, pte_t *pte)
+void PrintPTE(void *virtual_address, pte_t *pte)
 {
-  SerialPrint("PTE %p -> %p : present=%x, flags=%x, accessed=%x, dirty=%x, pteAttribute=%x, globalPage=%x, kernelInfo=%x\n",
+  PrintBoth("PTE %p -> %p : present=%x, flags=%x, accessed=%x, dirty=%x, pteAttribute=%x, globalPage=%x, kernelInfo=%x\n",
              virtual_address,
              (void*)(pte->pageBaseAddr << PAGE_POWER),
              pte->present,
@@ -99,17 +99,17 @@ void SerialPrintPTE(void *virtual_address, pte_t *pte)
 }
 
 
-void SerialDumpPageTables(pde_t *pde)
+void DumpPageTables(pde_t *pde)
 {
   uint_t i;
   
-  SerialPrint("Dumping the pages starting with the pde page at %p\n",pde);
+  PrintBoth("Dumping the pages starting with the pde page at %p\n",pde);
 
   for (i = 0; i < NUM_PAGE_DIR_ENTRIES; i++) { 
     if (pde[i].present) {
       if ((i * PAGE_SIZE * 1024) >= 0x40000000) {
-       SerialPrintPDE((void *)(PAGE_SIZE * NUM_PAGE_TABLE_ENTRIES * i), &(pde[i]));
-       SerialPrintPT((void *)(PAGE_SIZE * NUM_PAGE_TABLE_ENTRIES * i), (void *)(pde[i].pageTableBaseAddr << PAGE_POWER));
+       PrintPDE((void *)(PAGE_SIZE * NUM_PAGE_TABLE_ENTRIES * i), &(pde[i]));
+       PrintPT((void *)(PAGE_SIZE * NUM_PAGE_TABLE_ENTRIES * i), (void *)(pde[i].pageTableBaseAddr << PAGE_POWER));
       }
     }
   }
@@ -137,20 +137,20 @@ static void Print_Fault_Info(uint_t address, faultcode_t faultCode)
 
     g_freePageCount+=0;
 
-    SerialPrintLevel(100,"Pid %d, Page Fault received, at address %x (%d pages free)\n",
+    PrintBoth("Pid %d, Page Fault received, at address %x (%d pages free)\n",
         g_currentThread->pid, address, g_freePageCount);
     if (faultCode.protectionViolation)
-        SerialPrintLevel(100,"   Protection Violation, ");
+       PrintBoth("   Protection Violation, ");
     else
-        SerialPrintLevel(100,"   Non-present page, ");
+        PrintBoth("   Non-present page, ");
     if (faultCode.writeFault)
-        SerialPrintLevel(100,"Write Fault, ");
+       PrintBoth("Write Fault, ");
     else
-        SerialPrintLevel(100,"Read Fault, ");
+        PrintBoth("Read Fault, ");
     if (faultCode.userModeFault)
-        SerialPrintLevel(100,"in User Mode\n");
+        PrintBoth("in User Mode\n");
     else
-        SerialPrintLevel(100,"in Supervisor Mode\n");
+        PrintBoth("in Supervisor Mode\n");
 }
 
 /*
@@ -167,13 +167,13 @@ static void Print_Fault_Info(uint_t address, faultcode_t faultCode)
 
     /* Get the address that caused the page fault */
     address = Get_Page_Fault_Address();
-    Debug("Page fault @%lx\n", address);
+    PrintBoth("Page fault @%lx\n", address);
 
     /* Get the fault code */
     faultCode = *((faultcode_t *) &(state->errorCode));
 
     /* rest of your handling code here */
-    SerialPrintLevel(100,"Unexpected Page Fault received\n");
+    PrintBoth("Unexpected Page Fault received\n");
     Print_Fault_Info(address, faultCode);
     Dump_Interrupt_State(state);
     /* user faults just kill the process */
@@ -205,24 +205,24 @@ void Init_VM(struct Boot_Info *bootInfo)
   PrintBoth("Intitialing Virtual Memory\n");
 
   if (checkPaging()) { 
-    SerialPrintLevel(100,"Paging is currently ON\n");
+      PrintBoth("Paging is currently ON\n");
     return ;
   }
 
-  SerialPrintLevel(100,"Paging is currently OFF - initializing the pages for a 1-1 map\n");
+  PrintBoth("Paging is currently OFF - initializing the pages for a 1-1 map\n");
   
   numpages=bootInfo->memSizeKB / (PAGE_SIZE/1024);
   numpagetables = numpages / NUM_PAGE_TABLE_ENTRIES + ((numpages % NUM_PAGE_TABLE_ENTRIES) != 0 );
 
-  SerialPrintLevel(100,"We need %d pages, and thus %d page tables, and one page directory\n",numpages, numpagetables);
+  PrintBoth("We need %d pages, and thus %d page tables, and one page directory\n",numpages, numpagetables);
   
   pd = (pde_t*)Alloc_Page();
   
   if (!pd) { 
-    SerialPrintLevel(100,"We are giving up since we can't allocate a page directory!\n");
+      PrintBoth("We are giving up since we can't allocate a page directory!\n");
     return;
   } else {
-    SerialPrintLevel(100,"Our PDE is at physical address %p\n",pd);
+      PrintBoth("Our PDE is at physical address %p\n",pd);
   }
   
   for (i=0;i<NUM_PAGE_DIR_ENTRIES;i++) { 
@@ -238,9 +238,9 @@ void Init_VM(struct Boot_Info *bootInfo)
     } else {
       pt = (pte_t*)Alloc_Page();
       if (!pt) { 
-       SerialPrintLevel(100,"We are giving up since we can't allocate page table %d\n",i);
+         PrintBoth("We are giving up since we can't allocate page table %d\n",i);
       } else {
-       //SerialPrintLevel(100,"Page Table %d is at physical address %p\n",i,pt);
+       //PrintBoth("Page Table %d is at physical address %p\n",i,pt);
       }
       pd[i].present=1;
       pd[i].flags= VM_READ | VM_WRITE | VM_EXEC | VM_USER;
@@ -276,14 +276,14 @@ void Init_VM(struct Boot_Info *bootInfo)
   }
 
 
-  SerialPrintLevel(100,"Done creating 1<->1 initial page tables\n");
-  SerialPrintLevel(100,"Now installing page fault handler\n");
+  PrintBoth("Done creating 1<->1 initial page tables\n");
+  PrintBoth("Now installing page fault handler\n");
   //  SerialDumpPageTables(pd);
   Install_Interrupt_Handler(14,Page_Fault_Handler);
-  SerialPrintLevel(100,"Now turning on the paging bit!\n");
+  PrintBoth("Now turning on the paging bit!\n");
   Enable_Paging(pd);
-  SerialPrintLevel(100,"We are still alive after paging turned on!\n");
-  SerialPrintLevel(100,"checkPaging returns %d\n",checkPaging());
+  PrintBoth("We are still alive after paging turned on!\n");
+  PrintBoth("checkPaging returns %d\n",checkPaging());
 }
 
 
@@ -361,7 +361,7 @@ void VM_Test(struct Boot_Info *bootInfo, uint_t num_test_pages) {
   PrintBoth("Loading CR3\n");
   Set_PDBR(pd);
 
-  SerialDumpPageTables(pd);
+  DumpPageTables(pd);
 
   PrintBoth("Writing to Test Area\n");
 
@@ -369,7 +369,7 @@ void VM_Test(struct Boot_Info *bootInfo, uint_t num_test_pages) {
   uint_t * test_ptr = (uint_t *)two_gig;
   for (i = 0; i < num_test_pages; i++) {
 
-    SerialPrint("Writing %d to %p\n", i, test_ptr);
+    PrintBoth("Writing %d to %p\n", i, test_ptr);
     *test_ptr = (uint_t)i;
     test_ptr += PAGE_SIZE / 4;
   }
@@ -395,7 +395,7 @@ void VM_Test(struct Boot_Info *bootInfo, uint_t num_test_pages) {
   Set_PDBR(pd);
   
   PrintBoth("Page Mapping Reversed\n");
-  SerialDumpPageTables(pd);
+  DumpPageTables(pd);
 
 
   PrintBoth("Page Consistency Check\n");
index 9c78dde..077112f 100644 (file)
@@ -518,6 +518,12 @@ static struct Output_Sink s_outputSink = { &Print_Emit, &Print_Finish };
  * Print to console using printf()-style formatting.
  * Calls into Format_Output in common library.
  */
+
+static __inline__ void PrintInternal(const char * format, va_list ap) {
+    Format_Output(&s_outputSink, format, ap);
+}
+
+
 void Print(const char *fmt, ...)
 {
     va_list args;
@@ -525,9 +531,14 @@ void Print(const char *fmt, ...)
     bool iflag = Begin_Int_Atomic();
 
     va_start(args, fmt);
-    Format_Output(&s_outputSink, fmt, args);
+    PrintInternal(fmt, args);
     va_end(args);
 
     End_Int_Atomic(iflag);
 }
 
+void PrintList(const char * fmt, va_list ap) {
+    bool iflag = Begin_Int_Atomic();
+    PrintInternal(fmt, ap);
+    End_Int_Atomic(iflag);
+}
index 68ef275..0729501 100644 (file)
@@ -38,12 +38,6 @@ static void Serial_Interrupt_Handler(struct Interrupt_State * state) {
   End_IRQ(state);
 }
 
-void InitSerial() {
-  Print("Initialzing Serial\n");
-  Install_IRQ(COM1_IRQ, Serial_Interrupt_Handler);
-  Enable_IRQ(COM1_IRQ);
-  InitSerialAddr(DEFAULT_SERIAL_ADDR);
-}
 
 void InitSerialAddr(unsigned short io_addr) {
   serial_io_addr = io_addr;
@@ -138,3 +132,47 @@ void SerialMemDump(unsigned char *start, int n)
     SerialPrint("\n");
   }
 }
+
+
+static struct Output_Sink serial_output_sink;
+static void Serial_Emit(struct Output_Sink * o, int ch) { 
+  SerialPutChar((unsigned char)ch); 
+}
+static void Serial_Finish(struct Output_Sink * o) { return; }
+
+
+static void __inline__ SerialPrintInternal(const char * format, va_list ap) {
+  Format_Output(&serial_output_sink, format, ap);
+}
+
+
+void SerialPrint(const char * format, ...) {
+  va_list args;
+  bool iflag = Begin_Int_Atomic();
+
+  va_start(args, format);
+  SerialPrintInternal(format, args);
+  va_end(args);
+
+  End_Int_Atomic(iflag);
+}
+
+void SerialPrintList(const char * format, va_list ap) {
+  bool iflag = Begin_Int_Atomic();
+  SerialPrintInternal(format, ap);
+  End_Int_Atomic(iflag);
+
+}
+
+
+
+void InitSerial() {
+  Print("Initialzing Serial\n");
+
+  serial_output_sink.Emit = &Serial_Emit;
+  serial_output_sink.Finish = &Serial_Finish;
+
+  Install_IRQ(COM1_IRQ, Serial_Interrupt_Handler);
+  Enable_IRQ(COM1_IRQ);
+  InitSerialAddr(DEFAULT_SERIAL_ADDR);
+}
index b3120d3..2ac3a51 100644 (file)
@@ -15,7 +15,7 @@
 #include <geekos/kthread.h>
 #include <geekos/timer.h>
 
-#include <geekos/serial.h>
+#include <geekos/debug.h>
 
 #define HZ 100
 
@@ -69,7 +69,7 @@ static void Timer_Interrupt_Handler(struct Interrupt_State* state)
 
     Begin_IRQ(state);
 
-    SerialPrintLevel(10,"Host Timer Interrupt Handler Running\n");
+    PrintBoth("Host Timer Interrupt Handler Running\n");
 
     /* Update global and per-thread number of ticks */
     ++g_numTicks;
index 2085a99..7932c9a 100644 (file)
@@ -11,7 +11,7 @@
 #include <geekos/kthread.h>
 #include <geekos/defs.h>
 #include <geekos/trap.h>
-#include <geekos/serial.h>
+#include <geekos/debug.h>
 
 /*
  * TODO: need to add handlers for other exceptions (such as bounds
@@ -25,7 +25,7 @@
 static void GPF_Handler(struct Interrupt_State* state)
 {
     /* Send the thread to the reaper... */
-  SerialPrintLevel(1000,"Exception %d received, killing thread %p\n",state->intNum, g_currentThread);
+    PrintBoth("Exception %d received, killing thread %p\n",state->intNum, g_currentThread);
   Dump_Interrupt_State(state);
   
   Exit(-1);
index b97a844..2cdb968 100644 (file)
@@ -19,7 +19,7 @@
 #include <geekos/string.h>
 #include <geekos/tss.h>
 
-#include <geekos/serial.h>
+#include <geekos/debug.h>
 
 /*
  * We use one TSS in GeekOS.