git.ucc.asn.au
/
tpg
/
acess2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
df4e449
)
Fixed bug in libc.so/brk(), fixed support for VT100 escape codes
author
John Hodge
<
[email protected]
>
Tue, 22 Sep 2009 13:21:12 +0000
(21:21 +0800)
committer
John Hodge
<
[email protected]
>
Tue, 22 Sep 2009 13:21:12 +0000
(21:21 +0800)
Kernel/drv/vterm.c
patch
|
blob
|
history
Usermode/Libraries/libacess.so_src/core.asm
patch
|
blob
|
history
Usermode/Libraries/libacess.so_src/syscalls.inc.asm
patch
|
blob
|
history
Usermode/Libraries/libc.so_src/heap.c
patch
|
blob
|
history
Usermode/include/acess/sys.h
patch
|
blob
|
history
diff --git
a/Kernel/drv/vterm.c
b/Kernel/drv/vterm.c
index
4b5a231
..
d945bda
100644
(file)
--- a/
Kernel/drv/vterm.c
+++ b/
Kernel/drv/vterm.c
@@
-332,6
+332,7
@@
void VT_int_PutString(tVTerm *Term, Uint8 *Buffer, Uint Count)
{
if( Buffer[i] == 0x1B ) // Escape Sequence
{
{
if( Buffer[i] == 0x1B ) // Escape Sequence
{
+ i ++;
i += VT_int_ParseEscape(Term, (char*)&Buffer[i]);
continue;
}
i += VT_int_ParseEscape(Term, (char*)&Buffer[i]);
continue;
}
diff --git
a/Usermode/Libraries/libacess.so_src/core.asm
b/Usermode/Libraries/libacess.so_src/core.asm
index
22a2aa0
..
9740322
100644
(file)
--- a/
Usermode/Libraries/libacess.so_src/core.asm
+++ b/
Usermode/Libraries/libacess.so_src/core.asm
@@
-43,3
+43,5
@@
SYSCALL3 SysSpawn, SYS_SPAWN
SYSCALL3 execve, SYS_EXECVE
SYSCALL2 SysLoadBin, SYS_LOADBIN
SYSCALL3 execve, SYS_EXECVE
SYSCALL2 SysLoadBin, SYS_LOADBIN
+
+SYSCALL6 _SysDebug, 0x100
diff --git
a/Usermode/Libraries/libacess.so_src/syscalls.inc.asm
b/Usermode/Libraries/libacess.so_src/syscalls.inc.asm
index
fc0b9c0
..
c6e11df
100644
(file)
--- a/
Usermode/Libraries/libacess.so_src/syscalls.inc.asm
+++ b/
Usermode/Libraries/libacess.so_src/syscalls.inc.asm
@@
-87,3
+87,52
@@
pop ebp
ret
%endmacro
pop ebp
ret
%endmacro
+
+; System Call - 5 Arguments
+%macro SYSCALL5 2
+[global %1:func]
+%1:
+ push ebp
+ mov ebp, esp
+ push ebx
+ push edi
+ push esi
+ mov eax, %2
+ mov ebx, [ebp+8]
+ mov ecx, [ebp+12]
+ mov edx, [ebp+16]
+ mov edi, [ebp+20]
+ mov esi, [ebp+24]
+ int 0xAC
+ mov [_errno], ebx
+ pop esi
+ pop edi
+ pop ebx
+ pop ebp
+ ret
+%endmacro
+
+; System Call - 6 Arguments
+%macro SYSCALL6 2
+[global %1:func]
+%1:
+ push ebp
+ mov ebp, esp
+ push ebx
+ push edi
+ push esi
+ mov eax, %2
+ mov ebx, [ebp+8]
+ mov ecx, [ebp+12]
+ mov edx, [ebp+16]
+ mov edi, [ebp+20]
+ mov esi, [ebp+24]
+ mov ebp, [ebp+28]
+ int 0xAC
+ mov [_errno], ebx
+ pop esi
+ pop edi
+ pop ebx
+ pop ebp
+ ret
+%endmacro
diff --git
a/Usermode/Libraries/libc.so_src/heap.c
b/Usermode/Libraries/libc.so_src/heap.c
index
23df92a
..
6832738
100644
(file)
--- a/
Usermode/Libraries/libc.so_src/heap.c
+++ b/
Usermode/Libraries/libc.so_src/heap.c
@@
-34,7
+34,7
@@
EXPORT void free(void *mem);
EXPORT void *realloc(void *mem, Uint bytes);
\r
EXPORT void *sbrk(int increment);
\r
LOCAL void *extendHeap(int bytes);
\r
EXPORT void *realloc(void *mem, Uint bytes);
\r
EXPORT void *sbrk(int increment);
\r
LOCAL void *extendHeap(int bytes);
\r
-LOCAL uint brk(
int delta
);
\r
+LOCAL uint brk(
Uint newpos
);
\r
\r
//Code
\r
\r
\r
//Code
\r
\r
@@
-260,7
+260,7
@@
EXPORT void *sbrk(int increment)
static size_t oldEnd = 0;
\r
static size_t curEnd = 0;
\r
\r
static size_t oldEnd = 0;
\r
static size_t curEnd = 0;
\r
\r
- //SysDebug("sbrk: (increment=%i)\n", increment);
\r
+ //
_
SysDebug("sbrk: (increment=%i)\n", increment);
\r
\r
if (oldEnd == 0) curEnd = oldEnd = brk(0);
\r
\r
\r
if (oldEnd == 0) curEnd = oldEnd = brk(0);
\r
\r
@@
-328,20
+328,25
@@
static void *FindHeapBase()
return NULL;
\r
}
\r
\r
return NULL;
\r
}
\r
\r
-LOCAL uint brk(
int delta
)
\r
+LOCAL uint brk(
Uint newpos
)
\r
{
\r
static uint curpos;
\r
uint pages;
\r
uint ret = curpos;
\r
{
\r
static uint curpos;
\r
uint pages;
\r
uint ret = curpos;
\r
+ int delta;
\r
+
\r
+ //_SysDebug("brk: (newpos=0x%x)", newpos);
\r
\r
// Find initial position
\r
if(curpos == 0) curpos = (uint)FindHeapBase();
\r
\r
// Get Current Position
\r
\r
// Find initial position
\r
if(curpos == 0) curpos = (uint)FindHeapBase();
\r
\r
// Get Current Position
\r
- if(delta == 0)
\r
- {
\r
- return curpos;
\r
- }
\r
+ if(newpos == 0) return curpos;
\r
+
\r
+ if(newpos < curpos) return newpos;
\r
+
\r
+ delta = newpos - curpos;
\r
+ //_SysDebug(" brk: delta = 0x%x", delta);
\r
\r
// Do we need to add pages
\r
if(curpos & 0xFFF && (curpos & 0xFFF) + delta < 0x1000)
\r
\r
// Do we need to add pages
\r
if(curpos & 0xFFF && (curpos & 0xFFF) + delta < 0x1000)
\r
diff --git
a/Usermode/include/acess/sys.h
b/Usermode/include/acess/sys.h
index
d0b4530
..
4431e0b
100644
(file)
--- a/
Usermode/include/acess/sys.h
+++ b/
Usermode/include/acess/sys.h
@@
-30,6
+30,7
@@
struct s_sysFInfo {
typedef struct s_sysFInfo t_sysFInfo;
// === FUNCTIONS ===
typedef struct s_sysFInfo t_sysFInfo;
// === FUNCTIONS ===
+void _SysDebug(char *str, ...);
// --- Proc ---
void sleep();
int clone(int flags, void *stack);
// --- Proc ---
void sleep();
int clone(int flags, void *stack);
UCC
git Repository :: git.ucc.asn.au