mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
Fixed a few minor issues.
This commit is contained in:
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
pagerid = ascii_to_int(getenv("pagerid"));
|
||||
|
||||
wait_pager(0);
|
||||
wait_pager(pagerid);
|
||||
|
||||
printf("\n%s: Running POSIX API tests.\n", __TASKNAME__);
|
||||
|
||||
@@ -66,6 +66,6 @@ int main(int argc, char *argv[])
|
||||
exectest(parent_of_all);
|
||||
|
||||
while (1)
|
||||
wait_pager(0);
|
||||
wait_pager(pagerid);
|
||||
}
|
||||
|
||||
|
||||
26
conts/posix/test0/src/test_exec/atoi.h
Normal file
26
conts/posix/test0/src/test_exec/atoi.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef __ATOI_H__
|
||||
#define __ATOI_H__
|
||||
|
||||
static inline int power(int exp, int mul)
|
||||
{
|
||||
int total = 1;
|
||||
|
||||
while (exp > 0) {
|
||||
total *= mul;
|
||||
exp--;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
static inline int ascii_to_int(char *str)
|
||||
{
|
||||
int size = strlen(str);
|
||||
int iter = size - 1;
|
||||
int num = 0;
|
||||
|
||||
for (int i = 0; i < size; i++)
|
||||
num += ((int)str[iter - i] - 48) * power(i, 10);
|
||||
return num;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include "atoi.h"
|
||||
|
||||
void wait_pager(l4id_t partner)
|
||||
{
|
||||
@@ -23,6 +24,8 @@ void wait_pager(l4id_t partner)
|
||||
// printf("Pager synced with us.\n");
|
||||
}
|
||||
|
||||
pid_t pagerid;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
wait_pager(0);
|
||||
@@ -43,13 +46,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* Get parent of all pid as a string from environment */
|
||||
parent_of_all = getenv("parent_of_all");
|
||||
pagerid = ascii_to_int(getenv("pagerid"));
|
||||
|
||||
/* Compare two pid strings. We use strings because we dont have atoi() */
|
||||
if (!strcmp(pidbuf, parent_of_all)) {
|
||||
printf("EXECVE TEST -- PASSED --\n");
|
||||
printf("\nThread (%d): Continues to sync with the pager...\n\n", getpid());
|
||||
while (1)
|
||||
wait_pager(0);
|
||||
wait_pager(pagerid);
|
||||
}
|
||||
out:
|
||||
_exit(0);
|
||||
|
||||
@@ -17,11 +17,6 @@ PROJRELROOT = '../../'
|
||||
from config.projpaths import *
|
||||
from scripts.loader.generate_loader_asm import *
|
||||
|
||||
#loader_ksyms = generate_ksym_to_loader(join(PROJROOT, 'loader/ksyms.S'), \
|
||||
# join(BUILDDIR, 'kernel.elf'))
|
||||
|
||||
#loader_ksyms = Command([]'ksyms.S', 'kernel.elf', ksym_to_loader)
|
||||
|
||||
def ksym_to_loader(target, source, env):
|
||||
generate_ksym_to_loader(target[0].path, source[0].path)
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@ elf_loadFile(void *elfFile, bool phys)
|
||||
// printf("Memory cleared.\n");
|
||||
}
|
||||
// And this one
|
||||
//printf("\n");
|
||||
// printf("\n");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ ENTRY(_start)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x2000000;
|
||||
. = 0x3000000;
|
||||
.text : { *(.text.head) *(.text) }
|
||||
.rodata : { *(.rodata) }
|
||||
.rodata1 : { *(.rodata1) }
|
||||
|
||||
@@ -50,7 +50,7 @@ def build_posix_container(projpaths, container):
|
||||
images = []
|
||||
cwd = os.getcwd()
|
||||
os.chdir(POSIXDIR)
|
||||
print '\nBuilding the Posix Container...'
|
||||
print '\nBuilding Posix Container %d...' % container.id
|
||||
scons_cmd = 'scons ' + 'cont=' + str(container.id)
|
||||
#print "Issuing scons command: %s" % scons_cmd
|
||||
os.system(scons_cmd)
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include INC_SUBARCH(mm.h)
|
||||
|
||||
/* Abort debugging conditions */
|
||||
// #define DEBUG_ABORTS
|
||||
#define DEBUG_ABORTS
|
||||
#if defined (DEBUG_ABORTS)
|
||||
#define dbg_abort(...) dprintk(__VA_ARGS__)
|
||||
#else
|
||||
|
||||
@@ -268,7 +268,8 @@ static inline void context_switch(struct ktcb *next)
|
||||
{
|
||||
struct ktcb *cur = current;
|
||||
|
||||
// printk("(%d) to (%d)\n", cur->tid, next->tid);
|
||||
//printk("(%d) to (%d)\n", cur->tid, next->tid);
|
||||
|
||||
|
||||
/* Flush caches and everything */
|
||||
arch_hardware_flush(TASK_PGD(next));
|
||||
|
||||
@@ -23,7 +23,7 @@ void *mem_cache_alloc(struct mem_cache *cache)
|
||||
{
|
||||
int bit;
|
||||
int err;
|
||||
|
||||
printk("%s Called\n", __FUNCTION__);
|
||||
if (cache->free > 0) {
|
||||
if ((err = mutex_lock(&cache->mutex)) < 0)
|
||||
return PTR_ERR(err); /* Interruptible mutex */
|
||||
|
||||
Reference in New Issue
Block a user