Compare commits
7
Commits
fc5ca411f0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ba1129ca4 | ||
|
|
cd0adcb7e7 | ||
|
|
ff0f2cd7a0 | ||
|
|
9e4eb91044 | ||
|
|
d7ea214137 | ||
|
|
015efa9f5d | ||
|
|
edc5325a33 |
No files matched your search
@@ -0,0 +1,3 @@
|
|||||||
|
bin/
|
||||||
|
build/
|
||||||
|
buildSoLib
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
#define SYS_write 1
|
#define SYS_write 1
|
||||||
#define SYS_open 2
|
#define SYS_open 2
|
||||||
#define SYS_close 3
|
#define SYS_close 3
|
||||||
|
#define SYS_brk 12
|
||||||
#define SYS_sleep 35
|
#define SYS_sleep 35
|
||||||
#define SYS_exit 60
|
#define SYS_exit 60
|
||||||
#define SYS_mkdir 83
|
#define SYS_mkdir 83
|
||||||
|
|||||||
+2
-1
@@ -6,7 +6,6 @@
|
|||||||
#define STDWULLIE_H
|
#define STDWULLIE_H
|
||||||
|
|
||||||
// import everything
|
// import everything
|
||||||
|
|
||||||
//types
|
//types
|
||||||
#include "stdWullie/definitions/int.h"
|
#include "stdWullie/definitions/int.h"
|
||||||
#include "stdWullie/definitions/typeNull.h"
|
#include "stdWullie/definitions/typeNull.h"
|
||||||
@@ -29,6 +28,8 @@
|
|||||||
#include "stdWullie/filehandle/readWrite.h"
|
#include "stdWullie/filehandle/readWrite.h"
|
||||||
#include "stdWullie/filehandle/mkdir.h"
|
#include "stdWullie/filehandle/mkdir.h"
|
||||||
|
|
||||||
|
// # i cant believe its just a burning memory#
|
||||||
|
#include "stdWullie/memory/brk.h"
|
||||||
|
|
||||||
// string
|
// string
|
||||||
#include "stdWullie/String/colours.h"
|
#include "stdWullie/String/colours.h"
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
//defined like stdint to avoid confilict
|
//defined like stdint to avoid confilict
|
||||||
|
|
||||||
#ifndef _STDINT_H
|
#ifndef _STDWULLIEINT_H
|
||||||
#define _STDINT_H 1
|
#define _STDWULLIEINT_H 1
|
||||||
|
|
||||||
// create the types for signed ints using base structures
|
// create the types for signed ints using base structures
|
||||||
typedef signed char int8_t;
|
typedef signed char int8_t;
|
||||||
@@ -22,10 +22,14 @@ typedef unsigned long long int uint64_t;
|
|||||||
// misc int types
|
// misc int types
|
||||||
typedef unsigned long size_t;
|
typedef unsigned long size_t;
|
||||||
|
|
||||||
|
// intptr
|
||||||
|
typedef long int intptr_t;
|
||||||
|
typedef unsigned long int uintptr_t;
|
||||||
|
|
||||||
// macros for long long, unsigned and unsigned long long
|
// macros for long long, unsigned and unsigned long long
|
||||||
#define U unsigned
|
#define U unsigned
|
||||||
#define LL long long
|
#define LL long long
|
||||||
#define ULL unsigned long long
|
#define ULL unsigned long long
|
||||||
|
|
||||||
// int max values
|
// int max values
|
||||||
#define INT8_MAX ((int8_t)0x7F)
|
#define INT8_MAX ((int8_t)0x7F)
|
||||||
@@ -50,5 +54,10 @@ typedef unsigned long size_t;
|
|||||||
#define INT16_MIN ((int16_t)(-INT16_MAX - 1))
|
#define INT16_MIN ((int16_t)(-INT16_MAX - 1))
|
||||||
#define INT32_MIN ((int32_t)(-INT32_MAX - 1))
|
#define INT32_MIN ((int32_t)(-INT32_MAX - 1))
|
||||||
#define INT64_MIN ((int64_t)(-INT64_MAX - 1))
|
#define INT64_MIN ((int64_t)(-INT64_MAX - 1))
|
||||||
#endif
|
|
||||||
|
|
||||||
|
// intptr and uintptr min and max because its just a fucking int
|
||||||
|
#define INTPTR_MIN (INT64_MIN -1)
|
||||||
|
#define INTPTR_MAX (INT64_MAX)
|
||||||
|
#define UINTPTR_MIN (UINT64_MIN)
|
||||||
|
#define UINTPTR_MAX (UINT64_MAX)
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
// this code is licenced under Wrathmark licence
|
||||||
|
// © 2026 wullie wulliestudio.com
|
||||||
|
// please see attached licence for full usage and rights
|
||||||
|
|
||||||
|
#ifndef WRATHBRK_H
|
||||||
|
#define WRATHBRK_H
|
||||||
|
|
||||||
|
#include "stdWullie/definitions/int.h"
|
||||||
|
|
||||||
|
// just give me a brk
|
||||||
|
int brk(void *address);
|
||||||
|
void *sbrk(intptr_t addrIncrament);
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
typedef struct{
|
typedef struct{
|
||||||
uint32_t (*xor32)(void);
|
uint32_t (*xor32)(void);
|
||||||
uint64_t (*xor64)(void);
|
uint64_t (*xor64)(void);
|
||||||
int (*choice)(int min, int max)
|
int (*choice)(int min, int max);
|
||||||
}RandomNameSpace;
|
}RandomNameSpace;
|
||||||
|
|
||||||
extern const RandomNameSpace random;
|
extern const RandomNameSpace random;
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
// please see attached licence for full usage and rights
|
// please see attached licence for full usage and rights
|
||||||
#include "LocalHeader.h"
|
#include "LocalHeader.h"
|
||||||
#include "stdWullie.h"
|
#include "stdWullie.h"
|
||||||
|
#define WRATHINT 1
|
||||||
|
|
||||||
// decleration for random
|
// decleration for random
|
||||||
int randomTest();
|
int randomTest();
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
// this code is licenced under Wrathmark licence
|
||||||
|
// © 2026 wullie wulliestudio.com
|
||||||
|
// please see attached licence for full usage and rights
|
||||||
|
|
||||||
|
#include "stdWullie/memory/brk.h"
|
||||||
|
#include "stdWullie/exit.h"
|
||||||
|
#include "LocalHeader.h"
|
||||||
|
|
||||||
|
int brk(void *address){
|
||||||
|
|
||||||
|
long result = syscall1(SYS_brk, (long)address);
|
||||||
|
if((void*)result == address){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *sbrk(intptr_t incrament){
|
||||||
|
|
||||||
|
// gets the last break point and checks whether we just wanted that or do something else
|
||||||
|
void *prevBrk = (void *)syscall1(SYS_brk, 0);
|
||||||
|
if(incrament == 0){
|
||||||
|
return prevBrk;
|
||||||
|
}
|
||||||
|
|
||||||
|
// something else
|
||||||
|
void *newBrk = (char *)prevBrk + incrament;
|
||||||
|
|
||||||
|
long result = syscall1(SYS_brk, (long)newBrk);
|
||||||
|
|
||||||
|
if((void *)result != newBrk){
|
||||||
|
safeError("FAULT IN ALLOCATING NEW BREAK");
|
||||||
|
}
|
||||||
|
|
||||||
|
// pointer to the start of the new memory
|
||||||
|
return prevBrk;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user