From d1f512e3a0948a1291b42da650917a84513b3a74 Mon Sep 17 00:00:00 2001 From: spikey Date: Sun, 18 Feb 2024 10:30:09 -0500 Subject: [PATCH] stub process --- sys/include/extern.h | 6 ++++++ sys/include/memory.h | 10 +++++----- sys/include/process.h | 10 ++++++++++ sys/lib.c | 3 ++- sys/memory.c | 2 +- sys/sysinit.c | 44 +++++-------------------------------------- 6 files changed, 29 insertions(+), 46 deletions(-) create mode 100644 sys/include/extern.h create mode 100644 sys/include/process.h diff --git a/sys/include/extern.h b/sys/include/extern.h new file mode 100644 index 0000000..848bcea --- /dev/null +++ b/sys/include/extern.h @@ -0,0 +1,6 @@ +#ifndef EXTERN_H +#define EXTERN_H + +extern void *malloc(s32 size); + +#endif diff --git a/sys/include/memory.h b/sys/include/memory.h index 5ee51bc..6bbfa35 100644 --- a/sys/include/memory.h +++ b/sys/include/memory.h @@ -19,12 +19,12 @@ * so this complicated structure is utilized instead. */ -#define START 0xb80f1 +#define START 0xb80f0 #define SIZE 16384 -#define USABLE(m) m + sizeof(s32) + sizeof(void *) -#define NEXT(m) (void *) *m -#define SIZE(m) (s32) m[sizeof(void *)] -void *start = 0x0; +struct allocated { + void *ref; + s32 size; +} #endif diff --git a/sys/include/process.h b/sys/include/process.h new file mode 100644 index 0000000..4f7b87d --- /dev/null +++ b/sys/include/process.h @@ -0,0 +1,10 @@ +#ifndef PROCESS_H +#define PROCESS_H + +struct process { + void *prstart; + s32 prsize; + s32 pid; +} + +#endif diff --git a/sys/lib.c b/sys/lib.c index aae5f09..785c472 100644 --- a/sys/lib.c +++ b/sys/lib.c @@ -10,10 +10,11 @@ strlen(const char *str) return i; } +s32 printf(const char *format, ...) { const u32 len = strlen(format); vga_write(format, len, 0x0f); return len; -} \ No newline at end of file +} diff --git a/sys/memory.c b/sys/memory.c index a9216c4..0653927 100644 --- a/sys/memory.c +++ b/sys/memory.c @@ -7,4 +7,4 @@ void *malloc(s32 size) { u32 addr = curr; curr += size; return (void*)addr; -} \ No newline at end of file +} diff --git a/sys/sysinit.c b/sys/sysinit.c index 6d6bc6a..5467ca0 100644 --- a/sys/sysinit.c +++ b/sys/sysinit.c @@ -1,4 +1,6 @@ #include +#include + void sysinit(void) @@ -7,44 +9,8 @@ sysinit(void) char *howday = "Om Smarter."; vga_clearscreen(); - /* - for (s16 i = 0; i < 100; i++) { - vga_write(howdy, strlen(howdy), 0x1f); - vga_write(howday, strlen(howday), 0x0f); - } + vga_write("Starting omOS...", 16, 0x0F); - vga_write("sid", 3, 0x07); - vga_write("did", 3, 0x07); - vga_write("fid", 3, 0x07); - */ - - vga_write( -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter.Om Smart.Om Smarter." -"bob", 2003, 0x0F); - vga_write("indian", 6, 0x07); - vga_write("indian", 6, 0x07); + s8 *start = (s8 *) 0xb8fa0; + start[0] = 'h'; }