Skip to content

Commit

Permalink
added sse_sandbox_init()
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvraj1803 committed Nov 3, 2023
1 parent 33ecff5 commit 7883a04
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion guests/deltaOS
Submodule deltaOS updated from 57d337 to a327c3
20 changes: 20 additions & 0 deletions sse/sse.c
Original file line number Diff line number Diff line change
@@ -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"

/*
Expand All @@ -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(){

Expand Down

0 comments on commit 7883a04

Please sign in to comment.