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.


File support added (interface to file support in host)
Jack Lange [Thu, 5 Aug 2010 18:48:46 +0000 (13:48 -0500)]
Conflicts:

Kconfig

palacios/include/palacios/vmm_file.h [new file with mode: 0644]
palacios/src/palacios/Makefile
palacios/src/palacios/vmm_file.c [new file with mode: 0644]

diff --git a/palacios/include/palacios/vmm_file.h b/palacios/include/palacios/vmm_file.h
new file mode 100644 (file)
index 0000000..ea8dd97
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * This file is part of the Palacios Virtual Machine Monitor developed
+ * by the V3VEE Project with funding from the United States National 
+ * Science Foundation and the Department of Energy.  
+ *
+ * The V3VEE Project is a joint project between Northwestern University
+ * and the University of New Mexico.  You can find out more at 
+ * http://www.v3vee.org
+ *
+ * Copyright (c) 2010, Peter Dinda (pdinda@cs.northwestern.edu> 
+ * Copyright (c) 2010, The V3VEE Project <http://www.v3vee.org> 
+ * All rights reserved.
+ *
+ * Author: Peter Dinda <pdinda@cs.northwestern.edu>
+ *
+ * This is free software.  You are permitted to use,
+ * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
+ */
+
+
+#ifndef __VMM_FILE_H__
+#define __VMM_FILE_H__
+
+#include <palacios/vmm.h>
+
+
+#ifdef __V3VEE__
+
+#define V3_FileOpen(path, mode)                                                \
+    ({                                                                 \
+       extern struct v3_file_hooks *file_hooks;                                \
+       ((file_hooks) && (file_hooks)->file_open) ?                             \
+           (file_hooks)->file_open((path), (mode)) : -1 ;              \
+    })
+
+#define V3_FileClose(fd)                                               \
+    ({                                                                 \
+       extern struct v3_file_hooks *file_hooks;                                \
+       ((file_hooks) && (file_hooks)->file_close) ?                            \
+           (file_hooks)->file_close((fd))  :  -1 ;     \
+    })
+
+#define V3_FileSize(fd)                                                \
+    ({                                                                 \
+       extern struct v3_file_hooks *file_hooks;                                \
+       ((file_hooks) && (file_hooks)->file_size) ?                             \
+           (file_hooks)->file_size((fd))  : -1 ;       \
+    })
+
+#define V3_FileRead(fd,start,buf,len)                                  \
+    ({                                                                 \
+       extern struct v3_file_hooks *file_hooks;                                \
+       ((file_hooks) && (file_hooks)->file_read) ?                             \
+           (file_hooks)->file_read((fd),(start),(buf),(length)) : -1 ;  \
+    })
+
+#define V3_FileWrite(fd,start,buf,len)                                 \
+    ({                                                                 \
+       extern struct v3_file_hooks *file_hooks;                                \
+       ((file_hooks) && (file_hooks)->file_write) ?                            \
+           (file_hooks)->file_write((fd),(start),(buf),(length)) : -1 ;  \
+    })
+
+
+#endif
+
+#define FILE_OPEN_MODE_READ    (1 << 0)
+#define FILE_OPEN_MODE_WRITE   (1 << 1)
+
+struct v3_file_hooks {
+
+    int (*file_open)(const char *path, int mode);
+    int (*file_close)(int fd);
+
+    long long (*file_size)(int fd);
+
+    // blocking reads and writes
+    long long  (*file_read)(int fd,  long long start, void *buffer, long long length);
+    long long  (*file_write)(int fd, long long start, void *buffer, long long length);
+
+};
+
+
+extern void V3_Init_File(struct v3_file_hooks * hooks);
+
+#endif
index 2d2eda8..52497e1 100644 (file)
@@ -60,8 +60,9 @@ obj-$(CONFIG_VMX) +=          vmx.o \
 obj-$(CONFIG_INSTRUMENT_VMM) += vmm_instrument.o
 obj-$(CONFIG_TELEMETRY) += vmm_telemetry.o 
 obj-$(CONFIG_SOCKET) +=  vmm_socket.o
-obj-$(CONFIG_CONSOLE) +=  vmm_console.o
 obj-$(CONFIG_VNET) += vmm_vnet.o
+obj-$(CONFIG_FILE) += vmm_file.o
+
 
 obj-$(CONFIG_SYMBIOTIC) += vmm_symbiotic.o vmm_symspy.o
 obj-$(CONFIG_SYMCALL) += vmm_symcall.o
diff --git a/palacios/src/palacios/vmm_file.c b/palacios/src/palacios/vmm_file.c
new file mode 100644 (file)
index 0000000..ada9972
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * This file is part of the Palacios Virtual Machine Monitor developed
+ * by the V3VEE Project with funding from the United States National 
+ * Science Foundation and the Department of Energy.  
+ *
+ * The V3VEE Project is a joint project between Northwestern University
+ * and the University of New Mexico.  You can find out more at 
+ * http://www.v3vee.org
+ *
+ * Copyright (c) 2010, Peter Dinda <pdinda@northwestern.edu> 
+ * Copyright (c) 2010, The V3VEE Project <http://www.v3vee.org> 
+ * All rights reserved.
+ *
+ * Author: Peter Dinda <pdinda@northwestern.edu>
+ *
+ * This is free software.  You are permitted to use,
+ * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
+ */
+
+
+#include <palacios/vmm_file.h>
+#include <palacios/vmm.h>
+#include <palacios/vmm_debug.h>
+#include <palacios/vmm_types.h>
+
+
+struct v3_file_hooks * file_hooks = 0;
+
+void V3_Init_File(struct v3_file_hooks * hooks) {
+    file_hooks = hooks;
+    PrintDebug("V3 file access inited\n");
+
+    return;
+}