Hi Christian,

please find attached patches for Genode 15.08.


Thanks,

On Mon, Oct 26, 2015 at 1:25 PM, Christian Helmuth <
christian.helm...@genode-labs.com> wrote:

> Hello,
>
> see my answer below the quoted text.
>
> On Mon, Oct 26, 2015 at 12:54:13PM +0100, Joseph Lee wrote:
> > Here is the code that i put in tz_vmm.
> >
> >     int fd;
> >     char buffer[10];
> >     char const *file_name = "/home/test.txt";
> >
> >    if( ( fd = open(file_name, O_WRONLY | O_CREAT) ) != -1 )
> >              write( fd, "TEST ", 4 );
> >    else
> >              printf("File could not be opened");
> >     close( fd );
>
> Adding the attached patch that is derived from your changes above, I
> got the expected error
>
>   ../imx53/main.cc: In function ‘int main()’:
> /plain/krishna/src/genode/genode_staging.git/repos/os/src/server/tz_vmm/spec/imx53_qsb/../imx53/main.cc:143:21:
> error: ‘O_WRONLY’ was not declared in this scope
>   int fd = open("x", O_WRONLY | O_CREAT);
>
> tz_vmm in its virgin version in our repositories does not use the libc
> and, therefore, can't use the file system as you described. Please
> provide us with a working patch for Genode 15.08 or Git branch on
> GitHub as we otherwise can't reproduce your issue.
>
> Regards
> --
> Christian Helmuth
> Genode Labs
>
> http://www.genode-labs.com/ · http://genode.org/
> https://twitter.com/GenodeLabs · /ˈdʒiː.nəʊd/
>
> Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
> Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> genode-main mailing list
> genode-main@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
>
>
From 7f88adf8438b83f5b1b4fc0efb50a2392e38e805 Mon Sep 17 00:00:00 2001
From: mame2015 <leejose...@gmail.com>
Date: Mon, 26 Oct 2015 14:30:50 +0100
Subject: [PATCH] Update main.cc

---
 repos/os/src/server/tz_vmm/spec/imx53/main.cc | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/repos/os/src/server/tz_vmm/spec/imx53/main.cc b/repos/os/src/server/tz_vmm/spec/imx53/main.cc
index 2ee5a3c..4d11534 100644
--- a/repos/os/src/server/tz_vmm/spec/imx53/main.cc
+++ b/repos/os/src/server/tz_vmm/spec/imx53/main.cc
@@ -19,6 +19,14 @@
 #include <drivers/trustzone.h>
 #include <vm_state.h>
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <libc/fcntl.h>
+#include <libc/stdlib.h>
+#include <libc/unistd.h>
+#include <libc/ctype.h>
+
 /* local includes */
 #include <vm.h>
 #include <m4if.h>
@@ -139,7 +147,15 @@ int main()
 
 	PINF("Start virtual machine ...");
 	vmm.start();
-
-	sleep_forever();
+	
+	int fd;
+        char const *file_name = "/home/test.txt";
+       	if( ( fd = open( file_name, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR ) ) != -1 )
+        	write( fd,"TEST", 4 );
+       	else
+       		PINF("File could not be read");
+       	close( fd );
+       	
+        sleep_forever();
 	return 0;
 }
From 8099b8543a3b105468cb690eac4d4871cd26a32f Mon Sep 17 00:00:00 2001
From: mame2015 <leejose...@gmail.com>
Date: Mon, 26 Oct 2015 15:15:05 +0100
Subject: [PATCH] Update target.inc

---
 repos/os/src/server/tz_vmm/spec/imx53/target.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/repos/os/src/server/tz_vmm/spec/imx53/target.inc b/repos/os/src/server/tz_vmm/spec/imx53/target.inc
index e7145a9..575012b 100644
--- a/repos/os/src/server/tz_vmm/spec/imx53/target.inc
+++ b/repos/os/src/server/tz_vmm/spec/imx53/target.inc
@@ -1,9 +1,11 @@
 TARGET    = tz_vmm
 REQUIRES += trustzone imx53
-LIBS      = base
+LIBS      = base libc
 SRC_CC    = main.cc
 INC_DIR  += $(PRG_DIR) \
             $(PRG_DIR)/../../include \
             $(PRG_DIR)/../imx53
 
 vpath main.cc $(PRG_DIR)/../imx53
+
+INC_DIR	+= $(call select_from_ports,libc)/include
------------------------------------------------------------------------------
_______________________________________________
genode-main mailing list
genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main

Reply via email to