summaryrefslogtreecommitdiff
path: root/userspace
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-10-01 23:22:03 +0200
committerMiguel <m.i@gmx.at>2018-10-01 23:22:03 +0200
commita455cd5af26bf8731e7c981a9421b16ab34dae6f (patch)
tree140b184bf306cef258ba6e7965a78b3eecb598b9 /userspace
parentb518f39803eaaf0b25b95baf951b12ef4d5a727e (diff)
fukkin scheduler
Diffstat (limited to 'userspace')
-rw-r--r--userspace/fsh.c1
-rw-r--r--userspace/newcalls.h10
-rw-r--r--userspace/pain2.c13
3 files changed, 20 insertions, 4 deletions
diff --git a/userspace/fsh.c b/userspace/fsh.c
index d456d1b..62cd27e 100644
--- a/userspace/fsh.c
+++ b/userspace/fsh.c
@@ -88,6 +88,7 @@ int main(int argc, char **argv)
while(1)
{
+ _gui_rect();
char c=fgetc(stdin);
if(c=='\b')
diff --git a/userspace/newcalls.h b/userspace/newcalls.h
index 20d8ffd..e22bc78 100644
--- a/userspace/newcalls.h
+++ b/userspace/newcalls.h
@@ -4,6 +4,8 @@
#define SYSCALL_CLONE 83
#define SYSCALL_PIPE 84
#define SYSCALL_DUP2 86
+#define SYSCALL_GUI_RECT 87
+#define SYSCALL_GUI_WIN 88
int _clone(void)
{
@@ -17,4 +19,12 @@ int _dup2(uint32_t oldfd,uint32_t newfd)
{
return syscall(SYSCALL_DUP2,oldfd,newfd,0);
}
+int _gui_rect()
+{
+ return syscall(SYSCALL_GUI_RECT,0,0,0);
+}
+int _gui_win()
+{
+ return syscall(SYSCALL_GUI_WIN,0,0,0);
+}
//
diff --git a/userspace/pain2.c b/userspace/pain2.c
index 840b6b6..69784ce 100644
--- a/userspace/pain2.c
+++ b/userspace/pain2.c
@@ -1,4 +1,5 @@
#include "put_pixel.h"
+#include "newcalls.h"
#include <stdlib.h>
#include <stdio.h>
@@ -24,18 +25,22 @@ void doscolor(int color,int color2)
int main(int argc,char **argv)
{
+ _gui_win();
+
for(int i=0;i<atoi(argv[1]);i++)
{
- for(int i=0;i<100;i++)
+ for(int i=0;i<380;i+=40)
{
put_rect(0,0,640,480,0xff0000);
- put_rect(100+i,100+i,100,100,0x0000ff);
+ put_rect(i,i,100,100,0x0000ff);
+ _gui_rect();
}
- for(int i=100;i>0;i--)
+ for(int i=380;i>0;i-=80)
{
put_rect(0,0,640,480,0xff0000);
- put_rect(100+i,100+i,100,100,0x0000ff);
+ put_rect(i,i,100,100,0x0000ff);
+ _gui_rect();
}
}