From a2f065772bcb7766859033d140980720ef824546 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Tue, 3 Sep 2019 22:55:23 +0300 Subject: [PATCH] foo --- src/census/3dgfx.h | 2 +- src/census/census.c | 2 +- src/config.h | 5 +++++ src/kmain.c | 6 ++++-- src/libc/unistd.c | 12 ++++++++++++ src/libc/unistd.h | 2 ++ 6 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/census/3dgfx.h b/src/census/3dgfx.h index 89b28d8..0ae58c9 100644 --- a/src/census/3dgfx.h +++ b/src/census/3dgfx.h @@ -26,7 +26,7 @@ enum { G3D_LIGHT1 = 0x000010, G3D_LIGHT2 = 0x000020, G3D_LIGHT3 = 0x000040, - G3D_TEXTURE_2D = 0x000080, /* XXX doesn't affect anything, use g3d_polygon_mode */ + G3D_TEXTURE_2D = 0x000080, G3D_BLEND = 0x000100, G3D_TEXTURE_GEN = 0x000200, G3D_CLIP_FRUSTUM = 0x000800,/* when disabled, don't clip against the frustum */ diff --git a/src/census/census.c b/src/census/census.c index 724ab2a..7eea8d3 100644 --- a/src/census/census.c +++ b/src/census/census.c @@ -45,7 +45,7 @@ void draw_census(void) float a[2], b[2], dt; float anim, alpha, center_alpha; - memset(fb_pixels, 0, fb_width * fb_height * 4); + memset(fb_pixels, 0x11, fb_width * fb_height * 4); anim = fmod(t / 6.0f, LOOPTIME); alpha = 1.0f - ((anim - (LOOPTIME - 0.075)) / 0.06f); diff --git a/src/config.h b/src/config.h index 58a6147..f444b95 100644 --- a/src/config.h +++ b/src/config.h @@ -24,4 +24,9 @@ along with this program. If not, see . #define CON_TEXTMODE #define CON_SERIAL +#define MOVE_STACK_RAMTOP +/* allocate 64k for stack */ +#define STACK_PAGES 16 + + #endif /* PCBOOT_CONFIG_H_ */ diff --git a/src/kmain.c b/src/kmain.c index 99104a2..bcd8a91 100644 --- a/src/kmain.c +++ b/src/kmain.c @@ -18,6 +18,7 @@ along with this program. If not, see . #include #include #include +#include #include "segm.h" #include "intr.h" #include "mem.h" @@ -119,10 +120,11 @@ static int video_init(void) qsort(vmodes, nmodes, sizeof *vmodes, modecmp); for(i=0; i. #include #include "unistd.h" #include "fs.h" +#include "timer.h" +#include "asmops.h" int chdir(const char *path) { @@ -59,3 +61,13 @@ int rmdir(const char *path) fs_close(fsn); return 0; } + +int usleep(unsigned long usec) +{ + unsigned long wait_ticks = MSEC_TO_TICKS(usec / 1000ul); + unsigned long start_ticks = nticks; + while(nticks - start_ticks < wait_ticks) { + halt_cpu(); + } + return 0; +} diff --git a/src/libc/unistd.h b/src/libc/unistd.h index 1ed4cf2..63651c3 100644 --- a/src/libc/unistd.h +++ b/src/libc/unistd.h @@ -24,4 +24,6 @@ char *getcwd(char *buf, int sz); int mkdir(const char *path, int mode); int rmdir(const char *path); +int usleep(unsigned long usec); + #endif /* UNISTD_H_ */ -- 1.7.10.4