X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Fvm.c;h=2a67e385d3a5a08d8d4cf7ea3990db65a2e1bea2;hb=1a8382a1bd0a4e537b28d7906399bee2bff043de;hp=fe50c29c7fae9b5eeb2d007a22cf095ab0f57c6d;hpb=d16ef42bba84c7fe88352e5dc23e5e70a5207e29;p=palacios.releases.git diff --git a/palacios/src/geekos/vm.c b/palacios/src/geekos/vm.c index fe50c29..2a67e38 100644 --- a/palacios/src/geekos/vm.c +++ b/palacios/src/geekos/vm.c @@ -5,21 +5,21 @@ #include #include +#include #include #include #include #include +#include #include #include #include +#include #define SPEAKER_PORT 0x61 - - - -inline void VM_Out_Byte(ushort_t port, uchar_t value) +static inline void VM_Out_Byte(ushort_t port, uchar_t value) { __asm__ __volatile__ ( "outb %b0, %w1" @@ -31,7 +31,7 @@ inline void VM_Out_Byte(ushort_t port, uchar_t value) /* * Read a byte from an I/O port. */ -inline uchar_t VM_In_Byte(ushort_t port) +static inline uchar_t VM_In_Byte(ushort_t port) { uchar_t value; @@ -46,6 +46,7 @@ inline uchar_t VM_In_Byte(ushort_t port) + int IO_Read(ushort_t port, void * dst, uint_t length, void * priv_data) { if (length != 1) { @@ -182,7 +183,7 @@ int RunVMM(struct Boot_Info * bootInfo) { os_hooks.paddr_to_vaddr = &Identity; os_hooks.hook_interrupt = &hook_irq_stub; os_hooks.ack_irq = &ack_irq; - + os_hooks.get_cpu_khz = &get_cpu_khz; Init_VMM(&os_hooks, &vmm_ops); @@ -190,6 +191,7 @@ int RunVMM(struct Boot_Info * bootInfo) { /* MOVE THIS TO AN INIT GUEST ROUTINE */ init_shadow_map(&(vm_info.mem_map)); init_shadow_page_state(&(vm_info.shdw_pg_state)); + v3_init_time(&(vm_info.time_state)); vm_info.page_mode = SHADOW_PAGING; vm_info.cpu_mode = REAL; @@ -304,7 +306,7 @@ int RunVMM(struct Boot_Info * bootInfo) { print_shadow_map(&(vm_info.mem_map)); hook_io_port(&(vm_info.io_map), 0x61, &IO_Read, &IO_Write, NULL); - hook_io_port(&(vm_info.io_map), 0x05, &IO_Read, &IO_Write_to_Serial, NULL); + //hook_io_port(&(vm_info.io_map), 0x05, &IO_Read, &IO_Write_to_Serial, NULL); hook_io_port(&(vm_info.io_map), 0x400, &IO_Read, &IO_Write_to_Serial, NULL); @@ -313,16 +315,27 @@ int RunVMM(struct Boot_Info * bootInfo) { hook_io_port(&(vm_info.io_map), 0x403, &IO_Read, &IO_Write_to_Serial, NULL); { + struct vm_device * nvram = create_nvram(); //struct vm_device * timer = create_timer(); struct vm_device * pic = create_pic(); struct vm_device * keyboard = create_keyboard(); + struct vm_device * pit = create_pit(); + + //generic_port_range_type range = {0,1024} ; // hook first 1024 ports if not already hooked + + //struct vm_device * generic = create_generic(&range,1,NULL,0,NULL,0); + attach_device(&(vm_info), nvram); //attach_device(&(vm_info), timer); attach_device(&(vm_info), pic); + attach_device(&(vm_info), pit); attach_device(&(vm_info), keyboard); + // Important that this be attached last! + //attach_device(&(vm_info), generic); + PrintDebugDevMgr(&(vm_info.dev_mgr)); }