From 7883a04e0d5a1d05216be8eec1d394b410700db7 Mon Sep 17 00:00:00 2001 From: yuvraj1803 Date: Fri, 3 Nov 2023 14:58:01 +0530 Subject: [PATCH] added sse_sandbox_init() --- guests/deltaOS | 2 +- sse/sse.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/guests/deltaOS b/guests/deltaOS index 57d3376..a327c3f 160000 --- a/guests/deltaOS +++ b/guests/deltaOS @@ -1 +1 @@ -Subproject commit 57d33769f683b9d94190f5b55f642572fe3c9843 +Subproject commit a327c3fd8ba80aa92907a3334923c7d8d406608d diff --git a/sse/sse.c b/sse/sse.c index ca343bb..c6c0dc9 100644 --- a/sse/sse.c +++ b/sse/sse.c @@ -1,9 +1,12 @@ #include "sse/sse.h" #include "core/vm.h" #include "mm/paging.h" +#include "mm/mm.h" #include "fs/ff.h" #include "config.h" #include "stdio.h" +#include "stdlib.h" +#include "string.h" #include "memory.h" /* @@ -26,7 +29,24 @@ extern int total_vms; FIL* sse_files[CONFIG_MAX_SSE_FILES]; +static char* make_sse_vm_dir_name(uint8_t vmid){ + char* name = (char*) malloc(6); // 6 because VMID is <= 255. So VM_255 is the largest string. + // All this drama is unnecessary. Even though I am asking for 6 bytes, malloc will return an entire page ;). (4096bytes). + strcpy(name, "VM_"); + strcat(name, itoa(vmid)); + + return name; +} + +static int sse_sandbox_init(struct vm* vm){ + + f_chdir("/"); + f_mkdir(make_sse_vm_dir_name(vm->vmid)); // this will create a directory with VM_{VMID}. + // example: 'VM_1' for VM with id '1'. + + return 0; +} void sse_init(){