PROJECT_ROOT := ..
VPATH := $(PROJECT_ROOT)/src
- #when -DNDEBUG is set the kassert functions are disabled
- #JRLDEBUG=-DNDEBUG
-ifeq ($(DEBUG_SERIAL),1)
-JRL_DEBUG := -DDEBUG_SERIAL
-endif
+
+
+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)
ifeq ($(findstring CYGWIN,$(SYSTEM_NAME)),CYGWIN)
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
# ----------------------------------------------------------------------
# Flags used for all C source files
-GENERAL_OPTS := -O -Wall $(EXTRA_C_OPTS) $(JRL_DEBUG)
++
+GENERAL_OPTS := -O -Wall $(EXTRA_C_OPTS) $(JRLDEBUG)
CC_GENERAL_OPTS := $(GENERAL_OPTS) -Werror
# Flags used for kernel C source files
$(PAD) guest.img 1474560
guest-iso: guest-img
-
mkisofs -pad -b guest.img -R -o guest.iso guest.img
ifeq ($(DEBUG_ALL),1)
- DEBUG_SECTIONS:= $(DEBUG_SECTIONS) -DDEBUG_SHADOW_PAGING -DDEBUG_CTRL_REGS -DDEBUG_INTERRUPTS -DDEBUG_KEYBOARD -DDEBUG_PIC -DDEBUG_PIT -DDEBUG_NVRAM -DDEBUG_EMULATOR -DDEBUG_XED -DDEBUG_HALT -DDEBUG_DEV_MGR
- DEBUG_SECTIONS:= $(DEBUG_SECTIONS) -DDEBUG_SHADOW_PAGING -DDEBUG_NESTED_PAGING -DDEBUG_CTRL_REGS -DDEBUG_INTERRUPTS -DDEBUG_KEYBOARD -DDEBUG_PIC -DDEBUG_PIT -DDEBUG_NVRAM -DDEBUG_EMULATOR -DDEBUG_XED -DDEBUG_HALT -DDEBUG_DEV_MGR -DDEBUG_IO -DDEBUG_GENERIC -DDEBUG_RAMDISK
++ DEBUG_SECTIONS:= $(DEBUG_SECTIONS) -DDEBUG_SHADOW_PAGING -DDEBUG_NESTED_PAGING -DDEBUG_CTRL_REGS -DDEBUG_INTERRUPTS -DDEBUG_KEYBOARD -DDEBUG_PIC -DDEBUG_PIT -DDEBUG_NVRAM -DDEBUG_EMULATOR -DDEBUG_XED -DDEBUG_HALT -DDEBUG_DEV_MGR
+# -DDEBUG_IO -DDEBUG_GENERIC -DDEBUG_IDE
endif
ifeq ($(DEBUG_SHADOW_PAGING),0)
DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UDEBUG_SHADOW_PAGING
endif
+
+ endif
+ ifeq ($(DEBUG_NESTED_PAGING),1)
+ DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DDEBUG_NESTED_PAGING
+ else
+ ifeq ($(DEBUG_NESTED_PAGING),0)
+ DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UDEBUG_NESTED_PAGING
+ endif
endif
ifeq ($(DEBUG_CTRL_REGS),1)
endif
endif
-ifeq ($(DEBUG_RAMDISK),1)
-DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DDEBUG_RAMDISK
+ifeq ($(DEBUG_IDE),1)
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DDEBUG_IDE
else
-ifeq ($(DEBUG_RAMDISK),0)
-DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UDEBUG_RAMDISK
-endif
-endif
-
-ifeq ($(TRACE_RAMDISK),1)
-DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DTRACE_RAMDISK
-else
-ifeq ($(TRACE_RAMDSK),0)
-DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UTRACE_RAMDISK
+ifeq ($(DEBUG_IDE),0)
+DEBUG_SECTIONS := $(DEBUG_SECTIONS) -UDEBUG_IDE
endif
endif
palacios/vmm_debug.o \
palacios/svm_io.o \
palacios/vmm_intr.o \
+ palacios/vmm_excp.o \
palacios/vmm_time.o \
palacios/vmm_shadow_paging.o \
palacios/vm_guest_mem.o \
devices/8259a.o \
devices/8254.o \
devices/serial.o \
- devices/ramdisk.o \
- devices/cdrom.o \
devices/bochs_debug.o \
devices/os_debug.o \
devices/apic.o \
devices/io_apic.o \
devices/pci.o \
devices/para_net.o \
+ devices/ide.o \
+ devices/ram_cd.o \
+# devices/cdrom.o \
+# devices/ramdisk.o \
# devices/vnic.o \
$(DEVICES_OBJS) :: EXTRA_CFLAGS = \
ln -s -f ../src/vmboot/vgabios/VGABIOS-lgpl-latest.bin vgabios
- force_rombios: rombios_link
- (cd ../src/vmboot/rombios; make clean; make)
-
- force_vgabios: vgabios_link
- (cd ../src/vmboot/vgabios; make clean; make)
-
- force_payload: force_rombios force_vgabios
+ force_payload: rombios_link vgabios_link
../scripts/make_payload.pl payload_layout.txt vm_kernel
inter1: force_payload
uint32_t tmr_init_cnt;
+ struct local_vec_tbl_reg ext_intr_vec_tbl[4];
uint32_t rem_rd_data;
apic->lint1_vec_tbl.val = 0x00010000;
apic->err_vec_tbl.val = 0x00010000;
apic->tmr_div_cfg.val = 0x00000000;
+ //apic->ext_apic_feature.val = 0x00000007;
apic->ext_apic_feature.val = 0x00040007;
apic->ext_apic_ctrl.val = 0x00000000;
apic->spec_eoi.val = 0x00000000;
for (j = 7; j >= 0; j--) {
uchar_t flag = 0x1 << j;
if ((*svc_major) & flag) {
-
-
return ((i * 8) + j);
}
}
for (j = 7; j >= 0; j--) {
uchar_t flag = 0x1 << j;
if ((*req_major) & flag) {
-
-
return ((i * 8) + j);
}
}
#ifdef CRAY_XT
- if ((((i * 8) + j) == 238) ||
- (((i * 8) + j) == 239)) {
- PrintError("Acking IRQ %d\n", ((i * 8) + j));
+ if ((isr_irq == 238) ||
+ (isr_irq == 239)) {
+ PrintError("Acking IRQ %d\n", isr_irq);
}
- if (((i * 8) + j) == 238) {
+ if (isr_irq == 238) {
V3_ACK_IRQ(238);
}
#endif
// Unhandled Registers
case EXT_INT_LOC_VEC_TBL_OFFSET0:
+ val = apic->ext_intr_vec_tbl[0].val;
+ break;
case EXT_INT_LOC_VEC_TBL_OFFSET1:
+ val = apic->ext_intr_vec_tbl[1].val;
+ break;
case EXT_INT_LOC_VEC_TBL_OFFSET2:
+ val = apic->ext_intr_vec_tbl[2].val;
+ break;
case EXT_INT_LOC_VEC_TBL_OFFSET3:
+ val = apic->ext_intr_vec_tbl[3].val;
+ break;
+
+
case EXT_APIC_FEATURE_OFFSET:
case EXT_APIC_CMD_OFFSET:
case SEOI_OFFSET:
case IER_OFFSET7:
*(uint32_t *)(apic->int_en_reg + 28) = op_val;
break;
-
+
+ case EXT_INT_LOC_VEC_TBL_OFFSET0:
+ apic->ext_intr_vec_tbl[0].val = op_val;
+ break;
+ case EXT_INT_LOC_VEC_TBL_OFFSET1:
+ apic->ext_intr_vec_tbl[1].val = op_val;
+ break;
+ case EXT_INT_LOC_VEC_TBL_OFFSET2:
+ apic->ext_intr_vec_tbl[2].val = op_val;
+ break;
+ case EXT_INT_LOC_VEC_TBL_OFFSET3:
+ apic->ext_intr_vec_tbl[3].val = op_val;
+ break;
+
// Action Registers
case EOI_OFFSET:
case INT_CMD_LO_OFFSET:
case INT_CMD_HI_OFFSET:
// Unhandled Registers
- case EXT_INT_LOC_VEC_TBL_OFFSET0:
- case EXT_INT_LOC_VEC_TBL_OFFSET1:
- case EXT_INT_LOC_VEC_TBL_OFFSET2:
- case EXT_INT_LOC_VEC_TBL_OFFSET3:
+
case EXT_APIC_CMD_OFFSET:
case SEOI_OFFSET:
default:
case 0xec: // IDENTIFY DEVICE
case 0xa1:
{
-
-
controller->status.busy = 0;
controller->status.drive_ready = 1;
controller->status.write_fault = 0;
controller->status.seek_complete = 1;
controller->status.corrected_data = 0;
controller->status.err = 0;
-
+
/*
value32 = controller->buffer[index];
index++;
if (controller->buffer_index >= 512) {
controller->status.drq = 0;
}
-
+
return length;
}
case 0xa0: //send packet cmd
drive->id_drive[i] = 0;
}
- // now convert the id_drive array (native 256 word format) to
- // the controller buffer (512 bytes)
- Bit16u temp16;
- for (i = 0; i <= 255; i++) {
- temp16 = drive->id_drive[i];
- controller->buffer[i * 2] = temp16 & 0x00ff;
- controller->buffer[i * 2 + 1] = temp16 >> 8;
- }
return;
}
memset((char *)(channels + channel), 0, sizeof(struct channel_t));
}
*/
- PrintDebug("sizeof(*channels) = %d\n", sizeof(*channels));
- PrintDebug("sizeof(channles->drives[0].controller) = %d\n", sizeof((channels->drives[0].controller)));
- PrintDebug("sizeof(channles->drives[0].cdrom) = %d\n", sizeof((channels->drives[0].cdrom)));
- PrintDebug("sizeof(channles->drives[0].sense) = %d\n", sizeof((channels->drives[0].sense)));
- PrintDebug("sizeof(channles->drives[0].atapi) = %d\n", sizeof((channels->drives[0].atapi)));
- PrintDebug("sizeof(channles->drives[0].controller.status) = %d\n",
- sizeof((channels->drives[0].controller.status)));
- PrintDebug("sizeof(channles->drives[0].controller.sector_count) = %d\n",
- sizeof((channels->drives[0].controller.sector_count)));
- PrintDebug("sizeof(channles->drives[0].controller.interrupt_reason) = %d\n",
- sizeof((channels->drives[0].controller.interrupt_reason)));
-
- PrintDebug("sizeof(channles->drives[0].controller.cylinder_no) = %d\n",
- sizeof((channels->drives[0].controller.cylinder_no)));
- PrintDebug("sizeof(channles->drives[0].controller.byte_count) = %d\n",
- sizeof((channels->drives[0].controller.byte_count)));
-
-
- PrintDebug("sizeof(channles->drives[0].controller.control) = %d\n",
- sizeof((channels->drives[0].controller.control)));
-
for (channel = 0; channel < MAX_ATA_CHANNEL; channel++){
#include <devices/8254.h>
#include <devices/nvram.h>
#include <devices/generic.h>
-#include <devices/ramdisk.h>
-#include <devices/cdrom.h>
+#include <devices/ide.h>
+#include <devices/ram_cd.h>
#include <devices/bochs_debug.h>
#include <devices/os_debug.h>
#include <devices/apic.h>
v3_init_hypercall_map(info);
-
- if (v3_cpu_type == V3_SVM_REV3_CPU) {
+ if ((v3_cpu_type == V3_SVM_REV3_CPU) &&
+ (config_ptr->enable_nested_paging == 1)) {
+ PrintDebug("Guest Page Mode: NESTED_PAGING\n");
info->shdw_pg_mode = NESTED_PAGING;
} else {
+ PrintDebug("Guest Page Mode: SHADOW_PAGING\n");
v3_init_shadow_page_state(info);
info->shdw_pg_mode = SHADOW_PAGING;
}
static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ptr) {
- struct vm_device * ramdisk = NULL;
- struct vm_device * cdrom = NULL;
-#ifdef DEBUG_PCI
+ struct vm_device * ide = NULL;
+ struct vm_device * ram_cd = NULL;
struct vm_device * pci = v3_create_pci();
-#endif
struct vm_device * nvram = v3_create_nvram();
//struct vm_device * timer = v3_create_timer();
struct vm_device * pic = v3_create_pic();
int use_ramdisk = config_ptr->use_ramdisk;
int use_generic = USE_GENERIC;
+ ide = v3_create_ide(pci);
if (use_ramdisk) {
PrintDebug("Creating Ramdisk\n");
- ramdisk = v3_create_ramdisk();
- cdrom = v3_create_cdrom(ramdisk, config_ptr->ramdisk, config_ptr->ramdisk_size);
+ ram_cd = v3_create_ram_cd(ide, 0, 0,
+ (addr_t)(config_ptr->ramdisk),
+ config_ptr->ramdisk_size);
}
generic = configure_generic(info, config_ptr);
}
-#ifdef DEBUG_PCI
+
v3_attach_device(info, pci);
-#endif
v3_attach_device(info, nvram);
//v3_attach_device(info, timer);
v3_attach_device(info, para_net);
+ v3_attach_device(info, ide);
+
if (use_ramdisk) {
- v3_attach_device(info, ramdisk);
- v3_attach_device(info, cdrom);
+ v3_attach_device(info, ram_cd);
}
if (use_generic) {